WMAP, a Package for Plotting Daily Weather Maps and Station Model Data


Table of Contents


Acknowledgments

Author: Fred Clare (fred@ncar.ucar.edu)

Special thanks to David Kennison and Bob Lackman for reviewing this document. Also, thanks to Dennis Joseph and Ken Hansen for sharing their wind barb program and Dave Kennison for providing the example of wind barbs on a world map.

Copyright 1996 University Corporation for Atmospheric Research (UCAR)

All Rights Reserved

Published by: National Center for Atmospheric Research, Scientific Computing Division, P.O. Box 3000, Boulder, CO 80307-3000. The National Center for Atmospheric Research is operated by the University Corporation for Atmospheric Research and is sponsored by the National Science Foundation. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the authors and do not necessarily reflect the views of the National Science Foundation.

1.0 INTRODUCTION

WMAP is a collection of subroutines that will allow the user to create daily weather maps like the ones appearing in major U.S. newspapers. Full color is available. Functionality also exists for plotting station model data (temperature, pressure, wind speed, cloud cover, and so forth) in accordance with the World Meteorological Organization (WMO) guidelines. It is also possible to plot icons representing daily weather (like "snow", "thunderstorms," and so forth).

The functionality of the package, and the documentation, is broken into: plotting front lines; plotting regions showing weather type or temperature zone; plotting city names and daily high/low temperature readings; plotting regional weather labels (like "BREEZY," "HUMID," and so forth); plotting regional temperature labels with optional arrows; plotting special symbols (like ones for high and low pressure) and icons representing daily weather; plotting map legends; plotting wind barbs and station model data.

Either C or Fortran procedures may be invoked to effect the above functionality. In the descriptions of the procedures, the Fortran entry will be described in detail. A synopsis of the equivalent C procedure follows.

The basic programming approach is to set values for internal parameters that control various aspects of the output and then invoke the appropriate C or Fortran procedure. For a complete list of, and an explanation of how to set and retrieve values for, the internal parameters available in this package, consult the section Setting and Retrieving Internal Parameters. An easy way of using this package is to thumb through the example plots in Appendix A to find that plot that illustrates what you want to do, then modify the code that produces that plot to accomplish the desired goal. See the EXAMPLES section to find out how to retrieve and run the codes that produce the plots in Appendix A.

2.0 PLOTTING FRONT LINES

There is a single entry for drawing front lines.

Fortran:

      CALL WMDRFT(N,X,Y)
where X and Y are linear arrays of dimension N and ((X(I),Y(I)),I=1,N) are world coordinate values.

C:

    #include <ncarg/ncargC.h>
    void c_wmdrft(int n, float *x, float *y)

where the parameters are analogous to the Fortran ones.

The coordinate values are used as control points for a spline curve fit. By default the curve passes through the given coordinates. You can flag the use of a smoothing spline (a least-squares spline fit that does not go through the given coordinates) by setting the control parameter SMF to 1. If the front has little curvature, then only a few points need to be specified to get a nice smooth curve. See Figure 2 in Appendix A for an illustration.

2.1 Selecting front types

The values of the internal parameters FRO and ALO specify which of the ten possible front types will be drawn by calling WMDRFT. FRO specifies the basic front type, and ALO indicates if the front is at the surface or aloft in the cases of warm, cold, or stationary fronts. See the table of internal parameters for details on the internal parameters FRO and ALO. See Figure 1 in Appendix A for a plot illustrating all front types.

2.2 The number of symbols appearing along a front line

In the default case, WMAP attempts to choose a pleasing number of symbols along a front line by calculating the arc length of the line and spacing the symbols at equal distances along it. If the defaults are not desirable, complete control over the symbols appearing along the front line is possible as discussed in the next section.

2.3 Customizing the number and appearance of symbols on a front line

Unless a value has been specified for the internal parameter NMS, which states explicitly how many symbols should appear along a front line (like the number of bumps on a warm front), the number of symbols is determined by the settings for the internal parameters BEG, END, BET, and SWI. BEG specifies the distance along the front line before the first symbol is plotted; END specifies the distance along the front line after the final symbol is drawn; BET specifies the distance between symbols; SWI specifies the width of an individual symbol. The algorithm used is to find the largest number of symbols, NS, for which the sum of the four quantities BEG, END, NS*SWI, and (NS-1)*BET is less than the arc length of the front line. The distance between symbols is then readjusted to produce equal spacing. All distances are expressed as fractions of the maximum screen height. The value of the internal parameter ARC can be interrogated to determine the arc length of the most recent front line drawn.

If a non-negative value is specified for NMS, then precisely NMS symbols will be drawn along the front line, regardless of the settings for BEG, END, BET, and SWI. Setting the value of NMS to zero results in drawing a spline curve along the front line coordinates with no symbols appearing along it.

It is possible to specify the exact sequence in which warm front and cold front symbols appear along a front line, as well as which side of the line they point. The internal parameter array STY is used for this purpose. The legal values for elements of the STY array are plus or minus 1 and plus or minus 2. A "1" will produce a cold front symbol (a small triangle) and a "2" will produce a warm front symbol (a semi-circular bump). The algebraic sign of the elements of STY indicate what side of the front line the symbols will point - a positive value will cause the symbol to point to the right of the line (as traversed from the start to the end), and a negative value will cause the symbol to point to the left. Elements of the STY array are defined by using the internal parameter PAI to indicate which element is being specified and then providing a value for STY. The internal parameter REV can be used to reverse the directions that the symbols along a front line point.

Each of the bumps along a warm front is defined by points along a bezier curve. The default number of points along such a curve is 51 which makes these curves appear smooth at most sizes. If desired, this number can be reset by assigning the desired value to NBZ.

See the table of internal parameters for details on the internal parameters discussed in this section. See Figure 4 in Appendix A for an example that illustrates the use of the internal parameters BEG, BET, END, NMS, SWI, STY, PAI, and REV.

2.4 Setting colors

The color index for warm front symbols (the semi-circular bumps) is specified by the value of WFC. In colored weather maps this symbol is usually drawn either in black or red; in black and white maps this symbol is black. The color index for cold front symbols (triangles) is specified by the value of CFC. In colored weather maps this symbol is usually drawn either in blue or black; in black and white maps this symbol is black. The alternating colors in a tropical front are specified by the values for the color indices assigned to the internal parameters T1C and T2C. In colored weather maps the colors for the alternating dashes in tropical fronts are usually red and green. The color for the front line itself is inherited from the color of the symbols along it. For fronts that do not have special symbols along them (convergence lines, instability lines, and intertropical fronts) the colors are specified by the value of the internal parameter COL.

See the table of internal parameters for details on the internal parameters discussed in this section. See Figures 1, 4, and 14 in Appendix A for examples that illustrate setting colors for front lines.

2.5 Endpoint slopes

The value for the internal parameter SLF controls how slopes at the end points of a front line are to be handled. In the default case, the slopes are calculated internally as one-sided derivatives. SLF can be set to allow for user-specification of slopes at either end of a front line, or at both ends. The values of SL1 and SL2 specify the user-supplied slopes when applicable. The values of the internal parameters CS1 and CS2 can be interrogated to determine what values are currently being used for slopes at the endpoints.

See the table of internal parameters for details on the internal parameters discussed in this section. See Figure 3 in Appendix A for an example that illustrates setting endpoint slopes.

2.6 Linewidths

The value of the internal parameter LIN specifies a linewidth scale factor for front lines (the thickness of the spline curve) for all fronts except the convergence lines, the instability lines, and the intertropical fronts. The value of the internal parameter DWD specifies the linewidth scale factor for the convergence lines, the instability lines, and the intertropical fronts. The internal parameter WTY is a flag indicating whether linewidths should be implemented via GKS linewidth calls, or whether linewidths should be simulated in software. If plotting to a device that does not have adjustable linewidths, then the latter should be chosen. Simulating linewidths in software is expensive.

See the table of internal parameters for details on the internal parameters LIN, DWD, and WTY.

3.0 PLOTTING REGIONS SHOWING WEATHER TYPE

The entry point for drawing regions indicating weather patterns or temperatures is:

Fortran:

      CALL WMDRRG(N,X,Y,ITYPE,NC,XC,YC)
where X and Y are linear arrays of dimension N and ((X(I),Y(I)),I=1,N) are world coordinate values specifying a region. A spline fit is effected using the input coordinates so that only a few coordinates are needed to specify a smooth region. The spline fit passes through the input coordinates. See figure 2 in Appendix A for an example of a region defined by seven points. The region constructed is filled with either patterns or a solid color depending on ITYPE.

The legal values for ITYPE are:

If NC is greater than 2, then the region resulting from the spline fit to ((X(I),Y(I)),I=1,N) will be clipped against the region in ((XC(I),YC(I)),I=1,NC). If no clipping is to be done, then set NC equal to 1.

C:

    #include <ncarg/ncargC.h>
    void c_wmdrrg(int n, float *x, float *y, char *itype,
                  int nc, float *xc, float *yc)

where the parameters are analogous to the Fortran ones.

Internal parameter RHT can be used to change the size of the symbols in the weather patterns and COL can be used to change the colors. For examples of using WMDRRG, see Figures 2, 5, 13, 14 in Appendix A.

4.0 PLOTTING CITY NAMES AND DAILY HI/LOWs

The entry point for plotting city names and daily HI/LOWs is:

Fortran:

      CALL WMLABC(X,Y,CITY,TEMPS)
where X and Y are world coordinates specifying the position of the composite label that consists of the city name in the character variable CITY and the temperature ranges in the character variable TEMPS. For example, if CITY='Boulder' and TEMPS='84/68', then these strings would be plotted with CITY on top and TEMPS below.

C:

    #include <ncarg/ncargC.h>
    void c_wmlabc(float x, float y, char *city, char *temps)

where the parameters are analogous to the Fortran ones.

There are four internal parameters that control the appearance of the city labels: CBC, CHT, CMG, and RFC. Each character in the city name and the HI/LOW value is drawn against a background that surrounds the character. The color of this background is controlled by the value of CBC and the extent of the background is controlled by the value of CMG. This background can be used to provide space around the labels for readability. The size of the labels is controlled by the value of CHT and the color of the characters is given by RFC.

Plotting dots to mark the city positions is facilitated by using the entry WMLABS which is described in the section Dots below.

For examples of plotting city names, hi/low data, and dots, see Figures 6, 13, and 14 in Appendix A.

5.0 PLOTTING REGIONAL WEATHER LABELS

The entry point for plotting regional weather labels (like "HOT", or "BREEZY", or "COLD") is:

Fortran:

      CALL WMLABW(X,Y,LABEL)
where X and Y are world coordinates specifying the center position of the label in the character variable LABEL.

C:

    #include <ncarg/ncargC.h>
    void c_wmlabw(float x, float y, char *label)

where the parameters are analogous to the Fortran ones.

The labels are plotted in a rectangle that surrounds the label. This rectangle has a shadow. The internal parameters that control the appearance of the regional weather labels are: RC1, RC2, RC3, RC4, RC5, and WHT. WHT specifies the height of the characters in the label; RC4 specifies the color index of the text in the label; RC1 specifies a color index for the outline of the rectangle surrounding the text; RC2 specifies the color index of the interior of the box; RC3 specifies the color index of the rectangle shadow; and RC5 specifies the color index for outlines around each character in the LABEL (the character outlines are drawn only if RC5 is non-negative). For further details on these internal parameters, see the table of internal parameters.

For examples of plotting regional weather labels, see Figures 6, 13, and 14 in Appendix A.

6.0 PLOTTING REGIONAL TEMPERATURE LABELS

The entry point for plotting regional temperature labels (like "90s", or "60s") is:

Fortran:

      CALL WMLABT(X,Y,LABEL,IPOS)
where X and Y are world coordinates specifying a position for the label in the character variable LABEL. IPOS is a flag for controlling whether an optional arrow is drawn. If IPOS is 0, then no arrow is drawn and the label is centered at (X,Y). If IPOS is between 1 and 12, then arrows are drawn at the positions indicated in the following diagram:

This diagram is but a rough sketch of the positions. For example, if position 4 is requested, the label will appear under the arrow; if position 3 is requested, then the arrow will be on a line that goes through the center of the label at an angle of 67.5 degrees, and so forth.

If an arrow is drawn, then (X,Y) specifies the position at the tip of the arrow.

C:

    #include <ncarg/ncargC.h>
    void c_wmlabt(float x, float y, char *label, int ipos)

where the parameters are analogous to the Fortran ones.

The internal parameters that control the appearance of the regional temperature labels are: RBS, RFC, RLS, ROS, and THT. The appearance of the (optional) arrows is controlled by the internal parameters for arrows (see the section Arrows for details). THT specifies the label height; RFC specifies the color index for the character color; RLS specifies the color index for character shadows; ROS specifies the color index for character outlines (drawn only if this index is non-negative). RBS specifies a color index for background boxes drawn around each character in the temperature label; these background boxes are drawn only if RBS is non-negative. RMG controls the size of the margins for the background boxes. For further details on these internal parameters, see the table of internal parameters.

For examples of plotting regional temperature labels, see figures 6, 13, and 14 in Appendix A.

7.0 PLOTTING SPECIAL SYMBOLS AND ICONS

The entry point for plotting special symbols and icons for daily weather is:

Fortran:

      CALL WMLABS(X,Y,SYMTYP)
where X and Y are world coordinates specifying the center position of the symbol requested in the character variable SYMTYP. The available symbols include symbols for high and low pressure areas, arrows, dots, and icons representing daily weather (such as snow, rain, sun, etc.). These symbols are described in more detail in the subsections of this section.

C:

    #include <ncarg/ncargC.h>
    void c_wmlabs(float x, float y, char *symtyp)

where the parameters are analogous to the Fortran ones.

7.1 High and low pressure symbols

If SYMTYP='HI', then a circular symbol with an "H" in it will be drawn at position (X,Y). The internal parameters controlling the appearance of the high pressure symbols are: SHT, HIF, HIB, HIS, and HIC. SHT controls the size of the symbol; HIF specifies the color of the "H" inside the circle; HIB specifies the color of the interior of the circle; HIS specifies the color of the symbol shadow; HIC specifies the color of the circumference of the circle. If any of the color indices is set negative, then that particular feature will not be drawn at all. For further details on these internal parameters see the table of internal parameters. For examples of the usage of high pressure symbols, see figures 6, 13, and 14 in Appendix A.

If SYMTYP='LOW', then a circular symbol with an "L" in it will be drawn at position (X,Y). The internal parameters controlling the appearance of the low pressure symbols are: SHT, LOF, LOB, LOC, LOS. SHT controls the size of the symbol; LOF specifies the color of the "L" inside the circle; LOB specifies the color of the interior of the circle; LOS specifies the color of the symbol shadow. If any of the color indices is set negative, then that particular feature will not be drawn at all. For further details on these internal parameters see the table of internal parameters. For examples of the usage of low pressure symbols, see figures 6, 13, and 14 in Appendix A.

7.2 Arrows

If SYMTYP='ARROW', then an arrow is drawn with the tip of the arrow at position (X,Y). The internal parameters that control the appearance of arrows are: ARS, AWC, ARD, ASC, AOC, ARL. ARS specifies the size of the arrow from tip to tail; AWC specifies the color of the arrow; ARD specifies the direction of the arrow in degrees counterclockwise from the positive X-axis; ASC specifies the shadow color (shadows are drawn only if ASC is non-negative); AOC specifies the arrow outline color (outlines are drawn only if AOC is non-negative); ARL specifies a scale factor for the arrow tails independent of the arrow size given by the value of ARS. Values of ARL greater than one will cause arrows to have longer tails, and values less than one will cause shorter tails. For further details on these internal parameters see the table of internal parameters. For examples of the usage of arrows, see figures 6, 13, and 14 in Appendix A.

7.3 Dots

If SYMTYP='DOT', then a dot is drawn with its center at coordinate (X,Y). The internal parameters that control the appearance of dots are: DBC, DTC, and DTS. DTS specifies the size of the dot; DTC specifies the color index of the center of the dot; DBC specifies the color of the background circle of the dot. For further details on these internal parameters see the table of internal parameters. For examples of the usage of dots, see figures 6, 13, and 14 in Appendix A.

7.4 Icons for daily weather

Icons for daily weather can be drawn for many weather conditions by setting SYMTYP to one of the following:

Two internal parameters that apply to all of the weather icons are SHT (specifies height) and COL (specifies color for single objects). There are three symbols in the icons that have special controls: clouds, lightning bolts, and suns:

7.4.1 clouds

There are three internal parameters that control the appearance of cloud symbols that appear in the daily weather icons: CC1, CC2, and CC3. CC1 specifies the color of the interior of the cloud; CC2 specifies the color of the cloud shadow; CC3 specifies the color of the outline of the cloud. For further details on these internal parameters see the table of internal parameters. For examples of the usage of cloud symbols, see Figures 7 and 8 in Appendix A.

7.4.2 lightning bolts

There are three internal parameters that control the appearance of lightning bolt symbols that appear in the daily weather icons: LC1, LC2, and LC3. LC1 specifies the color of the interior of the lightning bolt; LC2 specifies the color of the lightning bolt shadow; LC3 specifies the color of the outline of the lightning bolt. For further details on these internal parameters see the table of internal parameters. For an example of the usage of the lightning bolt symbol, see Figure 7 in Appendix A.

7.4.3 sun

There are four internal parameters that control the appearance of the sun symbols that appear in the daily weather icons: SC1, SC2, SC3, and SC4. SC1 specifies the color of the center of the sun; SC2 specifies the color of the points of the sun; SC3 specifies the color of the outline of the sun; SC4 specifies the color of the sun shadow. For further details on these internal parameters see the table of internal parameters. For examples of the usage of sun symbols, see Figures 7 and 8 in Appendix A.

8.0 PLOTTING MAP LEGENDS

The entry point for plotting legends at the bottom of a weather map is:

Fortran:

      CALL WMLGND(X,Y,NTYPE,IROWS,ICOLS)
where X and Y are world coordinates. NTYPE specifies what legends are to be drawn:

IROWS and ICOLS specify how many rows and columns there will be in displaying the weather types; these values are significant only when NTYPE=1. Choices for IROWS x ICOLS are: 1x6, 2x3, 3x2, and 6x1.

C:

    #include <ncarg/ncargC.h>
    void c_wmlgnd(float x, float y, int ntype, int irows, int icols)

where the parameters are analogous to the Fortran ones.

The internal parameters that apply to the appearance of legends are COL for specifying color and those parameters that apply to the appearance of weather fronts. See the section PLOTTING FRONT LINES for details on the internal parameters that apply to weather fronts. For examples of weather map legends, see Figures 13 and 14 in Appendix A.

9.0 WIND BARBS AND STATION MODEL DATA

9.1 Wind Barbs

The Fortran entry for plotting wind barb is:

      CALL WMBARB(X,Y,DX,DY)

and the C entry is:

    #include <ncarg/ncargC.h>
    void c_wmbarb(float x, float y, float dx, float dy)

For the purposes of explaining the arguments in the above calls, the end of a wind barb where the barbs are drawn will be called the feather end of the barb, and the opposite end will be called the tip. Using this terminology, the tip of a wind barb will be at coordinate (X,Y), and the feather end will be at a point (X+s*DX,Y+s*DY), where "s" is a positive scale factor chosen by WMBARB to make the wind barb a standard length. The value of SQRT(DX**2+DY**2) determines the wind speed to use in drawing the barbs. The length of the shaft of the wind barb is controlled by the value of the internal parameter WBS. The length of the shaft has no relation to the wind speed.

For example, since by convention the feather end of a wind barb points in the direction where the wind is coming from, to draw a wind barb that indicates a wind coming from the north at 20 knots with tip at (0.,0.), you would make the call:

      CALL WMBARB(0.,0.,0.,20.)
You can shift the drawing of the wind barb direction by 180 degrees by setting the control parameter WDF to 1.

It is frequently the case that wind barbs are drawn over a world map. This can be done using WMBARB in conjunction with EZMAP, but care must be taken to adjust the direction of the wind barbs to accommodate for the map projection. For example, if your wind barb points to the north, then you will want it to point to the north pole in a map projection, rather than pointing straight up (or more accurately, it should be drawn on the map so that it is tangent to the projection of the local meridian and points northward along that meridian). See Figure 15 in Appendix A for wind barbs drawn over a map.

The internal parameters that apply to the appearance of wind barbs are: COL, BLW, EZF, WBA, WBD, WBF, WDF, WBS, WBT.

COL specifies the color of the barb; WBA specifies the angle, in degrees, that the wind barb tick marks make with the wind barb shaft; WBD specifies the spacing between tick marks along the shaft, expressed as a fraction of the shaft length; WDF is a flag controlling wind direction (=0, the default, barbs point away from wind and =1, barbs point toward wind) where barbs pointing toward the wind is the meteorological convention; WBF is a flag indicating whether space should be left at the base of a wind barb for a sky cover circle; WBS specifies the size of the wind barb shaft; WBT specifies the length of a wind barb full tick mark; BLW specifies the line width scale factor to use in drawing wind barb lines. See the table of internal parameters for details on the internal parameters that apply to wind barbs. For examples of wind barb usage, see Figures 10, 11, and 12 in Appendix A.

9.2 Plotting Station Model Data

The entry point for plotting station model data is:

Fortran:

      CALL WMSTNM(X,Y,IMDAT)
where X and Y are world coordinates specifying the center position of the base of the wind barb shaft. IMDAT is a CHARACTER*5 array of dimension 10 encoded as per the WMO/NOAA guidelines. In more detail:

For I=3,9 if IMDAT(I)(1:1) =

C:

    #include <ncarg/ncargC.h>
    void c_wmstnm(float x, float y, char *imdat)

where the parameters are analogous to the Fortran ones.

The internal parameters that control the appearance of wind barbs apply to the wind barbs that are part of the station model display. See the section Wind Barbs for details on wind barbs. If the specification for the wind direction, IMDAT(2)(2:3), is given as two blank characters, the plotting of the wind barb is suppressed. In addition to the wind barb parameters, the parameters WBC and WBL apply to the station model display. WBC specifies the diameter of the sky cover circle at the base of the wind barb and WBL specifies the size of the text labels in the station model display.

The internal parameter UNT specifies whether imperial units or metric units are used. The default is imperial units with the station model data being coded according to the chart "Explanation of the Daily Weather Map" provided by NOAA and published by the U.S. Government Printing Office. The coding of the metric units is in accordance with the SYNOP Data Format (FM-12) as described at:

http://weather.unisys.com/wxp/Appendices/Formats/SYNOP.html.

See the table of internal parametersfor details on the internal parameters that apply to the display of station models and wind barbs. For examples of station model displays, see Figures 11 and 12 in Appendix A.

10.0 PLOTTING VECTORS

10.1 Vectors not over maps

The Fortran entry for plotting vectors not over maps is:

      CALL WMVECT(X,Y,U,V)

and the C entry is:

    #include <ncarg/ncargC.h>
    void c_wmvect(float x, float y, float u, float v)

The base of the vector will be at world coordinate (X,Y). The arguments u and v specify the vector components in the X and Y directions.

There are several control parameters that control the vector apperance. The parameters VRS and VRN establish the relationship between vector lengths [the value sqrt(u*u+v*v)] and the length of the vector displayed on the plot. By default a vector length of 10. gets mapped to a line that is 2% of the maximum width of the output plot. You will most likely want to change these values.

Other control parameters are:

  1. VCH - controls the vector arrow size
  2. VCC - controls the vector color
  3. VCD - controls the vector direction
  4. VCW - controls the linewidth scale factor
  5. VVA - controls the angle between the arrow and tail
Example wmex16 (whose source and output can be produced by executing "ncargex wmex16") illustrates all of these settings. You can view the output from wmex16 below.

10.2 Vectors over maps

The Fortran entry for plotting vectors over maps is:

      CALL WMVECTMAP(X,Y,U,V)

and the C entry is:

    #include <ncarg/ncargC.h>
    void c_wmvectmap(float x, float y, float u, float v)
All of the control parameters mentioned above apply to vectors drawn over maps. In this case the u argument specifies the latitude component of the vector and v the longitude component. The vector directions are attenuated to accommodate for the position on the globe. For example, if u is non-zero and v is zero, then the vector will point toward the north pole and not necessarily straight up as it would in a call to WMVECT.

Example wmex17 (whose source and output can be produced by executing "ncargex wmex17") illustrates these points. You can view the output from wmex17 below.

10.3 Vector informational label box

An informational label box can be drawn on vector plots that shows a reference vector and its associated user coordinate size. The following call can be used to plot such a box:

      CALL WMVLBL(X,Y)

and the C entry is:

    #include <ncarg/ncargC.h>
    void c_wmvlbl(float x, float y)
The control paramaters that apply to the label box are VLF, for setting the foreground color, and VLB for setting the background color.

Example wmex17 (whose source and output can be produced by executing "ncargex wmex17") illustrates this. You can view the output from wmex17 below.

11.0 SETTING DEFAULTS

There is a single call that returns all settings of all internal parameters to their default values:

Fortran:

      CALL WMDFLT()
C:

    #include <ncarg/ncargC.h>
    void c_wmdflt()

12.0 PUTTING IT ALL TOGETHER

The plots in Figures 13 and 14 utilize almost all of the functionality discussed in this document to produce sample weather maps for the continental U.S. Figure 13 is a grayscale map and figure 14 is a full color map. Of course any other part of the world could have been used equally as well.

13.0 INTERNAL PARAMETERS

13.1 Setting and retrieving values for internal parameters

As mentioned in the introduction, the basic functionality of the package is implemented by way of setting values for internal parameters to control various attributes and then invoking one of the basic functions. The three functions for setting values for internal parameter and the three functions for retrieving internal parameter values are described in this section.

13.1.1 Setting integer values.

Fortran:

      CALL WMSETI(CNP, IVP)
where CNP is a character string at least three characters long (whose legal values are those given in the table of internal parameters), and IVP is the integer value to be assigned to that parameter.

C:

    #include <ncarg/ncargC.h>
    void c_wmseti(char *cnp, int ivp)

where the parameters are analogous to the Fortran ones.

13.1.2 Setting real values.

Fortran:

      CALL WMSETR(CNP, RVP)
where CNP is a character string at least three characters long (whose legal values are those given in the table of internal parameters), and RVP is the real value to be assigned to that parameter.

C:

    #include <ncarg/ncargC.h>
    void c_wmsetr(char *cnp, float rvp)

where the parameters are analogous to the Fortran ones.

13.1.3 Setting string values.

Fortran:

      CALL WMSETC(CNP, CVP)
where CNP is a character string at least three characters long (whose legal values are those given in the table of internal parameters), and CVP is the character value to be assigned to that parameter.

C:

    #include <ncarg/ncargC.h>
    void c_wmsetc(char *cnp, char *cvp)

where the parameters are analogous to the Fortran ones.

13.1.4 Retrieving integer values.

Fortran:

      CALL WMGETI(CNP, IVP)
where CNP is a character string at least three characters long (whose legal values are those given in the table of internal parameters), and IVP is returned as the current integer value assigned to that parameter.

C:

    #include <ncarg/ncargC.h>
    void c_wmgeti(char *cnp, int *ivp)

where the parameters are analogous to the Fortran ones.

13.1.5 Retrieving real values.

Fortran:

      CALL WMGETR(CNP, RVP)
where CNP is a character string at least three characters long (whose legal values are those given in the table of internal parameters), and RVP is returned as the real value currently assigned to that parameter.

C:

    #include <ncarg/ncargC.h>
    void c_wmgetr(char *cnp, float *rvp)

where the parameters are analogous to the Fortran ones.

13.1.6 Retrieving string values.

Fortran:

      CALL WMGETC(CNP, CVP)
where CNP is a character string at least three characters long (whose legal values are those given in the table of internal parameters), and CVP is the character value currently assigned to that parameter. CVP should be of a length suitable to receive the string value returned.

C:

    #include <ncarg/ncargC.h>
    void c_wmgetc(char *cnp, char *cvp)

where the parameters are analogous to the Fortran ones.

13.2 Table of internal parameters

The internal parameters of WMAP are summarized in the following table.

14.0 ERROR HANDLING

When a WMAP routine detects an error condition, it calls the routine SETER, which is the principal routine in the error-handling package for NCAR Graphics. (There is a programmer document describing SETER and associated routines; see that document for complete information about error handling in NCAR Graphics.)

By default, SETER prints a line and STOPs. The line printed will look something like this:

ERROR    2 IN WMDRFT - not enough space along the
input curve to draw two symbols for a stationary front
The error number ("2", in the example) may be of use to a consultant (to determine exactly where the error occurred), but is not otherwise meaningful. The actual error message consists of the name of the routine in which the error occurred ("WMDRFT", in the example), a blank, a minus sign, another blank, and, lastly, a short description of the error.

All errors are "recoverable" in the sense that, if the user program puts SETER into "recovery mode", control will be returned to the caller of the WMAP routine in which the error occurred. In some cases, it is then possible to take remedial action to get around whatever problem has occurred; in any case, the error flag can be cleared and execution of the user's program can continue.

15.0 EXAMPLES

On a Unix system on which NCAR Graphics has been installed, the command "ncargex" may be used to acquire the code for and create all of the example plots contained in Appendix A of this document. The example names recognized by ncargex are of the form "wmexnn" where "nn" is the Figure number used in Appendix A.

Appendix A

Example Plots

Figure 1 - ncargex example wmex01

Figure 2 - ncargex example wmex02

Figure 3 - ncargex example wmex03

Figure 4 - ncargex example wmex04

Figure 5 - ncargex example wmex05

Figure 6 - ncargex example wmex06

Figure 7 - ncargex example wmex07

Figure 8 - ncargex example wmex08

Figure 9 -ncargex example wmex09

Figure 10 - ncargex example wmex10

Figure 11 - ncargex example wmex11

Figure 12 - ncargex example wmex12

Figure 13 - ncargex example wmex13

Figure 14 - ncargex example wmex14

Figure 15 - ncargex example wmex15

Figure 16 - ncargex example wmex16

Figure 17 - ncargex example wmex17


INDEX

A

B

C

D

E

F

H

I

L

M

N

P

R

S

T

U

V

W