Overview
(Edition 2 - Version 6 - 09/2010)
FM 92-XIII Ext. - GRIB - General Regularly-distributed
Information in Binary form
CODE FORM:
SECTION 0 |
Indicator Section |
|
|
|
|
|
|
|
|
SECTION 1 |
Identification Section |
|
|
|
|
|
|
|
|
SECTION 2 |
(Local Use Section) |
|
|
} |
|
|
|
|
} |
SECTION 3 |
Grid Definition Section |
|
} |
} |
|
|
|
} |
} |
SECTION 4 |
Product Definition Section |
} |
} |
} |
|
|
} |
} |
} (repeated) |
SECTION 5 |
Data Representation Section |
} |
} (repeated) |
} |
|
|
} (repeated) |
} |
} |
SECTION 6 |
Bit-map Section |
} |
} |
} |
|
|
} |
} |
} |
SECTION 7 |
Data Section |
} |
} |
} |
|
|
|
|
|
SECTION 8 |
End Section |
|
|
|
Notes:
(1)
GRIB is the name of a data representation form for general
regularly-distributed information in binary.
(2)
Data encoded in GRIB consists of a continuous bit-stream made of a
sequence of octets (1 octet = 8 bits).
(3)
The octets of a GRIB message are grouped into sections:
Section Number |
Section Name |
Section Contents |
0 |
Indicator Section |
“GRIB”, Discipline, GRIB Edition number, length of message |
1 |
Identification Section |
Length of section, section number, characteristics that apply to all processed data in the GRIB message |
2 |
Local Use Section (optional) |
Length of section, section number, additional items for local use by originating centres |
3 |
Grid Definition Section |
Length of section, section number, definition of grid surface and geometry of data values within the surface |
4 |
Product Definition Section |
Length of section, section number, description of the nature of the data |
5 |
Data Representation Section |
Length of section, section number, description of how the data values are represented |
6 |
Bit-map Section |
Length of section, section number, indication of presence or absence of data at each of the grid points, as applicable |
7 |
Data Section |
Length of section, section number, data values |
8 |
End Section |
“7777" |
(4)
Sequences of GRIB sections 2 to 7, sections 3 to 7 or sections 4 to 7
may be repeated within a single GRIB message. All sections
within such repeated sequences must be present and shall appear in
the numerical order noted above. Unrepeated sections remain in
effect until redefined.
(5)
It will be noted that the GRIB code is not suitable for visual data
recognition without computer interpretation.
(6)
The representation of data by means of series of bits is independent
of any particular machine representation.
(7)
Message and section lengths are expressed in octets. Octets are
numbered 1, 2, 3, etc., starting at the beginning of each section.
Therefore, octet numbers in a template refer to the respective
section.
(8)
Bit positions within octets are referred to as bit 1 to bit 8, where
bit 1 is the most significant and bit 8 is the least significant.
Thus, an octet with only bit 8 set to 1 would have the integer value
1.
(9)
As used in "GRIB", “International Alphabet No. 5"
is regarded as an 8-bit alphabet with bit 1 set to zero.
(10)
The IEEE single precision floating point representation is specified
in the standard ISO/IEC 559-1985 and ANSI/IEEE 754-1985 (R1991),
which should be consulted for more details. The representation
occupies four octets and is
seeeeeee emmmmmmm mmmmmmmm mmmmmmmm
where
s is the sign bit, 0 means positive, 1 negative
e...e is an 8 bit biased exponent
m...m is the mantissa, with the first bit deleted
The value of the number is given by the following table:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Normally, only biased exponent values from 1 through
254 inclusive are used, except for positive or negative zero which
are represented by setting both the biased exponent and the mantissa
to 0.
The numbers are stored with the high order octet
first. The sign bit will be the first bit of the first octet.
The low order bit of the mantissa will be the last (eighth) bit of
the fourth octet.
This floating point representation
has been chosen because it is in common use in modern computer
hardware. Some computers use this representation with the order
of the octets reversed. They will have to convert the
representation, either by reversing the octets or by computing the
floating point value directly using the above formulae.