Arbitrary Cross Sections of Horizontal Divergence
José Paulo Bonatti
bonatti at CPTEC.INPE.BR
Wed Jan 26 08:01:39 EST 2005
Dear, Rainer Behrendt
When you open a GrADS control file the dimensions are fixed as following:
x -> all values
y -> all values
z -> the first one
t -> the first one
May be the solution could be put the statment
'set lev 1000 200'
before the define stament, and then you will get the divergence for the
entire
domain including the vertical level, for the first time.
If you want all times, you can put before the define statment
'set t 1 last'
And after the statments
'set x 1'
'set y 1'
you can set the time you want.
Best Regards,
Bonatti - CPTEC - Brasil
Rainer Behrendt wrote:
>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)
>
>
>
--
*****************************************************************
Jose Paulo Bonatti
Dr. em Meteorologia - Pesquisador Titular
Instituto Nacional de Pesquisas Espaciais - INPE
Centro de Previsao de Tempo e Estudos Climaticos - CPTEC
Divisao de Modelagem e Desenvolvimento
(http://www.cptec.inpe.br/)
Rodovia Presidente Dutra, km 40
12630-000 Cachoeira Paulista - SP Brasil
tel: (55) (12) 3186 8421 fax: (55) (12) 3101 2835
*****************************************************************
More information about the gradsusr
mailing list