maximusdooku
maximusdooku

Reputation: 5542

How can I concatenate using NCO when one of the dimensions is unlimited?

I have lots of files with the following header:

dimensions:
    grp = 100 ;
    time = UNLIMITED ; // (2184 currently)
    length = 3 ;
    scal = 1 ;
    bands = 2 ;
    midS1AndTime = 52569 ;
    midS2AndTime = 52569 ;
    midT3AndTime = 52569 ;
    t1AndTime = 52569 ;
    t2ndTime = 52569 ;
    t3AndTime = 52569 ;

All the files cover the same time period and I want to concatenate by grp. Basically, each file has 100 grps each.

How can I do this?

Upvotes: 1

Views: 953

Answers (2)

Charlie Zender
Charlie Zender

Reputation: 6352

NCO's ncrcat concatenates files with

ncrcat in*.nc out.nc

Edit: to address the requirement to concatenate by grp instead of time, the user can convert grp to the record coordinate with ncpdq -a grp,time, then use ncrcat as above, then convert back so time is the record coordinate. The manual gives examples.

Upvotes: 4

ClimateUnboxed
ClimateUnboxed

Reputation: 8107

I think you could try using the cat command in CDO for this

cdo cat file_*.nc output.nc

assuming the wild card * picks up the filenames file_001.nc file_002.nc etc

Hope that works for you.

Upvotes: 0

Related Questions