[gradsusr] DEFINE error: Invalid expression
pankaj kumar
pankajqumar at yahoo.com
Mon Dec 16 21:00:19 EST 2013
Hi,
Dear Jennifer and Mahakur,
Thank you for your reply. I am sorry that instead of abs(), I wrote mod. I have tried your suggestions. However, the error
SET error: Invalid operand
Operand =
SET error: Invalid operand
Operand =
:
:
DEFINE error: Invalid expression.
persists. Let me send you my script.
'reinit'
'open SI-Decadal.ctl'
'set gxout fwrite'
'set fwrite data-sorted.dat'
t=1
while(t<=120)
'set t 't
lv=1
while(lv<=15)
'set lv 'lv
lt=-90
while(lt<=90)
'set lt 'lt
ln=0
while(ln<=360)
'set ln 'ln
'define si_avg = aave(si,lon=0,lon=360,lat=-90,lat=90)'
'define dv = pow(si_avg-si,2)'
'define sd = sqrt(aave(dv,lon=0,lon=360,lat=-90,lat=89))'
'define x = 2*sd'
'define y = abs(si_avg-si)'
* if (y>=x);
* 'set gxout fwrite'
* 'set fwrite data-sorted.dat'
'display maskout(si,si-x)'
* endif
ln=ln+1
endwhile
lt=lt+1
endwhile
lv=lv+1
endwhile
t=t+1
endwhile
'disable fwrite'
Thank you again for looking into my problem. Now, I am planning to write a fortran program to read netcdf data and solve my problem.
Regards
Pankaj
EES, Hokkaido University
On Monday, December 16, 2013 10:51 PM, Jennifer Adams <jma at cola.iges.org> wrote:
On Dec 16, 2013, at 3:32 AM, pankaj kumar wrote:
Hi,
>
>
>I am writing a grads script to sort out values which differnece from mean is more than 3 times standard deviation. The netcdf data is spread in x,y,z,t dimesions. Though while loops for x,y,z,t are running well, I get error as below:
>
>
> Operand = lat1 -90
>SET error: Invalid operand
> Operand = lon1 0
>SET error: Invalid operand
> Operand = lon1 1
>SET error: Invalid operand
> Operand = lon1 2
>:
>:
>:
> Operand = lon1 360
>SET error: Invalid operand
>:
>:
>
>DEFINE error: Invalid expression.
>
>
>
>My script for defining variables are as follows:
>
>
>'define si_avg = aave(si,lon=0,lon=360,lat=0,lat=180)'
>'define dv = pow(siavg-si,2)'
>'define sd = sqrt(aave(dv,lon=0,lon=360,lat=0,lat=179))'
>'define x = 3*sd'
>'define y = mod(si_avg-si)'
>
What is the mod() function?
if (y>=x);
>
The 'if' statment in the scripting language doesn't evaluate defined variables like this. You need to use the maskout() function to create a grid with missing values where x < y. Something like this:
' d maskout(si,y-x)'
--Jennifer
'set gxout fwrite'
> 'set fwrite data-sorted.dat'
> 'd 'si
> endif
>
>
>
>Please see what kind of error I am facing here in defining variables though it seems okay as variables are defined properly. If someone has script or fortran program to sort data in x,y,z,t which has much higher standard deviation, please help me urgently.
>
>
>Thanks in advance!
>Regards
>Pankaj
>EES, Hokkaido University
>_______________________________________________
>gradsusr mailing list
>gradsusr at gradsusr.org
>http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Jennifer M. Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
111 Research Hall, Mail Stop 2B3
George Mason University
4400 University Drive
Fairfax, VA 22030
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20131216/0050624a/attachment.html
More information about the gradsusr
mailing list