Repository: ESMCI/cime

Issue:
Major refactor of baseline handling.
Major refactor of baseline handling.
    
1) Instead of hard-coding ACME's addition of compiler name to baseline area,
just use XML configuration to achieve this.
    
2) Improve default values for all baseline generation and comparison tools.
Priority will be given to the BASELINE_GEN|CMP_NAME as default baseline name.
BASELINE_ROOT for the case will be used as the default baseline_root.
    
3) Change scripts_regression_test to make much heavier use of default values
now that they are better

4) I should also note, if you have a set of cases with different baseline names and baseline roots, the system handles it much better now.

Test suite: scripts_regression_tests 
Test baseline: 
Test namelist changes: 
Test status: bit for bit

Fixes [CIME Github issue #]

User interface changes?: Yes, better defaults for bless_test_results and compare_test_results

Update gh-pages html (Y/N)?: N

Code review: @jedwards4b @billsacks 



Discussion:

Resolving patch:
diff --git a/scripts/lib/CIME/XML/env_mach_specific.py b/scripts/lib/CIME/XML/env_mach_specific.py
--- a/scripts/lib/CIME/XML/env_mach_specific.py
+++ b/scripts/lib/CIME/XML/env_mach_specific.py
@@ -246,7 +246,6 @@ def _get_module_commands(self, modules_to_load, shell):
         cmds = []
         last_action = None
         last_cmd    = None
-        actions_that_cannot_be_batched = ["swap"]
 
         # Normally, we will try to combine or batch module commands together...
         #
diff --git a/scripts/lib/CIME/XML/pes.py b/scripts/lib/CIME/XML/pes.py
--- a/scripts/lib/CIME/XML/pes.py
+++ b/scripts/lib/CIME/XML/pes.py
@@ -96,7 +96,7 @@ def _find_matches(self, grid_nodes, grid, compset, machine, pesize_opts, overrid
                             pesize_match = self.get(pes_node, "pesize")
                             compset_match = self.get(pes_node, "compset")
                             if (pesize_match == "any" or (pesize_opts is not None and \
-                                                          re.search(pesize_match, pesize_opts))) and \
+                                                          pesize_match == pesize_opts)) and \
                                                           (compset_match == "any" or \
                                                            re.search(compset_match,compset)):
 
diff --git a/scripts/lib/jenkins_generic_job.py b/scripts/lib/jenkins_generic_job.py
--- a/scripts/lib/jenkins_generic_job.py
+++ b/scripts/lib/jenkins_generic_job.py
@@ -72,7 +72,7 @@ def jenkins_generic_job(generate_baselines, submit_to_cdash, no_batch,
         shutil.rmtree("Testing")
 
     # Remove old dirs
-    test_id_root = "J{}{}".format(baseline_name.capitalize(), test_suite.replace("acme_", "").capitalize())
+    test_id_root = "J{}{}".format(baseline_name.capitalize(), test_suite.replace("e3sm_", "").capitalize())
     for clutter_area in [scratch_root, test_root, run_area]:
         for old_file in glob.glob("{}/*{}*{}*".format(clutter_area, mach_comp, test_id_root)):
             if (os.path.isdir(old_file)):


Test patch:
diff --git a/scripts/lib/update_e3sm_tests.py b/scripts/lib/update_e3sm_tests.py
--- a/scripts/lib/update_e3sm_tests.py
+++ b/scripts/lib/update_e3sm_tests.py
@@ -152,7 +152,9 @@
                            "ERP_Ld3.ne30_oECv3_ICG.A_WCYCL1850S",
                            "SEQ_IOP.f19_g16.X",
                            "SMS.ne30_oECv3_ICG.A_WCYCL1850S",
-                           "SMS.f09_g16_a.MPASLIALB")
+                           "SMS.f09_g16_a.MPASLIALB",
+			   ("SMS.ne30_oECv3.BGCEXP_BCRC_CNPRDCTC_1850","clm-bgcexp"),
+                           ("SMS.ne30_oECv3.BGCEXP_BCRC_CNPECACNT_1850","clm-bgcexp"))
                           ),
     #e3sm tests for extra coverage
     "e3sm_extra_coverage" : (("e3sm_atm_extra_coverage",),None,
@@ -162,6 +164,7 @@
     "e3sm_hi_res" : (("e3sm_atm_hi_res",),None,
                      (
                       ("SMS.ne120_oRRS18v3_ICG.A_WCYCL2000_H01AS", "cam-cosplite"),
+                       "SMS.T62_oRRS30to10v3wLI.GMPAS-IAF",
                      )),
 
     #e3sm tests to mimic production runs
diff --git a/scripts/tests/scripts_regression_tests.py b/scripts/tests/scripts_regression_tests.py
--- a/scripts/tests/scripts_regression_tests.py
+++ b/scripts/tests/scripts_regression_tests.py
@@ -1226,12 +1226,8 @@ def threaded_test(self, expect_works, extra_args, build_name=None):
             self._thread_error = str(e)
 
     ###########################################################################
-    def assert_num_leftovers(self, test_id=None):
+    def assert_num_leftovers(self):
     ###########################################################################
-        # There should only be two directories matching the test_id in both
-        # the testroot (bld/run dump area) and jenkins root
-        if (test_id is None):
-            test_id = self._baseline_name
         num_tests_in_tiny = len(update_e3sm_tests.get_test_suite("cime_test_only_pass"))
 
         jenkins_dirs = glob.glob("%s/*%s*/" % (self._jenkins_root, self._baseline_name.capitalize())) # case dirs