[ncl-talk] set Time to Unlimited

Laura Fowler laura at ucar.edu
Mon Nov 13 21:42:02 MST 2017


Hello:

I created a bunch of history files but forgot to set Time to
Unlimited. The beginning of each netCDF file looks like this:

netcdf history_2drad.append.r4.2015-11-29_00.00.00 {

dimensions:
Time = 24 ;
StrLen = 64 ;
nCells = 6488066 ;

variables:
char xtime(Time, StrLen) ;
        string xtime:units = "YYYY-MM-DD_hh:mm:ss" ;
        string xtime:long_name = "Model valid time" ;

float acswdnb(Time, nCells) ;
        string acswdnb:units = "W m^{-2}" ;
        string acswdnb:long_name = "accumulated all-sky downward
surface shortwave radiation flux" ;

etc ....


But, I actually need the dimensions to look like
Time = UNLIMITED ; // (24 currently)


So my question is: Is there an "easy way" that I can modify the Time
dimensions without having to re-create all my files (so would be
really time-consuming)? I tried something like

begin
f = addfile("file.nc","w")

ntime  = 24
StrLen = 64
nCells = 6488066

dim_names = (/"Time","StrLen","nCells"/)
dim_sizes = (/ntime,StrLen,nCells/)
dimUnlim  = (/True,False,False/)
filedimdef(f,dim_names,dim_sizes,dimUnlim )
end

but that did not work? I may be missing something. Any hint would be
appreciated.

Thanks,
Laura




-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler
Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------


More information about the ncl-talk mailing list