Yi-Chih,<br>Again, using "set defval" will probably give you what you want here.<br><br>Jeff Duda<br><br><div class="gmail_quote">On Mon, Nov 14, 2011 at 2:40 PM, Yi-Chih Huang <span dir="ltr"><<a href="mailto:dscpln@gmail.com">dscpln@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br><div><div><br> I want to calculate variable 2 based on the value of some variable as follows. <br><div><br>
When var1 = 100, then var2 = (calculation 1)<br>When var1 != 100, then var2 = (calculation 2)<br>
<br></div>I wrote a .gs script as follows. But the condition rh=100 did not effect. Could anyone reveal what would
be the right command in .gs script to give the condition in which variables are in the
.ctl file? <br><br></div>"malr=dalr*(1+2500000*q/287/tk)/(1+0.622*pow(2500000,2)*q/1004/287/tk/tk)"<div><div><div>"elr=-(tk(z+1)-tk(z-1))/(height(z+1)-height(z-1))"<br>
<br>if (rh=100) then<br> "mai=elr-malr"<br>
else<br>
"mai=0"<br>endif<br>"set gxout shaded"<br>"set cint 1"<br>"d mai"<br><br> Thanks much for your help,<br><font color="#888888"><font color="#888888"><br> Yi-Chih</font></font></div>
</div></div></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Grad student - PhD, Meteorology<br>University of Oklahoma School of Meteorology - Center for Analysis and Prediction of Storms<br><br>