-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What exactly does cdfmoy_freq do for 5d to 1mo averaging? #42
Comments
Hi Willi, I agree, the monthly means from 5d output do not make much sense. That's why I tried to improve
|
If I'm reading the code of
cdfmoy_freq
correctly, there is a bug in how it associates the input periods to target averaging periods if the boundaries of the input periods do not exactly match those of the desired outputs.For the case of
5d
inputs and1mo
outputs, it will do the following (consideringnoleap
here):Based on the month lenghts in
njm
CDFTOOLS/src/cdfmoy_freq.f90
Line 212 in 22e3eb0
nhfri
CDFTOOLS/src/cdfmoy_freq.f90
Line 198 in 22e3eb0
ibox
is calculated:CDFTOOLS/src/cdfmoy_freq.f90
Line 244 in 22e3eb0
The resulting list of full bins per month is (I read this as a floor division, but this may be where I'm wrong)
(/ 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 /)
(eleven sixes and one five for February).Then, the resulting
ibox
is used to construct the iteration that groups input time bins without taking into account the truncation that happened in constructingibox
CDFTOOLS/src/cdfmoy_freq.f90
Line 317 in 22e3eb0
So this will lead to the first 6 bins (Jan-01 to Jan-30) to be counted for the January mean, the following 5 bins (Jan-31 to Feb-24) to go into the February mean, the following 6 bins (Feb-25 to Mar-26) to go into March, ..., and the 65th to 71st bins (Nov-21 to Dec-21) to be counted for December.
The text was updated successfully, but these errors were encountered: