From 2c5e8595f939b7e4247525c56d05c3dd826e330d Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Mon, 2 Feb 2026 12:04:26 -0800 Subject: [PATCH 1/6] Use 'not' to change bools or sign of floats --- polaris/ocean/model/mpaso_to_omega.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polaris/ocean/model/mpaso_to_omega.yaml b/polaris/ocean/model/mpaso_to_omega.yaml index 15b5882835..c9a00c6cdd 100644 --- a/polaris/ocean/model/mpaso_to_omega.yaml +++ b/polaris/ocean/model/mpaso_to_omega.yaml @@ -89,7 +89,7 @@ config: - section: debug: Tendencies options: - config_disable_vel_explicit_bottom_drag: BottomDragTendencyEnable + config_disable_vel_explicit_bottom_drag: not BottomDragTendencyEnable - section: bottom_drag: Tendencies @@ -111,6 +111,6 @@ config: - section: eos_linear: [Eos, Linear] options: - config_eos_linear_alpha: DRhoDT + config_eos_linear_alpha: not DRhoDT config_eos_linear_beta: DRhoDS config_eos_linear_densityref: RhoT0S0 From c59083f5697e4c84e67c071006526b118052adb9 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Mon, 2 Feb 2026 12:09:29 -0800 Subject: [PATCH 2/6] Set linear Tref and Sref to 0 --- polaris/ocean/ocean.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/polaris/ocean/ocean.cfg b/polaris/ocean/ocean.cfg index faa5bce94b..05fb08e601 100644 --- a/polaris/ocean/ocean.cfg +++ b/polaris/ocean/ocean.cfg @@ -38,11 +38,11 @@ eos_linear_beta = 0.8 # Equation of state reference density when T and S are the reference values, defaults to mpas-ocean default eos_linear_rhoref = 1000. -# Equation of state reference temperature, defaults to mpas-ocean default -eos_linear_Tref = 5. +# Equation of state reference temperature, defaults to omega default +eos_linear_Tref = 0. -# Equation of state reference salinity, defaults to mpas-ocean default -eos_linear_Sref = 35. +# Equation of state reference salinity, defaults to omega default +eos_linear_Sref = 0. # Options relate to adjusting the sea-surface height or land-ice pressure # below ice shelves to they are dynamically consistent with one another From 250813da0059d4f5fc65c28fc42bcf46799d723b Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Mon, 2 Feb 2026 12:47:20 -0800 Subject: [PATCH 3/6] Update EOS for single_column tests --- polaris/tasks/ocean/single_column/cvmix/forward.yaml | 12 ++++++++---- polaris/tasks/ocean/single_column/forward.py | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/polaris/tasks/ocean/single_column/cvmix/forward.yaml b/polaris/tasks/ocean/single_column/cvmix/forward.yaml index f2a7bd5282..c70faab149 100644 --- a/polaris/tasks/ocean/single_column/cvmix/forward.yaml +++ b/polaris/tasks/ocean/single_column/cvmix/forward.yaml @@ -1,3 +1,11 @@ +ocean: + eos: + config_eos_type: linear + eos_linear: + config_eos_linear_alpha: 0.2 + config_eos_linear_beta: 0.01 + config_eos_linear_Tref: 5.0 + mpas-ocean: time_management: config_run_duration: 0010_00:00:00 @@ -13,9 +21,5 @@ mpas-ocean: config_use_cvmix_kpp: true config_cvmix_kpp_matching: MatchBoth config_cvmix_kpp_interpolationOMLType: cubic - eos: - config_eos_type: linear - eos_linear: - config_eos_linear_beta: 0.01 streams: KPP_testing: {} diff --git a/polaris/tasks/ocean/single_column/forward.py b/polaris/tasks/ocean/single_column/forward.py index ed9c992aea..7bfc5f85ec 100644 --- a/polaris/tasks/ocean/single_column/forward.py +++ b/polaris/tasks/ocean/single_column/forward.py @@ -24,6 +24,7 @@ def __init__( openmp_threads=1, validate_vars=None, task_name='', + update_eos=True, ): """ Create a new test case From b17b1db2e7ae0f11c4379f896f658d5cf4cdccb4 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Mon, 2 Feb 2026 12:50:10 -0800 Subject: [PATCH 4/6] Use 'not' for bool and floats --- polaris/ocean/model/ocean_model_step.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/polaris/ocean/model/ocean_model_step.py b/polaris/ocean/model/ocean_model_step.py index 0d2359787c..01894a97ee 100644 --- a/polaris/ocean/model/ocean_model_step.py +++ b/polaris/ocean/model/ocean_model_step.py @@ -669,5 +669,13 @@ def _map_handle_not( if option.startswith('not '): # a special case where we want the opposite of a boolean value option = option[4:] - value = not value + if isinstance(value, bool): + value = not value + elif isinstance(value, float): + value = -value + else: + raise ValueError( + f"{option}: Cannot apply 'not' to option type " + f'{type(value)}' + ) return option, value From c7fb0dbdc4de1d573f10727180d25297871cd759 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Mon, 2 Feb 2026 12:52:43 -0800 Subject: [PATCH 5/6] Update mpas-o to omega mapping --- polaris/ocean/model/mpaso_to_omega.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/polaris/ocean/model/mpaso_to_omega.yaml b/polaris/ocean/model/mpaso_to_omega.yaml index c9a00c6cdd..5f5a72bd84 100644 --- a/polaris/ocean/model/mpaso_to_omega.yaml +++ b/polaris/ocean/model/mpaso_to_omega.yaml @@ -109,8 +109,13 @@ config: config_eos_type: EosType - section: - eos_linear: [Eos, Linear] + eos_linear: [Eos, Linear] options: config_eos_linear_alpha: not DRhoDT config_eos_linear_beta: DRhoDS config_eos_linear_densityref: RhoT0S0 + +- section: + ocean_constants: VertCoord + options: + config_density0: Density0 From ada1a071a146ab2b3b5af0bb7861ef6605a521bc Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Tue, 3 Feb 2026 11:19:31 -0700 Subject: [PATCH 6/6] WIP: choose EOS settings to maintain BFB --- polaris/ocean/ocean.cfg | 5 +++-- polaris/tasks/ocean/single_column/cvmix/forward.yaml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/polaris/ocean/ocean.cfg b/polaris/ocean/ocean.cfg index 05fb08e601..6a3f26a9dd 100644 --- a/polaris/ocean/ocean.cfg +++ b/polaris/ocean/ocean.cfg @@ -35,8 +35,9 @@ eos_linear_alpha = 0.2 # Equation of state drho/dS, defaults to mpas-ocean default eos_linear_beta = 0.8 -# Equation of state reference density when T and S are the reference values, defaults to mpas-ocean default -eos_linear_rhoref = 1000. +# Equation of state constant term, designed to match mpas-ocean's default linear EOS +# 1000.0 + 0.2 * 5.0 - 0.8 * 35 = 973.0 +eos_linear_rhoref = 973.0 # Equation of state reference temperature, defaults to omega default eos_linear_Tref = 0. diff --git a/polaris/tasks/ocean/single_column/cvmix/forward.yaml b/polaris/tasks/ocean/single_column/cvmix/forward.yaml index c70faab149..0e0b51941f 100644 --- a/polaris/tasks/ocean/single_column/cvmix/forward.yaml +++ b/polaris/tasks/ocean/single_column/cvmix/forward.yaml @@ -4,7 +4,8 @@ ocean: eos_linear: config_eos_linear_alpha: 0.2 config_eos_linear_beta: 0.01 - config_eos_linear_Tref: 5.0 + # 1000.0 + 0.2 * 5 - 0.01 * 35 + eos_linear_rhoref: 1000.65 mpas-ocean: time_management: