Skip to content
Open
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
11 changes: 5 additions & 6 deletions lib/adf_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def get_climo_file(self, case, variablename):
a = self.adf.get_cam_info("cam_climo_loc", required=True) # list of paths (could be multiple cases)
caseindex = (self.case_names).index(case) # the entry for specified case
model_cl_loc = Path(a[caseindex])
return sorted(model_cl_loc.glob(f"{case}_{variablename}_climo.nc"))
fils = sorted(model_cl_loc.glob(f"{case}_{variablename}_climo.nc"))
return fils


# Reference case (baseline/obs)
Expand All @@ -213,13 +214,11 @@ def get_reference_climo_file(self, var):
"""Return a list of files to be used as reference (aka baseline) for variable var."""
if self.adf.compare_obs:
fils = self.ref_var_loc.get(var, None)
return [fils] if fils is not None else None
return [fils] if fils is not None else []
ref_loc = self.adf.get_baseline_info("cam_climo_loc")
# NOTE: originally had this looking for *_baseline.nc
fils = sorted(Path(ref_loc).glob(f"{self.ref_case_label}_{var}_climo.nc"))
if fils:
return fils
return None
return fils

#------------------

Expand Down Expand Up @@ -363,4 +362,4 @@ def get_value_converters(self, case, variablename):





Loading