<br>Hi,<br> I tried with<br> if (rainlow <=aa & aa<rainhigh)<br><br> but didn'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"><<a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a>></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 <=aa & aa<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'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 " if" statement is not working!! Any help would be appreciated. <br>
<br> 'reinit'<br>'c'<br>'open iwc.ctl'<br>'open /rain.ctl'<br>'set gxout fwrite'<br>'set fwrite iwc_ppt_binned.dat'<br><br>lon1=40 ; lon2=180<br>lat1=-20 ; lat2=20<br>undef=-1e+34<br>
rainlow=0 ; rainhigh=5;<br><br>while(rainhigh<11)<br>t1=1<br>while(t1<21)<br>'set t 't1<br>z1=1<br>while(z1<19)<br>'set z 'z1<br>'define aa=24*rain.2(z=1)'<br>if (rainlow <= aa < rainhigh)</blockquote>
</div></div></div><div><div></div><div class="h5"><div><blockquote type="cite"> 'd aave(iwc,lon='lon1',lon='lon2',lat='lat1',lat='lat2')'<br>else<br>'d aave(iwc*0+'undef',lon='lon1',lon='lon2',lat='lat1',lat='lat2')'<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>'close 2'<br>'close 1'<br>'disable fwrite'<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>