CICE-Consortium/CICE

PIO createfile where path is a symlink

anton-seaice opened this issue · 3 comments

In the UFS model configuration, the output files can be configured as symlinks which are created before the model is run.

e.g. a symlink is created to point to the desired locations of history / restart files, but the target of the symlink doesn't exist yet. CICE creates the actual file during the model execution.

@DeniseWorthen has found that using _format = 'hdf5' this fails with this error:

 (ice_pio_init) ERROR: Failed to create file .

This is because :

inquire(file=trim(filename),exist=exists)

gives exists=True where filename is a symlink, even if the target is not does not exist. Therefore the file is created with "NOCLOBBER" and it fails.

We think we can remove this "NOCLOBBER" case, and create the file with "CLOBBER" irrespective of whether it already exists=True or not. This works with modern PIO (e.g. 2.6.2) builds.

We should check with older PIO builds also and possibly raise with the PIO developers (as its not clear why you can't create with NOCLOBBER).