Skip to content

Commit

Permalink
Merge branch 'main' into aod-4-panel
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-richling authored Nov 12, 2024
2 parents 87ce1a4 + b205677 commit 73ae772
Show file tree
Hide file tree
Showing 10 changed files with 1,498 additions and 94 deletions.
8 changes: 4 additions & 4 deletions config_amwg_default_plots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ diag_cam_climo:
# eg. cam.h0 or ocn.pop.h.ecosys.nday1 or hist_str: [cam.h2,cam.h0]
# Only affects timeseries as everything else uses the created timeseries
# Default:
hist_str: cam.h0
hist_str: cam.h0a

#Calculate climatologies?
#If false, the climatology files will not be created:
Expand Down Expand Up @@ -206,7 +206,7 @@ diag_cam_baseline_climo:
# eg. cam.h0 or ocn.pop.h.ecosys.nday1 or hist_str: [cam.h2,cam.h0]
# Only affects timeseries as everything else uses the created timeseries
# Default:
hist_str: cam.h0
hist_str: cam.h0a

#Calculate cam baseline climatologies?
#If false, the climatology files will not be created:
Expand Down Expand Up @@ -343,8 +343,8 @@ diag_mdtf_info:
# Intermediate/output file settings
make_variab_tar: false # tar up MDTF results
save_ps : false # save postscript figures in addition to bitmaps
save_nc : true # save netCDF files of processed data (recommend true when starting with new model data)
overwrite: true # overwrite results in OUTPUT_DIR; otherwise results saved under a unique name
save_nc : false # save netCDF files of processed data (recommend true when starting with new model data)
overwrite: true # overwrite results in OUTPUT_DIR; otherwise results will be saved under a unique name

# Settings used in debugging:
verbose : 3 # Log verbosity level.
Expand Down
8 changes: 4 additions & 4 deletions config_cam_baseline_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ diag_cam_climo:
# eg. cam.h0 or ocn.pop.h.ecosys.nday1 or hist_str: [cam.h2,cam.h0]
# Only affects timeseries as everything else uses the created timeseries
# Default:
hist_str: cam.h0
hist_str: cam.h0a

#Calculate climatologies?
#If false, the climatology files will not be created:
Expand Down Expand Up @@ -290,7 +290,7 @@ diag_cam_baseline_climo:
# eg. cam.h0 or ocn.pop.h.ecosys.nday1 or hist_str: [cam.h2,cam.h0]
# Only affects timeseries as everything else uses the created timeseries
# Default:
hist_str: cam.h0
hist_str: cam.h0a

#Calculate cam baseline climatologies?
#If false, the climatology files will not be created:
Expand Down Expand Up @@ -428,8 +428,8 @@ diag_mdtf_info:
# Intermediate/output file settings
make_variab_tar: false # tar up MDTF results
save_ps : false # save postscript figures in addition to bitmaps
save_nc : true # save netCDF files of processed data (recommend true when starting with new model data)
overwrite: true # overwrite results in OUTPUT_DIR; otherwise results saved under a unique name
save_nc : false # save netCDF files of processed data (recommend true when starting with new model data)
overwrite: true # overwrite results in OUTPUT_DIR; otherwise results will be saved under a unique name

# Settings used in debugging:
verbose : 3 # Log verbosity level.
Expand Down
9 changes: 6 additions & 3 deletions lib/adf_diag.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def call_ncrcat(cmd):
# End if (var in var_diag_list)

# Check if variable has a "lev" dimension according to first file:
has_lev = bool("lev" in hist_file_ds[var].dims)
has_lev = bool("lev" in hist_file_ds[var].dims or "ilev" in hist_file_ds[var].dims)

# Create full path name, file name template:
# $cam_case_name.$hist_str.$variable.YYYYMM-YYYYMM.nc
Expand Down Expand Up @@ -1269,6 +1269,7 @@ def setup_run_mdtf(self):
"""
Create MDTF directory tree, generate input settings jsonc file
Submit MDTF diagnostics.
Returns mdtf_proc for sub-process control (waits for it to finish in run_adf_diag)
"""

Expand Down Expand Up @@ -1345,19 +1346,21 @@ def setup_run_mdtf(self):
if copy_files_only:
print("\t ...Copy files only. NOT Running MDTF")
print(f"\t Command: {mdtf_exe} Log: {mdtf_log}")
return 0
else:
print(
f"\t ...Running MDTF in background. Command: {mdtf_exe} Log: {mdtf_log}"
)
print(f"Running MDTF in background. Command: {mdtf_exe} Log: {mdtf_log}")
with open(mdtf_log, "w", encoding="utf-8") as subout:
_ = subprocess.Popen(
mdtf_proc_var = subprocess.Popen(
[mdtf_exe],
shell=True,
stdout=subout,
stderr=subout,
close_fds=True,
)
return mdtf_proc_var

def move_tsfiles_for_mdtf(self, verbose):
"""
Expand Down Expand Up @@ -1526,4 +1529,4 @@ def my_formatwarning(msg, *args, **kwargs):
return xr.open_dataset(fils[0])
#End if
# End def
########
########
Loading

0 comments on commit 73ae772

Please sign in to comment.