Hi Eduardo,<br><br>Forgive me if I'm addressing the wrong issue again but should your if statement have "vmerid >= 5.0" instead of "vmerd >= 5.0"?<br><br>Also, for what it is worth, <a href="mailto:GRADSUSR@list.cineca.it">GRADSUSR@list.cineca.it</a> is the old grad's user list, you can find info about the new one here:<br>
<br><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br><br>Matt<br><br><div class="gmail_quote">On Fri, Apr 2, 2010 at 8:10 AM, Eduardo Agosta Scarel <span dir="ltr"><<a href="mailto:eduardo.agosta@gmail.com">eduardo.agosta@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello Matt and Grads' Users,<div><br></div><div>you are righ and I am sorry for the mistake. I wrote a quick script as an example.</div>
<div><br></div><div>The corrected way is:</div><div><br></div><div><div class="im"><div>j=1</div><div>
i=0</div><div>while (j < 31)</div><div>'set t 27'</div><div>'set lat 0'</div><div>'set lon 0 360'</div><div>'define vmerid=ave(vwnd(t='j'), lat=0, lat=10)'</div><div>v='vmerid'</div>
<div>if (vmerd >= 5.0 & vmerid <= 5.0)</div><div> i=i+1</div><div>endif</div></div><div>j=j+1</div><div>endwhile</div><div><br></div><div>Anyway that is not the problem. </div><div>What I want to do is to evaluate every value obtained for the defined vmerid variable against the thresholds in order to count those cases.</div>
<div><br></div><div>Thank you for your help.</div><div><br></div><div>Eduardo.</div></div><div><br></div><div><br><br><div class="gmail_quote">2010/4/2 Matt Alonso <span dir="ltr"><<a href="mailto:matt.alonso@gmail.com" target="_blank">matt.alonso@gmail.com</a>></span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> I might be missing something but it doesn't look like j will ever be anything other than 1. Is that what you are intending to do? <p>
Sent from my Verizon Wireless BlackBerry</p><hr><div><b>From: </b> Eduardo Agosta Scarel <<a href="mailto:eduardo.agosta@GMAIL.COM" target="_blank">eduardo.agosta@GMAIL.COM</a>>
</div><div><b>Date: </b>Fri, 2 Apr 2010 08:50:23 -0300</div><div><b>To: </b><<a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a>></div><div><b>Subject: </b>if/endif use with defined variables</div>
<div><div></div><div><div><br></div>Hi you all!<div><br></div><div>I am trying to use the values obtained for a defined variable within an if/endif construction, but it appears that the script does not read in fact every value (which must be compared with a certain threshold).</div>
<div><br></div><div>Any suggestion for that?</div><div><br></div><div>I will much appreciate.</div><div><br></div><div>Eduardo.</div><div><br></div><div><br></div><div>PS: E.g. of what I want to do: to count the numbers of days when the defined variable is below or over a threshold:</div>
<div><br></div><div>j=1</div><div>i=0</div><div>while (j < 31)</div><div>'set t 27'</div><div>'set lat 0'</div><div>'set lon 0 360'</div><div>'define vmerid=ave(vwnd(t='j'), lat=0, lat=10)'</div>
<div>v='vmerid'</div><div>if (vmerd >= 5.0 & vmerid <= 5.0)</div><div> i=i+1</div><div>endif</div><div>enwhile</div><div><br></div><div><br clear="all"><br>-- <br><br><a href="mailto:eduardo.agosta@conicet.gov.ar" target="_blank">eduardo.agosta@conicet.gov.ar</a><br>
<a href="mailto:eduardo_agosta@uca.edu.ar" target="_blank">eduardo_agosta@uca.edu.ar</a><br>
</div>
</div></div></blockquote></div></div></div><br><br clear="all"><br>-- <br><font color="#888888">Eduardo Agosta Scarel<br></font><div class="im"><br><a href="mailto:eduardo.agosta@conicet.gov.ar" target="_blank">eduardo.agosta@conicet.gov.ar</a><br>
<a href="mailto:eduardo_agosta@uca.edu.ar" target="_blank">eduardo_agosta@uca.edu.ar</a><br>
</div></div>
</blockquote></div><br>