There are three methods of adding new tables for GRIB 1 files.
All three methods require that a new parameter table be made using the NCEP format that is similar to the following table. Let's call our new table gwctab_2.tab.
-1:57:-1:2 0:var0:undefined 1:PRES:Pressure [Pa] 2:PRMSL:Pressure reduced to MSL [Pa] 3:PTEND:Pressure tendency [Pa/s] 4:PVORT:Pot. vorticity [km^2/kg/s] 5:ICAHT:ICAO Standard Atmosphere Reference Height [m] 6:GP:Geopotential [m^2/s^2] ...
The first line in the sample table above:
-1:57:-1:2
The syntax is: it always starts with -1, the second number is the center number, the third number is the subcenter number or -1, and the forth number is the version number of the table. Many centers have different versions of the table depending on the dataset to be decoded so it's not unusual to have duplicate lines with the just the last number different.
The rest of the lines in the file follows this format:
0:var0:undefined 1:PRES:Pressure [Pa] ...
The first field is the parameter number, the second is the short parameter name, the third is a long parameter name, and the forth that is inside the square brackets if it exist is the parameter units that need to be Udunits compatible. The maximum number of parameters is 255 and not all numbers need to be present. The number 255 is designated for a missing parameter.
The format of grib1lookuptable.lst is:
<center>:<subcenter>:<version>: <table location>
so our sample above would look like:
57: 1: 2: gwctab_2.tab
gwctab_2.tab can be a relative or absolute path. If the table name doesn't contain a path, it needs to be on the CLASSPATH and located at: resources/grib/tables/
For our sample above, resources/grib/tables/gwctab_2.tab
The calling routine would look like this in your code.
GribPDSParamTable.addParameterUserLookup( "/<absolutePath>/grib1lookuptable.lst")
This library does not read in the actual parameter table until it is requested and it will overwrite a previous defined table with the same center, sub-center, version number fields.
% cd "where the distribution was unpacked" % cd resources/resources/grib/tables % edit tablelookup.lst adding your new table entry using above format copy your new table to this directory % cd ../../../.. % ant
The new jar file in now located in the build directory. At this point your new table can be access in the library without using any special calls.
% cd "location of grib<version>.jar" The following directory structure is needed % mkdir resources/grib/tables Extract tablelookup.lst file % jar xvf grib<version>.jar resources/grib/tables/tablelookup.lst % cd resources/grib/tables % edit tablelookup.lst adding your new table entry using above format copy your new table to this directory % cd ../../../.. % jar uvf grib<version>.jar resources/grib/tables/tablelookup.lst % jar uvf grib<version>.jar resources/grib/tables/gwctab_2.tab Check your jar file to see if the new table has been added. % jar tvf grib<version>.jar
At this point your new table can be access in the library without using any special calls.