Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding date based pruning for ESM #465

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions payu/models/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ def archive(self):
o2i_dst = os.path.join(cice5.restart_path, 'o2i.nc')
shutil.copy2(o2i_src, o2i_dst)

def get_restart_datetime(self, restart_path):
"""Given a restart path, parse the restart files and
return a cftime datetime (for date-based restart pruning)"""
for model in self.expt.models:
if model.model_type == 'mom':
mom_restart_path = os.path.join(restart_path, model.name)
return model.get_restart_datetime(mom_restart_path)

raise NotImplementedError(
'Cannot find mom sub-model: access-esm1.5 date-based '
'restart pruning requires the mom sub-model to '
'determine restart dates'
)

def set_model_pathnames(self):
pass

Expand Down
Loading