Archive‎ > ‎Spring 2016‎ > ‎EAPS 434 Spring 2016‎ > ‎

Intro to GEMPAK

GEMPAK = GEneral Meteorological PAcKage

GEMPAK is a software package that includes several programs useful for decoding, plotting, and displaying meteorological data. The N-AWIPS programs that we have been using are based upon the GEMPAK engine. Certain GEMPAK programs will work only with specific types of data or will perform only specific tasks. The first two letters of a GEMPAK program's name correspond with these data types or tasks:
  • SF-surface observation data
  • SN-sounding observation data
  • GD-gridded data
  • OA-objective analysis
  • GP-graphics capabilities

To begin using any of the GEMPAK programs, make sure that you have sourced the proper setup.csh.

source /export/project/a/ldm/NAWIPS/setup.csh

Then, simply type the name of the program at a linux/unix prompt. All of the GEMPAK programs work similarly through the use of parameter lists. Once in one of the GEMPAK programs, it is useful to get a listing of all of the parameters and their settings by typing “l” (lowercase L, for 'list') followed by ENTER. To change a parameter, just use the following syntax:

parameter_name = value

GEMPAK has a useful help library for each parameter and each program. This library can be accessed with the phelp or help commands. (phelp displays the help one page at a time). As an example, if you were interested in the MAP parameter, you would type phelp map, while the command phelp sfmap would provide information and examples illustrating the use of the sfmap program. You must be within a GEMPAK program to use these commands.

Once you have changed all the parameters to your liking, type "r" for run from the prompt to create your plot. 
To quit, type "ex" (or exit).
Finally, type "gpend" to clean up remaining GEMPAK plots and processes.

If you need more information regarding parameters, use the phelp command, ask your instructor, or visit the GEMPAK documentation online at the following URL:

Remember that you must use gpend to close GEMPAK windows. (“gpend is your friend”) NEVER click on the corner of an open GEMPAK window to close it. You will leave behind ghost GEMPAK processes that will continue to run, slowing down and eventually crashing your machine! You must also use gpend before printing newly created PostScript files.

We will be using the program gdplot2, at the linux command line type:


The program gdplot2 plots scalar and or vector variables (if they are available in or derivable from a GEMPAK file) such as wind, temperature, height, sea level pressure, etc. In addition, you can plot combinations of the available variables such as vorticity, temperature advection, thickness, and divergence. Here is a listing of some important GEMPAK parameters:

gdfile: Specifies file to plot
gdattim: Specifies date/time to plot
glevel: Vertical level to plot
gvcord: Vertical coordinate in which glevel is defined
gdpfun: Grid function/parameter (scalar or vector) to plot/contour
cint: Contour interval to use
fint: Color fill interval
fline: Colors for color fill
line: Defines line type, color, thickness, etc.
type: Defines whether to contour or use color filling or wind barbs/arrows
scale: Scaling factor to plot variables of order one

I strongly suggest reading up on the gparm parameter (phelp gparm) to get an idea of the variety of parameters that can be plotted using GEMPAK. Change the following parameters as outlined below. Once you have set a parameter, it will remain the same for future plots, unless you specifically change it.

gdfile = $MODEL/rap/2016030400_rap20km.gem
gdattim = f00
glevel = 800
gvcord = pres
gdpfun = tmpc ! wnd
type = c!b
garea = in-

Now let’s plot the temperature advection by the full wind. Change:


This should plot the temperature advection term in units of K/s * 104. In other words, the 2 contour represents temperature advection of 2 x 10-4 K/s. If we are interested in units of K/day we need to multiply these numbers by the factor of 86400 s/day. To do this, we’ll combine two functions at the same time, multiplication and advection. Change:


(also try: type=cf to get a color fill) The “mul” function multiplies two fields, here the second “field” is a constant number = 86400 s/day.


For this example, we used device = xw to output plots to the computer monitor (xw = X-window). You may want to print paper copies of the plots you create in various GEMPAK programs. You can create files suitable for printouts by changing the device parameter. The file format most suitable for quality printing is postscript. To write your output to a postscript file, use the following syntax:

device = ps|

Then, run the GEMPAK program like you normally do by typing run and pressing ENTER. You will not see a window display on your screen as you do when the device is set to xw. Rather, the output is being stored to a postscript file named in the device statement. After the GEMPAK program has created the file, exit the program, then type gpend. You can also try to write your output to a gif file, use the following syntax:

device = gf|filename.gif

GIF files are easy to insert into documents, such as formal lab reports or webpages.