Skip to content

Commit

Permalink
read runconfig from output_path in collate
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiesquire committed May 25, 2023
1 parent b2e7a16 commit e1bbe27
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions payu/models/cesm_cmeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,16 @@ def __init__(self, expt, name, config):
]

self.realms = ["ocn", "ice", "wav", "atm", "rof", "cpl"]
self.runconfig = None # nuopc.runconfig. Cna't read this yet as work_path hasn't been set
self.runconfig = None # nuopc.runconfig. Can't read this yet as paths haven't necessarily been set
self.components = {} # To be read from nuopc.runconfig
self.rpointers = [] # To be inferred from nuopc.runconfig

def get_runconfig(self, path):
self.runconfig = Runconfig(os.path.join(path, 'nuopc.runconfig'))

def get_components(self):
"""Get components from nuopc.runconfig"""

self.runconfig = Runconfig(os.path.join(self.work_path, 'nuopc.runconfig'))

self.components = {}
self.rpointers = ["rpointer.cpl"]
for realm in self.realms:
Expand Down Expand Up @@ -113,6 +114,7 @@ def setup(self):
super().setup()

# Read components from nuopc.runconfig and copy component configuration files
self.get_runconfig(self.work_path)
self.get_components()
for f_name in self.config_files:
f_path = os.path.join(self.control_path, f_name)
Expand Down Expand Up @@ -233,6 +235,7 @@ def archive(self):
def collate(self):

# .setup is not run when collate is called so need to get components
self.get_runconfig(self.output_path)
self.get_components()

if "mom" in self.components.values():
Expand Down

0 comments on commit e1bbe27

Please sign in to comment.