Forums » Operator News »
scatter/gather - split and join regular gridded data
Added by Ralf Mueller about 11 years ago
See this thread
Finally I wrote something about these two gems ... let'em shine
Replies (1)
RE: scatter/gather - split and join regular gridded data - Added by Karin Meier-Fleischer over 4 years ago
Update:
the operators scatter and gather have been replaced by distgrid and collgrid.
The operator distgrid distributes a dataset into smaller pieces.
The operator collgrid collects the data of the input files to one output file.
See and ff. https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-1280002.2.11
Example:
Split data file into regions (-distgrid,nx,ny)
cdo -distgrid,3,2 infile.nc infile_parts
Loop: compute the timmean of each file
for f in $(ls infile_parts*.nc); do; cdo -timmean ${f} avg_${f}; done
Collect the regions (-collgrid,nx)
cdo -O -collgrid,3 avg_*.nc outfile.nc