diff --git a/payu/models/__init__.py b/payu/models/__init__.py index e7f0d0a9..c3b4e971 100644 --- a/payu/models/__init__.py +++ b/payu/models/__init__.py @@ -20,7 +20,7 @@ from payu.models.model import Model index = { - 'access': Access, + 'access': Access, 'access-om2': AccessOm2, 'access-om3': AccessOm3, 'cice': Cice, diff --git a/payu/models/cable.py b/payu/models/cable.py index a908d622..cfd48017 100644 --- a/payu/models/cable.py +++ b/payu/models/cable.py @@ -56,9 +56,14 @@ def set_model_pathnames(self): def setup(self): super(Cable, self).setup() - if os.path.exists(self.restart_calendar_path): - with open(self.restart_calendar_path, 'r') as restart_file: - self.restart_info = yaml.safe_load(restart_file) + if not self.prior_restart_path: + raise RuntimeError( + "Spinup is not yet supported for the CABLE model driver. Please " + "specify the `restart` key in config.yaml." + ) + + with open(self.restart_calendar_path, 'r') as restart_file: + self.restart_info = yaml.safe_load(restart_file) with open(self.cable_nml_path, 'r') as f: nml_template = Template(f.read()) @@ -67,10 +72,7 @@ def setup(self): nml_template.substitute(self.restart_info) ) - if self.prior_restart_path: - self.cable_nml['cable']['spinup'] = False - else: - self.cable_nml['cable']['spinup'] = True + self.cable_nml['cable']['ncciy'] = self.restart_info['year'] # Write modified namelist file to work dir self.cable_nml.write(