[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting from netCDF to grib 218



Brian,

Actually I don't know of any s/w to create GRIB files from netCDF.  That
isn't to say that there's not any out there or it can't be done.  One can
dump a netCDF file to stdout using a netCDF routine called ncdump.  One
would have to install netCDF and udunits, not a major under taking. Since
the netCDF output from ncdump is usually large, it would probably be
better to modify ncdump to write to a grib file. The hard part would be to
write the grib file.  The Unidata decoders package reads GRIB and writes
netCDF, so one would have to reverse the routine, probably not a easy
task. gribtonc reads the GRIB file over a template and then it extracts
the info. The gribdump routine reads the GRIB and writes the output to
stdout. Probably the reverse of gribdump would be the better choice. One
would have to install the decoders package for these routines.  I looked
on the web, there are GRIB encoding packages available, never used any so
I can't comment. That's probably a better way to go instead of trying to
read the ~10k lines code of gribdump.

Some info about GRIB encoding, many more on the web :
http://rsd-www.nrl.navy.mil/7214/data_fmt.html#grib

You might want to look at the output of the eta model using gribdump, so
you are aware of the format and parameters.


I would appreciate hearing about your findings. I've heard of the
netCDF-GRIB request a couple of times and never heard of the result.  Also
you might want to send your problem to address@hidden mail
list. You have to join to send the message. 

The decoders page has all the needed info.

http://www.unidata.ucar.edu/packages/decoders

Good luck,
Robb...



On Tue, 10 Dec 2002, Brian Etherton wrote:

> Hello there Robb,
> 
> My name is Brian Etherton, post-doc at the University of Miami.  I am working 
> in collaboration (COMET proposal) with the NWS to initialize the workstation 
> ETA model using the LAPS analysis produced at NWS Miami.  At present, the 
> LAPS output is in netCDF form.  The ETA model, as near as I know, is 
> initialized using the grib 218 format.
> 
> So, my task is to convert from one to the other, and to have the correct 
> variables in the grib file (which I reckon may not be the same as the LAPS 
> analyses, certainly, the vertical coordinate will differ).
> 
> I am kind of new to this whole game, so any insights you have would be great. 
>  There seems to be lots of ways to go from grib to netCDF, but as of yet, I 
> haven't found a way to do the reverse.  My guess is that I will have to code 
> this all up myself, which I can do if given a pretty clear road map of how to 
> go about doing it.
> 
> Thanks for any and all help,
> Brian Etherton

===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================