[ncl-talk] reading in netCDF4Classic data where time is UNLIMITED but not leading dimension

Dennis Shea shea at ucar.edu
Thu Jan 21 10:58:03 MST 2016


Hi Mar,

To my knowledge (DaveB, pls correct me if I am wrong), NCL's addfiles
does not care if a dimension is UNLIMITED or not.

Operators such as 'ncrcat' do require an UNLIMITED dimension. It
facilitates efficient concatenation (appending the 'time' dimension).

FYI: HDF5 and the subset netCDF4 (which, under the hood, is HDF5)
supports *multiple* unlimited dimensions.

---
A sketch ... I must run



dimensions:
        time = UNLIMITED ; // (365 currently)
        yt_ocean = 300 ;
        xt_ocean = 360 ;
        ensemble = 5 ;
        nv = 2 ;
variables:
        float sst(ensemble, time, yt_ocean, xt_ocean) ;

---

    NYRS   = ?
    NTIM    = NYRS*366     ; max # days
    nens     = 5
    ny         = 300
    nx         = 360

    SST = new( (/nens, NDAYS, ny, nx)

   f = addfiles(....)


    do ne=0,nens-1
         SST(ne,:,:,:) = f[:]->sst(ne,:,:,:)

    end do


HTH
D

On Thu, Jan 21, 2016 at 10:36 AM, David Brown <dbrown at ucar.edu> wrote:
> Hi Mark,
> It's true that NCL can only concatenate on the leftmost dimension
> currently. It would definitely requirement some development work to
> implement concatenation on an interior dimension. I can definitely see
> the use case for it though.
>  -dave
>
>
> On Wed, Jan 20, 2016 at 8:15 PM,  <Mark.Collier at csiro.au> wrote:
>> Hi
>>
>> I have a set of netCDF files that I would like to process using the addfiles function, however, when time is UNLIMITED but not the leading dimension NCL wants to create a data object with a concatenated leading dimension. I have tried various setfileoption approaches without success. Of course I could rewrite the data with time first, but I am sharing the data with someone who needs it written this way.
>>
>> I’m using ncl/6.3.0 and
>> uname -a
>> Linux raijin4 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 21:19:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>>
>> A ncdump on the first input file gives:
>>
>> netcdf ocean_daily_sst_070101-070112_e1-5 {
>> dimensions:
>>         time = UNLIMITED ; // (365 currently)
>>         yt_ocean = 300 ;
>>         xt_ocean = 360 ;
>>         ensemble = 5 ;
>>         nv = 2 ;
>> variables:
>>         float sst(ensemble, time, yt_ocean, xt_ocean) ;
>>
>> ...
>>
>> Thanks for any advice/solutions,
>> Mark.
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk


More information about the ncl-talk mailing list