<div dir="ltr">Unless you're running OpenGrads, if statements do not work on fields. IF statements in scripts only apply to script variables.<div><br></div><div>The field analogy to the IF statement is to use a combination of const() and maskout(), usually nested. Your example would be converted into</div><div><br></div><div>d maskout(tmp2m,5-tmp2m)</div><div><br></div><div>Jeff Duda</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 26, 2015 at 2:54 PM, Christopher Gilroy <span dir="ltr"><<a href="mailto:chris.gilroy@gmail.com" target="_blank">chris.gilroy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey guys, I don't believe IF statements are meant to be used like this which would make sense why it's not working:<div><br></div><div><div>'define maxtemp = max(tmpprs,lev=1000,lev=500)-273.15'</div><div><br></div><div>if ( maxtemp <= 5 )</div><div>'d tmp2m'</div><div>endif</div><div><br></div><div>That expectation would have been to only plot tmp2m where maxtemp <= 5.</div><div><br></div><div>As I said, I don't think it's as easy/designed to use IF statements like this? I think I may have to do something with const and maskout in order to do something like this?</div>
</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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br></div>
</div>