Skip to content

Custom WW3 wave grids for custom ocean grids#42

Open
alperaltuntas wants to merge 10 commits into
mainfrom
ww3_changes
Open

Custom WW3 wave grids for custom ocean grids#42
alperaltuntas wants to merge 10 commits into
mainfrom
ww3_changes

Conversation

@alperaltuntas

Copy link
Copy Markdown
Member

Let users choose, in the custom-grid flow, whether WW3 uses a standard wave grid
or reuses the newly created custom ocean grid. Adds a Wave Grid stage with a
WAV_GRID_MODE toggle; when "Custom Ocean Grid" is selected, the WW3 grid-preprocessor
input files (*.inp) are generated from the saved ocean grid via mom6_forge.

Built on a new relevance_condition mechanism so irrelevant stages (e.g. Land/Runoff/Wave
for stub components) are skipped entirely instead of shown as empty boxes.

Changes

  • ProConPy/stage.py: Stage.relevance_condition — irrelevant stages are skipped
    (variables auto-resolved, no UI), and revert() skips back over them. Factored a shared
    condition_holds(); renamed Guard's conditionbranch_condition so the two condition
    concepts read as duals rather than parent/child.
  • stages/grid_stages.py: Wave Grid Mode / Wave Grid / Wave Input Files stages;
    relevance_condition applied to Land and Runoff stages.
  • custom_widget_types/ww3_input_generator.py (new): inline generator that reconstructs
    the grid/topo from the saved ocean files and writes the WW3 *.inp files; reads min_depth
    from the topog attribute so the WW3 land/sea mask matches the ocean mask.
  • case_creator.py: branches on WAV_GRID_MODE — reuse-ocean-grid (legacy coupling +
    copy *.inp) vs. standard wave grid (set WAV_GRID/WAV_DOMAIN_MESH).
  • specs/grid_options.py, widgets/grid_widgets.py, config_vars/grid_vars.py: options,
    widgets, and config vars for the wave grid.
  • Fix: spurious empty "remaining variable(s)" warning when an auto-proceeded stage's OK
    button is clicked; T_REF commits on enter.

Testing

  • Unit/integration/system suites pass (incl. new test_stage_relevance.py,
    test_ww3_coupling.py wave-grid options, and a mom6_forge write_ww3_input round-trip).
  • End-to-end CESM runs (build + submit) confirm both wave modes work in real coupled cases:
    global custom-ocean (custom & standard wave), custom ridge bathymetry (land masking), and
    the full Ridge World example (CAM/CLM/CICE/MOM6/WW3) with custom and standard wave grids.

@alperaltuntas alperaltuntas requested a review from manishvenu June 29, 2026 15:25
@manishvenu

Copy link
Copy Markdown
Collaborator

This closes #33

@manishvenu

manishvenu commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

@alperaltuntas

I got this error on building a case from visualCaseGen with ww3 (custom):

2026-06-29 10:17:44 wav
Create namelist for component ww3
Calling /glade/work/manishrv/installs/cesm3_0_beta08_gui/components/ww3//cime_config/buildnml
Running /glade/work/manishrv/installs/cesm3_0_beta08_gui/components/ww3//cime_config/buildnml
Traceback (most recent call last):
File "/glade/work/manishrv/installs/cesm3_0_beta08_gui/components/ww3//cime_config/buildnml", line 253, in <module>
_main_func()
File "/glade/work/manishrv/installs/cesm3_0_beta08_gui/components/ww3//cime_config/buildnml", line 248, in _main_func
buildnml(case, caseroot, "ww")
File "/glade/work/manishrv/installs/cesm3_0_beta08_gui/components/ww3//cime_config/buildnml", line 182, in buildnml
_prestage_inputs(case)
File "/glade/work/manishrv/installs/cesm3_0_beta08_gui/components/ww3//cime_config/buildnml", line 211, in _prestage_inputs
files = os.listdir(input_dir)
^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/glade/campaign/cesm/cesmdata/inputdata/wav/ww3/grid_inp.huh'

There doesn't seem to be anything in my user_nl_ww3, but the files are written to my ocnice

@alperaltuntas

Copy link
Copy Markdown
Member Author

@manishvenu Could you update to the latest WW3 tags and retry:

main_0.1.0
dev/unified_0.1.0

I think we'll need to update CESM version checking accordingly.

@manishvenu

manishvenu commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

@manishvenu Could you update to the latest WW3 tags and retry:

main_0.1.0 dev/unified_0.1.0

I think we'll need to update CESM version checking accordingly.

Changing to this, passed the namelist build stage with ww3_grid file not found. The mod_def.ww3 file will be created after the build phase., I'll let you know if I get a successful submit

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