NCAR / ncl

The NCAR Command Language (NCL) is a scripting language for the analysis and visualization of climate and weather data.

Home Page:http://www.ncl.ucar.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DRS Template 5.42

ghassan-alaka opened this issue · comments

Describe the bug
ECMWF recently upgraded the GRIB2 compression method to CCSDS (using data representation template 5.42). This is resulting in an error while attempting to read ECMWF-produced GRIB2 files in NCL. NCL does not exit with this error, but my script quickly fails because no GRIB2 data is actually read. The full error is:

getdrstemplate: DRS Template 5.42 not defined.
warning:Error unpacking GRIB record section 5.

Provide the following:

  • NCL script:
f=addfile("/DATA/PATH/20230627120000-0h-oper-fc.grib2","r")
print(f)

Computing environment

  • OS: Linux (NOAA)
  • OS version: CentOS Linux 7 (Core)
  • NCL Version: 6.6.2
  • Installation method: binary from NCAR website

Additional context
I think this problem might be resolved by adding the correct table information in this sub-directory, but I'm not sure exactly what to change/add:
${NCARG_ROOT}/lib/ncarg/grib2_codetables/ecmwf/5/

I am in the process of migrating from NCL to Python. It would be nice to continue to process ECMWF data using NCL until that migration is complete.

NCL uses g2clib to read GRIB2. Does anyone know if g2clib can currently handle the CCSDS compression method? If so, how would I make that updated library available in NCL v6.6.2?

Found this on a google search, as I ran into this issue as well (not with NCL, but with GDAL). Looks like you can use the ecCodes tool to decompress the data and get it into a usable format by NCL or GDAL or whatever.

grib_set -r -w packingType=grid_ccsds -s packingType=grid_simple ccsds_compressed_grib.grib output.grib

Hope this workaround helps you, and other strangers that search for this issue.