I have files with monthly data only for September, October and November (filtered in a previous step) and I want to compute seasonal averages (one value for each trimester of each year). I'm using ncra --mro -d time,,,3,3
(average on the record dimension, from start to finish, jumping every tree records and each subcycle is 3 records) but the result is not an average of the tree months but just the value of each September.
I can confirm that by using ncks -d time,,,3
to select only the first month of each year (September in my case) and when I read both results using an external tool, they are exactly the same.
Here are the commands that I ran along with comments on the results. All the files can be here.
# Try to make a seasonal average from the orignal file
# It gets :
# ncra: WARNING Subcycle argument is only supported for the record dimension on ncra and ncrcat operations
ncra --mro -d time,,,3,3 original.nc4 average.nc4
# Select only the first month of the season
ncks -d time,,,3 original.nc4 sampled.nc4
# When I read both files (using an external tool) I see that both files are identical. That is,
# the first command didn't actually compute an average, it just selected the first value
# of each season.
# Perhaps it's related to the warning about the record dimension.
# Ok, let's make sure time is a record dimension I guess?
ncks --mk_rec_dmn time original.nc4 record.nc4
# And now again try to compute seasonal average
ncra --mro -d time,,,3,3 record.nc4 record_average.nc4
# Now this new file is too small (77kb vs 928kb) and I cannot read it with any tool
ncks --version
returns:
NCO netCDF Operators version "4.6.3" built by buildd on binet at Dec 23 2016 22:34:40
ncks version "4.6.3"