From 63717d9bb881921894622db6c6a0352ee6b231b3 Mon Sep 17 00:00:00 2001 From: lniu Date: Fri, 17 Sep 2021 11:01:43 +0200 Subject: [PATCH 1/2] fix for do_hosing --- esm_runscripts/coupler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esm_runscripts/coupler.py b/esm_runscripts/coupler.py index b141296..361d9c0 100644 --- a/esm_runscripts/coupler.py +++ b/esm_runscripts/coupler.py @@ -16,6 +16,8 @@ def __init__(self, full_config, name): if "coupling_target_fields" in full_config[self.name]: for restart_file in list(full_config[self.name]["coupling_target_fields"]): self.nb_of_couplings += len(list(full_config[self.name]["coupling_target_fields"][restart_file])) + if full_config['fesom'].get("do_hosing"): + self.nb_of_couplings += 1 if name == "oasis3mct": from . import oasis @@ -23,7 +25,7 @@ def __init__(self, full_config, name): self.norestart = full_config["oasis3mct"].get("norestart", "F") self.coupler = oasis.oasis(self.nb_of_couplings, self.coupled_execs, self.runtime, nnorest=self.norestart, mct_version=full_config["oasis3mct"].get("mct_version", "2.8"), - debug_level=full_config["oasis3mct"].get("debug_level",1), + debug_level=full_config["oasis3mct"].get("debug_level",1), lucia=full_config["oasis3mct"].get("use_lucia", False)) elif name == "yac": from . import yac @@ -269,7 +271,7 @@ def add_couplings(self, full_config): if "coupling_methods" in full_config[self.name]: if interpolation in full_config[self.name]["coupling_methods"]: transf_info = full_config[self.name]["coupling_methods"][interpolation] - + self.coupler.add_coupling(lefts, lgrid_info, rights, rgrid_info, direction_info, transf_info, restart_file, full_config[self.name]["coupling_time_step"], full_config[self.name]["lresume"], export_mode=export_mode) if "coupling_input_fields" in full_config[self.name]: From 86d7d86caddb32874adbc15bd6adcb7e8bccec75 Mon Sep 17 00:00:00 2001 From: Miguel <63242832+mandresm@users.noreply.github.com> Date: Fri, 17 Jun 2022 15:06:03 +0200 Subject: [PATCH 2/2] Update esm_runscripts/coupler.py --- esm_runscripts/coupler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esm_runscripts/coupler.py b/esm_runscripts/coupler.py index 361d9c0..ff39e26 100644 --- a/esm_runscripts/coupler.py +++ b/esm_runscripts/coupler.py @@ -16,7 +16,7 @@ def __init__(self, full_config, name): if "coupling_target_fields" in full_config[self.name]: for restart_file in list(full_config[self.name]["coupling_target_fields"]): self.nb_of_couplings += len(list(full_config[self.name]["coupling_target_fields"][restart_file])) - if full_config['fesom'].get("do_hosing"): + if full_config.get('fesom', {}).get("do_hosing"): self.nb_of_couplings += 1 if name == "oasis3mct": from . import oasis