Skip to content

Start SCHISM from the hotstart.nc the boundary conditions write - #21

Merged
tomdurrant merged 3 commits into
mainfrom
fix/hotstart-ihot
Oct 8, 2026
Merged

tomdurrant merged 3 commits into
mainfrom
fix/hotstart-ihot

Conversation

@rafa-guedes

Copy link
Copy Markdown
Contributor

With boundary_conditions.hotstart_config enabled, hotstart.nc was written but param.nml kept ihot = 0, so SCHISM cold-started and ignored the file. SCHISMConfig.check_hotstart still looked for data.hotstart, which no longer exists: hotstart generation moved into boundary_conditions.hotstart_config.

Changes

  • check_hotstart now looks at data.boundary_conditions.hotstart_config.
  • When the hotstart is enabled and opt.ihot is not set, it is set to 1: SCHISM starts from the hotstart state with its clock at zero.
  • An ihot of 1 or 2 set by the user is kept.
  • An explicit ihot = 0 together with a hotstart is an error, because SCHISM would ignore the file.
  • docs/hotstart.md explains ihot.

Checks

New tests in tests/unit/test_hotstart_ihot.py. The full suite passes.

check_hotstart looked for data.hotstart, which no longer exists since
hotstart generation moved to boundary_conditions.hotstart_config. So
hotstart.nc was written but ihot stayed 0 and SCHISM cold-started.
The check now uses hotstart_config: it sets opt.ihot=1 when ihot is not
set, keeps 1 or 2, and rejects an explicit ihot=0.
@tomdurrant

Copy link
Copy Markdown
Contributor

Correctness finding: with hotstart_config.enabled=True and nml=NML() (or a Param with opt=None), check_hotstart() returns without setting ihot. NML.update_times() later creates a Param whose ihot remains 0, so SCHISM ignores the generated hotstart. Please reject this unsupported configuration or create/set the required Param/Opt, and add a regression test.

@tomdurrant

Copy link
Copy Markdown
Contributor

Follow-up: fixed in commit 17129b9. Hotstart-enabled configs now create missing NML/Param/Opt groups before setting ihot=1; added absent-group regressions. Targeted tests pass (7 passed); CI is passing.

@tomdurrant
tomdurrant merged commit 830981e into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants