<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Cool will keep this in mind as well - I had been making good
progress with everything until I hit the function for LiftWet. On
plotskew.gs (<a class="moz-txt-link-freetext" href="http://moe.met.fsu.edu/~rhart/software/plotskew.gs">http://moe.met.fsu.edu/~rhart/software/plotskew.gs</a>)
everything there is taken for a single point on a chart - I guess
because I'm trying to use an entire chart section, it's why I'm
having dramas?<br>
<br>
I've got all other functions working perfectly.. here's one for
example:<br>
<br>
function Templcl(temp,dewp)<br>
<br>
*------------------------------------------------------<br>
* Calculate the temp at the LCL given temp & dewp in C<br>
*------------------------------------------------------<br>
<br>
'tempk='temp'+273.15'<br>
'dewpk='dewp'+273.15'<br>
'Parta=1/(dewpk-56)'<br>
'Partb=log(tempk/dewpk)/800'<br>
'Tlcl=(1/(Parta+Partb)+56)-273.15'<br>
return(Tlcl)<br>
<br>
<br>
This is the function I am having trouble with, it basically gets
stuck in the loop and never exits :(<br>
<br>
function LiftWet(startt,startp,endp)<br>
<br>
*--------------------------------------------------------------------<br>
* Lift a parcel moist adiabatically from startp to endp.<br>
* Init temp is startt in C. If you wish to see the parcel's<br>
* path plotted, display should be 1. Returns temp of parcel at
endp.<br>
*--------------------------------------------------------------------<br>
<br>
'temp='startt<br>
'pres='startp<br>
'delp=10'<br>
While (pres >= endp)<br>
'temp=temp-100*delp*'gammaw('temp','pres-delp/2',100)<br>
'pres=pres-delp'<br>
EndWhile<br>
return(temp)<br>
<br>
<br>
I call it by 'define PclTemp='LiftWet('TLcl','PLcl',500) where TLcl
and PLcl work perfectly when I plot those 2 variables by themselves
so I know they are all good. I just have a funny feeling now that I
have hit a brick wall that I cannot get around - which probably
explains why no one else has created a Lifted Index chart. I do hope
I am wrong though<br>
<br>
Cheers, Mike<br>
<br>
<br>
On 2/03/2012 11:24 AM, Arlindo da Silva wrote:
<blockquote
cite="mid:CALz7xZcoesAmzUS=y8pa86MTtrghQu1F3kvKTqq7GT-BUigwzA@mail.gmail.com"
type="cite"><br>
<br>
<div class="gmail_quote">On Thu, Mar 1, 2012 at 11:25 AM, Jeff
Duda <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:jeffduda319@gmail.com">jeffduda319@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
You've confused the different uses of scripting functions vs.
Grads prompt functions. You can only display a variable that
you have defined using the 'define ...' command (note the use
of the quotes signaling that it was defined as if you typed it
in at the Grads prompt). Your use of variable = satvap(...)
with satvap being a script function only is causing Grads to
assume variable is a script variable only, not one that can be
displayed. The reason you get the other error when you put
the other line in quotes is because math_exp is strictly a
script version of the exp function that you would use in the
Grads command prompt. Thus, you would want to change that
line to<br>
<br>
'es = 6.112*exp(17.67*temp/(temp+243.5))'<br>
<br>
in order to display es or define any other variables that
would depend on it.<br>
<br>
</blockquote>
<div><br>
</div>
<div><br>
</div>
<div>This is generally true but if you are using opengrads you
can make the script function satvap() available to the display
command, say</div>
<div><br>
</div>
<div>ga-> d satvap(t1000)</div>
<div> </div>
<div>by putting it in its own file "satvap.gsf" and loading the
corresponding UDXT as described in the <a
moz-do-not-send="true"
href="http://opengrads.org/doc/udxt/gsudf/">gsUDF
documentation</a>. Actually, you could in principle
implemented the lifted index as a gsUDF function.</div>
<div><br>
</div>
<div> Arlindo</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Jeff Duda
<div>
<div class="h5">
<br>
<br>
<div class="gmail_quote">On Thu, Mar 1, 2012 at 7:06 AM,
Mike Manning <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:michael@bsch.au.com" target="_blank">michael@bsch.au.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
everyone,<br>
<br>
I'm using data from the FNMOC model and am trying to
make a function<br>
that calculates Lifted Index. I'm using bits of the
code from the<br>
<a moz-do-not-send="true" href="http://plotskew.gs"
target="_blank">plotskew.gs</a> code. So far I've
got the temperature (celsius) and<br>
dewpoint (celsius) worked out for each level. Now I'm
calculating the<br>
parcel details.. I've pulled some of the functions and
have just been<br>
testing to make sure I'm on the right track. If I
have this code for<br>
example:<br>
<br>
'c'<br>
'reinit'<br>
'open gfs.00z.ctl'<br>
'set t 7'<br>
'set lon 135 155'<br>
'set lat -31 -10'<br>
<br>
'set lev 1000'<br>
't1000mb = TMPprs-273.14'<br>
'define dp1000mb =<br>
t1000mb-((14.55+0.114*t1000mb)*(1-0.01*RHprs)+pow((2.5+0.007*t1000mb)*(1-0.01*RHprs),3)+(15.9+0.117*t1000mb)*pow((1-0.01*RHprs),14))'<br>
<br>
variable = satvap2(t1000mb)<br>
<br>
'd variable'<br>
<br>
function satvap2(temp)<br>
<br>
*---------------------------------------------------------------<br>
* Given temp in Celsius, returns saturation vapor
pressure in mb<br>
*---------------------------------------------------------------<br>
<br>
es=6.112*math_exp(17.67*temp/(temp+243.5))<br>
<br>
return(es)<br>
'quit'<br>
<br>
<br>
<br>
it complains about an error? If I put the code in the
satvap2 function<br>
in single quotes it then says "math_exp" is not a
variable or function"?<br>
I'm a little lost on how to fix this one up if it's
possible.<br>
<br>
Cheers, Mike<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a moz-do-not-send="true"
href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a moz-do-not-send="true"
href="http://gradsusr.org/mailman/listinfo/gradsusr"
target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
</div>
</div>
<font color="#888888">-- <br>
Jeff Duda<br>
Graduate research assistant<br>
University of Oklahoma School of Meteorology<br>
Center for Analysis and Prediction of Storms<br>
<br>
</font><br>
_______________________________________________<br>
gradsusr mailing list<br>
<a moz-do-not-send="true" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a moz-do-not-send="true"
href="http://gradsusr.org/mailman/listinfo/gradsusr"
target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Arlindo da Silva<br>
<a moz-do-not-send="true" href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</body>
</html>