Arbitrary cross section - need help

Elizabeth Austin ecarter at WEATHEREXTREME.COM
Sat Dec 2 16:28:57 EST 2006


Hello all,

A while back someone posted a script to plot an arbitrary cross section.
I tried to modify it to plot turbulent kinetic energy but keep getting
the message: incorrect input args.

As you will see, I do not know what to put for x1 and x2. I am also not
sure if I am modifying the script correctly. I am trying to draw a cross
section from:
39.3°N, 94.6°W to 38.0°N, 92.6°W

The script is pasted at the end of this message

Any help or suggestions would be much appreciated.
Thanks,
Elizabeth Austin

WeatherExtreme Ltd.
elizabeth at weatherextreme.com


function cross_sec(args)
say 'Usage: cross_sec var lon1 lon2 x1 x2 lat1 lat2 lev1 lev2'
say '       tkeprs   ----   variable'
say '       -94.6  ----   leftmost longitude'
say '       -92.6  ----   rightmost longitude'
say '       x1    ----   leftmost x coordinate'
say '       x2    ----   rightmost x coordinate'
say '       38.0  ----   southmost latitude'
say '       39.33  ----   northmost latitude'
say '       1000  ----   lowmost level'
say '       500  ----   highmost level'
var  =  subwrd(args,1)
lon1 =  subwrd(args,2)
lon2 =  subwrd(args,3)
x1   =  subwrd(args,4)
x2   =  subwrd(args,5)
lat1 =  subwrd(args,6)
lat2 =  subwrd(args,7)
lev1 =  subwrd(args,8)
lev2 =  subwrd(args,9)
if(var=''|lon1=''|lon2=''|x1=''|x2=''|lat1=''|lat2=''|lev1=''|lev2='');
say 'Incorrect input args';
return;
endif
'set grads off'
'set zlog on'
'set x 1'
'set y 1'
'set z 'lev1' 'lev2''
lon = lon1
'collect 1 free'
while (lon <= lon2)
  lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)
  'collect 1 gr2stn('var','lon','lat')'
  lon = lon + 1
endwhile
'set x 'x1' 'x2''
'set xaxis 'lon1' 'lon2
'set clab on'
'set gxout shaded'
'd tkeprs'
'cbarn.gs'
return



More information about the gradsusr mailing list