From 0b52c77e40d3473471f58f691814c426b749fcc4 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 12:27:33 -0600 Subject: [PATCH 1/8] moved config_tests.xml to cime_config directory, reorder tests in scripts_regression tests --- {scripts/Testing/Testcases => cime_config}/config_tests.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {scripts/Testing/Testcases => cime_config}/config_tests.xml (100%) diff --git a/scripts/Testing/Testcases/config_tests.xml b/cime_config/config_tests.xml similarity index 100% rename from scripts/Testing/Testcases/config_tests.xml rename to cime_config/config_tests.xml From 60290c670605af9ee85e700175a185489a222b6e Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 12:27:46 -0600 Subject: [PATCH 2/8] moved config_tests.xml to cime_config directory, reorder tests in scripts_regression tests --- cime_config/cesm/config_files.xml | 2 +- .../python/tests/scripts_regression_tests.py | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cime_config/cesm/config_files.xml b/cime_config/cesm/config_files.xml index bcbb55130d0..1e9c4afb1b6 100644 --- a/cime_config/cesm/config_files.xml +++ b/cime_config/cesm/config_files.xml @@ -66,7 +66,7 @@ char - $CIMEROOT/scripts/Testing/Testcases/config_tests.xml + $CIMEROOT/cime_config/config_tests.xml test env_test.xml file containing system test descriptions diff --git a/utils/python/tests/scripts_regression_tests.py b/utils/python/tests/scripts_regression_tests.py index 606d7be63a4..7a332986cbf 100755 --- a/utils/python/tests/scripts_regression_tests.py +++ b/utils/python/tests/scripts_regression_tests.py @@ -113,7 +113,7 @@ def setup_proxy(): return False ############################################################################### -class B_TestCreateNewcase(unittest.TestCase): +class J_TestCreateNewcase(unittest.TestCase): ############################################################################### def setUp(self): self._testroot = MACHINE.get_value("CESMSCRATCHROOT") @@ -162,7 +162,7 @@ def tearDown(self): elif do_teardown: shutil.rmtree(tfile) ############################################################################### -class D_TestWaitForTests(unittest.TestCase): +class M_TestWaitForTests(unittest.TestCase): ############################################################################### ########################################################################### @@ -417,7 +417,7 @@ def tearDown(self): os.remove(file_to_clean) ############################################################################### -class C_TestCreateTest(TestCreateTestCommon): +class N_TestCreateTest(TestCreateTestCommon): ############################################################################### ########################################################################### @@ -472,7 +472,7 @@ def test_create_test_rebless_namelist(self): self.simple_test(True, "-c -n -b %s -t %s-%s" % (self._baseline_name, self._baseline_name, CIME.utils.get_utc_timestamp())) ############################################################################### -class E_TestTestScheduler(TestCreateTestCommon): +class O_TestTestScheduler(TestCreateTestCommon): ############################################################################### ########################################################################### @@ -609,7 +609,7 @@ def test_b_full(self): self.assertEqual(ts.get_status(MEMLEAK_PHASE), TEST_PASS_STATUS) ############################################################################### -class TestJenkinsGenericJob(TestCreateTestCommon): +class P_TestJenkinsGenericJob(TestCreateTestCommon): ############################################################################### ########################################################################### @@ -705,7 +705,7 @@ def test_jenkins_generic_job_kill(self): assert_dashboard_has_build(self, build_name) ############################################################################### -class TestBlessTestResults(TestCreateTestCommon): +class Q_TestBlessTestResults(TestCreateTestCommon): ############################################################################### _test_name = "TESTRUNDIFF_Mmpi-serial.f19_g16_rx1.A" @@ -761,7 +761,7 @@ def test_bless_test_results(self): ############################################################################### @unittest.skip("Disabling this test until we figure out how to integrate ACME tests and CIME xml files.") -class TestUpdateACMETests(unittest.TestCase): +class R_TestUpdateACMETests(unittest.TestCase): ############################################################################### ########################################################################### @@ -868,7 +868,7 @@ def test_full_system(self): self.assertTrue(test_time > 0, msg="test time was zero for %s" % test_status) ############################################################################### -class TestCimeCase(TestCreateTestCommon): +class K_TestCimeCase(TestCreateTestCommon): ############################################################################### ########################################################################### @@ -910,7 +910,7 @@ def test_cime_case(self): self.assertEqual(case.get_value("PIO_TYPENAME"), "netcdf") ############################################################################### -class TestSingleSubmit(TestCreateTestCommon): +class X_TestSingleSubmit(TestCreateTestCommon): ############################################################################### ########################################################################### @@ -933,7 +933,7 @@ def test_single_submit(self): msg="COMMAND SHOULD HAVE WORKED\nwait_for_tests output:\n%s\n\nerrput:\n%s\n\ncode: %d" % (output, errput, stat)) ############################################################################### -class TestSaveTimings(TestCreateTestCommon): +class L_TestSaveTimings(TestCreateTestCommon): ############################################################################### ########################################################################### @@ -954,7 +954,7 @@ def test_save_timings(self): msg="COMMAND SHOULD HAVE WORKED\nwait_for_tests output:\n%s\n\nerrput:\n%s\n\ncode: %d" % (output, errput, stat)) ############################################################################### -class TestXMLQuery(unittest.TestCase): +class C_TestXMLQuery(unittest.TestCase): # Testing command line scripts ############################################################################### @@ -1037,7 +1037,7 @@ def test_subgroup(self): self.assertEqual(searchObj.group() , group_out) ############################################################################### -class CheckCode(unittest.TestCase): +class B_CheckCode(unittest.TestCase): ############################################################################### ########################################################################### @@ -1283,7 +1283,7 @@ def assert_variable_matches(self, var_name, regex, env=None, var=None): ############################################################################### -class TestMacrosBasic(unittest.TestCase): +class G_TestMacrosBasic(unittest.TestCase): ############################################################################### """Basic infrastructure tests. @@ -1317,7 +1317,7 @@ def test_script_rejects_bad_build_system(self): ############################################################################### -class TestMakeMacros(unittest.TestCase): +class H_TestMakeMacros(unittest.TestCase): ############################################################################### """Makefile macros tests. @@ -1592,7 +1592,7 @@ def test_variable_insertion_with_machine_specific_setting(self): ############################################################################### @unittest.skipIf(FAST_ONLY, "Skipping slow CMake tests.") -class TestCMakeMacros(TestMakeMacros): +class I_TestCMakeMacros(H_TestMakeMacros): ############################################################################### """CMake macros tests. From 40f5b476092b5cac5ab19f3e00caa941bd08b278 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 12:51:27 -0600 Subject: [PATCH 3/8] add support for special queue on yellowstone --- cime_config/cesm/machines/config_batch.xml | 3 ++- utils/python/CIME/XML/env_batch.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cime_config/cesm/machines/config_batch.xml b/cime_config/cesm/machines/config_batch.xml index 12c31b06e3b..0d2fe946825 100644 --- a/cime_config/cesm/machines/config_batch.xml +++ b/cime_config/cesm/machines/config_batch.xml @@ -424,7 +424,8 @@ - caldera + hpss + caldera regular capability diff --git a/utils/python/CIME/XML/env_batch.py b/utils/python/CIME/XML/env_batch.py index 846bec7c1ca..477c1ad3509 100644 --- a/utils/python/CIME/XML/env_batch.py +++ b/utils/python/CIME/XML/env_batch.py @@ -276,7 +276,7 @@ def set_job_defaults(self, bjobs, pesize=None, walltime=None, force_queue=None): else: task_count = int(task_count) - queue = force_queue if force_queue is not None else self.select_best_queue(task_count) + queue = force_queue if force_queue is not None else self.select_best_queue(task_count, job) self.set_value("JOB_QUEUE", queue, subgroup=job) walltime = self.get_max_walltime(queue) if walltime is None else walltime @@ -464,7 +464,7 @@ def get_job_id(self, output): jobid = re.search(jobid_pattern, output).group(1) return jobid - def select_best_queue(self, num_pes): + def select_best_queue(self, num_pes, job=None): # Make sure to check default queue first. all_queues = [] all_queues.append( self.get_default_queue()) @@ -473,9 +473,13 @@ def select_best_queue(self, num_pes): if queue is not None: jobmin = queue.get("jobmin") jobmax = queue.get("jobmax") + jobname = queue.get("jobname") + if jobname is not None: + if job == jobname: + return queue.text # if the fullsum is between the min and max # jobs, then use this queue. - if jobmin is not None and jobmax is not None and num_pes >= int(jobmin) and num_pes <= int(jobmax): - return queue.text + elif jobmin is not None and jobmax is not None and num_pes >= int(jobmin) and num_pes <= int(jobmax): + return queue.text return None def get_max_walltime(self, queue): From 631b7faf71e14ace6341fab2a0ab26117f79b14e Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 13:03:41 -0600 Subject: [PATCH 4/8] fix indent --- utils/python/CIME/XML/env_batch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/python/CIME/XML/env_batch.py b/utils/python/CIME/XML/env_batch.py index 477c1ad3509..581610d0184 100644 --- a/utils/python/CIME/XML/env_batch.py +++ b/utils/python/CIME/XML/env_batch.py @@ -330,6 +330,8 @@ def get_submit_args(self, case, job): if name is None: submitargs+=" %s"%flag else: + if name.startswith("$"): + name = name[:1] val = case.get_value(name,subgroup=job) if val is None: val = case.get_resolved_value(name) @@ -479,7 +481,7 @@ def select_best_queue(self, num_pes, job=None): return queue.text # if the fullsum is between the min and max # jobs, then use this queue. elif jobmin is not None and jobmax is not None and num_pes >= int(jobmin) and num_pes <= int(jobmax): - return queue.text + return queue.text return None def get_max_walltime(self, queue): From aa9c4dc53d40bb5ff7a4ca19f8cbeab3ae35c3f7 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 13:27:31 -0600 Subject: [PATCH 5/8] add timestamp to testcase names --- utils/python/CIME/XML/env_batch.py | 2 +- utils/python/tests/scripts_regression_tests.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/python/CIME/XML/env_batch.py b/utils/python/CIME/XML/env_batch.py index 581610d0184..be78beadba4 100644 --- a/utils/python/CIME/XML/env_batch.py +++ b/utils/python/CIME/XML/env_batch.py @@ -331,7 +331,7 @@ def get_submit_args(self, case, job): submitargs+=" %s"%flag else: if name.startswith("$"): - name = name[:1] + name = name[1:] val = case.get_value(name,subgroup=job) if val is None: val = case.get_resolved_value(name) diff --git a/utils/python/tests/scripts_regression_tests.py b/utils/python/tests/scripts_regression_tests.py index 7a332986cbf..62c516494e9 100755 --- a/utils/python/tests/scripts_regression_tests.py +++ b/utils/python/tests/scripts_regression_tests.py @@ -121,7 +121,7 @@ def setUp(self): self._do_teardown = [] def test_createnewcase(self): - testdir = os.path.join(self._testroot, 'scripts_regression_tests.testcreatenewcase') + testdir = os.path.join(self._testroot, 'scripts_regression_tests.testcreatenewcase.%s'% CIME.utils.get_utc_timestamp()) if os.path.exists(testdir): shutil.rmtree(testdir) self._testdirs.append(testdir) @@ -137,7 +137,7 @@ def test_createnewcase(self): self._do_teardown.append(testdir) def test_user_mods(self): - testdir = os.path.join(self._testroot, 'scripts_regression_tests.testusermods') + testdir = os.path.join(self._testroot, 'scripts_regression_tests.testusermods.%s'% CIME.utils.get_utc_timestamp()) if os.path.exists(testdir): shutil.rmtree(testdir) self._testdirs.append(testdir) @@ -169,10 +169,10 @@ class M_TestWaitForTests(unittest.TestCase): def setUp(self): ########################################################################### self._testroot = MACHINE.get_value("CESMSCRATCHROOT") - self._testdir_all_pass = os.path.join(self._testroot, 'scripts_regression_tests.testdir_all_pass') - self._testdir_with_fail = os.path.join(self._testroot, 'scripts_regression_tests.testdir_with_fail') - self._testdir_unfinished = os.path.join(self._testroot, 'scripts_regression_tests.testdir_unfinished') - self._testdir_unfinished2 = os.path.join(self._testroot, 'scripts_regression_tests.testdir_unfinished2') + self._testdir_all_pass = os.path.join(self._testroot, 'scripts_regression_tests.testdir_all_pass.%s'% CIME.utils.get_utc_timestamp()) + self._testdir_with_fail = os.path.join(self._testroot, 'scripts_regression_tests.testdir_with_fail.%s'% CIME.utils.get_utc_timestamp()) + self._testdir_unfinished = os.path.join(self._testroot, 'scripts_regression_tests.testdir_unfinished.%s'% CIME.utils.get_utc_timestamp()) + self._testdir_unfinished2 = os.path.join(self._testroot, 'scripts_regression_tests.testdir_unfinished2.%s'% CIME.utils.get_utc_timestamp()) testdirs = [self._testdir_all_pass, self._testdir_with_fail, self._testdir_unfinished, self._testdir_unfinished2] for testdir in testdirs: if os.path.exists(testdir): @@ -964,7 +964,7 @@ def setUp(self): self._testdirs = [] self._do_teardown = [] - testdir = os.path.join(self._testroot, 'scripts_regression_tests.testscripts') + testdir = os.path.join(self._testroot, 'scripts_regression_tests.testscripts.%s'% CIME.utils.get_utc_timestamp()) machine = 'melvin' if os.path.exists(testdir): shutil.rmtree(testdir) From 00755f59600cdc9c33cedce91e837af52dac6a24 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 14:18:46 -0600 Subject: [PATCH 6/8] trying again Revert "Revert "More early resolve issues"" This reverts commit fe0ae4d4176ee29da4ce505c18b53f42b5044c18. --- driver_cpl/cime_config/config_component.xml | 8 -------- utils/python/CIME/XML/machines.py | 6 +++--- utils/python/CIME/case.py | 17 +++++++++-------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index cf4881ddda8..c1b10351181 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -1766,14 +1766,6 @@ Machine name - - char - - case_def - env_case.xml - full pathname of file specifying supported machines location - - char diff --git a/utils/python/CIME/XML/machines.py b/utils/python/CIME/XML/machines.py index 5c861ca1311..8b83c9d6f61 100644 --- a/utils/python/CIME/XML/machines.py +++ b/utils/python/CIME/XML/machines.py @@ -27,9 +27,9 @@ def __init__(self, infile=None, files=None, machine=None): if infile is None: if files is None: files = Files() - infile = files.get_value("MACHINES_SPEC_FILE") + infile = files.get_value("MACHINES_SPEC_FILE", resolved=False) self.machines_dir = os.path.dirname(infile) - + infile = files.get_resolved_value(infile) GenericXML.__init__(self, infile) # Append the contents of $HOME/.cime/config_machines.xml if it exists @@ -340,7 +340,7 @@ def get_full_mpirun(self, check_members, case, job): batch_system = self.get_value("BATCH_SYSTEM") if batch_system == "cobalt": mpi_arg_string += " : " - + return "%s %s %s" % (executable if executable is not None else "", mpi_arg_string, default_run_suffix) def print_values(self): diff --git a/utils/python/CIME/case.py b/utils/python/CIME/case.py index 0ed270cd38d..fa73b36e342 100644 --- a/utils/python/CIME/case.py +++ b/utils/python/CIME/case.py @@ -91,7 +91,6 @@ def __init__(self, case_root=None, read_only=True): self._pesfile = None self._gridfile = None self._components = [] - self._component_config_files = [] self._component_classes = [] # Define __enter__ and __exit__ so that we can use this as a context manager @@ -399,12 +398,14 @@ def _get_component_config_data(self): comp_class = self._component_classes[i] comp_name = self._components[i-1] node_name = 'CONFIG_' + comp_class + '_FILE' - comp_config_file = files.get_value(node_name, {"component":comp_name}, resolved=True) + # Add the group and elements for the config_files.xml + comp_config_file = files.get_value(node_name, {"component":comp_name}, resolved=False) + self.set_value(node_name, comp_config_file) + comp_config_file = self.get_resolved_value(comp_config_file) expect(comp_config_file is not None,"No config file for component %s"%comp_name) compobj = Component(comp_config_file) for env_file in self._env_entryid_files: env_file.add_elements_by_group(compobj, attributes=attlist) - self._component_config_files.append((node_name,comp_config_file)) # Add the group and elements for the config_files.xml for env_file in self._env_entryid_files: @@ -474,10 +475,6 @@ def configure(self, compset_name, grid_name, machine_name=None, self.get_compset_var_settings() - # Add the group and elements for the config_files.xml - for config_file in self._component_config_files: - self.set_value(config_file[0],config_file[1]) - #-------------------------------------------- # machine #-------------------------------------------- @@ -829,13 +826,17 @@ def create_clone(self, newcase, keepexe=False, mach_dir=None, project=None): # create clone from self to case clone_cimeroot = self.get_value("CIMEROOT") if newcase_cimeroot != clone_cimeroot: + case_branch = get_current_branch(clone_cimeroot) + clone_branch = get_current_branch(newcase_cimeroot) logger.warning(" case CIMEROOT is %s " %newcase_cimeroot) logger.warning(" clone CIMEROOT is %s " %clone_cimeroot) - logger.warning(" It is NOT recommended to clone cases from different versions of CIMEROOT") + logger.warning(" It is NOT recommended to clone cases from different versions of CIME.") + # *** create case object as deepcopy of clone object *** srcroot = os.path.join(newcase_cimeroot,"..") newcase = self.copy(newcasename, newcaseroot, newsrcroot=srcroot) + newcase.set_value("CIMEROOT", newcase_cimeroot) # determine if will use clone executable or not if keepexe: From b33c9e19980a5f621eba8e31625da2d637383900 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 15:49:07 -0600 Subject: [PATCH 7/8] remove unused MASK_GRID variable --- driver_cpl/cime_config/config_component.xml | 8 ------- scripts/create_newcase | 6 ++--- utils/python/CIME/case.py | 26 +++++++++++---------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index c1b10351181..7abe633670c 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -1146,14 +1146,6 @@ number of wav cells in j direction - DO NOT EDIT (for experts only) - - char - UNSET - build_grid - env_build.xml - grid mask - DO NOT EDIT (for experts only) - - logical TRUE,FALSE diff --git a/scripts/create_newcase b/scripts/create_newcase index dee0026c657..bba9d90de5d 100755 --- a/scripts/create_newcase +++ b/scripts/create_newcase @@ -154,9 +154,9 @@ def _main_func(): with Case(caseroot, read_only=False) as case: # Set values for env_case.xml - case.set_value("CASE", os.path.basename(caseroot)) - case.set_value("CASEROOT", caseroot) - case.set_value("SRCROOT", srcroot) + case.set_lookup_value("CASE", os.path.basename(caseroot)) + case.set_lookup_value("CASEROOT", caseroot) + case.set_lookup_value("SRCROOT", srcroot) # Configure the Case case.configure(compset, grid, machine_name=machine, project=project, diff --git a/utils/python/CIME/case.py b/utils/python/CIME/case.py index fa73b36e342..dc13e8e029f 100644 --- a/utils/python/CIME/case.py +++ b/utils/python/CIME/case.py @@ -80,10 +80,9 @@ def __init__(self, case_root=None, read_only=True): # for xml files that haven't been created yet. We need a place # to store them until we are ready to create the file. At file # creation we get the values for those fields from this lookup - # table and then remove the entry. This was what I came up - # with in the perl anyway and I think that we still need it here. + # table and then remove the entry. self.lookups = {} - self.lookups['CIMEROOT'] = os.path.abspath(get_cime_root()) + self.set_lookup_value('CIMEROOT',os.path.abspath(get_cime_root())) self._compsetname = None self._gridname = None @@ -285,11 +284,12 @@ def set_value(self, item, value, subgroup=None, ignore_type=False): logger.debug("Will rewrite file %s %s",env_file.filename, item) self._env_files_that_need_rewrite.add(env_file) return result - if result is None: - if item in self.lookups.keys() and self.lookups[item] is not None: - logger.warn("Item %s already in lookups with value %s"%(item,self.lookups[item])) - else: - self.lookups[item] = value + + def set_lookup_value(self, item, value): + if item in self.lookups.keys() and self.lookups[item] is not None: + logger.warn("Item %s already in lookups with value %s"%(item,self.lookups[item])) + else: + self.lookups[item] = value def _set_compset_and_pesfile(self, compset_name, user_compset=False, pesfile=None): @@ -383,6 +383,10 @@ def _get_component_config_data(self): # Determine list of component classes that this coupler/driver knows how # to deal with. This list follows the same order as compset longnames follow. files = Files() + # Add the group and elements for the config_files.xml + for env_file in self._env_entryid_files: + env_file.add_elements_by_group(files, attlist) + drv_config_file = files.get_value("CONFIG_DRV_FILE") drv_comp = Component(drv_config_file) for env_file in self._env_entryid_files: @@ -407,9 +411,6 @@ def _get_component_config_data(self): for env_file in self._env_entryid_files: env_file.add_elements_by_group(compobj, attributes=attlist) - # Add the group and elements for the config_files.xml - for env_file in self._env_entryid_files: - env_file.add_elements_by_group(files, attlist) for key,value in self.lookups.items(): result = self.set_value(key,value) @@ -463,10 +464,11 @@ def configure(self, compset_name, grid_name, machine_name=None, grids = Grids(gridfile) gridinfo = grids.get_grid_info(name=grid_name, compset=self._compsetname) + self._gridname = gridinfo["GRID"] for key,value in gridinfo.items(): logger.debug("Set grid %s %s"%(key,value)) - self.set_value(key,value) + self.set_lookup_value(key,value) #-------------------------------------------- # component config data From 4107bada1225be29074c7798ecdd10cf8c202eac Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 16 Aug 2016 19:31:24 -0600 Subject: [PATCH 8/8] fix issue in perl cice path was corrupted --- components/data_comps/dice/bld/build-namelist | 3 +++ utils/perl5lib/Streams/TemplateGeneric.pm | 13 ++++++++----- utils/python/CIME/buildnml.py | 4 +++- utils/python/CIME/case.py | 2 -- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/components/data_comps/dice/bld/build-namelist b/components/data_comps/dice/bld/build-namelist index 9abf6cca743..faa1dab5fda 100755 --- a/components/data_comps/dice/bld/build-namelist +++ b/components/data_comps/dice/bld/build-namelist @@ -306,6 +306,9 @@ if (defined $opts{'infile'}) { my %xmlvars = (); SetupTools::getxmlvars(${CASEROOT},\%xmlvars); +# need to expand DIN_LOC_ROOT first +$xmlvars{DIN_LOC_ROOT}=SetupTools::expand_xml_var($xmlvars{DIN_LOC_ROOT}, \%xmlvars); + foreach my $attr (keys %xmlvars) { $xmlvars{$attr} = SetupTools::expand_xml_var($xmlvars{$attr}, \%xmlvars); } diff --git a/utils/perl5lib/Streams/TemplateGeneric.pm b/utils/perl5lib/Streams/TemplateGeneric.pm index 0e726177c3a..5c0d5858dcd 100644 --- a/utils/perl5lib/Streams/TemplateGeneric.pm +++ b/utils/perl5lib/Streams/TemplateGeneric.pm @@ -425,7 +425,9 @@ sub GetDataFilenames { # # Get path # + my $filepath = $self->GetDataFilepath( $type ); + my $key = "fileNames"; my $info; if ( $type eq "data" ) { @@ -463,8 +465,8 @@ sub GetDataFilepath { if ( ! defined($self->{'template'}) ) { die "${nm}:: a template has NOT been read in yet -- abort.\n"; } - my $defaults_ref = $self->{'defaults'}; - my %defaults = %$defaults_ref; + my %defaults = %{$self->{'defaults'}}; + my $key; if ( $type eq "data" ) { $key = "fieldInfo"; @@ -473,13 +475,14 @@ sub GetDataFilepath { } else { die "${nm}:: bad input type to method: $type should be data or domain\n"; } + my $Info_ref = $defaults{$key}; + if ( ref($Info_ref) ne "HASH" ) { die "${nm}:: $key is NOT a hash -- something must have went wrong in the Read\n"; } - my %Info = %$Info_ref; - my $filepath = $self->__Sub__( $Info_ref, 'filePath'); + my $filepath = $self->__Sub__( $Info_ref, 'filePath'); return( $filepath ); } @@ -490,7 +493,6 @@ sub expandXMLVar { my $value = shift; my $varhash_ref = shift; my $nm = "expandXMLVar"; - if ( ! defined($value) ) { die "${nm}:: a value was NOT input\n"; } @@ -559,6 +561,7 @@ sub __Sub__ { my $lastmonth = $opts{'lastmonth'}; my $value = $$Info_ref{$name}; + $value =~ s/^[ \n]+//; # remove leading spaces $value =~ s/[ \n]+$//; # remove ending spaces diff --git a/utils/python/CIME/buildnml.py b/utils/python/CIME/buildnml.py index 80ad886d9a7..ec0e8b09652 100644 --- a/utils/python/CIME/buildnml.py +++ b/utils/python/CIME/buildnml.py @@ -154,7 +154,9 @@ def _build_data_nml(case, caseroot, compclass): rc, out, err = run_cmd(cmd, from_dir=confdir) expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err)) - + if out is not None: + logger.debug("cmd=%s"%cmd) + logger.info("out = %s"%out) # copy namelist files and stream text files, to rundir if os.path.isdir(rundir): filename = compname + "_in" diff --git a/utils/python/CIME/case.py b/utils/python/CIME/case.py index dc13e8e029f..e4bcae10c58 100644 --- a/utils/python/CIME/case.py +++ b/utils/python/CIME/case.py @@ -828,8 +828,6 @@ def create_clone(self, newcase, keepexe=False, mach_dir=None, project=None): # create clone from self to case clone_cimeroot = self.get_value("CIMEROOT") if newcase_cimeroot != clone_cimeroot: - case_branch = get_current_branch(clone_cimeroot) - clone_branch = get_current_branch(newcase_cimeroot) logger.warning(" case CIMEROOT is %s " %newcase_cimeroot) logger.warning(" clone CIMEROOT is %s " %clone_cimeroot) logger.warning(" It is NOT recommended to clone cases from different versions of CIME.")