All,<div><br></div><div>I have a GrADS script I use, among other things, to calculate run total precip over my model domain throughout my model run (output format is grib2). I create images of numerous fields on an hourly basis (say 72hrs worth for example), so I produce 72 runtotal precip images. As the script runs and iterates through a loop, my code to calculate the runtotal looks like this:</div>
<div><br></div><div>&#39;define runtotal=sum(apcpsfc.1, t=2, t=&#39;dis_t&#39;)&#39;</div><div>&#39;display runtotal&#39;</div><div><br></div><div>where dis_t is the hour I am currently working on.</div><div><br></div><div>
My script works fine and fast early on, but slows down over time. Naturally, I assume the amount of time it takes to &#39;sum&#39; hours of precip will increase as I get further into my run. However, if I kill and restart my script at an arbitrary time (dis_t=60) for example, this calculation speeds right back up again.   Likewise if I comment out this portion of my script, the rest of my script moves along at the same pace the entire time. I&#39;m thinking some resources aren&#39;t being released properly while the script is running since the problem seems to go away if I kill/restart my script. </div>
<div><br></div><div>Is there a more efficient way to calculate a runtotal than the method shown above?  I&#39;ve been careful to undefine any variables after each iteration of my loop so I don&#39;t think that&#39;s a factor. </div>
<div><br></div><div>Any help would be great!</div><div>Thanks,</div><div>Dan Leins</div>