Opened 11 years ago

Closed 11 years ago

#587 closed bug (Fixed)

Invalid use of optional argment in find_file function — at Version 1

Reported by: m.hadfield Owned by: arango
Priority: major Milestone: Release ROMS/TOMS 3.7
Component: Nonlinear Version: 3.7
Keywords: Cc:

Description (last modified by arango)

In revision 658, ticket 584, an extra optional argument named KeyWord was added to the find_file function in ROMS/Utility/inp_par.F. However optional arguments are only valid for external functions with an explicit interface (eg. those declared inside a module) which does not apply in this case.

The interesting thing is that this violation of the Fortran standard does not cause any problems on some compilers (eg. Gfortran). However with xlf on AIX on a case I have run, the length of the file name argument inside find_file is incorrect at run-time, meaning that the file is reported to be missing when in fact it exists.

Noting that all the calls to find_file in the ROMS code do actually have the extra argument, the simplest solution is to remove the optional keyword.

(Putting all the procedures in inp_par.F inside a module would be a good idea, too, but I vaguely recall that there is a reason not to do this.)

Change History (1)

comment:1 by arango, 11 years ago

Description: modified (diff)
Resolution: Fixed
Status: newclosed

Yes, we cannot have KeyWord as an optional argument. I changed it to a fix new argument. I was trying to be backward compatible with additional biology models that people have coded and are not part of this ROMS repository. Users need to add the appropriate KeyWord to the calls to find_file. This new argument is very useful during error tracking when the user missed a particular input file.

Thanks for bringing this to my attention.

I also corrected a out-bounds error in step2d_LF_AM3.h. It turns out that nesting requires a special exception of the I- and J-ranges when computing internal arrays for DUon and DVom. It took me days to track this problem in the debugger.

Note: See TracTickets for help on using tickets.