selmonth vs timselsum
Added by Ilias Moysidis 26 days ago
Hello guys. I wanted to calculate the average number of days per year for which the temperature during spring is over 30 degrees celcius. Logically, I used this cdo chain of commands
cdo timmean -yearsum -selmonth,3,4,5 -expr,'hot=(tasmax-273.15)>30' tasmax__model1.nc tmax_over30_spring.nc
Unfortunately, this was not enough for me and I wanted to cross check my results. To do this I used this cdo chain of commands
cdo timmean -timselsum,92,60 -expr,'hot=(tasmax-273.15)>30' tasmax_model1.nc tmax_over30_spring.nc
There is a huge descrepancy in the results of these two commands, 13 and 35 days. My gut tells me that I did not use timselsum correctly. I am not sure if timselsum skips the first 60 days of the year, keeps the rest 92 of the same year and then repeats for the next year or repeats for the same year.
Can someone give me a definite answer?
Replies (1)
RE: selmonth vs timselsum - Added by Karin Meier-Fleischer 9 days ago
If you want to compare different ways to compute the result you have to take care to use the same number of timesteps. Use the del29feb operator to delete February 29.
1. command
cdo -timmean -yearsum -selmon,3,4,5 -del29feb -expr,'hot=(tasmax-273.15)>30' tasmax__model1.nc tmax_over30_spring_1.nc
2. command
You have to give the number of input timesteps skipped between timestep ranges for timselsum (see https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#page.137).
cdo -timmean -timselsum,92,59,273 -del29feb -expr,'hot=(tasmax-273.15)>30' tasmax__model1.nc tmax_over30_spring_2.nc
I recommend to use the first command line using the selmon operator.