Skip Navigation Link 
NOAA logo - Click to go to the NOAA homepage NWS Title - Click to go to the NWS homepage   NWS logo - Click to go to the NWS homepage
MDL Title - Click to go to MDL's homepage


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)
5 Number of the section (2)
6 MDL Section 2 template number (1)
7-8 Total number of data groups in the local use section
9-12 Number of values in first group of local use data
13-16 Reference value of first group of data (R) (IEEE 32-bit floating-point value)
17-18 Decimal scale factor (D)
19 Number of bits to pack each value of the first group of data with
20 Type of data in first group ("0"=floating point, "1"=integer)
21-N 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
RRainRWRain Showers
ZRFreezing RainIPIce Pellets (sleet)
SSnowSWSnow Showers
Weather Types Not Currently Used in GMOS Weather
A Hail L Drizzle
ZL Freezing Drizzle F Fog
H Haze BS Blowing Snow
K Smoke BD Blowing Dust
BN Blowing Sand

Coverage/Probability Codes

SChcSlight Chance IsoIsolated
ChcChance of SctScattered
LklyLikely NumNumerous
DefDefinite <NoCov>No Coverage / probability
Coverage/Probability Codes Not Currently Used in GMOS Weather
Wide Widespread Ocnl Occasional
Patchy Patchy Areas Areas of
Pds Periods of Frq Frequent
Inter Intermittent Brf Brief

Intensity Codes

<NoInten>No Intensity +Heavy
-Light mModerate
Coverage/Probability Codes Not Currently Used in GMOS Weather
-- Very Light

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

US Dept of Commerce
National Oceanic and Atmospheric Administration
National Weather Service
1325 East-West Highway
Silver Spring, MD 20910
Meterological Development Laboratory
Web site owner: MOS Web Team
Information Quality
Privacy Policy
Freedom of Information Act (FOIA)
About Us
Career Opportunities
Page Last Modified: June 06 2017 19:42:42 UTC