Consider aborting with an error if the user tries to set cisminputfile in a branch run

未关闭
#152 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@billsacks 已经在做这个了。

开始于 2026年10月22日。

  • #153 来自 @billsacks —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
fortran
领域
backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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:

https://github.com/ESCOMP/CISM-wrapper/blob/d6497d2bc254bdfed6dbc876761e2918271ba033/source_glc/glc_InitMod.F90#L286-L287

Incidentally, this is set to branch in some cases, but it doesn't look like this runtype="branch" setting is ever checked:

https://github.com/ESCOMP/CISM-wrapper/blob/d6497d2bc254bdfed6dbc876761e2918271ba033/drivers/cpl/nuopc/glc_comp_nuopc.F90#L322-L323

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.

主要语言
Fortran
星标
4
派生
18
平均合并
3 天 17 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ESCOMP/CISM-wrapper 的其他 Issue

查看 ESCOMP/CISM-wrapper 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。