<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 6, 2012, at 7:58 AM, Dipak Sahu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Dear Friends <br>&nbsp;&nbsp;&nbsp;&nbsp; I am facing some problem with <b>nested if </b>loop in grads. I want to write different calculations for different logical expressions in grads using <b>"if...else"</b> loop. My problems are like below<br>

<br>'open file.ctl'<br>prompt 'Enter time t1:'<br>pull t1<br>'set t ' t1<br>if ( t1 &lt;=13)<br>&nbsp;&nbsp;&nbsp; 'd expression'<br>endif<br>if (13 &lt; t1 &lt;=25)<br></div></blockquote>This line and others like it should be:</div><div>&nbsp; if (13 &lt; t1 &amp; t1 &lt;= 25)</div><div>See if that fixes things.&nbsp;</div><div>--Jennifer</div><div><br><blockquote type="cite"><div dir="ltr">&nbsp;&nbsp;&nbsp;&nbsp; 'd expression1'<br>endif<br>

if (25 &lt; t1 &lt;=37)<br>&nbsp; 'd&nbsp; expression2'<br>endif<br>if (37 &lt; t1 &lt;=49)<br>&nbsp; 'd&nbsp; expression3'<br>endif<br>if (49 &lt; t1 &lt;=61)<br>&nbsp;&nbsp; 'd&nbsp; expression4'<br>endif<br><br>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.<br>

<br>Thanks and welcome for your suggestions<br><br>Dipak Sahu<br>Centre for Atmospheric Sciences<br>IIT Delhi, India<br><br><br clear="all"><br>-<br>
</div>
_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span>
</div>
<br></body></html>