Hi,
I'd also note that striding through the file this way is extremely inefficient. Unless you've done some rather odd chunking of the input files the read/writes will not
not be contiguous. It would be far better to loop over the j index processing all longitudes at once. If this still requires too mush memory then you may require a double loop. With luck you may be able to use non unit stride in the I direction. Also note that
you don't need to redifine your variables in the loop.
Something like
let v_ij=var_dta
let v_norm=v_ij[GT=tdaily@mod]
...
save/clob/i=1/j=1/ilimits=../jlimits=../file=.. v_norm...
!Save 277 values at once (1385=5*277)
repeat/j=1:596 (repeat/range=1:1385:277/name=s save/app/i=`s`:`s+276`/app/file=.. v_norm...)
If 277 points requires too much memory You can use smaller strides and replace `s+276` by `min(s+stride-1,1385)` in the above.
Cheers,
Russ
From: owner-ferret_users@xxxxxxxx <owner-ferret_users@xxxxxxxx> on behalf of Ansley C. Manke <ansley.b.manke@xxxxxxxx>
Sent: Thursday, 6 February 2020 10:43 AM To: ferret_users@xxxxxxxx <ferret_users@xxxxxxxx> Subject: Re: [ferret_users] Appending output data to a netCDF file in i-dimension The general answer for appending to a file in directions other than time, is to first create the file with the full limits that you want to appear in the file, using /ILIMITS, /JLIMITS, /KLIMITS, in all except the time axis. Then make sure the variable is defined on the same grid, so that when you're writing data at i=1, it's i=1 on the axis, with the same axis names so that it can be appended. The documentattion for /ILIMITS, etc is here, and follow the links there to examples of appending in I, J, or Z.
-Ansley
On 2/5/2020 12:46 PM, Ge Peng - NOAA Affiliate wrote:
|