<div dir="ltr"><div>Hi NCLers,</div><div><br></div><div>I have an archive of large grib files. Each grib file contains a month of multiple daily global variables. I use the following script to extract a small part of one variable. The script, which uses addfile in a large loop, runs very fast for the first few months, then begins to slow down substantially. I let it run for a few years, then terminate the job (Ctrl-Z) and re-run the same script. Surprisingly, the new job runs very fast to the month when the previous job was terminated. I wonder why it behaves this way, and what I can do to avoid the slow down problem.</div><div><br></div><div>Have a nice day!</div><div><br></div><div>Ruping</div><div><br></div><div>The script:</div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div>begin</div><div> nday = 12784     ; number of days from Jan 1979 to Dec 2013</div><div> temp = new((/nday, 9, 9/), float)</div><div>;;;;</div><div> t0 = 0</div><div> do yr = 1979, 2013</div><div>   syr = tostring(yr)</div><div>   do mo = 1, 12</div><div>    smo = tostring(mo)</div><div>    print(syr + &quot;-&quot; + smo)</div><div>    fname = syr + &quot;/&quot; + syr + &quot;-&quot; + smo + &quot;.grib&quot;</div><div>    dat = addfile(fname, &quot;r&quot;)</div><div>    mday = getfilevardimsizes(dat, &quot;initial_time0&quot;) - 1</div><div>    i1 = i0 + mday</div><div>    temp(i0:i1, :, :) = (/ dat-&gt;2T_GDS0_SFC(:, 80:88, 146:154) /)</div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2T_GDS0_SFC(mday, 241, 480)</div><div>    i0 = i1 + 1</div><div>   end do</div><div> end do</div><div>end</div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div></div>