<br>Hi,<br>   I tried with<br> if (rainlow &lt;=aa &amp; aa&lt;rainhigh)<br><br> but didn&#39;t work. Am I mising something?<br><br>thanks in advance.<br><br><br><div class="gmail_quote">On Wed, Mar 11, 2009 at 1:28 PM, Jennifer Adams <span dir="ltr">&lt;<a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div>Try  changing your if statement to: </div><div class="im"><div>if (rainlow &lt;=aa &amp; aa&lt;rainhigh)</div>
</div><div><div>--Jennifer</div><div><div></div><div class="h5"><div><br></div><div>On Mar 11, 2009, at 1:19 PM, John Guhin wrote:</div><br><blockquote type="cite"><br>Hi,<br>    I am trying to use if statement in a grads script... which doesn&#39;t seem to work. I am <br>
attaching  the gs file. iwc is a 3D variable, and rain is 2D variable exactly in the same grids. I am trying to extract iwc when rain is within certain range. The script executes without any error, but the output repeats itself every 20 days. This means that the &quot; if&quot; statement is not working!! Any help would be appreciated. <br>
 <br> &#39;reinit&#39;<br>&#39;c&#39;<br>&#39;open iwc.ctl&#39;<br>&#39;open /rain.ctl&#39;<br>&#39;set gxout fwrite&#39;<br>&#39;set fwrite iwc_ppt_binned.dat&#39;<br><br>lon1=40 ; lon2=180<br>lat1=-20 ; lat2=20<br>undef=-1e+34<br>
 rainlow=0 ; rainhigh=5;<br><br>while(rainhigh&lt;11)<br>t1=1<br>while(t1&lt;21)<br>&#39;set t &#39;t1<br>z1=1<br>while(z1&lt;19)<br>&#39;set z &#39;z1<br>&#39;define aa=24*rain.2(z=1)&#39;<br>if (rainlow &lt;= aa &lt; rainhigh)</blockquote>
</div></div></div><div><div></div><div class="h5"><div><blockquote type="cite"> &#39;d aave(iwc,lon=&#39;lon1&#39;,lon=&#39;lon2&#39;,lat=&#39;lat1&#39;,lat=&#39;lat2&#39;)&#39;<br>else<br>&#39;d aave(iwc*0+&#39;undef&#39;,lon=&#39;lon1&#39;,lon=&#39;lon2&#39;,lat=&#39;lat1&#39;,lat=&#39;lat2&#39;)&#39;<br>
 endif<br>z1=z1+1<br>endwhile<br>t1=t1+1<br>endwhile<br>rainlow=rainlow+5<br>rainhigh=rainhigh+5<br>endwhile<br><br>&#39;close 2&#39;<br>&#39;close 1&#39;<br>&#39;disable fwrite&#39;<br clear="all"><br>-- <br>John Guhin<br>
 </blockquote></div><br></div></div><font color="#888888"><div> <span style="border-collapse: separate; border-spacing: 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-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="">
<span style="border-collapse: separate; border-spacing: 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-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; border-spacing: 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-indent: 0px; text-transform: none; white-space: normal; 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" target="_blank">jma@cola.iges.org</a></div><div><br>
</div><br></span></span></div></span> </div><br></font></div></blockquote></div><br><br clear="all"><br>-- <br>John Guhin<br>