From fe0ae4d4176ee29da4ce505c18b53f42b5044c18 Mon Sep 17 00:00:00 2001 From: jedwards4b Date: Mon, 15 Aug 2016 21:19:40 -0600 Subject: [PATCH] Revert "More early resolve issues" --- driver_cpl/cime_config/config_component.xml | 8 ++++++++ utils/python/CIME/XML/machines.py | 6 +++--- utils/python/CIME/case.py | 17 ++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index c1b10351181..cf4881ddda8 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -1766,6 +1766,14 @@ 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 8b83c9d6f61..5c861ca1311 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", resolved=False) + infile = files.get_value("MACHINES_SPEC_FILE") 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 fa73b36e342..0ed270cd38d 100644 --- a/utils/python/CIME/case.py +++ b/utils/python/CIME/case.py @@ -91,6 +91,7 @@ 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 @@ -398,14 +399,12 @@ def _get_component_config_data(self): comp_class = self._component_classes[i] comp_name = self._components[i-1] node_name = 'CONFIG_' + comp_class + '_FILE' - # 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) + comp_config_file = files.get_value(node_name, {"component":comp_name}, resolved=True) 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: @@ -475,6 +474,10 @@ 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 #-------------------------------------------- @@ -826,17 +829,13 @@ 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.") - + logger.warning(" It is NOT recommended to clone cases from different versions of CIMEROOT") # *** 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: