<html><body>
<DIV>Hi Arlindo,</DIV>
<DIV>OK, let's see if I can answer a few of you queries:</DIV>
<DIV>&nbsp;</DIV>
<DIV>1) The "-verf" option is essential for forecast files so that it uses the<BR>verification rather than initial condition date/time. What kind of errors do<BR>you get? I never used ActiveState perl for this, I'll have to give it a try.<BR></DIV>
<DIV>Oh I see.&nbsp; The documentation (wiki) indicates to use the '-v' option. But in your email you indicate '-verf'.&nbsp; '-verf' works fine!&nbsp; That was easy.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>D:\Documents and Settings\Storm&gt;g2gdf.pl -v -o c:\grib\hires_input\wc_4m.gdf -I c:\grib\hires_input\wc_4m.inv c:\grib\hires_input\multi_1.wc_4m.t00z.grib2</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; g2gdf - control file/inventory for "g2" extension</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Descriptor: c:\grib\hires_input\wc_4m.gdf.gdf<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inventory: c:\grib\hires_input\wc_4m.gdf.inv<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Data Dir: c:\grib\hires_input\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Grib files: wc_4m.gdf</DIV>
<DIV>Big problem:<BR>&nbsp; either c:\grib\hires_input\wc_4m.gdf is missing or not a grib file<BR>&nbsp; or wgrib2 is not on your path or wgrib2 is too old.<BR>cannot create c:\grib\hires_input\wc_4m.gdf.gdf --- is g2ctl.pl on path? at c:\Program Files\PCGrADS19\win32\g2gdf.pl line 52.</DIV>
<DIV>&nbsp;</DIV>
<DIV>D:\Documents and Settings\Storm&gt;g2gdf.pl -verf -o c:\grib\hires_input\wc_4m.gdf -I c:\grib\hires_input\wc_4m.inv c:\grib\hires_input\multi_1.wc_4m.t00z.grib2</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; g2gdf - control file/inventory for "g2" extension</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Descriptor: c:\grib\hires_input\wc_4m.gdf<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Inventory: c:\grib\hires_input\wc_4m.inv<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Data Dir: c:\grib\hires_input\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Grib files: multi_1.wc_4m.t00z.grib2</DIV>
<DIV><BR>D:\Documents and Settings\Storm&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>2)&nbsp;I don't see the "OPTIONS template" record. Is it there?</DIV>
<DIV><BR>Nope - I've attached the resulting gdf file for your review. </DIV>
<DIV>&nbsp;</DIV>
<DIV>I'll go run some tests with the model_25.grib2 now and see what happens.</DIV>
<DIV>--<BR>Thanks, <BR>Mark</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message -------------- <BR>From: Arlindo da Silva &lt;dasilva@ALUM.MIT.EDU&gt; <BR>
<DIV class=gmail_quote>On Tue, Apr 15, 2008 at 3:02 PM, Mark Sponsler &lt;<A href="mailto:msponsler@comcast.net">msponsler@comcast.net</A>&gt; wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">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: &nbsp;<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. &nbsp;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="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><BR>2)When running g2gdfl.pl to produce a control file, something interesting<BR>occurs in the control file. &nbsp;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___&nbsp;</BLOCKQUOTE>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">undef 9.999E+20<BR>title c:\grib\hires_input\multi_1.wc_4m.t12z.grib2<BR>* &nbsp;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>&nbsp;</DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><BR>When trying to open that file, an error is received:<BR><BR>P:\&gt;set PATH=c:\Program Files\PCGrADS19\win32;%PATH%<BR><BR>P:\&gt;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-&gt; g2_open c:/grib/hires_input/wc_4m.gdf<BR>Scanning description file: &nbsp;c:/grib/hires_input/wc_4m.gdf<BR>Open Error: &nbsp;Can't open binary data
  file<
BR>&nbsp;File name = c:\grib\hires_input\multi_1.wc_4m.t12z.grib2___<BR>ga-&gt;<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.&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><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.&nbsp;</DIV>
<DIV><BR></DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><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>&nbsp;</DIV>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><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&nbsp;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>&nbsp;&nbsp;I'll try ActiveState perl on a gfs file and let you know what I find out.&nbsp;</DIV>
<DIV><BR></DIV>
<DIV>&nbsp;&nbsp; &nbsp;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></BLOCKQUOTE></body></html>