[gradsusr] Difficulties with nested if loop in grads

Dipak Sahu dipakmath at gmail.com
Tue Nov 6 07:58:26 EST 2012


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)
     '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



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


More information about the gradsusr mailing list