[ncl-talk] Errors occur when converting grib2 data to nc type.

Dennis Shea shea at ucar.edu
Sun Jan 31 08:41:31 MST 2021


GRIB is a bit of a moving target.

+ GRIB is a record format *not* a file format. Unlike, (say) netCDF/HDF
there are no rules for creating a collection of GRIB records.  In fact,
individual randomly created GRIB records can be collected together and
called a 'GRIB file'
+ GRIB uses  external tables to describe the meaning of the data.
+ Parameter identification is via an 'id number'. Parameter 'id numbers'
0-127 are defined by the WMO. Other 'id numbers'  are defined by the center
creating the GRIB.
+ The WMO does not provide links to the external tables  created by various
centers.

For example:  *ECMWF's GRIB parameter table*
<https://apps.ecmwf.int/codes/grib/param-db>

As a result, a tool like NCL must update internal GRIB tables for different
centers. Historically, these were done for each new NCL release.

That said ....

*NCL will correctly unpack the records*.   The information like the
appropriate variable name and units may be missing.

The following indicates that parameter ids 224, 228 and 238 were not in the
6.4 table associated with the creating center..

warning: Entry (224) not found in code table file
/app/ncl/lib/ncarg/grib2_codetables/ncep/4/4.2.0.0.table

warning: Entry (228) not found in code table file
/app/ncl/lib/ncarg/grib2_codetables/ncep/4/4.2.0.1.table

warning: Entry (238) not found in code table file
/app/ncl/lib/ncarg/grib2_codetables/ncep/4/4.2.0.1.table


If you could find the appropriate table for the center that created the
file you could manually change it via something loke


    f = addfile("FOO.grb","r")

    x = f->"variable 224"             ; I do not know how the actual name
of the variable returned  by NCL

    x at long_name = "...."            ; add the long _name

    x at units = "..."



.....

On Sat, Jan 30, 2021 at 10:48 PM 宣守丽 via ncl-talk <ncl-talk at mailman.ucar.edu>
wrote:

> Dear NCL experts,
>
>
> When I use NCL to read the grib2 data file or use the  provided script (
> http://www.ncl.ucar.edu/Applications/griball.shtml) to convert grib2 data
> to nc data, a series of errors show on the screen as follows:
>
> warning: Entry (224) not found in code table file
> /app/ncl/lib/ncarg/grib2_codetables/ncep/4/4.2.0.0.table
>
> warning: Entry (228) not found in code table file
> /app/ncl/lib/ncarg/grib2_codetables/ncep/4/4.2.0.1.table
>
> warning: Entry (238) not found in code table file
> /app/ncl/lib/ncarg/grib2_codetables/ncep/4/4.2.0.1.table
>
> ......
>
>
> Using ncl_convert2nc also has the same problem. My NCL version is Version
> 6.4.0. Could you help me?
>
>
>
> Sincerely
>
> Shouli Xuan
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210131/ef3a5c2a/attachment.html>


More information about the ncl-talk mailing list