Setting GEMPAK Defaults
Date: Tue, 27 Feb 1996 12:01:15 -0700
From: Peggy Bruehl
To: SOO_STRC Mailing List
Subject: 960227:GAREA Defaults
Cc: paulw@STRC.pubnwscr.noaa.gov, peggy@comet.ucar.edu
>From: paulw@STRC.pubnwscr.noaa.gov
>Subject: garea/area defaults
>To: soo_STRC@comet.ucar.edu
>Date: Tue, 27 Feb 96 11:25:25 MST
Paul,
>Can anyone offer any advice?
>
>In gempak the variables garea and area keep in defaulting to wv (West Virginia).
Yes, because the software was originally written at NASA Goddard...in
Washington DC.
>I would like to change this default to something more appropriate for Pueblo.
>I have looked at the documentation and have not found anything obvious
>suggesting how to solve this problem.
The file which defines the absolute defaults for GEMPAK is
$GEMPDF/gemglb.pdf (/usr1/nawips/gempak5.2/pdf/gemglb.pdf). To change these
defaults, simply change the entry for the variable. For example, change:
PARM NAME=$GAREA TYPE=(STRING,48) DEFAULT="WV"
to:
PARM NAME=$GAREA TYPE=(STRING,48) DEFAULT="CO"
Sometimes, however, you may want to define some defaults that are
of a "less global" nature. In this case, you can rely on GEMPAK's
use of "relative" defaults. When you run any GEMPAK program, the
GEMPAK software comes up with a set of values for each of the
variables used in the program. To find these default values, GEMPAK
first checks for the existence of a file called "gemglb.nts" in the
current directory. This file contains the relative defaults for all
the GEMPAK variables. If this file exists, all the variables default
to the values in this file. Each time you successfully run GEMPAK,
the local gemglb.nts file is updated. The absolute defaults are
only used if there is no file gemglb.nts in the current directory.
So, if you find yourself usually running GEMPAK in the same directory,
then setting GAREA=CO once will be enough to set the "relative"
default to Colorado. However, if you delete the gemglb.nts file,
or you cd to a different directory, you will go back to the "absolute"
default of WV.
Sometimes relying on gemglb.nts just doesn't work very well. Maybe
you are always running GEMPAK in different directories, or there
are several users running GEMPAK in their own directories, etc.
In this case, you may want to define your own "default file" for
the GAREA and AREA. Default files have a very simple syntax (see
gemglb.nts or last.nts for examples). Here's the "default file"
that I use to specify a nice GAREA & Projection for North America
plots:
% cat $GEMNTS/defaults/area.na
PROJ str/+90;-100;0/0;3;0;2
GAREA 10;-125;50;-20
I also have a simple one for Colorado:
% cat $GEMNTS/areaco.nts
GAREA co
AREA co
PROJ nps
Now, anytime I want to read in my Colorado default area, I simply
use the "restore" command. Here's an example with GPMAP, the
map drawing program:
% gpmap
MAP Map color/dash/width 1
GAREA Graphics area WV
PROJ Map projection/angles/margins MER
SATFIL Satellite image filename(s)
RADFIL Radar image filename(s)
LATLON Line color/dash/width/label/inc 0
PANEL Panel loc/color/dash/width/regn 0
TITLE Title color/line/title 1
TEXT Text size/font/width/hw flag 1
CLEAR Clear screen flag YES
DEVICE Dev|name|X;Y|colormode|plotmode XW
Parameters requested: MAP,GAREA,PROJ,SATFIL,RADFIL,LATLON,PANEL,TITLE,TEXT,
CLEAR,DEVICE.
GEMPAK-GPMAP>restore areaco
That's the command. Note that because I named the file "areaco.nts", I
don't have to type the ".nts" in the restore command. If I didn't use
the ".nts" suffix, I'd have to type out the full file name.
ALSO, because I put my default file in the $GEMNTS directory
(/usr1/nawips/gempak5.2/nts), I don't have to type the full path.
If the default file were in any other directory, I'd have to type
in the full path.
Now, let's look at what happened when I restored the areaco.nts file:
GEMPAK-GPMAP>display
MAP Map color/dash/width 1
GAREA Graphics area co
PROJ Map projection/angles/margins nps
SATFIL Satellite image filename(s)
RADFIL Radar image filename(s)
LATLON Line color/dash/width/label/inc 0
PANEL Panel loc/color/dash/width/regn 0
TITLE Title color/line/title 1
TEXT Text size/font/width/hw flag 1
CLEAR Clear screen flag YES
DEVICE Dev|name|X;Y|colormode|plotmode XW
See how my Colorado defaults have been set in the program.
You can now run the program to see the map:
GEMPAK-GPMAP>run
Creating process: xw for queue 122707
GPMAP PARAMETERS:
Device: XW
Projection: nps
Graphics area name: co
Map: 1
Title: 1
Panel: 0
Latlon: 0
Clear: YES
Enter to accept parameters or type EXIT:
Parameters requested: MAP,GAREA,PROJ,SATFIL,RADFIL,LATLON,PANEL,TITLE,TEXT,
CLEAR,DEVICE.
GEMPAK-GPMAP>exit
Don't forget to run GPEND!
% gpend
There are a full set of sample default files for GEMPAK programs
already included in your copy of NAWIPS 5.2.1. Take a look at
the $GEMNTS/defaults/ directory. If you want to use any of these
default files in your GEMPAK programs, you'll have to specify
the "defaults/" part of the full path. (Remember, you can only
leave off the "$GEMNTS" part of the full path.) For example:
GEMPAK-GPMAP>restore defaults/area.na
>When I first ran the ro_rtgrids, I had to add the line "garea=dest" in the
>subroutine which writes the nagrib commands in read_statfile.f. I am plotting
>only the "main" metafiles, and the plots are OK.
Yes, in the ro_rtgrids scripts, Ron Miller always deletes the gemglb.nts
files, so all the variables must be set each time you run any program.
>Has anybody else run into this problem and how can I change the default?
Let me kwow if you have any other questions,
Peggy
__________________________________________________________________
Peggy Bruehl National STRC Coordinator - NWS
peggy@comet.ucar.edu COMET/UCAR PO Box 3000
(303) 497-8356 Boulder, CO 80307-3000
SOO/STRC Home Page:
http://www.comet.ucar.edu/pub_html/STRC_html/index.html
------------------------------------------------------------------
>
>Thanks,
>Paul Wolyn
>SOO PUB