Using the web plotter involves three people, the owner
of the software (Wesley Ebisuzaki, WNE), the owner of
the .ctl file and data (point of contact, POC) and the web
surfer who is making the plots (surfer). [By owner, I am
using the computer definition of the account which owns
WNE makes available a cgi-bin program which points to the POC's
directory. This program has very limited customization options.
There are no "custom" versions of this program available because
this program undergoes frequent changes which makes maintaining custom
versions too time consuming. WNE prefers to own the cgi-bin
programs because WNE has scripts to update all the cgi-bin
In the POC's directory are GrADS control files. These control files
may refer to data on other directories but the control, index
and data files must be visible (NFS mounted) by the web servers
(SGI62 and SGI51). The POC's control file is where all the
magic occurs. Through commands in the control file, the
web plotter can make arbitrary plots. Color choices,
titles, etc are controlled from the control file.
Standard GrADS Commands
- TITLE comment
The comment appears on the .ctl selection page
- TDEF (daily data)
For daily data, use 01may1997 instead of 00Z01may1997, looks nicer
- TDEF (monthly data)
For monthly data, use may1997 instead of 00Z01may1997, looks nicer
- TDEF n
Try to get n right. It tells people how much data
- VAR .. ENDVAR
Define each variable with units in the comment field!
- VAR .. ENDVAR
Use "(hidden)" in the comment field to "hide" variables.
Use "(hide)" in the comment field to "hide" variables in lite mode.
The web plotter understands a simple language which allows you
to customize plots. The syntax is very simple,
* [action]:[variable]:[field 1]:[field 2]:..:[field n]
Each embedded command starts with an asterisk and then a space. This is
a GrADS comment so that the control file remains a control file.
These new commands can be put anywhere in the file except between
the VARS and ENDVARS statements. (Script limitation)
Customized Titles: title
The easiest command is the "title" command. This allows the
POC to redefine the plot title.
* title:[variable]:new title
In the title command, you can use the symbolic variables
such as $_level, $_hour, $_day, $_month, $_year.
(Time series and hovmoller diagrams can also use
$_fhour, $_fday, $_fmonth and $_fyear.)
Note, the word "title" and the variable
are case sensitive. In addition, there can only be one space separating
the asterisk and the word "title". An example of a "title" command is,
* title:UGRD:Zonal wind (m/s) $_level mb $_hour $_day$_month$_year
Customized Settings: line, shaded
The variables and functions (following section) are plotted using
the "shaded" and/or "line" code. When the default contour
interval is chosen, the POC can modify the default contour
intervals and colors by using the "line" and "shaded" commands.
The "line" and "shaded" commands are ignored when the surfer
selects a contour interval.
* [line|shaded]:[variable]:[level|*]:grads command
If the grads command applies to all the levels, use an asterisk
in the level field. Almost always both "line" and "shaded" are
used together otherwise a "shaded & line" plot will look strange.
Any number of "shaded" and "line" commands can be included in the .ctl file.
This example sets the default "clevs",
* shaded:precip:*:set clevs 0.1 .5 2 5 10 15 20 30 40 50 75 100
New Variables: function
The web plotter allows you to define new variables. Once a new
variable is defined, it can be used in maps, time series and
hovmoller diagrams. The syntax is,
* function:[variable]:[number of levels]:[defn]:[comment]
Note, the variable name can include spaces and hyphens, for example,
* function:isotach m/s:17:mag(UGRD,VGRD):wind speed (m/s)
The function command is very powerful when combined with the
"init" command. Using the "init" command, one can define
function which uses data from other control files.
More Data: init
The "init" commands are executed before any data is accessed.
The main purpose of the "init" command is to open additional
control files and perhaps process the data. These new data
can be used in function and plot definitions. The "init"
commands get executed after the domain has been defined but
before the time (range) has been defined. They are useful
for defining climatologies as that requires time manipulation.
Plotting data from a Second ctl File
Using the "function" and "init" commands, data from an other
.ctl can be plotted. This very useful when trying to
compare data or use data from someone else's control file.
Note, the "original" control file is unit 1 and each
control files opened by an "init" command are units 2, 3 etc.
* function:abc UGRD:17:UGRD.2:abc UGRD (m/s)
* init:abc UGRD:open abcdata.ctl
Making an Anomaly
Using the "function" and "init" commands, an anomaly can
be created by
* function:olr anom:1:olr-olrclim:olr anomaly (79-95) (w/m/m)
* init:olr anom:open olrmonth.y1979.y1995.climo.ctl
* init:olr anom:set time jan1974 dec1974
* init:olr anom:define olrclim=olrc.2
* init:olr anom:modify olrclim seasonal
The "function" command defines the "OLR anomaly" to be the
difference between the OLR and OLR climatology. The following
four "init" commands are GrADS commands to create an OLR
climatology by opening the OLR climatology, reading the
data into a variable and making the variable into a climatology
The "init2" commands are like the "init" commands except
they are executed after the domain and time has been defined.
"Init2" commands are useful for defining temporary variables.
* function:thick:1:x-y:1000 500 thickness
* init2:thick:define x=hgt(lev=500)
* init2:thick:define y=hgt(lev=1000)
Prespecified Plots: plot
The prespecified plot allows the POC the ultimate control
and the web surfer almost no control over the plot. Using
the prespecified plot, the POC can generate multi-panel
displays, composite plots or vertical cross-sections.
The prespecified plot is made by an embedded GrADS script.
The POC has control over everything. Prespecified plots
are only available for "map" even though the prespecified
plots can be hovmoller diagrams and time series.
The prespecified plot needs two statements, the "plot" specification
and the any number of "display" commands,
* display:[variable]:GrADS command
The "plot" command defines the button that appears on the
variable selection page (map only). The "display" commands
define the GrADS commands needed to generate the plot. This
is an example that plots the isotachs and draws wind barbs,
* plot:winds:17:isotachs (m/s) and wind vectors
* title:winds:isotachs $_level mb $_hour $_day$_month$_year
* display:winds:set gxout shaded
* display:winds:d mag(UGRD,VGRD)
* display:winds:run /your_dir//cbar98.gs
* display:winds:set ccolor 98
* display:winds:run /your_dir/d_uv.gs ugrd vgrd
In the initialization code, a call to a modified rgbset.gs is made.
The main difference between my rgbset and Jae Schemm's is that
color 98 is black and color 99 is white. In order that the
colors in Xwindows and the png's are identical, you must not
use colors 0 and 1. Replace 0 by 98 and 1 by 99.
When the POC is adding embedded commands, he or she may need
to know how the plots are being made. To see the GrADS scripts,
make the plot, and then add "gradsfile=1&" into the URL after
an "&" and then remake the plot. At the bottom of the plot, you
should see the GrADS script.