Grid File

  1. grid_file (character)
    The name of the file holding the grid data. In the case of a spectral element data, the file should contain the spectral grid. Otherwise, if contouring x-y data, set it to "structured_grid mx ny" where mx and ny are the number of points in the x and y directions, respectively. These 3 entries should be separated by blank spaces.
  2. scale, shift (real)
    parameters to scale and shift the data as in data_new = data_old*scale + shift
  3. xmin, xmax, ymin, ymax (real)
    The minima and maxima of the grid in user coordinates. They are irrelevant if imap=3 (a map projection is used). They are important in the case of a structured_grid. They should reflect the extremal coordinates of the data.

    Map Projection

  4. icartmap (integer)
    Flag to indicate if a map projection is desired. If set to a non-zero value, the parameters defining the projection should be present in the next 6 lines. icartmap takes the following values:
    1. 0 no map projection, line 5-10 below must be omitted.
    2. 1 a map projection is desired, and the continental outlines are those of NCAR.
    3. 2 same as 1, except that the continents are colored with whatever color is in index color 2.
    4. -1 a map projection is desired, but the continental outline is that of xcoast. The environment variable XCOASTDATA should point to the place where the file is located. Currently mine is pointing to "/u1/coasts/coast0.lines".
    5. -2 a map projection is desired, the xcoast continents are used, and an isobath is drawn (as for the Abyssal Basin of the Eastern Mediterranean). The environment variable ISOBATH must point to the isobath data file. My file is located in "/d2/mohamed/rmed/xcoast.isobath".
    6. < -2 For integers less than -2, only the isobaths are drawn.
  5. JPRJ (character)
    Defines the type of projection (e.g. ME for mercator, OR for orthographic). Check the NCAR manual for the list of projections available.
  6. PLAT, PLONG, ROTA (real)
    The latitude, longitude and rotation angle of the projection. Their meaning depends on the type of projection used.
  7. JLTS (character)
    Decide on the extent of the map to be drawn. JLTS can take the following values:
    1. MA the maximum visible portion of the map is drawn.
    2. CO the data on line 8 specify corner locations
    3. AN the data on line 8 specify angles from center of projection.
  8. P1, P2, P3, P4 (real)
    The meanining of the above paremeters change depending on the type of projection (JPRJ) and area definition (JLTS). For JPRJ=ME and JLTS = CO, P1 and P2 are the latitudes and longitudes of the lower left corner of the map; P3 and P4 are the latitudes and longitude of the upper right corner.
  9. JGRD (real)
    Increments in degrees in case a lon-lat grid is desired. Has never really worked for some reason. I set to 0.
  10. XOFF, YOFF (real)
    Indicate the offset of the grid upon projecting lat-lon to x-y space. These parameters are now obsolete.

    Plot Position

  11. lft, rgt, bot, top (real)
    Position of the map on the plotter frame. These numbers must be between 0.0 and 1.0.
    1. lft: distance from left border to left edge of the plot, suggested (0.05)
    2. rgt: distance from left border to right edge of the plot, suggested (0.95)
    3. bot: distance from bottom border to bottom edge of the plot, suggested (0.05)
    4. top: distance from bottom border to top edge of the plot, suggested (0.95)

    Computational Map

  12. xc1, xcm, yc1, ycn (real)
    In the case of a structured grid with MxN points,
    1. xc1 defines the position of the data point corresponding to X(1), it is 1.0 for a spectral element contour.
    2. xcm defines the position of the data point corresponding to X(M), it is -1.0 for a spectral element contour.
    3. yc1 defines the position of the data point corresponding to Y(1), it is 1.0 for a spectral element contour.
    4. ycn defines the position of the data point corresponding to Y(N), it is -1.0 for a spectral element contour.
    These numbers should be not be changed from their mandated value for spectral element contouring. If a structured grid is being contoured, then these numbers should be exactly as listed in line 2 for (xmin,xmax, ymin, ymax).
  13. imap (integer)
    informs the NCAR contouring routine if mapping is applied. imap should always be set to 3 for spectral element contouring. If contouring on a structured grid, imap should be set to 1. If sigma-levels are used in the vertical a la SCRUM, imap should be set to -3.

    Color Contours and Palettes

  14. icolor (integer)
    Decide whether to color the contour levels. If it is non-zero contours are colored. The palette depends on the value of icolor:
    1. 1: the palette is generated internally.
    2. 2: Hernan's palette gs1.pal.white is used.
    3. 3: for 3 and greater the code expects a file name in the following line that will hold the palette. It should be in the same format as gs1.pal.white.
    4. -3: contour lines are omitted, only colors are drawn
    If icolor > 0, then a color bar is drawn. The parameters can be controlled through a file which must be indicated by the environment variable COLORBAR_FILE, e.g. setenv COLORBAR_FILE /d2/mohamed/plot/colorbar.hz. If this environment variable is not set, the default values are used, which places the color bar vertically. The parameters that can be controlled are: orientation, fill height and width, (x,y) extents of the color bar, and the FORMAT of the labels. The names of few color palette files are hard coded, they should be changed prior to compilation on a new system. They are all located in contcolr.F. The file names are
    1. a. '/d1/mohamed/plot/gs1.pal.white'
    2. b. '/d2/mohamed/plot/palette.moe'.

    Contour Interpolation

  15. spectral (integer)
    Choose the interpolation algorithm for the spectral element contouring. If set to -1, a spectral interpolation is first applied to the data to find the value of the function on a uniform dense grid (the square of the number of collocation points per element) before contouring the data. If contouring spectral element data, it is best to leave set to -1.

    Choice of Contour Levels

  16. ncl (integer), ciu (real), autocontours (integer), cmn (real)
    Decide on the choice of contour levels.
    1. ncl: number of contours.
    2. ciu: increment of contour levels if autocontour set to 0.
    3. cmn: minimum contour level if autocontours set to 0.
    4. autocontours: flag to indicate how to decide on the contours; it takes the following values:
      1. 0 : use a linear function to set the contours. Thus the m-th contour is given by zlev(m) = cmn + (m-1)*ciu.
      2. 1 : use the minimum and maximum of the data to decide on cmn and ciu, then cmn = minimum of data and ciu = (data_max-data_min)/(ncl-1)
      3. -1 and smaller, and the contour levels must be provided indivdually by the user. This is useful if contour level increment have to be controlled closely.

    Format and Number of Data

  17. iformat, nframes (integer)
    iformat: decide on the format of the data. If it is less than zero, the data to be read must be binary, else the data is in ascii form. iformat understands the following values:
    1. 0 : data is read in ascii as in read(7,*) (data(i), i=1,MN)
    2. -2 : the data is read from a fortran-written binary file, and is in nodal form.
    3. -3 : same as for -2.
    4. -4 : the data is read from a fortran-written binary file, and is in elemental form.
    5. -5 : the data is read from a c-written binary file, the option is mostly for Enrique's benefit.
    6. -6 : Read elemental binary data defined on the Gauss-Legendre points. (for discontinuously-staggered pressure contours).
    nframes is the number of frames to draw. If nframes is set to 0 it draws all the frame available in the data set up to a maximum of 1000.
  18. data_file (character)
    The name of the file containing the data.

    Plot Labels

  19. xfstg, yfstg, timei, dtime (real)
    parameters to draw a title for the plot.
    1. xfstg: x-location of the title string in plotter coordinates. 0 <= xfstg <= 1. recommended (0.5)
    2. yfstg: y-location of the title string in plotter coordinates. 0 <= xfstg <= 1. recommended (0.97)
    3. timei: time-stamp of initial frame.
    4. dtime: time-interval between frame.
    timei and dtime are used to stamp a number (usually meant to indicate simulated time) at the end of title string. The time of frame iframe is: (iframe-1)*dtime + timei
  20. string (character)
    The title string

    Plot Options

  21. wholesphere (integer)
    flag to indicate if the wholesphere is considered. It takes the values:
    1. 0 : map does not cross the date line.
    2. 1 : grid crosses the date line.
  22. iso_elements (logical)
    1. T: the spectral truncation is the same in the x and y directions.
    2. F: the spectral expansions in x and y are different. This is useful to draw the vertical sections spectrally.
  23. draw_elements (logical)
    If true the border of the elements are drawn. This is useful to locate the number of the elements with interesting (usually troubling) features.
  24. draw_continents (logical)
    flag to draw continents. True : Continents are drawn. False : Continents are not drawn (like for the sector).
  25. tick_marks (integer)
    flag to draw the tick-marks and write the labels on the x and y axes. No tick-marks or labels are drawn if tick_marks is set to 0.

    Vector Plot

  26. draw_vectors (logical)
    flag to draw vectors. if true, additional information must be provided. Set to false if running contours, and to true if running vectors. (no more data is needed for contouring).
  27. file_data (character)
    file name holding y-component of the vector to be drawn.
  28. ix, iy (integers)
    x-y increments at which to draw vectors.
  29. veclen, flo, fhi (real)
    parameters controlling the drawing of vectors: veclen: vector length flo: low cut-off fhi: high cut-off

Examples

Here are a few sample contouring scripts:
  1. Picture script of a vertical slice with sigma mapping in the vertical
  2. Picture and script of a contour plot on a SEOM grid.
  3. Picture and script of the same contour plot on a structured grid. The interpolation was done from a SEOM grid using interp2d.
  4. Picture and script of a color structured-grid-contour plot. You can take a look a at the colorbar-file used to control the lay-out and labelling of the color bar.
The gmeta files produced by NCAR Graphics were translated to gif format using the following command:
ctrans -d sun -res 600x600 gmeta | rasttopnm | ppmtogif > zt.gif
See href=http://ngwww.ucar.edu/info/faq.html#ConvertGif for more information on how to translate gmeta files into other formats.