<div dir="ltr"><div><div><div>For concatenation of netCDF files, the &#39;record dimension (here, time) must be unlimited.<br></div>You have a few things out-of-place. Also, you can do better than time steps of 999.<br><br></div><div>I used &#39;ncrcat&#39; ... likely the CDO have some equivalent operator.<br><br></div>See attached ... not tested<br><br></div>Good Luck<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 23, 2015 at 12:40 PM, Frank Rüthrich <span dir="ltr">&lt;<a href="mailto:frank.ruethrich@posteo.de" target="_blank">frank.ruethrich@posteo.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there!<br>
I wonder if anybody of you had success with a similar problem:<br>
<br>
I want to calculate hourly horizontal divergences on 20 pressure levels<br>
for one year.<br>
Dimensions are:[ 8784 &lt;time | unlimited&gt;, 20 &lt;pressure&gt;, 180<br>
&lt;south_north&gt;, 270 &lt;west_east&gt; ]<br>
Unfortunately, reading the entire u and v netCDF-files gives me a memory<br>
error, so i will have to perform the calculation in slices.<br>
I neither can allocate an array to store the divergences and thus:<br>
I will have to append the divergences of the sliced u and v variables<br>
directly to the netCDF file.<br>
<br>
Reading u and v in timeslices and calculating divergences works fine,<br>
but I did not succeed in writing them to a netcdf file so far.<br>
<br>
I guess need somethin like the &quot;ncdf-&gt;div(i:i+999,:,:,:)=DV&quot; in the<br>
below example:<br>
<br>
fu      = addfile (fileu, &quot;r&quot;)<br>
fv      = addfile (filev, &quot;r&quot;)<br>
ncdf     = addfile(fnameout ,&quot;w&quot;)  ; open output netCDF file (already<br>
existing)<br>
filedimdef(ncdf,&quot;time&quot;,-1,True)<br>
TIME   = fu-&gt;time<br>
m=dimsizes(TIME)<br>
do while (i.le.m)<br>
       VARu    =  short2flt(fu-&gt;u(i:i+999,:,:,:))<br>
       VARv    =  short2flt(fv-&gt;v(i:i+999,:,:,:))<br>
       DV    = uv2dvF_Wrap(VARu,VARv)<br>
       ncdf-&gt;div(i:i+999,:,:,:)=DV<br>
       i=i+1000<br>
end do<br>
<br>
I would very much appreciate every idea!<br>
<br>
Cheers,<br>
Frank<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>