multi-year monthly mean standard deviation
Laura Feudale
feudale at ICTP.IT
Tue Apr 3 16:38:40 EDT 2007
Dear Simon,
in your script, after you define ztemp and zprec, add the following
commands to transform the two variables in climatological variables:
'modify ztemp seasonal'
'modify zprec seasonal'
So your script should look like this:
.......
'define ztemp=ave(aave(tmp.2,lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)'
'define zprec=ave(aave(pre,lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)/30'
'modify ztemp seasonal
'modify zprec seasonal'
'd
tloop(sqrt(ave(aave(pow(ztemp-tmp.2,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)))'
'd
tloop(sqrt(ave(aave(pow(zprec-pre,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)))'
It should fix your problem.
Regards,
-- Laura
----------------------------------------------------------------------
Laura Feudale, Ph.D. (Climate Dynamics, George Mason University/COLA)
*Current Affiliation: Earth System Physics Section
The Abdus Salam International Centre for Theoretical Physics
Trieste, ITALY
----------------------------------------------------------------------
Simon Krichak wrote:
> Dear all,
>
> My script looks better now (after the suggested by Laura correction) :
>
> 'open ../CRU-DATA/GRADS:1951-2000.pre.ctl '
> 'open ../CRU-DATA/GRADS:1951-2000.tmp.ctl '
> 'set x 1'
> 'set y 1'
> 'set t 1 12'
> 'set tlsupp year'
> 'define
> ztemp=ave(aave(tmp.2,lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)'
> 'define
> zprec=ave(aave(pre,lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)/30'
> 'd
> tloop(sqrt(ave(aave(pow(ztemp-tmp.2,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)))'
>
> 'd
> tloop(sqrt(ave(aave(pow(zprec-pre,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)))'
>
>
>
> But still doesn't work properly - please see the result below.
> Thanks,
> Simon Krichak
>
> Grid Analysis and Display System (GrADS) Version 1.9b4
> Copyright (c) 1988-2005 by Brian Doty and IGES
> Center for Ocean-Land-Atmosphere Studies (COLA)
> Institute for Global Environment and Society (IGES)
> GrADS comes with ABSOLUTELY NO WARRANTY
> See file COPYRIGHT for more information
>
> Config: v1.9b4 32-bit little-endian readline sdf/xdf hdf-sds netcdf lats
> printim
>
> Issue 'q config' command for more information.
>
> Landscape mode? (no for portrait):
> GX Package Initialization: Size = 11 8.5
> ga-> stand-deviation.gs
> Cannot plot data - all undefined values
> Cannot plot data - all undefined values
> ga->
>
> ----- Original Message -----
> From: "LAURA FEUDALE" <feudale at ICTP.IT>
> To: <GRADSUSR at LIST.CINECA.IT>
> Sent: Tuesday, April 03, 2007 11:42 AM
> Subject: Re: multi-year monthly mean standard deviation
>
>
>> Dear Simon,
>> the aave function doesn't work when time is a varying dimension. In this
>> case you should use the "tloop" function.
>> So try adding the tloop function in this way:
>>
>> .....
>> 'd
>> tloop(sqrt(ave(aave(pow(ztemp-tmp.2,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)))'
>>
>> 'd
>> tloop(sqrt(ave(aave(pow(zprec-pre,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)))'
>>
>>
>> Regards,
>>
>> -- Laura
>>
>> ----------------------------------------------------------------------
>> Laura Feudale, Ph.D. (Climate Dynamics, George Mason University/COLA)
>> *Current Affiliation: Earth System Physics Section
>> The Abdus Salam International Centre for Theoretical Physics
>> Trieste, ITALY
>> ----------------------------------------------------------------------
>>
>>
>>
>> On Tue, 3 Apr 2007, Simon Krichak wrote:
>>
>>> Dear Experts,
>>>
>>> I am trying to calculate mean multiyear standard deviations from
>>> monthly mean data on temperature and precip.
>>>
>>> To do it I apply the following script:
>>>
>>> 'open ../CRU-DATA/GRADS:1951-2000.pre.ctl '
>>> 'open ../CRU-DATA/GRADS:1951-2000.tmp.ctl '
>>> 'set x 1'
>>> 'set y 1'
>>> 'set t 1 12'
>>> 'set tlsupp year'
>>> 'define
>>> ztemp=ave(aave(tmp.2,lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)'
>>> 'define
>>> zprec=ave(aave(pre,lon=36,lon=54,lat=51,lat=65),t+396,t=528,12)/30'
>>> 'd
>>> sqrt(ave(aave(pow(ztemp-tmp.2,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12))'
>>>
>>> 'd
>>> sqrt(ave(aave(pow(zprec-pre,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12))'
>>>
>>>
>>> And obtain the following diagnostics:
>>>
>>> ga-> stand-deviation.gs
>>> Syntax Error: Invalid dimension expression
>>> Cannot use an offset value with a varying dimension
>>> Varying dimension = 3
>>> Error from AVE: 1st dimension expression invalid
>>> Operation Error: Error from ave function
>>> Operation Error: Error from sqrt function
>>> Error ocurred at column 1
>>> DISPLAY error: Invalid expression
>>> Expression =
>>> sqrt(ave(aave(pow(ztemp-tmp.2,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12))
>>>
>>> Syntax Error: Invalid dimension expression
>>> Cannot use an offset value with a varying dimension
>>> Varying dimension = 3
>>> Error from AVE: 1st dimension expression invalid
>>> Operation Error: Error from ave function
>>> Operation Error: Error from sqrt function
>>> Error ocurred at column 1
>>> DISPLAY error: Invalid expression
>>> Expression =
>>> sqrt(ave(aave(pow(zprec-pre,2),lon=36,lon=54,lat=51,lat=65),t+396,t=528,12))
>>>
>>>
>>>
>>> I do not understand my mistake unfortunately.
>>> Please kindly let me know your recommendations.
>>>
>>> Thanks.
>>> Simon Krichak
>>>
>>>
>>
More information about the gradsusr
mailing list