NOAA-EMC / wgrib2

Provides functionality for interacting with, reading, writing, and manipulating GRIB2 files.
39 stars 14 forks source link

Fix suspicious GRIB2 table entries #285

Open JohnHalleyGotway opened 2 weeks ago

JohnHalleyGotway commented 2 weeks ago

While working on issue dtcenter/MET#2780 to incorporate recent updates to GRIB2 tables into the Model Evaluation Tools software for MET version 12.0.0, I ran into the following suspicious entries in the GRIB2 tables. Recommend that you take a look.

  1. NDFD_gribtable.dat has non-unique entries starting on line 27:
    {0,1,0,255,8,1,19,215, "TOTALSVRPROB", "Total probability of severe thunderstorms", "??"}, 
    {0,1,0,255,8,1,19,215, "TOTALXTRMPROB", "Total probability of extreme severe thunderstorms", "??"}, 

    For MET, we've encoded line 28 as 216 instead of 215. However, I'm not positive that that's correct.

  2. Line 108 of MRMS_gribtable.dat has the long name and units strings reversed:
    {209,10,0,255,161,1,11,1, "MergedReflectivityComposite", "dBZ", "UnQCed Composite Reflectivity Mosaic (max ref)"},

    Should be changed to:

    {209,10,0,255,161,1,11,1, "MergedReflectivityComposite", "UnQCed Composite Reflectivity Mosaic (max ref)",  "dBZ"},
  3. I also note discrepancies between the content of ncep/gribtable.dat and the GRIB2 documentation.

For example, in this table https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-2-10-2.shtml, of the entries for XICE (24), YICE (25), FRZMLTPOT (27), MLTDATE (28), and FRZDATE (29) do not appear in ncep/gribtable.dat.

@GwenChen-NOAA notes that Hera:/home/Wesley.Ebisuzaki/grib2/wgrib2/gribtables/ncep/gribtable.dat does contain entries for those. That file contains 1668 lines while ncep/gribtable.dat contains 1569. Recommend reviewing/resolving discrepancies.

webisu commented 1 week ago

Can someone provide a link to the official table? I got it off the web back in 11/2015. I could have made some mistakes or the table was changed.

JohnHalleyGotway commented 1 week ago

Can someone provide a link to the official table? I got it off the web back in 11/2015. I could have made some mistakes or the table was changed.

@webisu, while working on GRIB table updates for the Model Evaluation Tools software (dtcenter/MET#2780), I pulled input from three sources:

  1. The gribtables directory in this NOAA-EMC/wgrib2 repository which is version 3.4.0.
  2. The gribtables directory from wgrib2 version 3.1.4 in hera:/home/Wesley.Ebisuzaki/grib2/wgrib2/gribtables. While the numbering would suggest the 3.4.0 contains all of the 3.1.4 code, I don't think the development was entirely linear.
  3. The NCEP GRIB2 Documentation website.

It isn't entirely clear to me which, if any of these, is the authoritative source for NOAA. I'll note that ECMWF also provides GRIB2 table definitions (https://codes.ecmwf.int/grib/format/grib2/ctables/). And other centers, like the USAF, have additional GRIB2 tables that are not included in the NOAA sources.

I wrote up this issue because I ran into a few obvious discrepancies that I wanted to point out. Personally, I'd recommend checking for consistency between the 3 sources listed above. And you might also ask how/when the website docs get updated. Perhaps those really are the authoritative NOAA source?

webisu commented 1 week ago

AFAIK, the grib files in NDFD use center=8. Therefore, the local tables will have to be provided by that center. The NCEP locally defined variables will not apply. There hasn't been any changes to the wgrib2's NDFD tables since 11/2015 according to my change log. Manfred (external developer) is from Europe and naturally is keen on keeping the ecmwf tables up to date. The BOM, DWD, KMA, MRMS and NDFD tables were created/updated because I was making wgrib2 compatible with their files and decided to add their grib tables. Yes, it time to update the NDFD table.

On Thu, Nov 7, 2024 at 10:54 AM John Halley Gotway @.***> wrote:

Can someone provide a link to the official table? I got it off the web back in 11/2015. I could have made some mistakes or the table was changed.

@webisu https://github.com/webisu, while working on GRIB table updates for the Model Evaluation Tools software (dtcenter/MET#2780 https://github.com/dtcenter/MET/issues/2780), I pulled input from three sources:

  1. The gribtables https://github.com/NOAA-EMC/wgrib2/tree/develop/wgrib2/gribtables directory in this NOAA-EMC/wgrib2 repository which is version 3.4.0.
  2. The gribtables directory from wgrib2 version 3.1.4 in hera:/home/Wesley.Ebisuzaki/grib2/wgrib2/gribtables. While the numbering would suggest the 3.4.0 contains all of the 3.1.4 code, I don't think the development was entirely linear.
  3. The NCEP GRIB2 Documentation https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/ website.

It isn't entirely clear to me which, if any of these, is the authoritative source for NOAA. I'll note that ECMWF also provides GRIB2 table definitions ( https://codes.ecmwf.int/grib/format/grib2/ctables/). And other centers, like the USAF, have additional GRIB2 tables that are not included in the NOAA sources.

I wrote up this issue because I ran into a few obvious discrepancies that I wanted to point out. Personally, I'd recommend checking for consistency between the 3 sources listed above. And you might also ask how/when the website docs get updated. Perhaps those really are the authoritative NOAA source?

— Reply to this email directly, view it on GitHub https://github.com/NOAA-EMC/wgrib2/issues/285#issuecomment-2462593821, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEIB7ZRHOGELRZ5FLSYOL6DZ7OEMHAVCNFSM6AAAAABQ4XMNVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRSGU4TGOBSGE . You are receiving this because you were mentioned.Message ID: @.***>