Skip to content

Commit

Permalink
Generalize _hists_match for mom6 files:
Browse files Browse the repository at this point in the history
- Extend matching to files without datestamps.
- Support matching instance numbers formatted as ._000X.
  • Loading branch information
alperaltuntas committed Aug 19, 2024
1 parent fcb9c6e commit 8c08700
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CIME/hist_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ def _hists_match(model, hists1, hists2, suffix1="", suffix2=""):
: len(normalized_name) - len(suffix) - 1
]

m = re.search("(.+)_[0-9]{4}(.+.nc)", normalized_name)
m = re.search("(.+)_[0-9]{4}(.*.nc)", normalized_name)
if m is not None:
multiinst = True
multi_normalized.append(m.group(1) + m.group(2))
if m.group(1).endswith(".") and m.group(2).startswith("."):
multi_normalized.append(m.group(1) + m.group(2)[1:])
else:
multi_normalized.append(m.group(1) + m.group(2))

normalized.append(normalized_name)

Expand Down

0 comments on commit 8c08700

Please sign in to comment.