Skip to content
Open
Changes from 1 commit
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
12 changes: 10 additions & 2 deletions payu/models/cesm_cmeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
"GREGORIAN" : "proleptic_gregorian"
}

restart_error_msg = f"""
Possible cause: model runtime is shorter than the restart write frequency.
Fix:
1. Remove the incomplete restart subdirectory in the archive path
2. Adjust the restart write frequency to be shorter than/equal to the model runtime."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Adjust the restart write frequency to be shorter than/equal to the model runtime."""
2. Adjust the restart write frequency to write a restart at the end of the model run."""

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Unit test is added to confirm error message is delivered when

  1. rpointer file is missing
  2. restart files in pointer are missing


# Add as needed
component_info = {
"mom": {
Expand Down Expand Up @@ -328,7 +334,8 @@ def _collect_restart_files(self, pointer_files):
# rpointer file not exist
if not os.path.exists(pointer):
raise FileNotFoundError(
f"payu: rpointer file {pointer} does not exist!"
f"\nPayu Error: Restart pointer file not found at the end of payu run: {pointer}"
f"{restart_error_msg}"
)

with open(pointer, "r") as f:
Expand All @@ -348,7 +355,8 @@ def _collect_restart_files(self, pointer_files):
continue

raise FileNotFoundError(
f"payu: restart file {target_restart_path} listed in the rpointer file {pointer} does not exist!"
f"\nPayu Error: Restart file {target_restart_path} listed in the rpointer file {pointer} not found."
f"{restart_error_msg}"
)

return sorted(restart_files)
Expand Down
Loading