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

RE: grib to netcdf conversion question



Charles,

if you make a sample file available on the web, i'll take a look at it for ya.

robb...



On Tue, 13 Feb 2007, Ross,Charles H - PGPW-5 wrote:

Thanks Robb and everyone else for replying so far, this has been very helpful.

From what I've read so far, it appears that it is not possible to take a model 
grib file (grib 1 format) and send it through the gribtocdl process and have 
the netcdf output be readable in the GFE/IFPS software (not necessarily an 
awips d2d).

It sounds like only the nws awips grib decoder which produces their version of 
netcdf (again, so much for standards!) output for use in the gfe/ifps (or an 
awips d2d).

Is this a correct assumption, or has anyone been able to display model data on 
gfe/ifps not using the nws grib decoder?

I have not tried using the Java Grib libraries yet, I was unclear from Robb's 
last message if that will get me to where I want to go on this.

Thanks again for everyone's help on this; I am very thankful for this forum.   
Have a great day everyone!

-Charles



-----Original Message-----
From: Robb Kambic [mailto:address@hidden]
Sent: Tuesday, February 13, 2007 7:50 AM
To: John Kelley
Cc: Ross,Charles H - PGPW-5; address@hidden
Subject: Re: grib to netcdf conversion question

On Mon, 12 Feb 2007, John Kelley wrote:

Mr. Ross,

Are you dealing with GRIB or GRIB2 GFS files?

Sincerely,
John Kelley
NOAA/National Ocean Service


Hello all,


I'm trying to convert model grib files into GFE/IFPS compatible file
formats using the Unidata Converter suite.  So far I'm having no luck and
am seeking input from anyone who may be able to help.


Here's what I've done so far...


1.  I'm using a GFS grib file for input.


2.  Create a .cdl file:

        $ gribtocdl -v -g awips.tbl  2007021212_gfs.grib >
gfs_2007021212.cdl


        * I'm using a awips.tbl file that I found while browsing the
unidata archives


3.  Create the nc file:

        $ gribtonc -l - -g awips.tbl gfs_2007021212.cdl awips.nc <
2007021212_gfs.grib


Hi,

if the 2007021212_gfs.grib is in awips format then no Unidata decoder can
convert it to netCDF directly because we don't suppport AWIPS.  Also the
gribtonc decoder is being deprecated for the the Java Grib Libraries. To
use the Java Grib libraries:


One needs to download the toolsUI.jar from the netCDF java page,
http://www.unidata.ucar.edu/software/netcdf-java/

set the classpath and run Grib2Netcdf

#/bin/csh -f

set CP="<yourpathtoo>toolsUI-2.2.18.jar"

java -Xmx512m -classpath $CP ucar.nc2.iosp.grib.Grib2Netcdf INPUT OUTPUT.NC

Don't forget to add the INPUT grib file and OUTPUT.NC names.

robb...

ps  if the conversion didn't work, you can look at the data with the
ToolUI program by:

java -Xmx512m -classpath $CP ucar.nc2.ui.ToolsUI


        My output here is interesting and may be problematic.  Here is a
sample:


        -------------

Feb 12 21:37:59 gribtonc[13996]: YHHD99 KWBC 121200, awips.nc nav. mismatch
Nx: 129 != 65

Feb 12 21:37:59 gribtonc[13996]: YHHD99 KWBC 121200, awips.nc nav. mismatch
Ny: 85 != 65

Feb 12 21:37:59 gribtonc[13996]: YHHD99 KWBC 121200, awips.nc nav. mismatch
La1: 7.838 != -20.826

Feb 12 21:37:59 gribtonc[13996]: YHHD99 KWBC 121200, awips.nc nav. mismatch
Lo1: -141.028 != -150

Feb 12 21:37:59 gribtonc[13996]: YHHD99 KWBC 121200, awips.nc nav. mismatch
Dx: 95250 != 381000

Feb 12 21:37:59 gribtonc[13996]: YHHD99 KWBC 121200, awips.nc nav. mismatch
Dy: 95250 != 381000

Feb 12 21:37:59 gribtonc[13996]: YHHD30 KWBC 121200, awips.nc nav. mismatch
Nx: 129 != 65

Feb 12 21:37:59 gribtonc[13996]: YHHD30 KWBC 121200, awips.nc nav. mismatch
Ny: 85 != 65

Feb 12 21:37:59 gribtonc[13996]: YHHD30 KWBC 121200, awips.nc nav. mismatch
La1: 7.838 != -20.826

Feb 12 21:37:59 gribtonc[13996]: YHHD30 KWBC 121200, awips.nc nav. mismatch
Lo1: -141.028 != -150

Feb 12 21:37:59 gribtonc[13996]: YHHD30 KWBC 121200, awips.nc nav. mismatch
Dx: 95250 != 381000

Feb 12 21:37:59 gribtonc[13996]: YHHD30 KWBC 121200, awips.nc nav. mismatch
Dy: 95250 != 381000

Feb 12 21:37:59 gribtonc[13996]: YUHD85 KWBC 121200, awips.nc nav. mismatch
Nx: 129 != 65


-------------


4.  Even though I'm getting hundreds (thousands) of mismatch statements I
do get a large .nc file.


From there I'm tried to put it into my designated input directory in the
GFE/IFPS but do not see it available when I run the program.


Obviously I'm doing something wrong.


Can anyone out there help me?   Thanks in advance for any
comments/suggestions, etc, I really appreciate it!


-Charles


-------------------


Charles Ross

Meteorologist

Bonneville Power Administration

905 NE 11th Ave.
Portland , OR 97232


503-230-3159


address@hidden




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


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