Opened 2 years ago
Last modified 2 years ago
#934 closed upgrade
Added new module get_env.F — at Initial Version
Reported by: | arango | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 4.1 |
Component: | Nonlinear | Version: | 4.0 |
Keywords: | Cc: |
Description
A new module get_env.F was added to retrieve system environmental variables, which can be decoded as logical, integer, or string values. For example, we can have in the environment:
setenv ROMS_DEBUG 1 setenv ROMS_TRACE 4 setenv ROMS_HOME /Users/arango/ocean/repository/git
Then, we can retrieve such values into a logical, integer, and strings variables, respectively, inside ROMS code by using:
Logical :: Ldebug integer :: Itrace character (len=256) :: roms_home status = get_env('ROMS_DEBUG', Ldebug) status = get_env('ROMS_TRACE', Itrace) status = get_env('ROMS_HOME', roms_home)
Notice that get_env is a PUBLIC overloading function that decodes the string value of the environmental variables to another type of variable like integer and logical.
Currently, this capability is used in the ROMS-JEDi interface, but I can see its usage in the ROMS source code in the future.