Fix stale 'ocnice' grid directory references in case creation - #45
Open
manishvenu wants to merge 9 commits into
Open
manishvenu wants to merge 9 commits into
manishvenu wants to merge 9 commits into
Conversation
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.
alperaltuntas
requested changes
Sep 10, 2026
| def get_custom_ice_grid_path(): | ||
| """Return the path to the directory where the custom CICE grid file is to be stored.""" | ||
| custom_grid_path = cvars["CUSTOM_GRID_PATH"].value | ||
| return Path(custom_grid_path) / "sea_ice" |
Member
There was a problem hiding this comment.
Can we set the path to "ice" instead of sea_ice?.
Collaborator
Author
There was a problem hiding this comment.
any concern about land ice?
Rename the custom grid subdirectories to match CIME component naming: ocean -> ocn, sea_ice -> ice, wave -> wav. Applied at every site, not just the accessors -- including the WW3 *.inp glob in case_creator, where a stale name silently copied zero files rather than erroring. Also create the CICE grid directory in _create_notebook_object. The generated notebook calls Topo.write_cice_grid, which (unlike write_ww3_input) does not create parent directories, so a CICE-active case previously failed with FileNotFoundError.
alperaltuntas
requested changes
Sep 11, 2026
alperaltuntas
left a comment
Member
There was a problem hiding this comment.
Below are a couple more line comments. Also, the mom6_forge commit hash doesn't appear to be pointing to a commit that's in the main branch. Could you elaborate on that?
| """Return the path to the directory where the custom ocean grid files are to be stored.""" | ||
| custom_grid_path = cvars["CUSTOM_GRID_PATH"].value | ||
| return Path(custom_grid_path) / "ocnice" | ||
| return Path(custom_grid_path) / "ocn" |
Member
There was a problem hiding this comment.
We now need to update the documentation and the examples where we had ocnice.
| return Path(custom_grid_path) / "ice" | ||
|
|
||
| @staticmethod | ||
| def get_custom_wave_grid_path(): |
Member
There was a problem hiding this comment.
let's rename this function as get_custom_wav_grid_path to be consistent with the other two.
Collaborator
Author
|
Reverted the m6f change, not sure what that was there for. |
Collaborator
Author
|
Do you mind if we bring in mom6_forge main on this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Casecreation writes MOM6/CICE/WW3 grid files into separateocean/sea_ice/wavesubdirectories, but several call sites here still looked for a single combinedocnicedirectory that no longer exists on disk._update_component_grids_xml'socn_direxistence assertion fail unconditionally for every custom-grid case created throughCaseCreator(add_grids_to_ccs_config=Falsepath). TheAssertionErrorwas silently swallowed by the caller's broadexcept Exception, socase.setupnever actually ran and the MOM6 grid namelist section (NIGLOBAL,GRID_CONFIG,GRID_FILE, ...) never got written touser_nl_mom-- the case looked like it was created successfully, but only surfaced as aKeyError: 'NIGLOBAL'much later, atcase.buildtime.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") andget_custom_wave_grid_path()(->"wave"), since CICE's grid file and WW3's.inpfiles live in their own subdirectories, not alongside the ocean grid files.Test plan