ESCOMP / ESCOMP/CTSM

Resetting causes runaccum accumulators to miss an update

Open
#2,586 0 comments 0 reactions 1 assignee Claimed by @samsrabin View on GitHub
bug priority: low
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

### 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` with `if/endif, if/endif` would solve the issue.
https://github.com/ESCOMP/CTSM/blob/a9433779f0ae499d60ad118d2ec331628f0eaaa8/src/main/accumulMod.F90#L683-L690

As 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.