ESCOMP / ESCOMP/CTSM

runaccum accumulation fields shouldn't assume a certain min and max

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

Description

**Bill Sacks < sacks@ucar.edu > - 2017-11-29 16:34:22 -0700**
**Bugzilla Id:** [2541](http://bugz.cgd.ucar.edu/show_bug.cgi?id=2541)
**Bugzilla CC:** rfisher@ucar.edu,

accumulMod.F90 has the following code for runaccum accumulation fields:

accum(nf)%val(beg:end,1) = min(max(accum(nf)%val(beg:end,1) + field(beg:end), 0._r8), 99999._r8)

Note the min & max applications here.

Currently this min & max application is okay, since runaccum is currently only used for GDD-type variables. But this could easily trip someone up who expects this generic infrastructure to truly be generic.

These min & max values should be applied on a field-by-field basis, not in the generic infrastructure. I think it would be best for the min & max values to be applied to the field by the caller, before the call to update_accum_field. However, I could accept specifying min and max values as optional arguments when calling init_accum_field if that were deemed preferable.

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.