ESCOMP / ESCOMP/CTSM

Introduce an accumulator type that triggers at the end of the day

Open
#839 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

This is needed for the upcoming AgSys model, but I'm thinking it may also be important for some existing code (FATES, maybe others):

Currently, 24-hour accumulators accumulate every 24 hours from whenever the run started. If, for example, the run started at 0600Z (i.e., 21600 sec) – the accumulators would accumulate every 24 hours from 0600Z to 0600Z, rather than the typical accumulation from 0Z to 0Z. In many cases, this is probably okay. But this is a problem for code that runs each day based on the is_end_curr_day or is_beg_curr_day trigger; this is the case for the upcoming AgSys crop model, as well (I think) as for FATES: that code assumes that it has up-to-date averages when it runs. (It's probably not terrible if the averages are offset by a portion of a day, but it's not ideal.)

I'd like to introduce an accumulator type that triggers at the end of the day (based on the is_end_curr_day trigger), rather than every 24 hours. I would use this in AgSys's accumulators, and we could also consider changing some of the existing accumulators to use this, or something similar.

I'm thinking of implementing this by introducing a new class that implements two functions: is_end_of_period and is_start_of_period. We'll have two versions of this for now: one that is based on modding nsteps (as is currently done), and another that is based on whether it's the end/beginning of the current day. Then we'll pass an instance of the appropriate class into the initialization routine for each acc field.

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.