Opened 18 years ago
Closed 18 years ago
#91 closed request (Done)
Use of `__FILE__` macro in ana_*.h files
Reported by: | jprinehimer | Owned by: | arango |
---|---|---|---|
Priority: | minor | Milestone: | Release ROMS/TOMS 3.1 |
Component: | Nonlinear | Version: | 3.1 |
Keywords: | analytical, CPP | Cc: |
Description
If an ana_*.h file is copied into a project directory from the ROMS Functionals directory, and the line (e.g., from ana_tobc.h)
ANANAME(34)='ROMS/FUNCTIONALS/ana_tobc.h'
is not changed to match the current location, the path of the header files output at the end of a ROMS model run following "Analytical header files used:" is incorrect.
The predefined CPP macro __FILE__
can be used to obtain the correct filename automatically like so:
ANANAME(34)=__FILE__
The __FILE__
macro works with the #include statements in analytical.F and will return the correct values for the file.
Would there be any unforeseen issues with this change to all of the ana_* files? It seems to work fine with my version.
Yes, I thought about that but I didn't do it because the path and file name can be very long and exceed the fixed-format length. We want ROMS to compile with both fixed and free format. Anyway, we have similar length problems in mod_ncparam.F and mod_strings.F, so we need special free-format rule to compile these files. So adding analytical.F is not longer a problem. Therefore, I accept your request. Notice that we need to change all the make configuration files to allow free format for analytical.F.