<div dir="ltr">From:<br>   <a href="https://stackoverflow.com/questions/28598485/how-to-convert-fixed-size-dimension-to-unlimited-in-a-netcdf-file" target="_blank">https://stackoverflow.com/<wbr>questions/28598485/how-to-<wbr>convert-fixed-size-dimension-<wbr>to-unlimited-in-a-netcdf-file</a><br><div><br><pre>ncks --mk_rec_dmn time_counter <a href="http://myfile.nc" target="_blank">myfile.nc</a> -o <a href="http://myfileunlimited.nc" target="_blank">myfileunlimited.nc</a> <br><br>; mv <a href="http://myfileunlimited.nc" target="_blank">myfileunlimited.nc</a> <a href="http://myfile.nc" target="_blank">myfile.nc</a></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 13, 2017 at 9:42 PM, Laura Fowler <span dir="ltr"><<a href="mailto:laura@ucar.edu" target="_blank">laura@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello:<br>
<br>
I created a bunch of history files but forgot to set Time to<br>
Unlimited. The beginning of each netCDF file looks like this:<br>
<br>
netcdf history_2drad.append.r4.2015-<wbr>11-29_00.00.00 {<br>
<br>
dimensions:<br>
Time = 24 ;<br>
StrLen = 64 ;<br>
nCells = 6488066 ;<br>
<br>
variables:<br>
char xtime(Time, StrLen) ;<br>
        string xtime:units = "YYYY-MM-DD_hh:mm:ss" ;<br>
        string xtime:long_name = "Model valid time" ;<br>
<br>
float acswdnb(Time, nCells) ;<br>
        string acswdnb:units = "W m^{-2}" ;<br>
        string acswdnb:long_name = "accumulated all-sky downward<br>
surface shortwave radiation flux" ;<br>
<br>
etc ....<br>
<br>
<br>
But, I actually need the dimensions to look like<br>
Time = UNLIMITED ; // (24 currently)<br>
<br>
<br>
So my question is: Is there an "easy way" that I can modify the Time<br>
dimensions without having to re-create all my files (so would be<br>
really time-consuming)? I tried something like<br>
<br>
begin<br>
f = addfile("<a href="http://file.nc" rel="noreferrer" target="_blank">file.nc</a>","w")<br>
<br>
ntime  = 24<br>
StrLen = 64<br>
nCells = 6488066<br>
<br>
dim_names = (/"Time","StrLen","nCells"/)<br>
dim_sizes = (/ntime,StrLen,nCells/)<br>
dimUnlim  = (/True,False,False/)<br>
filedimdef(f,dim_names,dim_<wbr>sizes,dimUnlim )<br>
end<br>
<br>
but that did not work? I may be missing something. Any hint would be<br>
appreciated.<br>
<br>
Thanks,<br>
Laura<br>
<br>
<br>
<br>
<br>
--<br>
!-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------------<br>
Laura D. Fowler<br>
Mesoscale and Microscale Meteorology Division (MMM)<br>
National Center for Atmospheric Research<br>
P.O. Box 3000, Boulder CO 80307-3000<br>
<br>
e-mail: <a href="mailto:laura@ucar.edu">laura@ucar.edu</a><br>
phone: <a href="tel:303-497-1628" value="+13034971628">303-497-1628</a><br>
<br>
!-----------------------------<wbr>------------------------------<wbr>------------------------------<wbr>--------------------<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>