<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.17080" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=856012915-22102010></SPAN><SPAN
lang=en-ca><FONT face=Arial><FONT color=#0000ff><FONT size=2>B<SPAN
class=856012915-22102010>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
class=856012915-22102010></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV><SPAN lang=en-ca><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=856012915-22102010>cheers</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN lang=en-ca><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=856012915-22102010></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV><SPAN lang=en-ca><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=856012915-22102010>ron</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><BR></DIV></SPAN><SPAN lang=en-us></SPAN><SPAN
lang=en-ca></SPAN>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> gradsusr-bounces@gradsusr.org
[mailto:gradsusr-bounces@gradsusr.org] <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>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">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">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.
***************************************************
</PRE></BODY></HTML>