Consider aborting with an error if the user tries to set cisminputfile in a branch run
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- fortran
- Domain
- backend
Research direction
Start with the buildnml logic that sets cisminputfile, then read source_glc/glc_InitMod.F90 around the linked lines and check how branch runs handle restart input. The issue proposes aborting when a user override is attempted, but asks whether branch run overrides can be legitimate; clarify that behavior before changing it. Done means branch runs cannot silently initialize from unintended older input, with the behavior verified for the relevant run types.
Written by the indexing model from the issue text.
Description
I'm not positive what the right thing is to do here, but am opening this issue to document a possible failure mode and discuss what should be done.
This emerges from a fully-coupled case run by @gunterl where the model was dying in CTSM at the start of day 2 with the message, "found unexpected non-zero delta mid-year". The problem was that @gunterl created a branch run by cloning the hybrid run that it was branching from, and that hybrid run had set cisminputfile in user_nl_cism, and that setting of cisminputfile was kept in place in the branch run. Although I haven't done a careful diagnosis of how this caused the error, I think I understand what's happening: When the branch run boots up, it initially sends fields to CTSM based on the cpl restart file. But CISM is incorrectly initializing based on the initial conditions in cisminputfile rather than from its restart file. This resets CISM's state to some older initial conditions rather than the correct state for the branch run. Then, when CISM first communicates with the mediator in the run loop - at the end of day 1 - it sends this older state. CTSM sees this change in GLC state at the start of day 2, and this triggers an error condition because CTSM is not expecting to see any area changes mid-year. I'm not positive of this whole sequence of events, but this makes sense to me as a possible chain. If that's right, then note that the abort in CTSM is just a symptom of a bigger issue, which is that CISM was incorrectly re-initialized to the older cisminputfile in this run rather than using the restart file from the case its branching from, which I assume was not intended.
CISM's buildnml has logic that sets cisminputfile to the appropriate CISM restart file in a branch run, but this logic allows the user to override this setting in user_nl_cism. In a restart / continue run, it looks like this cisminputfile setting is ignored, but it looks like the logic for this ignoring is based solely on whether it's a restart / continue run, not a branch run:
Incidentally, this is set to branch in some cases, but it doesn't look like this runtype="branch" setting is ever checked:
It seems like an attempt to override cisminputfile in a branch run is usually a mistake, and so I propose having CISM's buildnml abort with an error if the user tries to do this. I'm not sure the best way to do this. Maybe checking the final cisminputfile against the default value, and aborting if those differ in a branch run? Or are there legitimate cases when a user would want to override cisminputfile in a branch run that need to be allowed? With the current code in CMEPS and CTSM, I believe this will cause problems in any configuration with CTSM, but I suppose could be done in a T compset... but it's not clear to me why you'd want to set up a branch run then.
- Dominant language
- Fortran
- Stars
- 4
- Forks
- 18
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ESCOMP/CISM-wrapper
-
Coupler Updates for Missing AblationPossibly taken @Katetc claimed this 10 days ago. Open
ESCOMP/CISM-wrapper#151 · 1 comment · 1 assignee ·
-
ERI_Ly10.f10_f10_mg37.I1850Clm50SpG.derecho_intel.cism-isostasy_period4 Fail in cism_wrap_3.0.0May be free again @Katetc claimed this 30 days ago, and no pull request is open. Open
ESCOMP/CISM-wrapper#148 · 1 assignee ·
-
Update Externals and Tests for CESM3May be free again @Katetc claimed this 74 days ago, and no pull request is open. Open
ESCOMP/CISM-wrapper#145 · 2 comments · 1 assignee ·
-
Consistency of Isotopes in Surface Mass Balance from CLMMay be free again @Katetc claimed this 247 days ago, and no pull request is open. Open
ESCOMP/CISM-wrapper#136 · 2 comments · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ESCOMP/CISM-wrapper#135 · 1 comment ·
All issues in ESCOMP/CISM-wrapper
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aristocratos/btop#1945 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
boykopovar/AnyPS5#11291 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
stac-utils/stac-fastapi-elasticsearch-opensearch#965 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
Automattic/blocks-engine#3438 ·
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Tencent/teamai-cli#1397 ·
Maintainers usually reply within 1 day