From 3ccb2a24966eee70c754c38d4a2e227c3ba2b494 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Tue, 22 Oct 2024 16:08:27 -0500 Subject: [PATCH 1/2] Revert config change in task --- polaris/ocean/tasks/manufactured_solution/__init__.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/polaris/ocean/tasks/manufactured_solution/__init__.py b/polaris/ocean/tasks/manufactured_solution/__init__.py index a689553e1..2c95b634e 100644 --- a/polaris/ocean/tasks/manufactured_solution/__init__.py +++ b/polaris/ocean/tasks/manufactured_solution/__init__.py @@ -71,13 +71,3 @@ def __init__(self, component): self.config.add_from_package( 'polaris.ocean.tasks.manufactured_solution', 'manufactured_solution.cfg') - - def configure(self): - """ - Set omega default config options - """ - super().configure() - config = self.config - model = config.get('ocean', 'model') - if model == 'omega': - config.set('convergence_forward', 'time_integrator', 'RungeKutta4') From b25f885f4eb29f52113ebc507f53ed28c7ad7560 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Tue, 22 Oct 2024 16:08:57 -0500 Subject: [PATCH 2/2] Add namelist change in framework --- polaris/ocean/convergence/forward.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/polaris/ocean/convergence/forward.py b/polaris/ocean/convergence/forward.py index 68c3c15c9..2866853e2 100644 --- a/polaris/ocean/convergence/forward.py +++ b/polaris/ocean/convergence/forward.py @@ -117,7 +117,6 @@ def dynamic_model_config(self, at_setup): section = config['convergence_forward'] time_integrator = section.get('time_integrator') - # dt is proportional to resolution: default 30 seconds per km if time_integrator == 'RK4': dt_per_km = section.getfloat('rk4_dt_per_km') @@ -139,6 +138,16 @@ def dynamic_model_config(self, at_setup): output_interval_str = get_time_interval_string( seconds=output_interval * s_per_hour) + time_integrator_map = dict([('RK4', 'RungeKutta4')]) + model = config.get('ocean', 'model') + if model == 'omega': + if time_integrator in time_integrator_map.keys(): + time_integrator = time_integrator_map[time_integrator] + else: + print('Warning: mapping from time integrator ' + f'{time_integrator} to omega not found, ' + 'retaining name given in config') + replacements = dict( time_integrator=time_integrator, dt=dt_str,