Opened 13 years ago

Closed 13 years ago

#491 closed upgrade (Done)

Allowed tilde as file name paths in the plotting package

Reported by: arango Owned by: arango
Priority: minor Milestone: Plotting Package
Component: Plotting Version: 3.4
Keywords: Cc:

Description

Change the drivers of the plotting package ccnt, cnt, csec, and sec to specify a tilde in the input file path. For example, we can have in the input scripts:

...
T     WRTRANG: logical switch to write out data range values and CI.
F     WRTFNAM: logical switch to write out input primary filename.
F     WRTDATE: logical switch to write out current date.
T     CST    : logical switch to read and plot coastlines and islands.
 -30.0  70.0 : bottom and top map latitudes (south values are negative).
-100.5  20.5 : left and right map longitudes (west values are negative).
~/ocean/repository/plot/Data/varid.dat
~/ocean/repository/plot/Palettes/natlan1.pal
~/ocean/repository/plot/Data/default.cnt
damee4_avg.nc
damee4_avg.nc
../Data/damee4_grid_a.nc
~/ocean/repository/plot/Data/global_low.cst

A new routine Utility/read_fname.F was added to read file names from standard input scripts. If the file name starts with ~/, replace tilde with home directory path from the HOME environmental variable:

      READ (unit,'(a)') text
      lstr=lenstr(text)
      IF (text(1:2).eq.'~/') THEN
        CALL getenv ('HOME', home)
        ldir=lenstr(home)
        file_name=home(1:ldir)//text(2:lstr)
      ELSE      
        file_name=text(1:lstr)
      END IF

I found this to be useful when working in different computers environments, provided that we have the same directory tree for the ROMS software. For example, all my ROMS software is in the following directory tree: ${HOME}/ocean/repository.

Change History (1)

comment:1 by arango, 13 years ago

Resolution: Done
Status: newclosed
Note: See TracTickets for help on using tickets.