1

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?

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
maximusdooku
  • 5,242
  • 10
  • 54
  • 94

2 Answers2

4

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.

Charlie Zender
  • 5,929
  • 14
  • 19
0

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.

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86