[gradsusr] variables in .gs scripts
Jeff Duda
jeffduda319 at gmail.com
Mon Nov 14 15:49:53 EST 2011
Yi-Chih,
Again, using "set defval" will probably give you what you want here.
Jeff Duda
On Mon, Nov 14, 2011 at 2:40 PM, Yi-Chih Huang <dscpln at gmail.com> wrote:
> 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
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
--
Jeff Duda
Grad student - PhD, Meteorology
University of Oklahoma School of Meteorology - Center for Analysis and
Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111114/997d5572/attachment-0003.html
More information about the gradsusr
mailing list