Regulations


92.1 General

92.1.1 The GRIB code shall be used for the exchange and storage of general regularly-distributed information expressed in binary form.

92.1.2 The beginning and the end of the code shall be identified by 4 octets coded according to the International Alphabet No. 5 to represent the indicators "GRIB" and "7777" in Indicator Section 0 and End Section 8, respectively. All other octets included in the code shall represent data in binary form.

92.1.3 Each section included in the code shall always end on an octet boundary. This rule shall be applied by appending bits set to zero to the section where necessary.

92.1.4 All bits set to “1" for any value indicates that value is missing. This rule shall not apply to packed data.

92.1.5 If applicable, negative values shall be indicated by setting the most significant bit to “1”.

92.1.6 Latitude, longitude, and angle values shall be in units of 10-6 degree, except for specific cases explicitly stated in some grid definitions.

92.1.7 The latitude values shall be limited to the range 0 to 90 degrees inclusive. Orientation shall be north latitude positive, south latitude negative. Bit 1 is set to 1 to indicate south latitude.

92.1.8 The longitude values shall be limited to the range 0 to 360 degrees inclusive. Orientation shall be east longitude positive, with only positive values being used.

92.1.9 The latitude and longitude of the first grid point and the last grid point shall always be given for regular grids.

92.1.10 Vector components at the North and South Poles shall be coded according to the following conventions.

92.1.10.1 If the resolution and component flags in section 3 (Flag table 3.3) indicate that the vector components are relative to the defined grid, the vector components at the Pole shall be resolved relative to the grid.

92.1.10.2 Otherwise, for projections where there are multiple points at a given pole, the vector components shall be resolved as if measured an infinitesimal distance from the Pole at the longitude corresponding to each grid point. At the North Pole, the West to East (x direction) component at a grid point with longitude L shall be resolved along the meridian 90 degrees East of L, and the South to North (y direction) component shall be resolved along the meridian 180 degrees from L. At the South Pole the West to East component at a grid point with longitude L shall be resolved along the meridian 90 degrees East of L and the South to North component shall be resolved along L.

92.1.10.3 Otherwise, if there is only one Pole point, either on a cylindrical projection with all but one Pole point deleted, or on any projection (such as polar stereographic) where the Pole maps to a unique point, the West to East and South to North components shall be resolved along longitudes 270 and 0 respectively at the North Pole and along longitudes 270 and 180 respectively at the South Pole.

Note: (1) This differs from the treatment of the Poles in the WMO traditional alphanumeric codes.

92.1.11 The first and last grid points shall not necessarily correspond to the first and last data points, respectively, if the bit-map is used.

92.1.12 Items in sections 3 and 4 which consist of a scale factor F and a scaled value V are related to the original value L as follows:

L * 10F = V


92.2 Section 0 - Indicator Section

92.2.1 Section 0 shall always be 16 octets long.

92.2.2 The first four octets shall always be character coded according to the International Alphabet No. 5 as "GRIB".

92.2.3 The remainder of the section shall contain reserved octets, followed by the Discipline, the GRIB Edition number, and the length of the entire GRIB message (including the Indicator Section).


92.3 Section 1 - Identification Section

92.3.1 The length of the section, in units of octets, shall be expressed over the group of the first four octets, i.e., over the first 32 bits.

92.3.2 The section number shall be expressed in the fifth octet.

92.3.3 Octets beyond 21 are reserved for future use and need not be present.


92.4 Section 2 - Local Use Section

92.4.1 Regulations 92.3.1 and 92.3.2 shall apply.

92.4.2 Section 2 is optional.


92.5 Section 3 - Grid Definition Section

92.5.1 Regulations 92.3.1 and 92.3.2 shall apply.


92.6 Section 4 - Product Definition Section

92.6.1 Regulations 92.3.1 and 92.3.2 shall apply.

92.6.2 To maintain orthogonal structure of GRIB Edition 2, parameter names in the Code table 4.2 should not contain surface type and statistical process as part of the name.


92.7 Section 5 - Data Representation Section

92.7.1 Regulations 92.3.1 and 92.3.2 shall apply.


92.8 Section 6 - Bit-map Section

92.8.1 Regulations 92.3.1 and 92.3.2 shall apply.


92.9 Section 7 - Data Section

92.9.1 Regulations 92.3.1 and 92.3.2 shall apply.

92.9.2 Data shall be coded using the minimum number of bits necessary to provide the accuracy required by international agreement. This required accuracy/precision shall be achieved by scaling the data by multiplication by an appropriate power of 10 (the power may be 0) before forming the non-negative differences, and then using the binary scaling to select the precision of the transmitted value.

92.9.3 The data shall be packed by the method identified in Section 5.

92.9.4 Data shall be coded in the form of non-negative scaled differences from a reference value of the whole field plus, if applicable, a local reference value.

NOTES:

(1) A reference value is normally the minimum value of the data set which is represented.

(2) For grid-point values, complex packing features are intended to reduce the whole size of the GRIB message (data compression without loss of information with respect to simple packing). The basic concept is to reduce data size thanks to local redundancy. This is achieved just before packing, by splitting the whole set of scaled data values into groups, on which local references (such as local minima) are removed. It is done with some overhead, because extra descriptors are needed to manage the groups characteristics. An optional pre-processing of the scaled values (spatial differencing) may also be applied before splitting into groups, and combined methods, along with use of alternate row scanning mode, are very efficient on interpolated data.

(3) For spectral data, complex packing is provided for better accuracy of packing. This is because many spectral coefficients have small values (regardless of sign), especially for large wave numbers. The first principle is to not pack a subset of coefficients, associated with small wave numbers so that the amplitude of the packed coefficients is reduced . The second principle is to apply an operator to the remaining part of the spectrum: with appropriate tuning it leads to a more homogeneous set of values to pack.

(4) The original data value Y (in the units of code table 4.2) can be recovered with the formula:

Y * 10D= R + (X1+X2) * 2E

For simple packing and all spectral data
E = Binary scale factor,
D = Decimal scale factor
R = Reference value of the whole field,
X1 = 0,
X2 = Scaled (encoded) value.

For complex grid point packing schemes, E, D, and R are as above, but

X1 = Reference value (scaled integer) of the group the data value belongs to,
X2 = Scaled (encoded) value with the group reference value (XI) removed..


92.10 Section 8 - End Section

92.10.1 The end section shall always be 4 octets long, character coded according to the International Alphabet No. 5 as "7777".