WXP
File Reference

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:

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:

gridplot
   data_path: /home/wxp/model
   plot_domain: ngm

   nam
      model: nam
      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 gridplot.nam.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.

gridplot*data_path: /home/wxp/model
gridplot*plot_domain: nam
*nam*model: nam
*nam.prec.color_table: rainbow.clr
*nam.prec.color_fill: prec.cfl
*nam.prec.color_cmap: white
*nam.prec.variable: prec
*nam.prec.plot_type: cf
*nam.prec.level: snd

The named resource will be specified as:

gridplot -name=gridplot.nam.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:

gridplot -name=+nam.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
gridplot*data_path: /data/model
ELIF WXP
gridplot*data_path: /home/wxp/model
ELSE
gridplot*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 
gridplot -default +noaaport:~devo/.wxpdef

There is a special conditional value called "V6". This toggles on for all version 6 programs and can be used to isolate resources specific to version 6.

IF V6
WXP v6 resources
...
ELSE
WXP v5 resources
END 

EXAMPLES

Here is a sample resource file:

#
#  Global resources
#
IF V6
*file_path: /home/wxp/etc:/usr/local/etc/wxp
*data_path: /mnt/data/noaaport/data:/home/wxp/data
*con_path: /mnt/data/wxp/convert:/home/wxp/convert
*watch_path: /mnt/data/noaaport/data
*text_path: /mnt/data/noaaport/text
*model_path: /mnt/data/noaaport/model:/home/wxp/nwstg2/model
*sat_path: /mnt/data/noaaport/sat
ELSE
*file_path: /home/wxp/etc
*data_path: /mnt/data/noaaport/data
*con_path: /mnt/data/noaaport/convert
*watch_path: /mnt/data/nwstg/data
*text_path: /mnt/data/nwstg/text
*model_path: /mnt/data/nwstg/model
*sat_path: /mnt/data/goes/sat
END
*severe_path: /mnt/data/severe
*nids_path: /mnt/data/noaaport/nids
rad.nids_path: /mnt/data/noaaport/nids
*lev2_path: /mnt/data/nwstg/nids2
*nldn_path: /mnt/data/noaaport/nldn
#
#  Radar resources
#
rad.color_table: rad.clr
rcm.color_fill: off,mgreen,bgreen,xgreen,yellow,orange,bred
rcm.map_file: fi:cnty.mpl
rad.map_file: fi:cnty5.mpl
radplot.color_table: rad.clr
#radplot.color_fill: off,mgreen,bgreen,xgreen,yellow,orange,bred
nidsplot.color_table: rad.clr
nidsplot.map_file: fi:cnty.mpl

For more information on resource files, check the resource file section of the Users Guide.

SEE ALSO

Last updated May 10, 2020