From 942bc242bd37d335eb2a11faf7f08e446036dd05 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Tue, 22 Sep 2026 18:24:44 -0600 Subject: [PATCH 1/7] set _GRID xml variable for all comps sharing ocn grid --- visualCaseGen/custom_widget_types/case_creator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/visualCaseGen/custom_widget_types/case_creator.py b/visualCaseGen/custom_widget_types/case_creator.py index 892951b..089bb01 100644 --- a/visualCaseGen/custom_widget_types/case_creator.py +++ b/visualCaseGen/custom_widget_types/case_creator.py @@ -946,6 +946,7 @@ def _update_component_grids_xml( if self._wav_uses_custom_ocn_grid(): comps_sharing_ocn_grid.append("WAV") for comp in comps_sharing_ocn_grid: + xmlchange(f"{comp}_GRID", ocn_grid, do_exec, self._is_non_local(), self._out) xmlchange(f"{comp}_NX", cvars["OCN_NX"].value, do_exec, self._is_non_local(), self._out) xmlchange(f"{comp}_NY", cvars["OCN_NY"].value, do_exec, self._is_non_local(), self._out) xmlchange(f"{comp}_DOMAIN_MESH", ocn_mesh.as_posix(), do_exec, self._is_non_local(), self._out) From 6441bb44519beba08c2ca9e0878a284f6aae75ab Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Tue, 22 Sep 2026 20:05:51 -0600 Subject: [PATCH 2/7] switch to new (most) wave coupling --- external/mom6_forge | 2 +- visualCaseGen/custom_widget_types/case_creator.py | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/external/mom6_forge b/external/mom6_forge index 83d40e2..3b2fcf6 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit 83d40e2f63e1daaab3e007e14c3d1e27018209d4 +Subproject commit 3b2fcf6b1a78127063061916729404890546d130 diff --git a/visualCaseGen/custom_widget_types/case_creator.py b/visualCaseGen/custom_widget_types/case_creator.py index 089bb01..eaf6e52 100644 --- a/visualCaseGen/custom_widget_types/case_creator.py +++ b/visualCaseGen/custom_widget_types/case_creator.py @@ -578,7 +578,6 @@ def _apply_all_xmlchanges(self, do_exec): self._apply_lnd_grid_xmlchanges(do_exec) self._apply_ocn_grid_xmlchanges(do_exec) self._apply_runoff_ocn_mapping_xmlchanges(do_exec) - self._apply_wav_coupling_xmlchanges(do_exec) def _apply_lnd_grid_xmlchanges(self, do_exec): @@ -642,16 +641,6 @@ def _wav_uses_custom_ocn_grid(self): ) return not picked_standard_wav_grid - def _apply_wav_coupling_xmlchanges(self, do_exec): - """Use the legacy MOM6-WW3 wave coupling method when the custom ocean grid is reused as - the wave grid.""" - - if cvars["COMP_WAV"].value == "ww3" and self._wav_uses_custom_ocn_grid(): - with self._out: - print(f"{COMMENT}Set wave coupling mode to legacy:{RESET}\n") - xmlchange("MOM6_WW3_CPL_METHOD", "legacy", do_exec, self._is_non_local(), self._out) - - @staticmethod def _calc_cores_based_on_grid( num_points, min_points_per_core = 32, max_points_per_core = 300, ideal_multiple_of_cores_used = 128): """Calculate the number of cores based on the grid size.""" From 8cd3650803b91454fc7cecfb1831c40edc02ed84 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Wed, 23 Sep 2026 21:59:01 -0600 Subject: [PATCH 3/7] create_newcase: abort instead of prompting on pre-existing bld/run dirs --- visualCaseGen/custom_widget_types/case_creator.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/visualCaseGen/custom_widget_types/case_creator.py b/visualCaseGen/custom_widget_types/case_creator.py index eaf6e52..cb6206e 100644 --- a/visualCaseGen/custom_widget_types/case_creator.py +++ b/visualCaseGen/custom_widget_types/case_creator.py @@ -521,6 +521,7 @@ def _run_create_newcase(self, caseroot, compset, resolution, do_exec): + f"--case {caseroot} " + f"--machine {machine} " + "--run-unsupported " + + "--handle-preexisting-dirs a " ) # append pecount if provided: @@ -549,7 +550,9 @@ def _run_create_newcase(self, caseroot, compset, resolution, do_exec): # Run the create_newcase command: if do_exec: - runout = subprocess.run(cmd, shell=True, capture_output=True) + runout = subprocess.run( + cmd, shell=True, capture_output=True, text=True, stdin=subprocess.DEVNULL + ) with self._out: if runout.returncode == 0: print(f"{COMMENT}The create_newcase command was successful.{RESET}\n") @@ -557,6 +560,12 @@ def _run_create_newcase(self, caseroot, compset, resolution, do_exec): print(f"{ERROR}Error creating case.{RESET}\n") print(f"{runout.stderr}\n") if runout.returncode != 0: + if "Aborting by user request" in runout.stderr: + raise RuntimeError( + "Error creating case: a previous case with the same name left its " + "build/run directories behind (see the message above). Remove them, " + "or choose a different case name." + ) raise RuntimeError("Error creating case.") def _apply_all_xmlchanges(self, do_exec): From 965267173d12aec9488824d5ce202fe4d49bd2d0 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Wed, 23 Sep 2026 22:12:01 -0600 Subject: [PATCH 4/7] Tidy console output: INFO logs to stdout, WARNING+ to stderr, no blank line after each xmlchange --- ProConPy/out_handler.py | 28 ++++++++++++++++++- .../custom_widget_types/case_tools.py | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ProConPy/out_handler.py b/ProConPy/out_handler.py index 078521a..315c4b5 100644 --- a/ProConPy/out_handler.py +++ b/ProConPy/out_handler.py @@ -1,11 +1,37 @@ """ Logging Output Handler Module """ import logging +import sys import ipywidgets as widgets logger = logging.getLogger(__name__) +class _NameStrippingFormatter(logging.Formatter): + """Formatter that drops the whitespace some logger names are padded with.""" + + def format(self, record): + name = record.name + record.name = name.strip() + try: + return super().format(record) + finally: + record.name = name + + +def _console_handlers(): + """INFO and below to stdout, WARNING and above to stderr, so that notebooks + (which show stderr on a red background) only flag actual warnings.""" + formatter = _NameStrippingFormatter("%(levelname)s [%(name)s] %(message)s") + to_stdout = logging.StreamHandler(sys.stdout) + to_stdout.addFilter(lambda record: record.levelno < logging.WARNING) + to_stderr = logging.StreamHandler(sys.stderr) + to_stderr.setLevel(logging.WARNING) + for handler in (to_stdout, to_stderr): + handler.setFormatter(formatter) + return [to_stdout, to_stderr] + + class OutHandler(logging.Handler): """Custom logging handler sending logs to an output widget""" @@ -17,7 +43,7 @@ def __init__(self, *args, **kwargs): "border": "1px solid black" } self.out = widgets.Output(layout=layout) - logging.basicConfig(level=logging.DEBUG, datefmt="%I:%M:%S") + logging.basicConfig(level=logging.DEBUG, handlers=_console_handlers()) self.set_verbosity(verbose=False) def emit(self, record): diff --git a/visualCaseGen/custom_widget_types/case_tools.py b/visualCaseGen/custom_widget_types/case_tools.py index cb5bfdb..b227dcc 100644 --- a/visualCaseGen/custom_widget_types/case_tools.py +++ b/visualCaseGen/custom_widget_types/case_tools.py @@ -126,7 +126,7 @@ def xmlchange(var, val, do_exec=True, is_non_local=False, out=None): out = DummyOutput() if out is None else out with out: - print(f"{cmd}\n") + print(cmd) if not do_exec: return From 0291c535b7785d6ddc978cd54a3d1b36cf95d346 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Thu, 24 Sep 2026 09:50:50 -0600 Subject: [PATCH 5/7] bump up mom6_forge --- external/mom6_forge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mom6_forge b/external/mom6_forge index 3b2fcf6..8ae9c23 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit 3b2fcf6b1a78127063061916729404890546d130 +Subproject commit 8ae9c231f7e0d8bc04b256cabc7b36d5558385ad From cbdc88197045972d6943b5761297500b217a6c30 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Thu, 24 Sep 2026 15:41:11 -0600 Subject: [PATCH 6/7] bump up mom6_forge --- external/mom6_forge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mom6_forge b/external/mom6_forge index 8ae9c23..c64720b 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit 8ae9c231f7e0d8bc04b256cabc7b36d5558385ad +Subproject commit c64720b7a324443587e7a991bd463ccf51e1b4df From bd33b984665af616f970fb70eea34779cda275ad Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Fri, 25 Sep 2026 09:39:58 -0600 Subject: [PATCH 7/7] bump up mom6_forge --- external/mom6_forge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/mom6_forge b/external/mom6_forge index c64720b..89d8e67 160000 --- a/external/mom6_forge +++ b/external/mom6_forge @@ -1 +1 @@ -Subproject commit c64720b7a324443587e7a991bd463ccf51e1b4df +Subproject commit 89d8e67a76917a0d212da8db90517a7edc7ab24d