g2gdf.pl in GrADS1.9
Mark Sponsler
msponsler at COMCAST.NET
Thu Apr 10 00:25:58 EDT 2008
Hi Arlindo,
Sorry - I was not clear.
I'm using your latest build of GrADS19 with the new cygintl-3.dll installed
I built a windows batch file that contains the following 2 statements:
set PATH=c:/Program Files/PCGrADS19/win32/
g2gdf.pl -o C:/grib/input_new/wc4m.gdf -I C:/grib/input_new/wc4m.inv C:/grib/input_new/multi_1.wc_4m.t00z.grib2
I did not have the ability to set the environmnet variable via Control Panel>System>Advanced>Envionment Variables>etc... because I did not had admin rights on the machine.
Then I double click the bat file. And receive the error message indicated in the previous email.
I've been using this trick of setting the path to Grads19 in the batch file (like above) on all sorts of scripts where GrADS19 is installed on either a flash drive or just placed somewhere on the hard drive and where I have no admin rights and no ability to set path via Control Panel, and everything has been going quite smoothly. A totally portable application, even if I have no admin rights to the machine. So I figured running g2gdf.pl would be no different.
Intersting, but on a different machine which I do have admin rights, I set the path in Control Panel to PCGrads19/win32/ as normal
then run the following command in a batch file (same as first time but with the set PATH command commented out) and everything works fine!
REM set PATH=c:/Program Files/PCGrADS19/win32/
g2gdf.pl -o C:/grib/input_new/wc4m.gdf -I C:/grib/input_new/wc4m.inv C:/grib/input_new/multi_1.wc_4m.t00z.grib2
So this leads me to beleive that there is something in the perl or gdf script that is not virtualized to read the Path command in the batch file.
Likewise if I try and run g2ctl,pl with the path set in Control Panel everything works fine. But if I try to set the Path in the bat file (and do not have it set in Control Panel) it errors out:
set PATH=c:/Program Files/PCGrADS19/win32/
g2ctl.pl C:/grib/input_new/multi_1.wc_4m.t00z.grib2
Can't spawn "cmd.exe": No such file or directory at C:\Program Files\PCGrADS19\win32\g2ctl.pl line 238.
Big problem:
either C:/grib/input_new/multi_1.wc_4m.t00z.grib2 is missing or not a grib file
or wgrib2 is not on your path or wgrib2 is too old.
Hope this is useful. Just hoping all the functionality can be totally portable, but maybe I'm being unrealistic.
--
Thanks,
Mark
-------------- Original message --------------
From: Arlindo da Silva <dasilva at ALUM.MIT.EDU>
On Wed, Apr 9, 2008 at 7:00 PM, Mark Sponsler <msponsler at comcast.net> wrote:
Using Grads1.9 Win32 superpack (non-self installing) ver 4/6/08 off a
flash drive on a machine which I do not have admin rights...
While playing with the new g2gdf.pl extension in Grads1.9, received the
following error trying to read a grib2 file:
>set PATH=c:\Program Files\PCGrADS19\win32
>g2gdf.pl -o c:\grib\input_new\multi_1.gdf -I
c:\grib\input_new\multi_1.inv c:\grib\input_new\multi_1.wc_4m.t12z.grib2
g2gdf - control file/inventory for "g2" extension
Descriptor: c:\grib\input_new\multi_1.gdf
Inventory: c:\grib\input_new\multi_1.inv
Data Dir: c:\grib\input_new\
Grib files: multi_1.wc_4m.t12z.grib2
cannot create c:\grib\input_new\multi_1.gdf --- is g2ctl.pl on path? at
c:\Program Files\PCGrADS19\win32\g2gdf.pl line 52.
Start by testing whether g2ctl works on your grib2 file; use the g2ctl.exe version.
All the other apps seem to work fine when using the 'set PATH' command.
Maybe something needs to be 'virtualized' in g2gdf.pl?
I am a bit confused. Which shell are you using? Are you using the Perl version (g2gdf.pl) or the executable "g2gdf.exe"? If using the script version you must use a Cygwin compiled perl, or else you may need to use "dos2unix" to convert the resulting text files .gdf/.inv. Also, use POSIX file names with forward slashes: c:/grib/input_new/multi_1.wc_4m.t12z.grib2
My recommendation would be for you to start with g2gdf.exe and g2ctl.exe which should already be in your win32 directory. Next, try these with POSIX file names. And if using g2ctl.pl with perl/cygwin, you need the win32 patched version.
Let me know how it goes. Are your particular grib-2 files available on-line?
Arlindo
--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080410/46497c3d/attachment.html
More information about the gradsusr
mailing list