ncl-metno home

shell scripts:


slice.sh

Example: Temperature slice at 300m from overturning experiment

The figure below was made by issuing the command:

slice.sh 4dmap hycom_008c15_h.nc hycom_008c15_TS.nc thknss temp 300 10

slice.sh: syntax

slice.sh --help

           slice.sh  /  ncl-metno 1.2

>>>
>>>
>>> NOTE: This script assumes that the variable to depict has been
>>>  stored with dimensions in the order x  -y  -layer(-time)
>>>                                   or lon-lat-layer(-time)
>>>  (w/ Fortran style sequence of dimensions).
>>>
>>> Syntax:
>>> =======
>>>
>>>  slice.sh (layer) <option> <hfile> <varfile> <hname> <varname>\
>>>                                              <depth> (<time>)
>>> where
>>>    (layer)     include an initial argument 'layer' if you want isopleths
>>>                 to be drawn for layer interfaces, ignore otherwise
>>>    <option>    specifies dimensions and geo- or nongeo-grid
>>>                 implemented:
>>>                  [34]d    - [34]D fields
>>>                  [34]dmap - [34]D fields, dims. are lon & lat
>>>                  [34]dMap - [34]D fields, lon & lat are 2d fields
>>>                  ...[34]d[mM]ap will be displayed on a geogr. map
>>>    <hfile>     name of netCDF file w/thickness results
>>>    <varfile>   name of netCDF file w/requested variable
>>>                 you may use '.' if both variables are on the same file
>>>    <hname>     name of thickness variable
>>>    <varname>   name of variable to depict
>>>             NOTE! This script requires the existence of an
>>>                   attribute 'missing_value' to <varname>
>>>    <depth>     depth for which the contour plot is to be drawn
>>> (positive integer, 1-4 digits)
>>>    <time>      time step no. to depict
>>>                a negative <time> value is interpreted as a flag that
>>>                 stops the ncl script from being deleted
>>>
>>>  Special case:
>>>   If <option> is one of [34]dMap, the name of the 2d longitude and
>>>    latitude variable may be specified on the command line:
>>>   slice.sh (layer) <option> <lonname> <latname> <hfile> <varfile> <hname> <varname> <depth> (<time>)
>>>    (Alternatively, if these names are not 'lon' or 'lat', 'userdef.ncl' may
>>>     be edited when option is one of [34]dMap.)
>>>
>>>  The script will produce an eps-file and a png-file.
>>>
>>>
>>> User specifications:
>>> ====================
>>>
>>>  By copying the default spec.s from
>>> /home/arnem/lib/ncl-metno/userdef.ncl
>>>  to the directory where the command 'slice.sh' is given,
>>>  the user may specify
>>>   * title
>>>   * zooming
>>>   * font
>>>   * color map (palette)
>>>   * no. of colors
>>>   * plot size limits
>>>   for geographical maps:
>>>   * names of longitude & latitude variables
>>>   * map projection
>>>   * coastline detail level
>>>   (look up, or copy, this file to edit your own 'userdef' file).
>>>
>>>
>>> Example:
>>> =========
>>>
>>>  slice.sh 4dmap hycom_expt007.nc . thknss salin 1000 30
>>>    will produce a depiction on a lon-lat grid w/ a map,
>>>     of the variable 'salin' on the file 'hycom_expt007.nc',
>>>     for a depth of 1000m w/ layers given by 'thknss' on the
>>>     same file, from timestep no. 30
>>>
>>>
>>> Terminating.