[gradsusr] DEFINE error: Invalid expression
Jennifer Adams
jma at cola.iges.org
Mon Dec 16 08:51:50 EST 2013
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/e15c6e59/attachment.html
More information about the gradsusr
mailing list