WXP version 5
Program Reference

GRBCALC

Sections

NAME

grbcalc - GRIB model contouring program

SYNOPSIS

grbcalc [parameters...] filename

PARAMETERS

Command Line Resource Default Description
-h help No Lists basic help information.
-df=filename default .wxpdef Sets the name of the resource file.
-na=name name grbcalc Specifies the name used in resource file parsing.
-ba batch No Run program in batch mode
-me=level message out2 Specifies level of messages to be displayed
  • file information - mess
-fp=filepath file_path current directory Specifies location of database files.  
-dp=datapath data_path current directory Specifies the location (path) of the input raw data files. This may be modified in the name convention file.
-cp=conpath con_path current directory Specifies the location (path) of the input converted data files. This may be modified in the name convention file.
-rp=rawpath raw_path current directory Specifies the location of the output raw files generated by the program. These files will not be generated unless the out_file resource is specified and the output is plotted data.
-gp=gridpath grid_path current directory Specifies the location of the output grid files generated by the program. These files are not generated unless the out_file resource is specified and the output is a gridded field.
-ip=imagepath image_path current directory Specifies the default location of the output GIF images generated by the program.
-nc=name_conv name_conv name_conv The name convention file specifies how files are named in WXP. This sets which name convention file to use.
-if=in_file in_file grib Specifies the input file name tag. This value can also be specified with the model resource by looking up the naming convention in the model.lup file. The default is grib, but it can be modified to any value in the filename convention file. A full name convention can be specified as well.
-of=out_file[,out...] out_file None Specifies what type of grid file to create. By default, no output file is generated when the program is run. To produce an output file, this resource must be specified.  There are the following output file types:
  • wxp - WXP ASCII grid or raw file
  • wxpb - WXP binary grid file
  • raw - WXP ASCII raw file
  • cdf - NetCDF binary grid file

Second, the out_file resource specifies the output file name tag. The default is grd_grd but it can be modified to any value in the filename convention file. The file name tag can be specified separately or appended to the file type: wxp:eta_grd

A full filename can be specified which can contain name convention tags.

-pf=file_param file_param User prompt
Batch: use
This specifies how to treat output files that exist:
  • Use - use the existing file, don't overwrite. The program terminates when this occurs.
  • Over - overwrite the existing file
  • App - append the information onto the end of the existing file
  • Y - same as overwrite
  • N - same as use.
-mf=mapfile[,...] map_file wxp.map or
cont.dat, country.dat for domains outside North America
Specifies the name of the map database file. Multiple maps can be specified along with attributes to describe how to draw the map.
-cu=[hour|la] current None This specifies to use current data files. The current filename is based on the name convention. An optional hour can be specified for older data. If la is specified, the program will search back to find the most recent available file.
-ho=hour hour None This resource specifies the exact hour that a data file is valid for. This locks in the start hour for a multi-file sequence.
-mo=model model ngm or first model listed in model.lup file. Specifies the model to use as input data. These are defined in the model.lup file. This file can define how model grids are pieced together. Some samples are:
  • ngm -- Nested Grid Model
  • eta -- ETA model
  • avn -- Aviation model
  • mrf -- Medium Range Forecast model
-pd=domain plot_domain User prompt
Batch: first domain in wxp.reg file.
This specifies the plotting domain. The projection, aspect ratio and the domain size are specified.
-re=region region Same as plot domain This resource is synonymous with the plot_domain.
-ft=time time User prompt
Batch: initial time
This specifies the forecast time to be used in the plots. To create loops, a list of forecast time are specified separated by commas.
-le=level level User Prompt
Batch: 500
This specifies the vertical level to use in the plot. See the level resource for more information on what can be specified.
-va=variable variable User prompt
Batch: first variable listed in the grbcalc.var file
This specifies the variable to plot along with its formatting attributes. Multiple variables can be specified separated by commas for overlay plots. A list of valid variables is given below.
-pl=plot_type plot_type Data Plot
User prompt if plotting grids
Batch: fill contours or vectors
Specifies the type of output plot. By default, this is a simple data plot. To produce a contour or vector plot, use the following plot types:

Contours:

  • cf -- color fill contours
  • ln -- line contours
  • dln -- dashed line contours
  • ndln -- negative dash line contours
  • lcf -- both line and color fill contours
  • gvalue -- plot gridpoint values

Vectors:

  • vect -- vectors/arrows
  • strm -- streamlines
  • barb -- wind barbs
  • none -- for no output plot
-sc=scale_factor plot_scale 1.0 Specifies a scaling factor for all plotted text, symbols, vectors, etc.
-fm=format plot_format None Specifies the output format of the plots.  This is generally used to specify how many decimal places get displayed on the plot and in the output raw files.
-pp=param[,param...] plot_param None Specifies additional plotting parameters. See the plot_param resource for more details.
-dr=drawable[,...] draw all Specifies which part of the plot is to be drawn.
-la=label[,...] label Program defaults Specifies the labels to be plotted around the plot. By default, labels are generated by the program and plotted above and below the plot. This resource overrides these labels.
-in=interval con_interval None for plots, User prompt for grids. Batch: 0 Specifies the contour interval to use in contouring grids. This can also be used to color code plotted data and vectors.
-cb=base con_base Lowest contour value, maximum wind speed Specifies the base value for color fill contours, and wind speed per grid distance. For more details, see the con_base resource.
-fl=font_list font_list modern.fnt Specifies a list of fonts to use in the plots.
-ct=color_table color_table wxp.clr Specifies the color table to use in the plot. This maps color names to actual RGB color values.
-cot=color[:attr] color_text white
black
for inverse plots.
Specifies the text color for labels above and below the plot.
-com=color[:attr] color_map red Specifies the color for background maps.
-coln=color[:attr] color_line magenta:st=dsh Specifies the color for lat/lon lines.
-cocm=color[:attr] color_cmap black Specifies the color for color fill contour maps.
-coco=color[:attr] color_cont white
black
for inverse plots.
Specifies the color for line contours.
-cof=[val:]color[:attr],... color_fill A predefined color set based on the wxp.clr color table Specifies the color fill contour color set. See the color_fill resource for more details.
-cola=color[:attr] color_label white
black
for inverse plots.
Specifies the line contour label color.
-cocl=color[:attr] color_clabel black Specifies the color fill contour label color.
-de=device[,...] device User prompt
Batch: display
Specifies the output device.
-ti=title title Program name Specifies the window title.
-ic icon Off Specifies whether to open window in iconified mode.
-bg=color background black
white for inverse plots
Specifies the background color of the window.
-ge=geometry geometry 640x480 Specifies the window and paper geometry.
filename[#seq] filename None
User Prompt
Batch: current=la
The name of the grid data file to be plotted. An optional sequence number can be added to designate the time for non-WXP files.

DESCRIPTION

This program contours model gridpoint data.  For the most part, this is data stored in GRIB format.  GRIB is a compressed binary format ideal for storing model data for operational visualization. This program is set up to adapt to many types of model and file formats.  The forecast time, level and variable parameters are set up to mimic GRIB parameters so that any model grid can be queried using grbcalc. In addition, there is a way of automatically piecing component grids together prior to display.  Then, based on a plot domain, forecast time, level and variable, a contour plot is generated. Overlay plots, contour plots and loops can also be generated if the appropriate options are set.

The program will display data from many model sources. The model type is specified using the model resource. The specified string is looked up in the model.lup file which cross-references the model value to a file naming convention. Also, if the model grids are divided up, this lookup file will detail how the grids are to be pieced together. In many cases, global models are split into 4 or even 8 subgrids. Contouring the entire global grid may not be necessary for small domains such as North America. As a result, specialized pieced grids can be developed such as avn_na which will direct grbcalc to search and piece together only those grids that affect North America. In other cases, a specific model grid file will contain grids for more than one grid domain. The lookup file can direct grbcalc to only use specific grids from a specific domain. This is the case with the ETA model which is broadcast in two grid types: 211 and 207 (for Alaska).

The programs starts off by prompting the user for input grid file name. The list of available grid files is based on the file name convention which is dependent on the model type and the file name tag associated with it. The tag can be specifically changed with the in_file resource. The user may specify the input file either via the command line of through the current resource.

Next, the program prompts the user for the forecast time. This is done through a forecast time menu which is specified in the grbcalc.tim file. Remember, each model type has a specific set of valid forecast times which is defined in the time file. Because of the breadth of models available, not all of the model types will be covered. Even though a menu does not list an appropriate time, it is still accessible be specifically stating the time on either the command line or at the menu prompt.

After the forecast time has been set, the vertical level is prompted for. A level menu is displayed which covers most of the usable levels. This can be tailored with the grbcalc.lev file. Again, each model has a set of valid levels and the menu may not give a proper list of levels.  If the level is unknown, a value of "miss" can be used and the program will search for the first grid that matches both forecast time and variable type.

The program will now prompt the user for the particular variable to contour. The program will show a menu of commonly used variables but many more are defined internally by the GRIB products and listed in the grbcalc.var file. The GRIB variables can be queried with the griblook program.

Sample Internal Variables
Variable Description and units Plots
temp Temperature (K) grid
rhum Relative humidity (%) grid
uwnd U wind component - EW relative (m/s) grid
vwnd V wind component - NS relative (m/s) grid
vvel Vertical velocity (Pa/s) grid
hght Geopotential height (m) grid
pres Pressure (Pa) grid
prec Quantitative precipitation (m) grid

These parameters can be accessed by name if they have not been redefined in the grbcalc.var file. Otherwise, prepending a "+" to the variable name will guarantee these variables will appear.

There are several derived variables from this list which are defined in the grbcalc.var file. These include composite plots, overlay plots and computed grids.

Sample Derived/Composite Variables
Variable Description Plots
wind A vector quantity of <uwnd,vwnd> vector
conv Wind convergence (/s) positive is convergence grid
mconv Moisture convergence (/s) grid
rvort Relative vorticity (/s) grid
avort Absolute vorticity (/s) grid
tadv Temperature advection (K/s) grid
madv Moisture advection (/s) grid
vadv Vorticity advection (/s^2) grid

The plot domain defaults to the domain of the grid unless changed through the plot_domain resource. The domain can be interactively changed using the mouse once the plot has been generated.

The program will now open the graphics window and start processing the data. The user will be prompted for the output device. Then the grid file is opened and data read in. The piecing of grids will be done at this time. Any additional computations are performed to produce a derived variable.. The background map will plot first unless the output is a color fill contour in which the map plots last. Then, the maximum and minimum of the grid are displayed for the user to pick an appropriate contour interval. Then, the contour or vector plot will display.

There are several plot types.  For contour plots, there is:

For vectors:

When the plot is complete, output can be saved to a GIF image file, spooled to the printer or the plot can be zoomed.  When zooming the image, the plot will redraw to the new domain.  It will also add more stations to the plot depending on the size of the domain. When the user is finished with the plot, the enter key can be hit which closes the window and returns the user to the variable prompt.

Output Files

By default, this program does not produce output files.  If a raw or grid file output is desired, use the out_file resource to enable this.  By default, this will create a WXP ASCII raw or grid file depending on the plot type.  The out_file can be a filename, a file tag (lookup in file name convention file) or a name convention (with wildcards). The output can be GIF file by specifying gif as the file type. It may be desirable to turn plotting of when producing output files. To do this, specify none for the plot_type resource.

EXAMPLES

   grbcalc -mo=eta -cu=la -ft=h24 -le=500 -va=rvort -de=d -pl=cf -in=2

This contours the 500 mb relative vorticity from the ETA model's 24 hour forecast. The plot is color fill contours with an interval of 2.

   grbcalc -mo=ngm -cu=la -ft=h24 -le=850 -va=temp -of=wxp -pl=none

This will generate grid file based on the grd name convention.  A specific filename can be used instead of wxp.

FILES

SEE ALSO


Last updated June 10, 1998