Enter a ZIP code to get a forecast:
Setup Location

WRN Logo




sfcwx - Surface data plotting program


sfcwx [parameters...] filename


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 sfcwx 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
  • gridding information - out3
-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 which includes front files. This may be modified in the name convention file.
-cp=conpath con_path current directory Specifies the location (path) of the input surface 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 sfc_cvt Specifies the input file name tag. The default is sfc_cvt, but it can be modified to any value in the filename convention file. A full name convention can be specified as well.

In order to plot fronts, specify front

-of=out_file[,out...] out_file None Specifies what type of raw or 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 sfc_raw or sfc_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:sfc_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.
-cf=cityfile city_file sao.cty Specifies the name of the city database file used in finding station locations.
-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.
-nh=num_hour num_hour 0 (no loop) This specifies the number of hours that will be used in the plot. If this is not specified, a single hourly plot will appear. If this is specified, a loop of plots over this time will be generated.
-id=identifier identifier None Used to plot a specific observation. If not specified, all stations will be plotted.
-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.
-gd=grid_domain grid_domain Same as plot domain This specifies the domain to use when fitting data to a grid. If this is not specified, it is the plot_domain.
-re=region region Same as plot domain This resource is synonymous with the plot_domain.
-pr=prior stat_prior Depends on domain size This specifies the lowest priority to use in the plot. Priorities range from 1 to 7.
-va=variable variable User prompt
Batch: first variable listed in the sfcwx.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.
-oa=smooth[,radinf] [,passes] [,converg] [,min_sta] object_param 1,3,1,.2,1 Specifies the objective analysis parameters. There are 5 parameters including smoothing, radius of influence, number of passes, convergence parameter and minimum number of stations.
-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:


  • 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


  • 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
for inverse plots.
Specifies the text color for labels above and below the plot.
-cod=color[:attr] color_data green Specifies the color for plotted data.
-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.
-cowd=color[:attr] color_wind white
for inverse plots.
Specifies the color for wind barbs.
-cocd=color[:attr] color_cloud white
for inverse plots.
Specifies the color for cloud cover symbols.
-cowx=color[:attr] color_wx yellow
brown for inverse plots
Specifies the color for weather symbols
-cofr=color[:attr],... color_front A predefined color set Specifies the colors for fronts and pressure systems.
-cocm=color[:attr] color_cmap black Specifies the color for color fill contour maps.
-coco=color[:attr] color_cont white
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
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
Specifeis the background color of the window.
-ge=geometry geometry 640x480 Specifies the window and paper geometry.
filename None
User Pompt
Batch: current=la
The name of the surface converted data file to be plotted. An optional sequence number can be added to designate the time for non-WXP files.  More than one file can be specified to generate a loop.


This program plots surface data on a background map. The input to the program is a surface converted file produced by either the sacvt or smcvt programs. Then, based on a plot domain and a variable selected by the user, a plot is generated. Overlay plots, contour plots and loops can also be generated if the appropriate options are set.

The programs starts off by prompting the user for input converted file name.  The user may specify the input file either via the command line of through the current resource. The input naming convention is specified by the sfc_cvt tag but this can be changed with the in_file resource. To generate a loop, the num_hour resource can be specified. This will tell the program to loop through this number of hours.

Next, the program prompts the user for the plot domain. This is done through a region menu which has predefined regions available. If needed a full plot domain can be specified to get a precise domain. The domain can be interactively changed using the mouse once the plot has been generated.

After the region has been set, the city database is read in and a cross-reference table is setup. Since converted data is not saved with location information, the program will refer to this table to location each station in the input file.

The program will now prompt the user for the particular output variable to plot. The program will show a menu of commonly used variables but many more are defined internally by the program and in the sfcwx.var file. The internal variables are:

Internal Variables
Variable Description and units Plots
city Station ID string
temp Temperature (F) value
ttd Temperature and dewpoint (F) value0=temp,
dewp Dewpoint (F) value
dewd Dewpoint depression (F) value
wdir Wind direction (deg) value
wspd Wind speed (knt) value
wgst Wind gust (knt) value
Wind speed and direction (knt) value0=dir,
uwnd U wind component - EW relative (m/s) value
vwnd V wind component - NS relative (m/s) value
uwndg U wind component - grid relative (m/s) value
vwndg V wind component - grid relative (m/s) value
alt Altimeter setting (in_Hg) value
pres Sea level pressure (mb) use level parameter to get station/surface pressure value
pralt Sea level pressure or altimeter setting if sea level pressure is missing (mb) value
elev Station elevation (m) value
wx Present weather (SAO string) string
vis Visibility (mi) value, formatted string
cldcl Cloud ceiling (100 ft), string is "" for clear skies, value is 500 for clear value, formatted string
cldclc Cloud ceiling code (from synoptic code 0-9) value
cldcv Cloud cover (cloud string: C,F,S,O,X,0-8), converted to % for contouring. value=%, string
ptend Pressure tendency (mb) value, string=trend code
prec Precipitation (in) use time parameter to specify which type (3,6,12,24 hour) value
extt Extreme temperature (F) uses maximum if available, else minimum.
Use time parameter to specify which type (6,24 hour)
maxt Maxmium temperature (F) use time parameter to specify which type (6,24 hour) value
mint Minimum temperature (F) use time parameter to specify which type (6,24 hour) value
snwdp Snow depth (in) value
nlcld Amount of low clouds (code string) value=%, string=code
lcld Low cloud type (code string) string
mcld Middle cloud type (code string) string
hcld High cloud type (code string) string
solar Equivalent solar radiation (min) value
sst Sea surface temperature (C) value
wavper Wave period (sec) value
wavhgt Wave height (m) value
vpres Vapor pressure (mb) value
svpres Saturation vapor pressure (mb) value
wchilt Wind chill temperature (K) value
wchilf Wind chill factor (W/m^2) value
heat Heat index (K) value
humit Humiture (F) value
mrat Mixing ratio (g/kg) value
smrat Saturation mixing ration (g/kg) value
shum Specific humidity (g/kg) value
rhum Relative humidity (%) value
wetblb Wetbulb temperature (K) value
thetaw Wetbulb potential temperature (K) value
thetae Equivalent potential temperature (K) value
thetav Virtual potential temperature (K) value
theta Potential temperature (K) value
vtemp Virtual temperature (K) value
fr Flight rules (number and string: ) value=0, string=VFR
value=1, string=MVFR
value=2, string=IFR
front Fronts (special plot type)  

These parameters can be accessed by name if they have not been redefined in the sfcwx.var file. Otherwise, prepending a "+" to the variable name will guarantee these variables will appear. Also, time can be specified for use with precipitation (anal-6acc::prec::%.2f with give 6 hour precipitation).

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

Derived/Composite Variables
Variable Description Plots
all All data, a composite plot of temperature, dewpoint, sea level pressure, cloud cover, winds and present weather. comp
allc Same as all except temperatures in celcius. comp
full All data, a more complete station model plot of station ID, temperature, dewpoint, sea level pressure, cloud cover, winds, present weather, visibility, pressure tendency (value+symbol), cloud ceiling (code),  low, medium, high cloud symbols comp
fullc Same as all except temperatures in celcius. comp
depict Weather depiction plot including flight rules (contoured), cloud cover, cloud ceiling and present weather. comp
wind A vector quantity of <uwndg,vwndg> vector
vect Wind vector plot vector
strm Streamline plot vector
pres Sea level pressure (mb) to 1 decimal place value
spres Station pressure (mb) to 1 decimal place value
alt Altimeter setting (in_Hg) to 2 decimal places value
lmhcd Composite plot of low, medium and high cloud types as symbols comp
ptend Pressure tendency (mb) value
ptype Pressure tendency trend as a symbol symbol
prec6 6 hour precipitation (in) to 2 decimal places value
prec12 12 hour precipitation (in) to 2 decimal places value
prec24 24 hour precipitation (in) to 2 decimal places value
maxt 24 hour maximum temperature (F) value
mint 24 hour minimum temperature (F) value
maxt6 6 hour maximum temperature (F) value
mint6 6 hour minimum temperature (F) value
fr Flight rules plotted as text (VFR, MVFR, IFR) text
mrat Mixing ratio (g/kg) to 1 decimal place value
shum Specific humidity (g/kg) to 1 decimal place value
conv Wind convergence (/s) positive is convergence grid
mconv Moisture convergence (/s) grid
rvort Relative vorticity (/s) grid
avort Absolute voriticty (/s) grid
tadv Temperature advection (K/s) grid
madv Moisture advection (/s) grid
vadv Vortcity advection (/s^2) grid

The program will now open the graphics window and start processing the data. The user will be prompted for the output device. Then the converted file is opened and data read in. Any additional computations are performed and the data are plotted. The background map will plot first unless the output is a color fill contour in which the map plots last. If a simple plot is specified such as "temp", the data will be plotted to 0 decimal places on the map. Formatting of the number can be done with the plot_format resource.  Composite plots can either be specified with the variable resource (.var file, resource file, command line or variable prompt).  The variable resource allows the user to control much of the data formatting.  

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.

Contour/Vector Plots

By default, this program plots data but it can produce grids that can either be contoured or plotted as vectors or streamlines. By specifying the plot_type resource to a contour or vector type, the program will generate gridded fields rather than plotting the data.  The gridding process uses an objective analysis scheme to produce the grids. The parameters for this process are specified in the object_param resource. Once the grids have been created, 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 in much the same fashion as for the data plot.

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

  • ln - line contours
  • dln - dashed line contours
  • ndln - negative dashed line contours. All contours less than 0 are dashed. The breakoff can be reset with the con_base resource.
  • cf - color fill contours.  These are contours where the areas between the contour lines are filled with a progressive color scheme. By default, this is a 15 color scale in which the colors wrap around if there are more than 15 color level.  The color scheme can be set by the color_fill resource.

For vectors:

  • vect -- vectors/arrows
  • strm -- streamlines
  • barb -- wind barbs

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.

Front Data

The sfcwx program will plot coded front data in the ASUS1 products. The in_file resource must be set to front (sets frt_dat file name tag) for sfcwx to use front files instead of surface converted data.  High and Low pressure centers along with cold, warm, stationary and occluded fronts and troughs are plotted.  The colors are controlled by the color_front resource.


   sfcwx -cu=la -re=mw -va=all -de=d

This plots a surface composite plot containing temperature, dewpoint, pressure, clouds, winds and weather for the midwest region.

   sfcwx -cu=la -re=mw -va=temp -of=raw -pl=none

This will generate raw file based on the sfc_raw name convention.  A specific filename can be used instead of raw.

   sfcwx -cu=la -re=mw -va=temp -pl=cf -in=2 -de=d

This will produce a contour plot of temperature.  Without the "-pl=cf", the program will just plot the temperature data.

   sfcwx -cu=la -if=front -re=us

This plots front files.


  • sao.cty - the surface station location database file
  • sfcwx.var - variable menu and definitions


  • sacvt - the surface data decoding program
  • smcvt - the synoptic data decoding program.
  • sfccalc - the surface data contouring program
  • statlog - the surface meteogram plotting program

For further information about WXP, email technical-support@weather.unisys.com
Last updated by Dan Vietor on July 28, 1998