<div class="gmail_quote">On Tue, Apr 15, 2008 at 3:02 PM, Mark Sponsler <<a href="mailto:msponsler@comcast.net">msponsler@comcast.net</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Arlindo,<br>
I started trying to process grib2 files after building a gdf and inv file<br>
using g2gdf.pl but encountered some errors.<br>
<br>
1) Documentation: <a href="http://opengrads.org/doc/udxt/grib2/grib2.html" target="_blank">http://opengrads.org/doc/udxt/grib2/grib2.html</a><br>
In the example section the sample command below indicates it produces a<br>
inv and gdf file. I found that using the '-v' option does not produce the<br>
expected results, and causes g2gdfl.pl to error out. If the -v option is<br>
removed, all works fine.<br>
<br>
'g2gdf.pl -v gfs.t00z.pgrb2bf00' should be 'g2gdf.pl gfs.t00z.pgrb2bf00'<br></blockquote><div><br></div><div><br></div><div>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.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
2)When running g2gdfl.pl to produce a control file, something interesting<br>
occurs in the control file. Here's a snippet of the first few lines of<br>
the ctl file:<br>
<br>
dset c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___ </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">undef 9.999E+20<br>
title c:\grib\hires_input\multi_1.wc_4m.t12z.grib2<br>
* produced by g2ctl v0.0.3g<br>
* griddef=1:0:(736 x 526):grid_template=0: lat-lon grid:(736 x 526) units<br>
1e-06 input WE:NS output WE:SN res 48 lat 50.000000 to 15.000000 by<br>
0.066667 lon 195.000000 to 244.000000 by 0.066667 #points=387136<br>
<br>
ydef 526 linear 15.000000 0.066667<br>
xdef 736 linear 195.000000 0.066667<br></blockquote><div><br></div><div>I don't see the "OPTIONS template" record. Is it there?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
When trying to open that file, an error is received:<br>
<br>
P:\>set PATH=c:\Program Files\PCGrADS19\win32;%PATH%<br>
<br>
P:\>gradsc -l<br>
Starting X server under /Xming<br>
Starting gradsc under c:\PROGRA~1\PCGRAD~2\win32 ...<br>
<br>
Grid Analysis and Display System (GrADS) Version 1.9.0-rc1<br>
Copyright (c) 1988-2007 by Brian Doty and IGES<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
Institute for Global Environment and Society (IGES)<br>
GrADS comes with ABSOLUTELY NO WARRANTY<br>
See file COPYRIGHT for more information<br>
<br>
Config: v1.9.0-rc1 32-bit little-endian readline lats athena printim<br>
<br>
Issue 'q config' command for more information.<br>
<br>
GX Package Initialization: Size = 11 8.5<br>
ga-> g2_open c:/grib/hires_input/wc_4m.gdf<br>
Scanning description file: c:/grib/hires_input/wc_4m.gdf<br>
Open Error: Can't open binary data file<br>
File name = c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___<br>
ga-><br></blockquote><div><br></div><div>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. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Notice the underscores at the end of the dset name. If I manully delete<br>
those underscores, then try to open the file, all goes well. Can do a 'q<br>
file' with good results.<br></blockquote><div><br></div><div>Strange as it may sound, the undescores are there by design. This file is not supposed to exist. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
But the documentation seems to suggest that maybe there should be a binary<br>
file produced??? And if I try and actually display a variable things do<br>
not go well.<br></blockquote><div><br></div><div>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Not sure what to do now.<br>
<br>
I've got another way to get to the data, but am just trying to use the new<br>
interface to see how it works.<br>
</blockquote></div><br>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:<div><br></div>
<div>1) send the output of "g2gdf.pl -verf gfs.t00z.pgrb2bf00", including any file it produces or error messages.</div><div><br></div><div>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).</div>
<div><br></div><div>3) Can you create similar gdf/inv files from the model_25.grib2 file?</div><div><br></div><div> I'll try ActiveState perl on a gfs file and let you know what I find out. </div><div><br></div><div>
Arlindo</div><div><br clear="all"><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a>
</div>