<font size=2 face="sans-serif">John,</font><br><font size=2 face="sans-serif">Check the position of your "t1=1"
line. As it is, it would appear to repeat the 20 days once. Did
you intend to put "t1=1" before the outermost while loop?</font><br><font size=2 face="sans-serif">Stephen Mc</font><br><br><br><table width=100%><tr valign=top><td width=40%><font size=1 face="sans-serif"><b>John Guhin <johnguhin@GMAIL.COM></b></font><br><font size=1 face="sans-serif">Sent by: GRADSUSR@LIST.CINECA.IT</font><p><font size=1 face="sans-serif">03/11/2009 03:48 PM</font><table border><tr valign=top><td bgcolor=white><div align=center><font size=1 face="sans-serif">Please respond to<br>GRADSUSR@LIST.CINECA.IT</font></div></table><br><td width=59%><table width=100%><tr valign=top><td><div align=right><font size=1 face="sans-serif">To</font></div><td><font size=1 face="sans-serif">GRADSUSR@LIST.CINECA.IT</font><tr valign=top><td><div align=right><font size=1 face="sans-serif">cc</font></div><td><tr valign=top><td><div align=right><font size=1 face="sans-serif">Subject</font></div><td><font size=1 face="sans-serif">Re: if statement in grads</font></table><br><table><tr valign=top><td><td></table><br></table><br><br><br><font size=3>Hi,</font><br><font size=3> I tried with</font><br><font size=3> if (rainlow <=aa & aa<rainhigh)</font><br><br><font size=3> but didn't work. Am I mising something?</font><br><br><font size=3>thanks in advance.</font><br><br><br><font size=3>On Wed, Mar 11, 2009 at 1:28 PM, Jennifer Adams <</font><a href=mailto:jma@cola.iges.org><font size=3 color=blue><u>jma@cola.iges.org</u></font></a><font size=3>>wrote:</font><br><font size=3>Try changing your if statement to: </font><br><font size=3>if (rainlow <=aa & aa<rainhigh)</font><br><font size=3>--Jennifer</font><br><br><font size=3>On Mar 11, 2009, at 1:19 PM, John Guhin wrote:</font><br><br><br><font size=3>Hi,</font><br><font size=3> I am trying to use if statement in
a grads script... which doesn't seem to work. I am </font><br><font size=3>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. </font><br><br><font size=3> 'reinit'</font><br><font size=3>'c'</font><br><font size=3>'open iwc.ctl'</font><br><font size=3>'open /rain.ctl'</font><br><font size=3>'set gxout fwrite'</font><br><font size=3>'set fwrite iwc_ppt_binned.dat'</font><br><br><font size=3>lon1=40 ; lon2=180</font><br><font size=3>lat1=-20 ; lat2=20</font><br><font size=3>undef=-1e+34</font><br><font size=3>rainlow=0 ; rainhigh=5;</font><br><br><font size=3>while(rainhigh<11)</font><br><font size=3>t1=1</font><br><font size=3>while(t1<21)</font><br><font size=3>'set t 't1</font><br><font size=3>z1=1</font><br><font size=3>while(z1<19)</font><br><font size=3>'set z 'z1</font><br><font size=3>'define aa=24*rain.2(z=1)'</font><br><font size=3>if (rainlow <= aa < rainhigh)</font><br><font size=3>'d aave(iwc,lon='lon1',lon='lon2',lat='lat1',lat='lat2')'</font><br><font size=3>else</font><br><font size=3>'d aave(iwc*0+'undef',lon='lon1',lon='lon2',lat='lat1',lat='lat2')'</font><br><font size=3>endif</font><br><font size=3>z1=z1+1</font><br><font size=3>endwhile</font><br><font size=3>t1=t1+1</font><br><font size=3>endwhile</font><br><font size=3>rainlow=rainlow+5</font><br><font size=3>rainhigh=rainhigh+5</font><br><font size=3>endwhile</font><br><br><font size=3>'close 2'</font><br><font size=3>'close 1'</font><br><font size=3>'disable fwrite'</font><br><br><font size=3>-- </font><br><font size=3>John Guhin</font><br><font size=3 color=#8f8f8f>--</font><br><font size=3 color=#8f8f8f>Jennifer M. Adams</font><br><font size=3 color=#8f8f8f>IGES/COLA</font><br><font size=3 color=#8f8f8f>4041 Powder Mill Road, Suite 302</font><br><font size=3 color=#8f8f8f>Calverton, MD 20705</font><br><a href=mailto:jma@cola.iges.org><font size=3 color=blue><u>jma@cola.iges.org</u></font></a><br><br><br><br><br><br><br><br><font size=3>-- </font><br><font size=3>John Guhin</font><br><br><BR>
<BR>
***************************************************<BR>
The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary. If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.<BR>
***************************************************<BR>