diff --git a/scripts/create_newcase b/scripts/create_newcase index e2c3a458e989..70c099a13d6e 100755 --- a/scripts/create_newcase +++ b/scripts/create_newcase @@ -170,7 +170,7 @@ def _main_func(): # Write out the case files case.flush(flushall=True) - if user_mods_dir.startswith(".."): + if user_mods_dir is not None and user_mods_dir.startswith(".."): user_mods_dir = os.path.abspath(user_mods_dir) case.apply_user_mods(user_mods_dir) diff --git a/utils/python/CIME/SystemTests/system_tests_common.py b/utils/python/CIME/SystemTests/system_tests_common.py index 136c47b0c2e6..5158244af8ab 100644 --- a/utils/python/CIME/SystemTests/system_tests_common.py +++ b/utils/python/CIME/SystemTests/system_tests_common.py @@ -223,8 +223,12 @@ def _coupler_log_indicates_run_complete(self): return False def _component_compare_move(self, suffix): - comments = move(self._case, suffix) + success, comments = move(self._case, suffix) append_status(comments, sfile="TestStatus.log") + status = TEST_PASS_STATUS if success else TEST_FAIL_STATUS + with self._test_status: + self._test_status.set_status("%s_%s_%s" % (COMPARE_PHASE, suffix1, suffix2), status) + return success def _component_compare_test(self, suffix1, suffix2): """ diff --git a/utils/python/CIME/hist_utils.py b/utils/python/CIME/hist_utils.py index 489925543223..edb86544f205 100644 --- a/utils/python/CIME/hist_utils.py +++ b/utils/python/CIME/hist_utils.py @@ -75,9 +75,12 @@ def move(case, suffix): comments += " Copying '%s' to '%s'\n" % (test_hist, new_file) shutil.copy(test_hist, new_file) - expect(num_moved > 0, "move failed: no hist files found in rundir '%s'" % rundir) + all_success = True + if num_moved == 0: + all_success = False + comments += "WARNING: No hist files found in rundir '%s'" % rundir) - return comments + return all_success, comments def _hists_match(model, hists1, hists2, suffix1="", suffix2=""): @@ -301,9 +304,11 @@ def get_extension(model, filepath): 'h' >>> get_extension("clm","clm2_0002.h0.1850-01-06-00000.nc") '0002.h0' + >>> get_extension("pop","PFS.f09_g16.B1850.yellowstone_intel.allactive-default.GC.c2_0_b1f2_int.pop.h.ecosys.nday1.0001-01-02.nc") + 'h' """ basename = os.path.basename(filepath) - ext_regex = re.compile(r'.*%s[^_]*_?([0-9]{4})?[.](h.?)([.][^.]+)?[.]nc' % model) + ext_regex = re.compile(r'.*%s[^_]*_?([0-9]{4})?[.](h.?)([.].*[^.])?[.]nc' % model) m = ext_regex.match(basename) expect(m is not None, "Failed to get extension for file '%s'" % filepath) @@ -312,6 +317,7 @@ def get_extension(model, filepath): else: result = m.group(2) + return result def generate_baseline(case, baseline_dir=None, allow_baseline_overwrite=False):