Calculating hourly mean using CDO for multiple years
Added by Shafiqah M almost 7 years ago
I need some help in calculating the hourly mean for the netcdf data from a model output using CDO command. Each of the files contains hourly time steps for 23 years. I had already use yhourmean for calculating hourly data in 23 years and it show 8784 time steps but i want the output file just show 24 time steps which are stand for 24 hour. Attached are the example i want my data o be display Thanks in advance
example 24 data.PNG (60.4 KB) example 24 data.PNG | Example |
Replies (1)
RE: Calculating hourly mean using CDO for multiple years - Added by Ralf Mueller almost 7 years ago
Hi!
There is not such operator in CDO since and hourly climatology is pretty unusual IMO. But I can offer you a workaround:
Lets say <ifile>
holds your hourly data of several years, then you can select each our, do a timmean on it and cat all files together afterwards:
for hour in $(seq 1 24);
do cdo -timmean -select,hour=${hour} ifile ${hour}_ifile;
done;
cdo cat *_ifile hourlyClimatology_ifile.nc
depending on the speed of your IO, you might run the for loop in a parallel mode.
hth
ralf