<div dir="ltr">You can&#39;t use underscores in defined array names in Grads.  Change si_avg to something else without the _.<div><br></div><div>Jeff DUda</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Dec 16, 2013 at 8:00 PM, pankaj kumar <span dir="ltr">&lt;<a href="mailto:pankajqumar@yahoo.com" target="_blank">pankajqumar@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:14pt;font-family:times new roman,new york,times,serif">Hi,<br><br>Dear Jennifer and Mahakur,<br><br>Thank you for your reply. I am sorry that instead of abs(), I wrote mod. I have tried your suggestions. However, the error <br>
<br>SET error: Invalid operand<br>  Operand = <br>SET error: Invalid operand<br>  Operand = <br>:<br>:<br>DEFINE error:  Invalid expression.<br><div><br><span></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span>persists. Let me send you my script.</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span><br></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span>&#39;reinit&#39;<br>&#39;open SI-Decadal.ctl&#39;<br><br>&#39;set gxout fwrite&#39;<br>&#39;set fwrite data-sorted.dat&#39;<br><br>t=1<br> while(t&lt;=120)<br>  &#39;set t &#39;t<br><br>   lv=1<br>    while(lv&lt;=15)<br>
     &#39;set lv &#39;lv<br><br>       lt=-90<br>        while(lt&lt;=90)<br>         &#39;set lt &#39;lt<br><br>          ln=0<br>            while(ln&lt;=360)<br>               &#39;set ln &#39;ln<br><br><br>&#39;define si_avg = aave(si,lon=0,lon=360,lat=-90,lat=90)&#39;<br>
&#39;define dv = pow(si_avg-si,2)&#39;<br>&#39;define sd = sqrt(aave(dv,lon=0,lon=360,lat=-90,lat=89))&#39;<br>&#39;define x = 2*sd&#39;<br>&#39;define y =
 abs(si_avg-si)&#39;<br><br>*         if (y&gt;=x);<br>*            &#39;set gxout fwrite&#39;<br>*            &#39;set fwrite data-sorted.dat&#39;<br>            &#39;display maskout(si,si-x)&#39;<br>*         endif<br>
<br>          ln=ln+1<br>         endwhile<br>       lt=lt+1<br>      endwhile<br>    lv=lv+1<br>   endwhile<br> t=t+1<br>endwhile<br><br>&#39;disable fwrite&#39;<br></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br><span></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span>Thank you again for looking into my problem. Now, I am planning to write a fortran program to read netcdf data and solve my problem.</span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span><br></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span>Regards</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span>Pankaj</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span>EES, Hokkaido University<br></span></div><div style="display:block"> <br> <br> <div style="font-family:times new roman,new york,times,serif;font-size:14pt"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt">
 <div dir="ltr"> <font face="Arial"> On Monday, December 16, 2013 10:51 PM, Jennifer Adams &lt;<a href="mailto:jma@cola.iges.org" target="_blank">jma@cola.iges.org</a>&gt; wrote:<br> </font> </div>  <div><div><div><br clear="none">
<div><div>On Dec 16, 2013, at 3:32 AM, pankaj kumar wrote:</div><br clear="none"><blockquote type="cite"><div><div style="font-size:14pt;font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif">
<div><span style="font-family:times new roman,new york,times,serif">Hi,</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><br clear="none">
<span style="font-family:times new roman,new york,times,serif"></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">I am writing a grads script to sort out values which differnece from mean is more than 3 times standard deviation. The netcdf data is spread in x,y,z,t dimesions. Though while loops for x,y,z,t are running well, I get error as below:</span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><br clear="none"><span style="font-family:times new roman,new york,times,serif"></span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">  Operand = lat1 -90<br clear="none">
SET error: Invalid operand<br clear="none">  Operand = lon1 0<br clear="none">SET error: Invalid operand<br clear="none">  Operand = lon1 1<br clear="none">SET error: Invalid operand<br clear="none">  Operand = lon1 2<br clear="none">
:</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">:</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="font-family:times new roman,new york,times,serif">:</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">  Operand = lon1 360<br clear="none">
</span><span style="font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">SET error: Invalid operand</span></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
:</div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">:<br clear="none"><span style="font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif"></span></span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif"></span>DEFINE error:  Invalid expression. <br clear="none">
</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><br clear="none"></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
My script for defining variables are as follows:</div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><br clear="none"><span style="font-family:times new roman,new york,times,serif"></span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">&#39;define si_avg = aave(si,lon=0,lon=360,lat=0,lat=180)&#39;<br clear="none">
&#39;define dv = pow(siavg-si,2)&#39;<br clear="none">&#39;define sd = sqrt(aave(dv,lon=0,lon=360,lat=0,lat=179))&#39;<br clear="none">&#39;define x = 3*sd&#39;</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="font-family:times new roman,new york,times,serif">&#39;define y = mod(si_avg-si)&#39;<br clear="none"></span></div></div></div></blockquote><div><br clear="none"></div>What is the mod() function?</div><div><br clear="none">
<blockquote type="cite"><div><div style="font-size:14pt;font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif"><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="font-family:times new roman,new york,times,serif">         if (y&gt;=x);<br clear="none"></span></div></div></div></blockquote><div><br clear="none"></div>The &#39;if&#39; statment in the scripting language doesn&#39;t evaluate defined variables like this. You need to use the maskout() function to create a grid with missing values where x &lt; y. Something like this:</div>
<div>&#39; d maskout(si,y-x)&#39;</div><div>--Jennifer</div><div><div><br clear="none"></div><div><br clear="none"></div></div><div><div><br clear="none"></div><blockquote type="cite"><div><div style="font-size:14pt;font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif">
<div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">            &#39;set gxout
 fwrite&#39;<br clear="none">            &#39;set fwrite data-sorted.dat&#39;<br clear="none">            &#39;d &#39;si<br clear="none">         endif<br clear="none"></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br clear="none"><span style="font-family:times new roman,new york,times,serif"></span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="font-family:times new roman,new york,times,serif">Please see what kind of error I am facing here in defining variables though it seems okay as variables are defined properly. If someone has script or fortran program to sort data in x,y,z,t
 which has much higher standard deviation, please help me
 urgently.</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><br clear="none"><span style="font-family:times new roman,new york,times,serif"></span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">Thanks in advance!</span></div>
<div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif">Regards</span></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="font-family:times new roman,new york,times,serif">Pankaj</span></div></div><div style="font-style:normal;font-size:18.6667px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="font-family:times new roman,new york,times,serif"><div>
EES, Hokkaido University</div><br clear="none"></span></div></div></div>_______________________________________________<br clear="none">gradsusr mailing list<br clear="none"><a rel="nofollow" shape="rect" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br clear="none">
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br clear="none"></blockquote></div><br clear="none"><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"></span></span><div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"></span></span><div>
--</div><div>Jennifer M. Adams<br clear="none">Center for Ocean-Land-Atmosphere Studies (COLA)<br clear="none">111 Research Hall, Mail Stop 2B3<br clear="none">George Mason University<br clear="none">4400 University Drive<br clear="none">
Fairfax, VA 22030 <div><br clear="none"><br clear="none"></div></div><div><div><br clear="none"></div><br clear="none"></div></div><div><br clear="none">
</div></div><div>
<br clear="none"></div></div></div><br><br></div>  </div> </div>  </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" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>
</div>