[ncl-talk] set Time to Unlimited

Laura Fowler laura at ucar.edu
Tue Nov 14 08:05:27 MST 2017


Hi Dennis:

Thanks. I really appreciated your help yesterday evening. I was
definitely able to set Time to UNLIMITED on some of my files, but not
on all of them. I think that it is because of the file size. Looks
like nicks worked on the files that were about 15GB but not on files
that were 290GB (outputs from high-resolution runs with MPAS.)

I searched the NCO User's guide for how nicks handles large file sizes
but did not see any specific or shared options. Do you know of any
option that I would need to add? On yellowstone, I loaded nco/4.6.9
with netcdf/4.4.1.1 to handle the netcDF4 file format.

Thanks,
Laura



On Mon, Nov 13, 2017 at 10:32 PM, Dennis Shea <shea at ucar.edu> wrote:
> From:
>
> https://stackoverflow.com/questions/28598485/how-to-convert-fixed-size-dimension-to-unlimited-in-a-netcdf-file
>
> ncks --mk_rec_dmn time_counter myfile.nc -o myfileunlimited.nc
>
> ; mv myfileunlimited.nc myfile.nc
>
>
> On Mon, Nov 13, 2017 at 9:42 PM, Laura Fowler <laura at ucar.edu> wrote:
>>
>> 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
>>
>>
>> !-------------------------------------------------------------------------------------------------------------
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>



-- 
!-------------------------------------------------------------------------------------------------------------
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