Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Warning

Please note:
According to the WMO, the use of local tables in messages intended for non-local or international exchange is strongly discouraged.

First of all ask the data provider for any local tables/definitions which they used in their GRIB messages.

Step-by-step guide

Local tables for parameters

...

So for example the GRIB edition 2 local parameters for DWD (centre=edzw) are defined in definitions/grib2/localConcepts/edzw and GRIB edition 1 local parameters for SMHI (centre=eswi) are in definitions/grib1/localConcepts/eswi.

The following in is an example of the contents for the above files in order to handle ECMWF parameter Geopotential in GRIB edition 1:

Code Block
languagebash
title/usr/local/share/eccodes/definitions/grib1/localConcepts/ecmf/name.def
#Geopotential
'Geopotential' = {
    table2Version = 128 ;
    indicatorOfParameter = 129 ;
}
Code Block
languagebash
title/usr/local/share/eccodes/definitions/grib1/localConcepts/ecmf/paramId.def
#Geopotential
'129' = {
    table2Version = 128 ;
    indicatorOfParameter = 129 ;
}
Code Block
languagebash
title/usr/local/share/eccodes/definitions/grib1/localConcepts/ecmf/shortName.def
#Geopotential
'z' = {
    table2Version = 128 ;
    indicatorOfParameter = 129 ;
}
Code Block
languagebash
title/usr/local/share/eccodes/definitions/grib1/localConcepts/ecmf/units.def
#Geopotential
'm**2 s**-2' = {
    table2Version = 128 ;
    indicatorOfParameter = 129 ;
}

And for GRIB edition 2, the contents of the same files for parameter Potential temperature gradient arethe ECMWF parameter 'Potential temperature gradient' in GRIB edition 2:

Code Block
languagebash
title/usr/local/share/eccodes/definitions/grib2/localConcepts/ecmf/name.def
#Potential temperature gradient
'Potential temperature gradient' = {
    discipline = 192 ;
    parameterCategory = 129 ;
    parameterNumber = 3 ;
}

...

Code Block
languagebash
title/usr/local/share/eccodes/definitions/grib2/localConcepts/ecmf/units.def
#Potential temperature gradient
'K' = {
    discipline = 192 ;
    parameterCategory = 129 ;
    parameterNumber = 3 ;
}
Warning

Note: It is important that you override only the files necessary to add your own local parameters. Do not copy the entire contents of the definitions directory!


Install and test your changes

...

To test the local parameter we added earlier, you can take a GRIB2 sample file and change its paramId to 87:

Code Block
% grib_set -s centre=ecmf,paramId=129003 samples/GRIB2.tmpl out.grib2

Now dump the out.grib2 file to check all the keys are there.check the parameter info in the output file:

Code Block
% grib_ls -jn parameter out.grib2

You should get something like this:

Code Block
{
  "centre": "ecmf",
  "paramId": 129003,
  "shortName": "ptgrd",
  "units": "K",
  "name": "Potential temperature gradient"
}


(smile)


Also please study the slides here:  Training course presentation.
And the How-To Article GRIB: Converting edition 1 to 2 (The "Local configuration" section)

...