[gradsusr] variables in .gs scripts

Yi-Chih Huang dscpln at gmail.com
Mon Nov 14 15:40:03 EST 2011


Hello,

    I want to calculate variable 2 based on the value of some variable as
follows.

When var1 = 100, then  var2 =  (calculation 1)
When var1 != 100, then  var2 = (calculation 2)

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?

"malr=dalr*(1+2500000*q/287/tk)/(1+0.622*pow(2500000,2)*q/1004/287/tk/tk)"
"elr=-(tk(z+1)-tk(z-1))/(height(z+1)-height(z-1))"

if (rh=100) then
   "mai=elr-malr"
else
   "mai=0"
endif
"set gxout shaded"
"set cint 1"
"d mai"

    Thanks much for your help,

               Yi-Chih
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111114/4aedeb11/attachment-0003.html 


More information about the gradsusr mailing list