Skip Navigation Links 
NOAA logo-Select to go to the NOAA homepage National Weather Service   NWS logo - Select to go to the NWS homepage
Meteorological Development Laboratory

MDL Use of Local Use Section

Certain weather elements have provided particular challenges in encoding them in GRIB2. Using Section 2 to encode various forms of metadata provides one solution. For the MOS element Weather ("Wx"), MDL GRIB2 encoding software uses the Local Use section for packing metadata unique to each grid. At this time, for parameters other than weather, the Local Use section is omitted.

MDL Local Use Template 2.1

Octet No. Content
Length of the section in octets (N)
Number of the section (2)
MDL Section 2 template number (1)
Total number of data groups in the local use section
Number of values in first group of local use data
Reference value of first group of data (R) (IEEE 32-bit floating-point value)
Decimal scale factor (D)
Number of bits to pack each value of the first group of data with
Type of data in first group ("0"=floating point, "1"=integer)
The first group of data packed using the simple packing method

Data Encoding Details

Grids of weather are stored as two distinct entities. The first entity is a grid of small integer values that will generally store very compactly in Section 5. The second entity is a series of null-terminated strings of ASCII characters called keys (weather keys). The integers on the weather grid serve as indices, each pointing to one of the unique keys in the series. Each key is comprised of one or more subkeys, separated by a caret "^".

The metadata packed in the Local Use Section for the weather element is a lookup table. The ASCII characters are loaded, one per octet, and then compressed using the Simple Packing Scheme for integers defined for Section 5. The Simple Packing Scheme treats the set of keys as an integer array. Each integer in the array is a decimal representation that corresponds to an ASCII character. For instance, the integer 65 translates to the ASCII character "A". The null character is represented by the integer 0, so that whenever a 0 is encountered in the array, it marks the ending of a unique key. The tables that follow show the specific contents of the weather keys/subkeys.

Data: Weather Keys and Subkeys

A weather subkey can have up to five parts, each part separated by colons ":". The parts are:
  • one weather type code. See Weather Type Codes, below.
  • one coverage/probability code. See Coverage/probability Codes, below.
  • one intensity code. See Intensity Codes, below.
  • one visibility code. See Visibility Codes, below.
  • zero or more attribute codes, separated by commas ",". See Attribute Codes, below.

Weather Type Codes

Code Value Code Value
<NoWx>No WeatherTThunder
RWRain ShowersLDrizzle
ZRFreezing RainZLFreezing Drizzle
SSnowSSnow Showers
IPIce Pellets (sleet)FFog
HHazeBSBlowing Snow
KSmokeBDBlowing Dust
BNBlowing Sand

Coverage/Probability Codes

<NoCov>No Coverage / probability IsoIsolated
SctScattered NumNumerous
WideWidespread OcnlOccasional
SChcSlight Chance ChcChance of
LklyLikely DefDefinite
PatchyPatchy AreasAreas of
PdsPeriods of FrqFrequent
InterIntermittent BrfBrief

Intensity Codes

<NoInten>No Intensity --Very Light
-Light mModerate

Visibility Codes

The following visibility codes may appear in MOS GRIB2 bulletins. The units are statute miles: <NoVis>, 0SM, 1/4SM, 1/2SM, 3/4SM, 1SM, 11/2SM, 2SM, 21/2SM, 3SM, 4SM, 5SM, 6SM, P6SM.

Attribute Codes

MOS weather grids will not generally have attribute codes.

Size Limitations for MOS Weather Grids

There is no (practical) limit to the number of weather keys, subkeys, etc. For MOS weather grids, a maximum of 5 weather subkeys in a weather key will be present.

Weather Key Examples

Sample Weather Key Meaning
Sct:SW:-:<NoVis>: Scattered snow showers
Occasional rain and snow, with a slight chance of freezing rain
Wide:FR:-:<NoVis>:OLA Widespread frost in the outlying areas
<NoWx>:<NoCov>:<NoInten>:<NoVis>: No weather
Sct:RW:-:<NoVis>:^T:Iso:m:<NoVis>: Scattered showers with isolated thunderstorms
Sct:T:+:<NoVis>:DmgW,LgA Scattered severe thunderstorms with damaging winds and large hail

Return to Gridded MOS Page
Send questions and comments to:

National Weather Service
Office Of Science and Technology
Meteorological Development Laboratory
Statistical Modeling Branch
1325 East West Highway
Silver Spring, MD 20910
Page last modified: 1 Feb 2010
Page Author: MOS Web Team
Privacy Policy