Skip to content

Fix stale 'ocnice' grid directory references in case creation - #45

Open
manishvenu wants to merge 3 commits into
mainfrom
fix/stale-ocnice-grid-paths
Open

Fix stale 'ocnice' grid directory references in case creation#45
manishvenu wants to merge 3 commits into
mainfrom
fix/stale-ocnice-grid-paths

Conversation

@manishvenu

Copy link
Copy Markdown
Collaborator

Summary

  • CrocoDash's Case creation writes MOM6/CICE/WW3 grid files into separate ocean/sea_ice/wave subdirectories, but several call sites here still looked for a single combined ocnice directory that no longer exists on disk.
  • This made _update_component_grids_xml's ocn_dir existence assertion fail unconditionally for every custom-grid case created through CaseCreator (add_grids_to_ccs_config=False path). The AssertionError was silently swallowed by the caller's broad except Exception, so case.setup never actually ran and the MOM6 grid namelist section (NIGLOBAL, GRID_CONFIG, GRID_FILE, ...) never got written to user_nl_mom -- the case looked like it was created successfully, but only surfaced as a KeyError: 'NIGLOBAL' much later, at case.build time.
  • get_custom_ocn_grid_path() now points at "ocean" (matching where MOM6's supergrid/topo/vgrid/scrip/ESMF-mesh files actually live). Added two new sibling methods, get_custom_ice_grid_path() (-> "sea_ice") and get_custom_wave_grid_path() (-> "wave"), since CICE's grid file and WW3's .inp files live in their own subdirectories, not alongside the ocean grid files.

Test plan

  • Fresh ocean-only `Case()` + `configure_forcings()` + `process_forcings()` now writes the full MOM6 grid section to `user_nl_mom`, and `case.setup`/`case.build` complete successfully (previously failed with `KeyError: 'NIGLOBAL'` at build time).
  • Submitted the resulting case to the real PBS queue on Derecho to confirm the run itself starts.
  • Rebuilt a WW3-active case (custom ocean grid reused as the wave grid) with the fix and confirmed `case.build` succeeds.

CrocoDash's Case creation writes MOM6/CICE/WW3 grid files into separate
ocean/sea_ice/wave subdirectories, but several call sites here still
looked for a single combined "ocnice" directory that no longer exists.
This made _update_component_grids_xml's ocn_dir existence assertion
fail unconditionally for every custom-grid case, which was silently
swallowed by CrocoDash's Case.__init__ -- case.setup never ran, and
MOM6's grid namelist section (NIGLOBAL, GRID_CONFIG, ...) never got
written to user_nl_mom, only surfacing as a KeyError at build time.

get_custom_ocn_grid_path() now points at "ocean"; new
get_custom_ice_grid_path()/get_custom_wave_grid_path() cover CICE's
grid file and WW3's *.inp files, which live in their own subdirectories.
Needed by CrocoDash's process_cice_forcing (extract_forcings/cice.py),
which calls supergrid.expand(n_halo_cells) to grow the CICE grid by a
halo before regridding -- the previously-pinned commit predates that
method entirely. Points at NCAR/mom6_forge#122 (still open upstream;
rebase onto its merge commit once that lands).
manishvenu added a commit to CROCODILE-CESM/CrocoDash that referenced this pull request Aug 7, 2026
visualCaseGen previously looked for a single combined "ocnice" grid
directory that no longer exists (CrocoDash's Case creation writes
ocean/sea_ice/wave separately), which silently broke case.setup for
every custom-grid case -- see ESMCI/visualCaseGen#45. Its embedded
external/mom6_forge was also several months stale and missing
SupergridBase.expand(), needed by process_cice_forcing.
Picks up NCAR/mom6_forge#112 (calendar-arg-chl), merged with the
existing expand() bump. interpolate_and_fill_seawifs() now accepts a
calendar kwarg, matching what CrocoDash's process_chl() has been
passing since CrocoDash#220.
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.

1 participant