<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Christopher,<br>
<br>
How about this, e.g., for the first 10 time steps:<br>
<br>
'set t 1 10'<br>
'define t2mtotal = sum ( tmp2m-273.15, t=1, t+0 )'<br>
'd t2mtotal'<br>
<br>
Jim<br>
<br>
<div class="moz-cite-prefix">On 10/20/15 3:42 AM, Christopher Gilroy
wrote:<br>
</div>
<blockquote
cite="mid:CAFCiPekywDn3AKh8ZM+NxNkB5Qar621pc3vbE=DD4cCsS+6saQ@mail.gmail.com"
type="cite">
<div dir="ltr">Ok, so I know I can 'easily' do this via a massive
if block but I'm trying to avoid that, and I have been. I have a
calculation that will return a unique value depending on which t
it's running on.
<div><br>
</div>
<div>So when I get to t=10 I need to run a calculation on data
contained in t=1, t=2, t=3, etc. t=20 would need to run the
calculation t=1, t=2, t=3, etc up to t=20. The actual value of
of each t would be the same for the entire run if that helps
to understand though.</div>
<div><br>
</div>
<div>So take this horrible example:</div>
<div><br>
</div>
<div>'define t2m = tmp2m-273.15'<br>
</div>
<div>'d t2m+allpreviousforecasthourt2ms'</div>
<div><br>
</div>
<div>Now, the other key is that I don't download all files and
then run in one big loop. I download each file one-by-one and
process one-by-one, in real-time, as they are released.</div>
<div><br>
</div>
<div>A real snippet of how I'm currently achieving this would
look like:</div>
<div><br>
</div>
<div>if (t=2)<br>
</div>
<div>
<div>'set t 2'<br>
</div>
<div>'define t2m06 = tmp2m-273.15'<br>
</div>
<div><br>
</div>
<div>'define t2mtotal= t2m06' <br>
</div>
<div>'d t2mtotal'<br>
</div>
<div>endif</div>
<div><br>
</div>
<div>if (t=3)</div>
<div>
<div>'set t 2'<br>
</div>
<div>'define t2m06 = tmp2m-273.15'<br>
</div>
<div><br>
</div>
</div>
<div>'set t 3'</div>
<div>'define t2m12 = tmp2m-273.15'</div>
<div><br>
</div>
<div>'define t2mtotal= t2m06+t2m12' <br>
</div>
<div>'d t2mtotal'<br>
</div>
<div>endif</div>
</div>
<div><br>
</div>
<div>
<div>if (t=4)</div>
<div>
<div>'set t 2'<br>
</div>
<div>'define t2m06 = tmp2m-273.15'<br>
</div>
<div><br>
</div>
</div>
<div>'set t 3'</div>
<div>'define t2m12 = tmp2m-273.15'</div>
<div><br>
</div>
<div>
<div>'set t 4'</div>
<div>'define t2m18 = tmp2m-273.15'</div>
</div>
<div><br>
</div>
<div>'define t2mtotal= t2m06+t2m12+t2m18' <br>
</div>
<div>'d t2mtotal'<br>
</div>
<div>endif</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>So, whether t2m06 is ran during hour 06, 12, 18, 240, etc
t2m06 is going to be the exact same value. As you can see, the
if blocks get exponentially bigger each t and that's what
concerns me in terms of grads memory limits or if there's
simply a better/faster approach.</div>
<div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</body>
</html>