ncl-metno home

shell scripts:


mcontour.sh

Syntax

Example: Tides in the North Sea

    The figures below were made by
  • first copying the file userdef.ncl from /home/arnem/lib/ncl-metno/
  • then, specifying the title to
    mytitle= "Sea surface height"
    
  • and modifying the contents of three additional lines further down in the same file to
    v1=  -0.85  ; Low  value for isopleths, disregarded when  nv  is 0 or 1
    v2=   0.85  ; High value for isopleths, disregarded when  nv  is 0 or 1
    nv=  17     ; No. of isopleths, there will be  nv+1  colors
    
    in order to lock the use of contours and color map (such a specification is essential to invoke when executing the multi-figure scripts mcontour.sh, mc-mask.sh) and mlayersection.sh)

Then, the following command was issued:

mcontour.sh 3dMap lon lat MIPOM_ssh.nc ssh 1 25 -40

Note that 'lon' (2nd argumnet) and 'lat' (3rd argument) are default 2D longitude and latitude names, and could thus have been dropped
(i.e., mcontour.sh 3dMap MIPOM_ssh.nc ssh 1 25 -40 would have worked here).
By executing this command, a set of cropped gif images are first produced, these are joined into a gif animation, and the original individual gif frames are deleted. The result is this animation:


mcontour.sh: syntax

mcontour.sh --help

        mcontour.sh  /  ncl-metno 1.2

>>>
>>>
>>> NOTE: The user is **STRONGLY** recommended to copy
>>> /home/arnem/lib/ncl-metno/userdef.ncl
>>>  to the directory where the command 'mcontour.sh' is given,
>>>  and at least specify
>>>   * color map (palette)
>>>  -otherwise, the series of files produced by  mcontour.sh
>>>   will (usually) NOT have the same color map (see more information below)
>>>
>>> NOTE: This script will provide a set of output files, where
>>>  the value of the final (3rd or 4th) dimension changes from
>>>  one output file to the next. Below, we assume that this
>>>  dimension is time.
>>>
>>> Syntax:
>>> =======
>>>
>>> ...if  <option> is  4d  or  4dmap:
>>>  mcontour.sh <option> <file> <variable> <depth> <first> <last> (<step>) (-<delay>)
>>> ...if  <option> is  3d  or  3dmap :
>>>  mcontour.sh <option> <file> <variable> <first> <last> (<step>) (-<delay>)
>>> where
>>>    <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
>>>    <file>      name of the netcdf file
>>>    <variable>  name of requested variable on the netcdf file
>>>                 (case sensitive)
>>>    <depth>     vertical level no.
>>>    <first>     first time step no.
>>>    <last>      last  time step no.
>>>    <step>      time step between consequtive frames
>>>                 (optional, set to  1  if not specified by user)
>>>    <delay>     frame delay in ms (optional, set to  10 if not specified by user)
>>>
>>>  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, e.g. (3D fields):
>>>   mcontour.sh <option> <lonname> <latname> <file> <variable> <first> <last> (<step>) (-<delay>)
>>>    (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 a gif animation.
>>>
>>>
>>> User specifications:
>>> ====================
>>>
>>>  By copying the default spec.s from
>>> /home/arnem/lib/ncl-metno/userdef.ncl
>>>  to the directory where the command 'mcontour.sh' is given,
>>>  the user may specify
>>>   * title
>>>   * font
>>>   * zooming
>>>   * 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).
>>>
>>>
>>> Examples:
>>> =========
>>>
>>>  mcontour.sh 4dmap hydrography.nc temp 1 10 15
>>>    will produce a gif animation with 6 frames for time steps
>>>      10-15 of the first vertical level of the variable 'temp'
>>>     on the file 'hydrography.nc', on a lon-lat grid w/ a map
>>>  mcontour.sh 3d surface.nc sst 1 9 2
>>>    will produce a gif animation with 5 frames for time steps
>>>    1, 3, 5, 7 and 9 on a x-y grid of the variable 'sst' on
>>>    the file 'surface.nc'
>>>
>>>
>>> Terminating.