When runaccum accumulators (accumulMod) are reset, their updates for that timestep are skipped. This results in a value of 0 when the accumulated values are extracted.
To me, it would make more sense if the reset took place, then the update. This is how it works for timeavg accumulators.
General bug information
CTSM version you are using: ctsm5.2.007
Does this bug cause significantly incorrect results in the model's science? Incorrect, yes, but probably not "significantly" so.
Brief summary of bug
When
runaccum
accumulators (accumulMod
) are reset, their updates for that timestep are skipped. This results in a value of 0 when the accumulated values are extracted.To me, it would make more sense if the reset took place, then the update. This is how it works for
timeavg
accumulators.General bug information
CTSM version you are using: ctsm5.2.007
Does this bug cause significantly incorrect results in the model's science? Incorrect, yes, but probably not "significantly" so.
Configurations affected: All
Details of bug
Replacing this
if/else/endif
withif/endif, if/endif
would solve the issue. https://github.com/ESCOMP/CTSM/blob/a9433779f0ae499d60ad118d2ec331628f0eaaa8/src/main/accumulMod.F90#L683-L690As an example, here's where the reset, (non-)update and extract take place for
AGDD
: https://github.com/ESCOMP/CTSM/blob/a9433779f0ae499d60ad118d2ec331628f0eaaa8/src/biogeochem/CNDVType.F90#L509-L512