This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hi Tom, > We would like to translate our GRIB format files to netCDF. What would you > recommend? Well, I don't currently know of any generic GRIB to netCDF translators. We have one (gribtonc) that is fairly specific to some of the GRIB products from NMC. It writes many GRIB products into a single netCDF file, using knowledge of the grids on which the GRIB products are defined to "stitch" subgrids together into a global grid and to stack up 2-D grids at different layers and forecast times into 4-dimensional arrays of parameters such as: float Z(record, level, y, x) ; Z:long_name = "geopotential height" ; Z:units = "gp m" ; Z:valid_range = -1500.0f, 50000.0f; Z:_FillValue = -9999.f ; Z:navigation_dim = "nav" ; where "record" is determined by the reference time and forecast time of a model run. gribtonc is limited in the GRIB features it supports (it doesn't handle the Grid Description Section or second-order packing) and it requires that GRIB products be "wrapped" in a WMO envelope. gribtonc has some other limitations: - inability to decode into more than one output file; - inability to handle recently added GRIB products, including "quasi-regular" thinned grids; - inability to decode GRIB data directly into ASCII form; - inability to use any kind of packing in the netCDF data: only arrays of floats are used. I'm currently in the process of writing a new GRIB to netCDF decoder (gribdec) that will handle the Grid Description Section, improve portability, permit more flexible specification of how multiple GRIB products are to be mapped into netCDF files, and handle a stream of raw GRIB products with no WMO envelopes. I hope to have a beta test version available soon. The purpose of the new decoder is still to handle GRIB products we get from model output runs at NMC and ECMWF, but it may also be more generally useful. There are lots of issues in how GRIB information should be represented in a netCDF file, for example how to represent georeferencing information in the Grid Description Section in an understandable way that application programs can use. For an example of how we have tentatively decided to represent georeferencing information with a single netCDF dimension and a set of variables that use that dimension, see ftp://ftp.unidata.ucar.edu/pub/netcdf/Conventions/NUWG/ruc.cdl ______________________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden P.O. Box 3000 http://www.unidata.ucar.edu/ Boulder, CO 80307-3000 ______________________________________________________________________________