ESCOMP / ESCOMP/CTSM

History fields incorrect when set_xxx=0 but the xxx landunit is also set in initCold

Open
#431 14 comments 0 reactions 1 assignee Claimed by @ekluzek View on GitHub
bug science
Dominant language
Fortran
Stars
352
Forks
361
Avg merge
2d 21h
Merged PRs (30d)
7

Description

### Summary of bug

When "set" options are used to hist_addfld InitHist should be after InitCold

### General bug information

**CTSM version you are using:** clm5.0.dev013, but has existed for a long time

**Does this bug cause significantly incorrect results in the model's science?** No (not necessarily)

**Configurations affected:** potentially all output fields that use the "set_*" option in hist_addfld

### Details of bug

This is seen as a problem in issue #426

The calling sequence for initialization is inconsistent sometimes it's

InitCold
InitHist

and sometimes

InitHist
InitCold

When the "set_" variables are used in the call to hist_addfld in InitHist are used, typically that means you should do the InitHist call **after** the InitCold call, because the "set_" option sets certain land-types to a given value, that could be overwritten by the InitCold call. This is fundamentally a design flaw in how the initialization is handled. It would be good to make the code such that the pattern can be consistent for all initialization routines. That would make it easier to detect and the same design pattern could be used throughout the code.

CC @dlawrenncar @billsacks

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.