Skip to content

Commit

Permalink
Merge pull request #345 from justin-richling/mdtf-fix
Browse files Browse the repository at this point in the history
Add check in case MDTF is missing in config yaml file
  • Loading branch information
justin-richling authored Nov 19, 2024
2 parents 8a0c6aa + c0d97ac commit 16331ef
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit 16331ef

Please sign in to comment.