Arbitrary Cross Sections of Horizontal Divergence

Rainer Behrendt rainer.behrendt at IMK.FZK.DE
Wed Jan 26 07:23:44 EST 2005


Dear GrADS Users,

what I'm trying to do is to plot an arbitrary cross section using
the functions gr2stn, collect and coll2gr as described in
the example script on the GrADS homepage.

When running my script (see below) I get the following error message:

>Error from COLL2GR:  Invalid dimension environment
>Operation Error:  Error from coll2gr function
>  Error ocurred at column 1
>DISPLAY error:  Invalid expression
>  Expression = coll2gr(1,-u)

I think, the problem is the use of the hdivg function.
Replacing the variable "divergence" inside the gr2stn function by
the expression "hdivg(UGRDprs,VGRDprs)" leads to the error:

>Error from HDIVG:  Invalid dimension environment
>  Horizontal environment (X, Y Varying) is required
>Operation Error:  Error from hdivg function
>Operation Error:  Error from gr2stn function
>  Error ocurred at column 1
>DISPLAY error:  Invalid expression
>  Expression = gr2stn(hdivg(ugrdprs,vgrdprs),30,60)
>Error from COLL2GR:  Collection 1 empty
>Operation Error:  Error from coll2gr function
>  Error ocurred at column 1
>DISPLAY error:  Invalid expression
>  Expression = coll2gr(1,-u)

The script works fine when the argument
of gr2stn is replaced by variables defined
in the ctl- file, but only with this
dimension environment. So if I modify the dimension environment
for the requirements of hdivg, I run into even
more essential problems.

Thank You in Advance!

Rainer

********************************************************
'open Daten/gfs.ctl'

'define divergence=hdivg(UGRDprs,VGRDprs)'

'set x 1'
'set y 1'
'set lev 1000 200'

lon1 = 10
lon2 = 30
lat1 = 40
lat2 = 60

lon = lon1
'collect 1 free'
while (lon <= lon2)
  lat = lat1 + (lat2-lat1)*(lon-lon1) / (lon2-lon1)
  'collect 1 gr2stn(divergence,'lon','lat')'
  lon = lon + 1
endwhile

'set x 1 2'
'set xaxis 'lon1' 'lon2
'set gxout shaded'
'display coll2gr(1,-u)'
*************************************************************

Rainer Behrendt

Institut fuer
Meteorologie und Klimaforschung (IMK)
Universitaet Karlsruhe (TH)/
Forschungszentrum Karlsruhe (FZK)



More information about the gradsusr mailing list