g2gdf.pl part2

Arlindo da Silva dasilva at ALUM.MIT.EDU
Tue Apr 15 20:31:13 EDT 2008


On Tue, Apr 15, 2008 at 3:02 PM, Mark Sponsler <msponsler at comcast.net>
wrote:

> Hi Arlindo,
> I started trying to process grib2 files after building a gdf and inv file
> using g2gdf.pl but encountered some errors.
>
> 1) Documentation:  http://opengrads.org/doc/udxt/grib2/grib2.html
> In the example section the sample command below indicates it produces a
> inv and gdf file.  I found that using the '-v' option does not produce the
> expected results, and causes g2gdfl.pl to error out. If the -v option is
> removed, all works fine.
>
> 'g2gdf.pl -v gfs.t00z.pgrb2bf00' should be 'g2gdf.pl gfs.t00z.pgrb2bf00'
>


The "-verf" option is essential for forecast files so that it uses the
verification rather than initial condition date/time. What kind of errors do
you get? I never used ActiveState perl for this, I'll have to give it a try.


> 2)When running g2gdfl.pl to produce a control file, something interesting
> occurs in the control file.  Here's a snippet of the first few lines of
> the ctl file:
>
> dset c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___

undef 9.999E+20
> title c:\grib\hires_input\multi_1.wc_4m.t12z.grib2
> *  produced by g2ctl v0.0.3g
> * griddef=1:0:(736 x 526):grid_template=0: lat-lon grid:(736 x 526) units
> 1e-06 input WE:NS output WE:SN res 48 lat 50.000000 to 15.000000 by
> 0.066667 lon 195.000000 to 244.000000 by 0.066667 #points=387136
>
> ydef 526 linear 15.000000 0.066667
> xdef 736 linear 195.000000 0.066667
>

I don't see the "OPTIONS template" record. Is it there?


>
> When trying to open that file, an error is received:
>
> P:\>set PATH=c:\Program Files\PCGrADS19\win32;%PATH%
>
> P:\>gradsc -l
> Starting X server under /Xming
> Starting gradsc under c:\PROGRA~1\PCGRAD~2\win32 ...
>
> Grid Analysis and Display System (GrADS) Version 1.9.0-rc1
> Copyright (c) 1988-2007 by Brian Doty and IGES
> Center for Ocean-Land-Atmosphere Studies (COLA)
> Institute for Global Environment and Society (IGES)
> GrADS comes with ABSOLUTELY NO WARRANTY
> See file COPYRIGHT for more information
>
> Config: v1.9.0-rc1 32-bit little-endian readline lats athena printim
>
> Issue 'q config' command for more information.
>
> GX Package Initialization: Size = 11 8.5
> ga-> g2_open c:/grib/hires_input/wc_4m.gdf
> Scanning description file:  c:/grib/hires_input/wc_4m.gdf
> Open Error:  Can't open binary data file
>  File name = c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___
> ga->
>

If you had a "OPTIONS template record in your gdf you should not get an
error. Any attempt to plot anything would return all undefs.


>
> Notice the underscores at the end of the dset name. If I manully delete
> those underscores, then try to open the file, all goes well. Can do a 'q
> file' with good results.
>

Strange as it may sound, the undescores are there by design. This file is
not supposed to exist.


> But the documentation seems to suggest that maybe there should be a binary
> file produced??? And if I try and actually display a variable things do
> not go well.
>

No binary file is produced. The gdf is the equivalent of a ctl, while the
inv file takes the place of the gribmap index, although it is a text file as
well. The only binary file involved is the grib-2 file.


>
> Not sure what to do now.
>
> I've got another way to get to the data, but am just trying to use the new
> interface to see how it works.
>

I suspect the issue may be perl related. All my tests have been with a
cygwin built perl. Unfortunately, the shipped g2ctl.exe does not seem to
work but on my machine. Could you please:
1) send the output of "g2gdf.pl -verf gfs.t00z.pgrb2bf00", including any
file it produces or error messages.

2) I included under test_data/ a test grib-2 file model_25.grib2 along with
.gdf/.inv files. Can you open and plot this data? (See my original post).

3) Can you create similar gdf/inv files from the model_25.grib2 file?

  I'll try ActiveState perl on a gfs file and let you know what I find out.

    Arlindo


--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080415/3f6a4732/attachment.html 


More information about the gradsusr mailing list