diff --git a/polaris/ocean/model/mpaso_to_omega.yaml b/polaris/ocean/model/mpaso_to_omega.yaml index 15b5882835..5f5a72bd84 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 @@ -109,8 +109,13 @@ config: config_eos_type: EosType - section: - eos_linear: [Eos, Linear] + 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 + +- section: + ocean_constants: VertCoord + options: + config_density0: Density0 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 diff --git a/polaris/ocean/ocean.cfg b/polaris/ocean/ocean.cfg index faa5bce94b..6a3f26a9dd 100644 --- a/polaris/ocean/ocean.cfg +++ b/polaris/ocean/ocean.cfg @@ -35,14 +35,15 @@ 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 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 diff --git a/polaris/tasks/ocean/single_column/cvmix/forward.yaml b/polaris/tasks/ocean/single_column/cvmix/forward.yaml index f2a7bd5282..0e0b51941f 100644 --- a/polaris/tasks/ocean/single_column/cvmix/forward.yaml +++ b/polaris/tasks/ocean/single_column/cvmix/forward.yaml @@ -1,3 +1,12 @@ +ocean: + eos: + config_eos_type: linear + eos_linear: + config_eos_linear_alpha: 0.2 + config_eos_linear_beta: 0.01 + # 1000.0 + 0.2 * 5 - 0.01 * 35 + eos_linear_rhoref: 1000.65 + mpas-ocean: time_management: config_run_duration: 0010_00:00:00 @@ -13,9 +22,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