ESCOMP / ESCOMP/CTSM

Try to rework atm2lndType initialization to follow the typical pattern

Open
#70 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-10-26 13:55:27 -0600**
**Bugzilla Id:** [2527](http://bugz.cgd.ucar.edu/show_bug.cgi?id=2527)
**Bugzilla CC:** andre@ucar.edu, erik@ucar.edu, rfisher@ucar.edu,

Motivated by bug 2526:

I noticed that the initialization code in atm2lndType doesn't follow the typical CLM pattern. Specifically, initAllocate initializes these variables to 0, then initHistory can overwrite these 0s with spval; there is no initCold. Typically, initAllocate would set these to NaN, and there would be an initCold after initHistory.

We should try to bring this more in line with the typical pattern. One reason to do this is to prevent accidental behavior changes that arise simply from adding or removing a history field (and thus by adding or removing the setting to spval).

I hope this won't change answers... but I am worried it might. If it does change answers, this likely suggests that some spval's have been leaking into the code where they shouldn't, maybe due to accumulator variables (see also bug 2526).

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.