Isca icon indicating copy to clipboard operation
Isca copied to clipboard

gfortran float to integer type conversion problems

Open sit23 opened this issue 1 year ago • 2 comments

Description

When running with gfortran @daw538 have had various nml errors of the type:

FATAL from PE 0: check_nml_error in fms_mod: Unknown namelist, or mistyped namelist variable in namelist main_nml, (IOSTAT = 5010 )

Upon a bit of digging, this is happening when you set variables in the namelist as floats when Isca's fortran expects them as integers. E.g. if you set seconds in main_nml to a float in the python script then Isca will error with gfortran because seconds is expected to be an integer.

When running with the Intel compilers this does not cause an error. It seems that gfortran is a bit fussier about this type of type conversion.

The solution to this is tricky to think about, as it would require the python to know about the fortran types in order to catch this sort of error. Just putting it here to note for anyone with this issue, and so that we can discuss potential work-arounds sometime.

sit23 avatar Oct 21 '22 16:10 sit23