Last updated: February 2013
To code / decode the meteorological data to GRIB, special software is needed. While a DWD-written software, the GRIB1-library is used to work with GRIB 1 data, the new application programmers interface grib_api from ECMWF is used for dealing with GRIB 2. But grib_api can also deal with GRIB 1 data. The approach, how data is coded to / decoded from GRIB messages is rather different in these software packages. While the GRIB1-library provides interfaces to code / decode the full GRIB message in one step, the grib_api uses the so-called key/value approach, where the single meta data could be set. Both approaches will be discussed shortly:
In the DWD GRIB1 library, full GRIB messages are coded / decoded in one step. The main interface routines are:
The meta data for the different sections have to be written to INTEGER arrays of a certain length:
Input to the routine grbin1 is an INTEGER array iblock, which contains the octets of the message in its bytes. grbin1 then returns the meta data for the different sections in INTEGER arrays (see above) and the values of the variable in a REAL array.