Resource File (wxp.cfg)
The resource file contains a list of resource defaults used by all WXP programs.
FORMAT
Each line in the resource file contains a resource and its default value:
resource_name: default_value
Resources can be tailored by program, by name or set globally:
- Global - these are used by all programs and are listed at the top of the resource
file. A global resource is used unless a named resource is specified to override the
global resource. These are specified by preceding the resource name with an
asterisk:
*resource_name: default_value
For example, to set the global data_path resource:
*data_path: /home/wxp/ldm/wxp/ddplus
- Named Program - these are used only by a specific program. These are specified by
preceding the resource name with the name of the program and a period:
WXP_program.resource_name: default_value
A program specific resource can be set:
grbcalc.data_path: /home/wxp/model
This value will override the global data_path resource.
- Named - these are used when special cases need to be defined (e.g. working with
synoptic data rather than SAO/METARs). These are specified by preceding the resource name
with a specific name chosen by the user:
special_name.resource_name: default_value
For example:
ngm.model: ngm
To enable the name, the user must specify the name on the command line when the program is executed:
grbcalc -name=ngm ...
Complex Resources
Named resources can have complex names in order to organize defaults. A wildcard character "*" can be used to use complex resource defaults in more than one case. For example the following resource structure is desired:
grbcalc data_path: /home/wxp/model plot_domain: ngm ngm model: ngm prec color_table: rainbow.clr color_fill: prec.cfl color_cmap: white variable: prec plot_type: cf level: snd
A full resource name would be grbcalc.ngm.prec.level but we want to carry over all the resources from grbcalc and ngm. These can be specified with a combination of absolute and wildcard resource specifications.
grbcalc*data_path: /home/wxp/model grbcalc*plot_domain: ngm *ngm*model: ngm *ngm.prec.color_table: rainbow.clr *ngm.prec.color_fill: prec.cfl *ngm.prec.color_cmap: white *ngm.prec.variable: prec *ngm.prec.plot_type: cf *ngm.prec.level: snd
The named resource will be specified as:
grbcalc -name=grbcalc.ngm.prec
and this will use all the resources listed above. This way resource files can be simplified and changing one resource can propagated quickly to the other complex resources.
There is a shortcut so the program name does not need to be specified every time:
grbcalc -name=+ngm.prec
and the program name is automatically prepended.
Conditional Resources
In some cases, resources may need to be changed in rare occasions. For example, a data feed is down and an alternate feed needs to be used. An example of this is:
IF NOAAPORT grbcalc*data_path: /data/model ELIF WXP grbcalc*data_path: /home/wxp/model ELSE grbcalc*data_path: /home/wxp/data END LDM
In this case, the first line is used if NOAAPORT is defined, otherwise the second if WXP is defined or the third otherwise. You can define NAAPORT in two places. You can add a line to the resource file:
DEF NOAAPORT
This carries over to all subsequent resource files. You can undefine a tag with:
UNDEF NOAAPORT
The more common method is to add the definition to the wxpdefault environment variable:
setenv wxpdefault +noaaport:~devo/.wxpdef or grbcalc -default +noaaport:~devo/.wxpdef
EXAMPLES
Here is a sample resource file:
# # Global resources # *file_path: /home/wxp/etc DEF GATEWAY IF GATEWAY *data_path: /data1/data *watch_path: /data1/data *name_conv: name_conv ELSE *data_path: /home/wxp/data *watch_path: /home/wxp/data *name_conv: name_conv END *con_path: /home/wxp/convert *con_path: /data1/convert *grid_path: ~/grid *raw_path: ~/raw *image_path: ~/image *background: def *color_table: rainbow.clr *color_front: lblue:w4,lred:w4,lblue:w4,lred:w4,lmagenta:w4,brown:w4 # # Satellite resources # IF GATEWAY xsat*data_path: /data2/sat ELSE xsat*data_path: /home/wxp/sat END xsat*input: awip xsat*map_file: cont.map,wxpstate.map xsat*color_fill: 0-50 xsat*color_table: sat.clr # GOES 8 Images xsat.goes8.input: unisat xsat.goes8.in_file: wxmax xsat.goes8.data_path: /wxsvr3/goes_8/dir_105 #xsat.goes8.grid_domain: go8fd # GOES 9 Images xsat.goes9.input: unisat xsat.goes9.in_file: wxmax xsat.goes9.data_path: /wxsvr3/goes_9/dir_260 xsat.goes9.grid_domain: go8fd
For more information on resource files, check the resource file section of the Users Guide.
SEE ALSO
Last updated August 11, 1998