[gradsusr] If else in GRADS

Yan Libin zjuyanlibin at 163.com
Tue May 1 10:27:21 EDT 2012


Try maskout function.

Good luck

发自我的 iPad

在 2012-5-1,22:17,Mubashar Dogar <mubashardogar at gmail.com> 写道:

> Dear GrADS users,
> 
> Could you please help me to fix the following problem. I have a file
> with one variable named NAO having different value for each year
> (1980-2002). I have two other constant gridded fields A and B. My NAO
> variable can have positive or negative values varying in between -3
> and 3. I want to calculate a formula in such a way that I need its
> values only when NAO absolute values are greater than 1. For other
> values of NAO, I want that formula to have missing (NAN) values.
> 
> I am trying in the following way but it is not taking abs(NAO) instead
> it is taking all the NAO values.
> 
> 
> **********************************
> Note: My A and B are constant gridded fields.
> NAO is a varying means different value for each year and it is not gridded.
> ***********************************
> Following is my script lines:
> 
> 'set time jan1979 jan2001'
> if ('abs(nao)' >= 1)
> 'define DT=B*nao+A'
> else
> 'define DT=-999'
> endif
> 'd DT'
> 
> 
> I can use while and endwhile to tell each time individually but I
> don't know why it is not considering absolute values of NAO.
> 
> Regards,
> 
> Mubashar
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr





More information about the gradsusr mailing list