SST data converted from netCDF to grib2 format - metadata scrambled

Topics related to running the ungrib.exe program
Post Reply
Posts: 5
Joined: Tue Dec 03, 2019 2:56 am

SST data converted from netCDF to grib2 format - metadata scrambled

Post by kprince » Wed Feb 26, 2020 7:06 pm

Hi all,

I am reading in some quarter degree SST data which was originally in netCDF format and I converted over to grib2 format using the Iris package in Python. The Python script does successfully convert the data over to grib2 format, however the metadata appears to have gotten mixed up in the conversion process. The output from the g2print command produces:

ungrib - grib edition num 2
reading from grib file =

rec Prod Cat Param Lvl Lvl Lvl Prod Name Time
num Disc num code one two Templ
1 255 255 255 103 0 0 0 IMGD 2017-09-09_00:00:00 00

Successful completion of g2print

With IMGD being the name and the parameter number being 255 (or missing). Additionally the level code is set as 103, when it should be either 1 (surface) or 102 (sea-level) however I am not sure which. I have come here with the hopes that somebody on here has dealt with this issue in the past and may have some suggestions on what to do, whether it be rewriting the Vtable for reading in the SST, or rewriting the metadata to something that ungrib will accept.

Posts: 59
Joined: Wed Aug 08, 2018 2:21 pm

Re: Issue reading in SST data

Post by bartbrashers » Thu Feb 27, 2020 10:30 pm

When I have SST data in netCDF format (e.g. the many GHRSST datasets at JPL, including the UKMO SST product at ... GLOB-OSTIA) I simply convert them to WPS intermediate file format. That skips storing them in yet another file format (GRIB2). However, you have to interpolate them yourself every interval_seconds. I've written Fortran programs to do those two steps, and I have plans to add the ability to sub-set geographically so the temporary SST:YYYY-MM-DD_HH files aren't larger than they need to be. Maybe after that's done I'll post it somewhere, if I can find an appropriate place. Contact me offline if you think my code could be helpful to you.

Post Reply

Return to “ungrib”