ufs-community / UFS_UTILS

Utilities for the NCEP models.
Other
21 stars 104 forks source link

Add "action='read'" to chgres_cube Fortran file open statement #869

Closed climbfuji closed 8 months ago

climbfuji commented 8 months ago

This is a question for the code managers. We have observed a weird behavior (well, it's a bug) with Fortran open statements on certain filesystems such as Amazon Web Services' EFS filesystem. What happens is that an open statement like

https://github.com/ufs-community/UFS_UTILS/blob/dc0e4a61419b95805a22e05d477cb58a33e581f8/sorc/chgres_cube.fd/atmosphere.F90#L1263

only work if the file is owned by the user running the code. For users who are not owners of the file, the code exits with an "ACCESS DENIED" error, regardless of the permissions on that file (I tried with 777). A simple fix for this is to add readonly to the Fortran open statement (it shouldn't be necessary, I think, but it doesn't hurt having it). Would making such a change to UFS_UTILS be acceptable to you?

GeorgeGayno-NOAA commented 8 months ago

As long as it does not break existing capability, I am fine with it.

Is readonly part of the Fortran standard? Should action=read be used instead?

climbfuji commented 8 months ago

readonly is in the Oracle Fortran 77 language reference. According to https://qcd.phys.cmu.edu/QCDcluster/intel/for_lang.pdf, it's an extension to the Fortran 95 standard and that should allow us to use it (UFS I believe requires Fortran 2008 compatibility).

climbfuji commented 8 months ago

That said, I am not finding it in https://j3-fortran.org/doc/year/10/10-007r1.pdf (2008 std working document). action=read should be just fine.