Skip to content
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
16 changes: 10 additions & 6 deletions lib/adf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def __init__(self, config_file, debug=False):
# End if

# Check if history file path exists:
if any(baseline_hist_locs):
elif baseline_hist_locs and any(baseline_hist_locs):
#Check if user provided
if not baseline_hist_str:
baseline_hist_str = ['cam.h0a']
Expand All @@ -256,7 +256,6 @@ def __init__(self, config_file, debug=False):
base_hist_str = baseline_hist_str[0]
starting_location = Path(baseline_hist_locs)
print(f"\tChecking history files in '{starting_location}'")
file_list = sorted(starting_location.glob("*" + base_hist_str + ".*.nc"))

#Check if the history file location exists
if not starting_location.is_dir():
Expand Down Expand Up @@ -322,10 +321,15 @@ def __init__(self, config_file, debug=False):
print(msg)
eyear_baseline = base_found_eyr

#Grab baseline nickname
base_nickname = self.get_baseline_info('case_nickname')
if base_nickname is None:
base_nickname = data_name
else:
#Neither pre-made time series nor a history file location was provided,
#so years can only come from explicit start_year/end_year config entries.
if (syear_baseline is None) or (eyear_baseline is None):
emsg = f"Unable to determine baseline years for '{data_name}'.\n"
emsg += "\tProvide 'cam_ts_loc' (with 'cam_ts_done'), or 'cam_hist_loc', or "
emsg += "explicit 'start_year' and 'end_year' in the 'diag_cam_baseline_climo' "
emsg += "section of your config file."
self.end_diag_fail(emsg)
#End if

#Grab baseline nickname
Expand Down
Loading