Pauli
Pauli

Reputation: 180

How should I use CDO selyear? I get an output file four times larger

CDO seems to work fine for me, until I met this. I have a netcdf of daily data from year 2101 to 2228, and I want to obtain a file with only years from 2101 to 2227, so I run:

cdo selyear,2101/2227 in.nc out.nc

But the output file is more than four times the input in memory size! It seems to have the right number of time steps, and the initial and end date are correct. Also, latitude and longitude seem to be the same as the input, so I wonder why the file size.

Upvotes: 3

Views: 6943

Answers (1)

ClimateUnboxed
ClimateUnboxed

Reputation: 8077

Perhaps try to retain the compression with the cdo operator and output netcdf 4

cdo -f nc4c -z zip_9 selyear,2101/2227 in.nc out.nc

This is the maximum compression, usually I use zip_5 or so, as the files are not much larger than zip_9 and the command is much faster.

An alternative is to (re?)pack the data to SHORTS with add_offset and scale_factor like this:

cdo pack -selyear,2101/2227 in.nc out.nc

Upvotes: 5

Related Questions