[gradsusr] Difficulties with nested if loop in grads

Jennifer Adams jma at cola.iges.org
Tue Nov 6 08:51:24 EST 2012


On Nov 6, 2012, at 7:58 AM, Dipak Sahu wrote:

> Dear Friends 
>      I am facing some problem with nested if loop in grads. I want to write different calculations for different logical expressions in grads using "if...else" loop. My problems are like below
> 
> 'open file.ctl'
> prompt 'Enter time t1:'
> pull t1
> 'set t ' t1
> if ( t1 <=13)
>     'd expression'
> endif
> if (13 < t1 <=25)
This line and others like it should be:
  if (13 < t1 & t1 <= 25)
See if that fixes things. 
--Jennifer

>      'd expression1'
> endif
> if (25 < t1 <=37)
>   'd  expression2'
> endif
> if (37 < t1 <=49)
>   'd  expression3'
> endif
> if (49 < t1 <=61)
>    'd  expression4'
> endif
> 
> But the above format of if...endif loop is not working properly. Is there any other way to write such expressions in GrADS. Please if anybody has any suggestions or solutions to resolve this issue kindly share with me.
> 
> Thanks and welcome for your suggestions
> 
> Dipak Sahu
> Centre for Atmospheric Sciences
> IIT Delhi, India
> 
> 
> 
> -
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20121106/d444329a/attachment-0003.html 


More information about the gradsusr mailing list