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

Add check in case MDTF is missing in config yaml file #345

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all 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
13 changes: 8 additions & 5 deletions run_adf_diag
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ if __name__ == "__main__":
#Call the MDTF:
if diag.get_mdtf_info('mdtf_run'):
mdtf_proc = diag.setup_run_mdtf() #returns mdtf_proc for subprocess control
else:
mdtf_proc = None

#Create model climatology (climo) files.
#This call uses the "time_averaging_scripts" specified
Expand Down Expand Up @@ -194,11 +196,12 @@ if __name__ == "__main__":
diag.create_website()

# Check if sub-processes are still running (CVDP, MDTF)
mdtf_status = mdtf_proc.wait(timeout=None)
if (mdtf_status != 0):
print(f"ERROR: MDTF finished with code {mdtf_status}")
else:
print("MDTF finished successfully")
if mdtf_proc:
mdtf_status = mdtf_proc.wait(timeout=None)
if (mdtf_status != 0):
print(f"ERROR: MDTF finished with code {mdtf_status}")
else:
print("MDTF finished successfully")

#+++++++++++++++
#End diag script
Expand Down
Loading