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>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>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">matt.alonso@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 class="h5"><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><br><br clear="all"><br>-- <br>Eduardo Agosta Scarel<br><br><a href="mailto:eduardo.agosta@conicet.gov.ar">eduardo.agosta@conicet.gov.ar</a><br><a href="mailto:eduardo_agosta@uca.edu.ar">eduardo_agosta@uca.edu.ar</a><br>
</div>