[Dart-dev] DART/branches Revision: 12674
dart at ucar.edu
dart at ucar.edu
Mon Jun 18 10:56:34 MDT 2018
raeder at ucar.edu
2018-06-18 10:56:34 -0600 (Mon, 18 Jun 2018)
56
These CESM files no longer need to be modified by DART.
Deleted: DART/branches/recam/models/cam-fv/shell_scripts/cesm2_0/case_st_archive.py
===================================================================
--- DART/branches/recam/models/cam-fv/shell_scripts/cesm2_0/case_st_archive.py 2018-06-18 16:54:01 UTC (rev 12673)
+++ DART/branches/recam/models/cam-fv/shell_scripts/cesm2_0/case_st_archive.py 2018-06-18 16:56:34 UTC (rev 12674)
@@ -1,455 +0,0 @@
-"""
-short term archiving
-"""
-
-import shutil, glob, re, os
-
-from CIME.XML.standard_module_setup import *
-from CIME.case_submit import submit
-from CIME.XML.env_archive import EnvArchive
-from CIME.utils import append_status
-from os.path import isdir, join
-
-logger = logging.getLogger(__name__)
-
-###############################################################################
-def _get_datenames(case):
-###############################################################################
-
- logger.debug('In get_datename...')
- rundir = case.get_value('RUNDIR')
- expect(isdir(rundir), 'Cannot open directory %s ' % rundir)
- casename = case.get_value("CASE")
- files = sorted(glob.glob(os.path.join(rundir, casename + '.cpl.r*.nc')))
- if not files:
- expect(False, 'Cannot find a %s.cpl.r.*.nc file in directory %s ' % (casename, rundir))
- datenames = []
- for filename in files:
- names = filename.split('.')
- datename = names[-2]
- datenames.append(datename)
- logger.debug('cpl dateName: %s ' % datename)
- return datenames
-
-
-###############################################################################
-def _get_ninst_info(case, compclass):
-###############################################################################
-
- if compclass != 'cpl':
- ninst = case.get_value('NINST_' + compclass.upper())
- else:
- ninst = 1
- ninst_strings = []
- if ninst is None:
- ninst = 1
- for i in range(1,ninst+1):
- if ninst > 1:
- ninst_strings.append('_' + '%04d' % i)
-# KDR This doesn't do what's intended. The result is ninst_strings is not empty.
-# It has "''" in it. Leave it for now, since _archive_restarts does what I need it too.
-## else:
-## ninst_strings.append('')
-
- logger.debug("ninst and ninst_strings are: %s and %s for %s" %(ninst, ninst_strings, compclass))
- return ninst, ninst_strings
-
-
-###############################################################################
-def _archive_rpointer_files(case, archive, archive_entry, archive_restdir,
- datename, datename_is_last):
-###############################################################################
-
- # archive the rpointer files associated with datename
- casename = case.get_value("CASE")
- compclass = archive.get_entry_info(archive_entry)[1]
- ninst_strings = _get_ninst_info(case, compclass)[1]
-
- if datename_is_last:
- # Copy of all rpointer files for latest restart date
- rundir = case.get_value("RUNDIR")
- rpointers = glob.glob(os.path.join(rundir, 'rpointer.*'))
- for rpointer in rpointers:
- shutil.copy(rpointer, os.path.join(archive_restdir, os.path.basename(rpointer)))
- else:
- # Generate rpointer file(s) for interim restarts for the one datename and each
- # possible value of ninst_strings
- if case.get_value('DOUT_S_SAVE_INTERIM_RESTART_FILES'):
-
- # parse env_archive.xml to determine the rpointer files
- # and contents for the given archive_entry tag
- rpointer_items = archive.get_rpointer_contents(archive_entry)
-
- # loop through the possible rpointer files and contents
- for rpointer_file, rpointer_content in rpointer_items:
-
- # put in a temporary setting for ninst_strings if they are empty
- # in order to have just one loop over ninst_strings below
- if rpointer_content is not 'unset':
- if not ninst_strings:
- ninst_strings = ["empty"]
- for ninst_string in ninst_strings:
- if ninst_string == 'empty':
- ninst_string = ""
- for key, value in [('$CASE', casename),
- ('$DATENAME', datename),
- ('$NINST_STRING', ninst_string)]:
More information about the Dart-dev
mailing list