Ron,<div>Actually, as I mentioned earlier, you can do it with the "if" UDF, although I don't believe it's part of the official COLA package. It functions similarly to the const and maskout combination, but I find "if" is simpler to use.</div>
<div>Steve Mc<br><br><div class="gmail_quote">On Fri, Oct 22, 2010 at 11:30 AM, Goodson,Ron [Edm] <span dir="ltr"><<a href="mailto:Ron.Goodson@ec.gc.ca">Ron.Goodson@ec.gc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div dir="ltr" align="left"><span></span><span lang="en-ca"><font face="Arial"><font color="#0000ff"><font size="2">B<span>eyond int vs floats .. 'm assuming hgt0deg is some
grid, and you want to set the MinCAPE in the grid .. not some single
point-value. If so, you will have to use a combination of const() and
maskout() to do this .. as shown in the documentation under the const
function</span></font></font></font></span></div>
<div><span lang="en-ca"><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font></span> </div>
<div><span lang="en-ca"><font face="Arial"><font color="#0000ff"><font size="2"><span>cheers</span></font></font></font></span></div>
<div><span lang="en-ca"><font face="Arial"><font color="#0000ff"><font size="2"><span></span></font></font></font></span> </div>
<div><span lang="en-ca"><font face="Arial"><font color="#0000ff"><font size="2"><span>ron</span></font></font></font></span></div>
<div dir="ltr" align="left"><br></div><span lang="en-us"></span><span lang="en-ca"></span>
<div> </div><br>
<div lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>
[mailto:<a href="mailto:gradsusr-bounces@gradsusr.org" target="_blank">gradsusr-bounces@gradsusr.org</a>] <b>On Behalf Of </b>Stephen
McMillan<br><b>Sent:</b> October 22, 2010 9:10 AM<br><b>To:</b> GrADS Users
Forum<br><b>Subject:</b> Re: [gradsusr] Script Problems<br></font><br></div><div><div></div><div class="h5">
<div></div>Andrew,
<div>Is it critical to have the resulting defined field as integers? If
not, you could do something like this, if your GrADS has the "if" conditional
UDF (such as in the opengrads version):</div>
<div><br></div>
<div>'define MinCAPE=1.4*hgt0deg-5400'</div>
<div>'define MinCAPE=if(MinCAPE,<,200,200,MinCAPE)'</div>
<div><br></div>
<div>Then, when you display MinCAPE, all areas < 200 from first define should
show up as 200.</div>
<div><br></div>
<div>Steve Mc<br><br>
<div class="gmail_quote">On Fri, Oct 22, 2010 at 12:08 AM, Andrew Revering <span dir="ltr"><<a href="mailto:andy@f5data.com" target="_blank">andy@f5data.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p class="MsoNormal">This is a simple but annoying problem… I have an equation
in a script…</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">'define MinCAPE = math_int(1.4 * hgt0deg - 5400)'</p>
<p class="MsoNormal">if (MinCAPE < 200) ; MinCAPE = 200 ; endif</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I get an error saying math_int() is not a valid function….
</p>
<p class="MsoNormal">also the whole IF statement is completely ignored. No
matter what I do, I still get negative values for MinCAPE.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">BTW…this is a unconventional method for me to determine if
there is 'enough' CAPE to support a severe thunderstorm given the freezing
level height in case anyone is wondering.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Andrew Revering</p>
<p class="MsoNormal">Convective Development, Inc.</p>
<p class="MsoNormal"><a href="http://www.convectivedevelopment.com/" target="_blank">http://www.convectivedevelopment.com/</a></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p></div></div><br>_______________________________________________<br>gradsusr
mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">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></div></div></div><pre>***************************************************
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.
***************************************************
</pre></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></div>
<pre>***************************************************
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.
***************************************************