[gradsusr] Error running script on Lambert Conformal Projection
Justin Traiteur
jtraite2 at atmos.uiuc.edu
Thu Jun 24 16:52:08 EDT 2010
Hey John,
I actually just discovered the problem in my code. I was using the same subwrd command for both .ctl files. In one file the output was numeric while the other output was a word. Sorry for the confusion.
Thanks,
Justin
----- Original Message -----
From: "John Huddleston" <Huddleston at cira.colostate.edu>
To: "GrADS Users Forum" <gradsusr at gradsusr.org>
Sent: Thursday, June 24, 2010 3:42:51 PM
Subject: Re: [gradsusr] Error running script on Lambert Conformal Projection
Justin
We saw your email the first time.
Can you send your two CTL files?
Can you put up a URL to a sample data file on a web server?
John Huddleston, PhD
Cooperative Institute for Research in the Atmosphere
-----Original Message-----
From: gradsusr-bounces at gradsusr.org
[mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Justin Traiteur
Sent: Thursday, June 24, 2010 9:49 AM
To: GrADS Users Forum
Subject: [gradsusr] Error running script on Lambert Conformal Projection
I have a script for pulling a vertical sounding of the atmosphere for a
location and ingesting the sounding into WRF. When I run the script on a
control file that uses the xdef and ydef options it works. When I use
the script on the same data with the pdef lccr (lambert conformal)
option it does not. Below is the display output for the 1st option and
then the second option. Below that the script can be found. Thank you so
much for your time.
Justin
[jtraite2 at manabe47 ~/Analysis]$ grads
Grid Analysis and Display System (GrADS) Version 2.0.a7.1
Copyright (c) 1988-2008 by Brian Doty and the
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information
Config: v2.0.a7.1 little-endian readline printim grib2 netcdf hdf4-sds
hdf5 geotiff
Issue 'q config' command for more information.
Landscape mode? ('n' for portrait): n
GX Package Initialization: Size = 8.5 11
ga-> open grib4.ctl
Scanning description file: grib4.ctl
Data file sgpallruc20isobX1.00.%y4%m2%d2.%h20000.raw.grib2 is open as
file 1
LON set to 0 30
LAT set to 0 22.4
LEV set to 1000 1000
Time values set: 2008:6:1:0 2008:6:1:0
E set to 1 1
ga-> vertout.gs
38 1.3 0.9 291.4 0.012671 98470
255 1.0 3.3 292.3 0.012181 98470
478 2.5 7.7 295.3 0.012413 98470
707 6.5 6.9 299.0 0.011699 98470
942 8.9 5.2 299.6 0.010961 98470
1183 10.2 2.8 299.9 0.010407 98470
1429 11.3 0.1 300.7 0.010329 98470
1680 11.6 -1.5 301.5 0.010022 98470
1938 12.9 -2.6 302.4 0.009270 98470
2202 14.1 -3.0 303.1 0.008613 98470
2473 15.0 -2.6 303.9 0.007603 98470
2751 16.5 -2.4 304.7 0.006110 98470
3037 16.8 -2.8 305.6 0.004603 98470
3330 16.9 -2.9 306.8 0.003477 98470
3633 17.3 -2.5 307.9 0.002545 98470
3944 18.3 -1.2 309.1 0.001904 98470
4266 19.6 0.0 310.0 0.001465 98470
4599 21.4 1.3 311.4 0.001302 98470
4943 23.1 2.6 312.9 0.001107 98470
5301 25.2 4.3 314.8 0.000828 98470
5674 27.3 6.4 316.8 0.000651 98470
6063 28.8 8.8 318.7 0.000730 98470
6469 30.2 11.8 320.3 0.000778 98470
6893 31.1 15.2 322.0 0.000677 98470
7339 31.2 18.4 323.9 0.000571 98470
7806 31.2 21.4 325.8 0.000481 98470
8300 31.1 24.6 327.7 0.000404 98470
8823 31.2 28.4 329.6 0.000294 98470
9378 31.3 31.9 331.5 0.000194 98470
9970 30.9 33.4 333.0 0.000138 98470
10606 30.9 35.1 334.8 0.000084 98470
Files written to output1.rft
ga-> quit
No hardcopy metafile open
GX package terminated
[jtraite2 at manabe47 ~/Analysis]$ grads
Grid Analysis and Display System (GrADS) Version 2.0.a7.1
Copyright (c) 1988-2008 by Brian Doty and the
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information
Config: v2.0.a7.1 little-endian readline printim grib2 netcdf hdf4-sds
hdf5 geotiff
Issue 'q config' command for more information.
Landscape mode? ('n' for portrait): n
GX Package Initialization: Size = 8.5 11
ga-> open grib5.ctl
Scanning description file: grib5.ctl
Data file sgpallruc20isobX1.00.%y4%m2%d2.%h20000.raw.grib2 is open as
file 1
LON set to -139.857 -57.4984
LAT set to 16.281 58.21
LEV set to 1000 1000
Time values set: 2008:6:1:0 2008:6:1:0
E set to 1 1
Notice: Implied interpolation for file grib5.ctl
Interpolation will be performed on any data displayed from this file
ga-> vertout.gs
Error in format: 2rd argument invalid.
Error occurred on line 17
In file vertout.gs
ga-> quit
No hardcopy metafile open
GX package terminated
[jtraite2 at manabe47 ~/Analysis]$ vi vertout.gs
#GrADS script to output "sounding" values to a text file
#SMcMillan, 6/11/2010
#Assumes variables tmpprs, ugrdprs, vgrdprs available
# 'set x 256'
'set y 132'
'set z 1'
'set t 1'
zlev=1 ts=1
while(ts<=3)
outfile='output'%ts'.rft'
while(zlev<=31)
'd
pressfc(t='ts',z=1)';val1=subwrd(result,4);prs=math_format('%9.0f',val1)
'd
hgtprs(t='ts',z='zlev')';val2=subwrd(result,4);hgt=math_format('%9.0f',val2)
'd
ugrdprs(t='ts',z='zlev')';val3=subwrd(result,4);u=math_format('%9.1f',val3)
'd
vgrdprs(t='ts',z='zlev')';val4=subwrd(result,4);v=math_format('%9.1f',val4)
'd lev(z='zlev')';val5=subwrd(result,4);plev=math_format('%9.0f',val5)
'd tmpprs(t='ts',z='zlev')';
val7=subwrd(result,4);tmp=math_format('%9.1f', val7)
'set z ' zlev
'd
tmpprs*pow((1000/lev),0.286)';val8=subwrd(result,4);theta=math_format('%9.1f',val8)
'd
rhprs/100*621.97*(6.11*pow(10,(7.5*(tmpprs-273.15))/(237.7+(tmpprs-273.15)))/(lev-(6.11*pow(10,(7.5*(tmpprs-273.15))/(237.7+(tmpprs-273.15))))))/1000';val9=subwrd(result,4);mr=math_format('%9.6f',val9)
vals=hgt%u%v%theta%mr%prs;say vals
dummy=write(outfile,vals)
zlev=zlev+1
endwhile
zlev=1 dummy=close(outfile)
say 'Files written to 'outfile
ts=ts+1
endwhile
-- Justin Traiteur
Graduate Teaching Assistant
President, AMS Student Chapter
Dept. of Atmospheric Sciences
University of Illinois
jtraite2 at illinois.edu 618.972.9950
_______________________________________________ gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
_______________________________________________ gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
--
Justin Traiteur
Graduate Teaching Assistant
President, AMS Student Chapter
Dept. of Atmospheric Sciences
University of Illinois
jtraite2 at illinois.edu
618.972.9950
More information about the gradsusr
mailing list