<br><br><div class="gmail_quote">On Thu, Nov 12, 2009 at 11:32 AM, Jason Snyder <span dir="ltr">&lt;<a href="mailto:jmssnyder@ucdavis.edu">jmssnyder@ucdavis.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am trying to make a script that composites pressure values from dates<br>
when OLR values over a certain area (latitude range: 5S to 5N and<br>
longitude: 120E and 120W) are below a certain value.  I tried using this<br>
script and it did not seem to work properly.  What should I do to make<br>
this script so that I can make this script work properly?  Also how can I<br>
composite wind data at specific pressure levels such as 850 mb and 500 mb<br>
based on this script?<br>
&#39;sdfopen <a href="http://olr.day.mean.nc" target="_blank">olr.day.mean.nc</a>&#39;<br>
&#39;sdfopen <a href="http://pres.sfc.1993.nc" target="_blank">pres.sfc.1993.nc</a>&#39;<br>
&#39;set t 6790&#39;<br>
&#39;define presa = 0&#39;<br>
&#39;define number = 0&#39;<br>
count = 6790<br>
while (count &lt; 12267)<br>
  &#39;set t &#39;count<br>
  &#39;define olra = aave(olr,lon=120,lon=240,lat=-5,lat=5)&#39;<br>
  if (olra &lt; 230)<br></blockquote><div><br></div><div>This is not valid. Grads scripting does not have access to defined variables, grads scripts  operate on a separate namespace from the expression parser. However, the bjt extensions have a if() function that could be used to implement this:</div>
<div><br></div><div>ga-&gt; define presb = if(olra&lt;230,pres.2,0.0)</div><div><br></div><div>Function maskout() can accomplished much of the same, but I find the if() syntax easier to read. More information on the bjt extensions here:</div>
<div><br></div><div>    <a href="http://opengrads.org/doc/udxt/libbjt/">http://opengrads.org/doc/udxt/libbjt/</a></div></div><div><br></div><div>    Arlindo</div><div><br></div><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>