#934 closed upgrade (Done)

Added new module get_env.F — at Version 1

Reported by: arango Owned by:
Priority: major Milestone: Release ROMS/TOMS 4.1
Component: Nonlinear Version: 4.0
Keywords: Cc:

Description (last modified by arango)

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.

The get_env.F module uses Fortran 2003 GET_ENVIRONMENT_VARIABLE intrinsic function.

Change History (1)

comment:1 by arango, 16 months ago

Description: modified (diff)
Resolution: Done
Status: newclosed
Note: See TracTickets for help on using tickets.