Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow short term archiving to work with MPAS files #1334

Merged
merged 4 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions cime/cime_config/acme/config_archive.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<comp_archive_spec compname="mpascice" compclass="ice">
<rest_file_extension>\.rst.*</rest_file_extension>
<hist_file_extension>\.hist.*</hist_file_extension>
<hist_file_extension>\.hist.*\.*\.*\.nc</hist_file_extension>
<rest_history_varname>unset</rest_history_varname>
<rpointer>
<rpointer_file>rpointer.ice</rpointer_file>
Expand All @@ -77,7 +77,7 @@

<comp_archive_spec compname="mpaso" compclass="ocn">
<rest_file_extension>\.rst.*</rest_file_extension>
<hist_file_extension>\.hist.*</hist_file_extension>
<hist_file_extension>\.hist.*\.*\.*\.nc</hist_file_extension>
<rest_history_varname>unset</rest_history_varname>
<rpointer>
<rpointer_file>rpointer.ocn</rpointer_file>
Expand Down
31 changes: 19 additions & 12 deletions cime/utils/python/CIME/case_st_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def _archive_history_files(case, archive, archive_entry,
for i in range(ninst):
if compname == 'dart':
newsuffix = casename + suffix
elif compname.find('mpas') == 0:
newsuffix = compname + '.*' + suffix
else:
if ninst_string:
newsuffix = casename + '.' + compname + ".*" + ninst_string[i] + suffix
Expand Down Expand Up @@ -231,22 +233,27 @@ def _archive_restarts(case, archive, archive_entry,
for suffix in archive.get_rest_file_extensions(archive_entry):
for i in range(ninst):
restfiles = ""
pattern = r"%s\.%s\d*.*" % (casename, compname)
if pattern != "dart":
if compname.find("mpas") == 0:
pattern = compname + suffix + '_'.join(datename.rsplit('-', 1))
pfile = re.compile(pattern)
files = [f for f in os.listdir(rundir) if pfile.search(f)]
if ninst_strings:
pattern = ninst_strings[i] + suffix + datename
restfiles = [f for f in os.listdir(rundir) if pfile.search(f)]
else:
pattern = r"%s\.%s\d*.*" % (casename, compname)
if pattern != "dart":
pfile = re.compile(pattern)
restfiles = [f for f in files if pfile.search(f)]
files = [f for f in os.listdir(rundir) if pfile.search(f)]
if ninst_strings:
pattern = ninst_strings[i] + suffix + datename
pfile = re.compile(pattern)
restfiles = [f for f in files if pfile.search(f)]
else:
pattern = suffix + datename
pfile = re.compile(pattern)
restfiles = [f for f in files if pfile.search(f)]
else:
pattern = suffix + datename
pattern = suffix
pfile = re.compile(pattern)
restfiles = [f for f in files if pfile.search(f)]
else:
pattern = suffix
pfile = re.compile(pattern)
restfiles = [f for f in os.listdir(rundir) if pfile.search(f)]
restfiles = [f for f in os.listdir(rundir) if pfile.search(f)]

for restfile in restfiles:
restfile = os.path.basename(restfile)
Expand Down