The GRAPH program generates simple diagnostics and plots for some standard meteorological variables. The GRAPH code will process multiple times and vertical levels, computing the same diagnostics for each time and level. The GRAPH code will provide simple vertical interpolation capability, cross-section figures, and skew-T plots. The GRAPH program can overlay two plots. The GRAPH code is written to be used as a batch processor, so that all graphical choices are made from tables. The GRAPH code can process data from TERRAIN, REGRID, little_r and RAWINS, INTERPF, MM5, NESTDOWN, LOWBDY, and INTERPB. But GRAPH code cannot plot boundary condition data. The GRAPH code does not produce any standard output for use by a subsequent program.
The GRAPH code in MM5 system is built on NCAR Graphics library (which is a licensed software: http://ngwww.ucar.edu, but part of it has become free which is sufficient to be used by all MM5 modeling system programs that require NCAR Graphics). It can be run on IBMs, Crays, workstations, and PC running Linux where NCAR Graphics is installed. When working on an IBM, a user can run GRAPH in batch or interactive mode. Examples of the interactive GRAPH use are shown in the section 12.7.
Note on compiling GRAPH on a PC:
When compiling on a PC running Linux using Portland Group Fortran compiler, it may require a library called libf2c.a. This library is required because NCAR Graphics library is compiled with GNU f77, while the GRAPH program requires PGF77 (or PGF90 - in order to deal with pointers). This library may or may not be available on your system. If it isn't, you may obtain it from the internet for free.
This table is used to define times, levels and fields to be processed and plotted by Graph. An example is shown below:
TIME LEVELS: FROM 1993-03-13_00:00:00 TO 1993-03-14_00:00:00 BY 21600 (A)
PRESSURE LEVEL MANDATORY: FROM SFC TO PTOP (B)
PRESSURE LEVEL NON STANDARD: FROM SFC TO PTOP BY 3 (C)
SIGMA LEVEL: FROM 23 TO KMAX BY 5 (D)
------------------------------------------------------------------------------
PLOT | FIELD | UNITS | CONTOUR | SMOOTH || OVERLAY | UNITS |CONTOUR |SMOOTH
T/F | | | INTERVAL | PASSES || FIELD | |INTERVAL|PASSES
-----|-------|-------|----------|--------||---------|-------|--------|------
T | TER | m | 100 | 0 || | | |
T | WIND | m/s | 5 | 0 || BARB | m/s | 2 | 0
TP500| HEIGHT| m | 30 | 0 || VOR |10**5/s| 0 | 0
TI305| PV | PVU | 1 | 0 || P | mb | 20 | 0
X | 5 | 5 | 23 | 8 || PSLV | mb | 2 | 0
X | THETA | K | 3 | 0 || CXW | m/s | 10 | 0
X | 5 | 18 | 23 | 5 || PSLV | mb | 2 | 0
X |THETA | K | 3 | 0 || CXW | m/s | 10 | 0
T |SKEWTLL|72469 DEN DENVER, CO |39.75 |-104.87 || | | |
T |SKEWTXY|STATION IN (X,Y) | 19 | 30 || | | |
------------------------------------------------------------------------------
Description of Table Header
Rows:
(A) |
TIME |
with beginning and ending times given in YYYY-MM-DD_HH:MM:SS, and time increment given in seconds defined by the number after BY. If one doesn't use :SS, the increment should be in minutes, and if one doesn't use :MM, then the increment should be in hours. `BY 0' means to plot every output times. |
(B) |
MANDATORY |
used for pressure level dataset (such as from DATAGRID and Rawins). Will plot every mandatory level from the maximum and minimum level requrested. ALL and NONE may also used to replace the entire string after the colon. |
(C) |
NON STANDARD |
used for pressure level dataset. Will plot every mandatory level from the maximum and minimum level requrested. Optional use of BY n will make plots at every n levels. ALL and NONE may also be used to replace the entire string after the colon. |
(D) |
SIGMA |
used for σ-level data. Will plot the levels specified by indexes (K=1 is at the top of the model). An increment is required, and defined by the number after BY. Can also use ALL or NONE. |
(E) |
TITLE |
except for a colon (:), any alpha-numeric character can be used to make a simple 1 line, 80 character title |
To create pressure-level
plot from sigma-level data:
TP500 | HEIGHT | m | 30 | 0 || VOR |10**5/s | 0 | 0
To create isentropic-level
plot from sigma-level data:
TI305 | PV | PVU | 1 | 0 || P | mb | 20 | 0
If the plot is a skew-T (SKEWTLL or
SKEWTXY), the UNITS column is used to define location name, and lat/long or
X/Y appear in the following two columns. e.g.
T |SKEWTLL |72469 DEN DENVER, CO |39.75 |-104.87 || | | |
To plot a vertical cross-section:
For a cross-section plot, the location
is defined by the 4 numbers in the columns following `X', and they are in
the order of X1, Y1, X2, and Y2. e.g.,
X | 5 | 5 | 23 | 8 || PSLV | mb | 2 | 0
This is a namelist file and it is optional. If this file exists in the current working directory when the Graph program starts executing, the file's contents replace the previously set defaults in the Fortran code. Since this is a namelist structured file, lines may be removed. Comments after `;' are not allowed on most platforms, but are shown here for easy reference only.
; ISTART=1, ; sub-domain plot beginning I location
; JSTART=1, ; sub-domain plot beginning J location
; IEND=37, ; sub-domain plot ending I location
; JEND=49, ; sub-domain plot ending J location
LW1=2000, ; line width, 1000 is thinnest
LW2=2000, ; line width for overlay plot
DASH1=-682, ; dash pattern, standard NCAR GKS method
DASH2=-682, ; 4092, 3640, 2730, -682
HDRINFO=F, ; true=print header and stop
LOGP=0, ; cross section: 0=linear in p; 1=linear in ln p
XPTOP=200., ; top of cross section plots (mb)
LABLINE=1, ; 0: no contour line labels
LABMESG=0, ; 1: no message below conrec plot
NOZERO=0, ; 0: allow zero line; 1:no min/max zero line;
IHIRES=0, ; 1: use high resolution US county line/China coastline
Description of variables in
the namelist:
To use higher resolution US county lines or Asia coastline, set IHIRES=1, and name the outline file to be hipone.ascii. These files may be downloaded from ftp://ftp.ucar.edu/mesouser/Data/GRAPH directory.
This table is used to modify map background specifics for a Graph plot.
------------------------------------------------------------------------------
MAP DETAILS
LL | DASH | INT | LB | LSZ | LQL | P | TTL | TSZ | TQL | OUT | DOT | LW | SP
------------------------------------------------------------------------------
A | PB | D | M | 12 | 00 | Y | Y | 8 | 00 | PS | N | D |
------------------------------------------------------------------------------
MAP COLORS
LL LINES | LABELS | TITLE | STATES | COUNTRIES | CONTINENTS | PERIMETER
------------------------------------------------------------------------------
1 | 1 | 1 | 1 | 1 | 1 | 1
------------------------------------------------------------------------------
Description of variables in g_plots.tbl: (Text is provided by Dr. Mark Stoelinga of University of Washington.)
With each parameter is given a conditional statement. If that conditional statement is not met, then that particular box should be made blank. The most common error that occurs when the routine attempts to read this table is "Too many entries on line", which simply means that the routine expected a box to be blank, but it wasn't.
One can also do color-filled maps. To do so, add the following in the g_map.tbl:
MAP FILL
WATER | SIX COLOR INDICIES WITH WHICH TO COLOR IN THE MAP
------------------------------------------------------------------------
1 | 2 | 2 | 2 | 2 | 2 | 2
------------------------------------------------------------------------
In this example, the water will be colored white, and land light grey according to the color tabel described below.
This table is used to define the color codes referred in the Graph program.
------------------------------------------------------------------------------
COLOR | RED | GREEN | BLUE | NUMBER
------------------------------------------------------------------------------
WHITE | 1.00 | 1.00 | 1.00 | 1
LIGHT GRAY | 0.66 | 0.66 | 0.66 | 2
DARK GRAY | 0.40 | 0.40 | 0.40 | 3
BLACK | 0.00 | 0.00 | 0.00 | 4
SKY BLUE | 0.20 | 0.56 | 0.80 | 5
LIGHT YELLOW | 0.80 | 0.80 | 0.00 | 7
MAGENTA | 1.00 | 0.00 | 1.00 | 8
YELLOW | 1.00 | 1.00 | 0.00 | 9
GREEN | 0.00 | 1.00 | 0.00 | 10
FOREST GREEN | 0.14 | 0.25 | 0.14 | 11
CYAN | 0.00 | 1.00 | 1.00 | 12
BROWN | 0.25 | 0.20 | 0.15 | 14
ORANGE | 1.00 | 0.50 | 0.00 | 15
MID-BLUE | 0.00 | 0.50 | 1.00 | 17
DULL MID-BLUE | 0.00 | 0.15 | 0.30 | 18
BRIGHT FOREST GREEN | 0.20 | 0.40 | 0.20 | 19
DULL ORANGE | 0.60 | 0.30 | 0.00 | 20
------------------------------------------------------------------------------
To make a color contour plot, change the background color from black to white using the following g_color.tbl:
------------------------------------------------------------------------------
COLOR | RED | GREEN | BLUE | NUMBER
------------------------------------------------------------------------------
WHITE | 1.00 | 1.00 | 1.00 | 0
BLACK | 0.00 | 0.00 | 0.00 | 1
LIGHT GRAY | 0.66 | 0.66 | 0.66 | 2
DARK GRAY | 0.40 | 0.40 | 0.40 | 3
BLACK | 0.00 | 0.00 | 0.00 | 4
and change color used for maps in the MAP COLORS section of the g_map.tbl from 1 to a color code other than white for borders, tick marks, and map background.
To run GRAPH interactively, the first step is to obtain the GRAPH tar file. The GRAPH tar file, GRAPH.TAR.gz, can be otained from ~mesouser/MM5V3 (or /fs/othrorgs/home0/mesouser/MM5V3) from NCAR's IBM, /MESOUSER/MM5V3/GRAPH.TAR.gz on MSS, or from the anonymous site (ftp://ftp.ucar.edu:mesouser/MM5V3). This tar file contains the GRAPH source code, makefiles, as well as the table files required to produce plots.
To get the tar file from the anonymous ftp site:
3) use your full email address as the password
5) set the transfer to binary (or image), usually this is just "bin"
Or to get the tar file on NCAR's IBM:
msread GRAPH.TAR.gz /MESOUSER/MM5V3/GRAPH.TAR.gz
cp ~mesouser/MM5V3/GRAPH.TAR.gz .
Once you have the GRAPH.TAR.gz on the IBM's working directory or on the local workstation, the building process is to gunzip the file, untar the file and make the executable.
After untarring the file, you should find the GRAPH directory and the following in GRAPH directory among others:
3) If your dataset dimensions are greater than 200x200x40, you need to edit two files in src/ directory: scratch.incl and data.incl
4) type "make", and this will create a graph executable called graph.exe.
(if working on NCAR's IBM, a user can simply copy the graph-run-ibm.tar.gz file from
~mesouser/MM5V3/IBM, unzip and untar it. An executable is inside)
5) edit the g_plots.tbl and g_defaults.nml (if needed) files.
6) if a user is working on NCAR's IBM, he/she needs to retrieve data from MSS by typing the following:
msread MMOUT_DOMAIN1[_01 through _99] MSSfilename &
The `&' puts the msread command in the background.
Program Graph can only process output from one domain at a time. To run Graph, type "graph.csh 1 1 MMOUT_DOMAIN1", or
The graph.csh tries to figure out what options you have placed on the command line. For example,
a) to run graph with one data file:
b) to run graph with 3 files named MMOUT_DOMAIN1, MMOUT_DOMAIN1_01, MMOUT_DOMAIN1_02:
c) to run graph with 3 files named MMOUT_DOMAIN1_00, MMOUT_DOMAIN1_01, MMOUT_DOMAIN1_02:
d) to run graph with 3 files named MMOUT_DOMAIN1_00, MMOUT_DOMAIN1_01, MMOUT_DOMAIN1_02:
The plot files generated by Graph are metacode files called `gmeta' (and gmeta.split1, gmeta.split2, etc. if you choose to split the file), which can be viewed by NCAR Graphics utility idt, and/or transformed to postscript files using ctrans (also an NCAR Graphics utility). For example, to transfer a gmeta file to postscript file,
ctrans -d ps.mono gmeta > gmeta.ps (for black-white plot), or
ctrans -d ps.color gmeta > gmeta.ps (for color plot)
Or to view the output interactively using an interface,
Table 8.1 List of 2-D horizontal fields available for plotting.
Table 8.2 List of cross-section-only fields available for plotting.
Table 8.3 List of 3-D fields available for plotting.
For some horizontal plots, please refer to Chapter 15, page 15-9 and 15-10.
The graph.tar file contains the following files and directories:
CHANGES Description of changes to the Graph program
Diff/ Will contain difference files between consecutive releases
Makefile Makefile to create Graph executable
README General information about the Graph directory and how to run Graph
Templates/ Job deck directory: batch deck for Cray only
g_color.tbl Color table for Graph job
g_defaults.nml NAMELIST file for Graph job
g_map.tbl Map table for Graph job
g_plots.tbl Table for selecting plot variables
graph.csh C-shell script to run Graph interactively
# this is INTERACTIVE or BATCH
echo "environment variable defined as $ENVIRONMENT"
setenv ENVIRONMENT INTERACTIVE
echo "environment variable defined as $ENVIRONMENT"
# initializations, no user modification required
set FILE_EXT = ( 00 01 02 03 04 05 06 07 08 09 \
10 11 12 13 14 15 16 17 18 19 \
20 21 22 23 24 25 26 27 28 29 \
30 31 32 33 34 35 36 37 38 39 \
40 41 42 43 44 45 46 47 48 49 \
50 51 52 53 54 55 56 57 58 59 \
60 61 62 63 64 65 66 67 68 69 )
# If this is an HP-UX machine, the generic name for fortran files
# starts with "ftn" not "fort".
if ( -e numsplit.tbl ) rm numsplit.tbl
if ( -e med.input ) rm med.input
if ( ( `uname` == AIX ) || ( `uname` == SunOS ) || ( `uname` == HP-UX ) ) then
if ( -e ${ForUnit}20 ) rm ${ForUnit}2*
if ( -e ${ForUnit}30 ) rm ${ForUnit}3*
if ( -e ${ForUnit}40 ) rm ${ForUnit}4*
if ( -e ${ForUnit}50 ) rm ${ForUnit}5*
if ( -e ${ForUnit}60 ) rm ${ForUnit}6*
if ( -e ${ForUnit}70 ) rm ${ForUnit}7*
if ( -e ${ForUnit}80 ) rm ${ForUnit}8*
if ( ( -e ${ForUnit}20 ) || ( -l ${ForUnit}20 ) ) rm ${ForUnit}2*
if ( ( -e ${ForUnit}30 ) || ( -l ${ForUnit}30 ) ) rm ${ForUnit}3*
if ( ( -e ${ForUnit}40 ) || ( -l ${ForUnit}40 ) ) rm ${ForUnit}4*
if ( ( -e ${ForUnit}50 ) || ( -l ${ForUnit}50 ) ) rm ${ForUnit}5*
if ( ( -e ${ForUnit}60 ) || ( -l ${ForUnit}60 ) ) rm ${ForUnit}6*
if ( ( -e ${ForUnit}70 ) || ( -l ${ForUnit}70 ) ) rm ${ForUnit}7*
if ( ( -e ${ForUnit}80 ) || ( -l ${ForUnit}80 ) ) rm ${ForUnit}8*
if (( $#argv == 0 ) && ( $ENVIRONMENT == INTERACTIVE )) then
echo -n "into how many pieces is the metafile to be split (1) "
echo -n "how many input files are there (1) "
echo -n "what is the name of the file (MMOUT_DOMAIN1) "
echo "graph.deck: error in call"
echo "usage: graph.deck ns nf filename [filename2 filename3 ...]"
echo " where ns is the number of files into which metacode is split"
echo " where nf is the number of input files"
echo " where filename is either the root name, or several names"
if (( $NumSplit < 1 ) || ( $NumSplit > 99 )) then
if (( $TotFiles < 1 ) || ( $TotFiles > 69 )) then
if (( ! -e $FileName ) && ( ! -e ${FileName}_00 )) then
echo "file $FileName does not exist"
if (( ! -e $argv[3] ) && ( ! -e $argv[3]_00 ) ) then
echo "file $argv[3] does not exist"
if ( ! -e graph.exe ) ln -s src/graph.exe graph.exe
# make sure we have all the required tables
echo "using local copy of g_map.tbl"
echo "need a copy of g_map.tbl"
echo "using local copy of g_color.tbl"
echo "need a copy of g_color.tbl"
echo "using local copy of g_plots.tbl"
echo "need a copy of g_plots.tbl"
echo "using local copy of g_defaults.nml"
echo "need a copy of g_defaults.nml"
if ( ( `uname` == AIX ) || ( `uname` == SunOS ) || ( `uname` == HP-UX ) ) then
if ( -e ${ForUnit}18 ) rm ${ForUnit}18
if ( ( -e ${ForUnit}18 ) || ( -l ${ForUnit}18 ) ) rm ${ForUnit}18
ln -s g_plots.tbl ${ForUnit}18
if ((( $TotFiles == 1 ) && ( $#argv == 3 )) || \
(( $TotFiles > 1 ) && ( $#argv > 3 ))) then
ln -s $argv[1] ${ForUnit}$UNIT
# assign -a $argv[1] -Ff77 -Nieee ${ForUnit}$UNIT
else if ( (( $TotFiles > 1 ) && ( $#argv == 3 )) || ( $#argv == 0 ) ) then
if ( ( `uname` == AIX ) || ( `uname` == SunOS ) || ( `uname` == HP-UX ) ) then
while ( $NUMFIL <= $TotFiles )
if ( ( $NUMFIL == 1 ) && ( -e $FileName ) ) then
ln -s $FileName ${ForUnit}$UNIT
# assign -a $FileName -Ff77 -Nieee ${ForUnit}$UNIT
else if ( ( $NUMFIL == 1 ) && ( -e ${FileName}_00 ) ) then
ln -s ${FileName}_$FILE_EXT[${NUMFIL}] ${ForUnit}$UNIT
# assign -a ${FileName}_$FILE_EXT[${NUMFIL}] -Ff77 -Nieee ${ForUnit}$UNIT
ln -s ${FileName}_$FILE_EXT[${NUMFIL}] ${ForUnit}$UNIT
# assign -a ${FileName}_$FILE_EXT[${NUMFIL}] -Ff77 -Nieee ${ForUnit}$UNIT
else if ( $AIX == false ) then
if ( ( $NUMFIL == 1 ) && ( ( -e $FileName ) || ( -l $FileName ) ) ) then
ln -s $FileName ${ForUnit}$UNIT
# assign -a $FileName -Ff77 -Nieee ${ForUnit}$UNIT
else if ( ( $NUMFIL == 1 ) && ( ( -e ${FileName}_00 ) || ( -l ${FileName}_00 ) ) ) then
ln -s ${FileName}_$FILE_EXT[${NUMFIL}] ${ForUnit}$UNIT
# assign -a ${FileName}_$FILE_EXT[${NUMFIL}] -Ff77 -Nieee ${ForUnit}$UNIT
ln -s ${FileName}_$FILE_EXT[${NUMFIL}] ${ForUnit}$UNIT
# assign -a ${FileName}_$FILE_EXT[${NUMFIL}] -Ff77 -Nieee ${ForUnit}$UNIT
RIP (which stands for Read, Interpolate and Plot), is a graphical program developed by Dr. Mark Stoelinga of University of Washington. This program is a popular alternative graphics program to GRAPH, especially when it comes to color plots. This program is also based on NCAR Graphics.
A descriptions of this package is
available in Appendix G.