No. Compounds only work for internal variables and you can't display them. there's a difference between a displayable product/field and an internal variable that is used in calculations.<br><br>If you want to make a field that is the sum of that field in previous times, you'll have to code it like that, but you can do it with a while loop in such a way:<br>
<br>'define product = product(first time)'<br>while (time step counter variable condition is true)<br> product '=' product '-' product'(t-'time step counter variable')'<br>endwhile<br>
<br>'d 'product<br><br>Each time the code goes through the loop, the previous time step of the field will be taken away from the current one, starting with the latest in time.<br><br>Jeff Duda<br><br><div class="gmail_quote">
On Mon, Feb 1, 2010 at 6:55 PM, Jason Snyder <span dir="ltr"><<a href="mailto:jmssnyder@ucdavis.edu">jmssnyder@ucdavis.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>I have a script to produce compound variables:</div>
<div> </div>
<div>'sdfopen <a href="http://uwnd.2001.nc" target="_blank">uwnd.2001.nc</a>'<br>'set gxout shaded'<br>'set t 1'<br>'define U=uwnd'<br>i=1<br>count=1<br>While(i<5)<br> count=count+1<br>
say count<br>
'set t 'i<br> U.count=uwnd<br> i=i+1<br>endwhile<br></div>
<div>the compound variable is U.count. How do I go about producing and displaying compound variables?</div>
<div>What modifications must I make to the script.</div>
<div> </div>
<div>What I want to make a formula that would be like this U(t)=U(t)+U(t-1)+U(t-2). Where t-1 is a time step earlier than t and t-2 is two timesteps earlier than t. I want to have this formula work for steptimes from 1 to say 5 (set t 1 5) How do I go about doing this? Are compound variables event the answer?</div>
<div> </div>
<div>Thanks,</div>
<div> </div><font color="#888888">
<div>Jason</div>
<div> </div>
<div> </div>
</font></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Iowa State University<br>Meteorology Graduate Student<br>3134 Agronomy Hall<br><a href="http://www.meteor.iastate.edu/~jdduda">www.meteor.iastate.edu/~jdduda</a><br>