From df9f5105f3c7a1b5aad0d977b2c09a14b7b5a19a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 17 Feb 2016 14:07:08 -0700 Subject: [PATCH] need a flush before preview_namelist in case.build, need to allow for finidat unset in check_input_data, improve parsing in xmlchange --- scripts-python/case.build | 3 ++- scripts-python/check_input_data | 39 ++++++++++++++++++--------------- scripts-python/xmlchange | 2 +- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/scripts-python/case.build b/scripts-python/case.build index d05179bfa86..0777b5c4c57 100755 --- a/scripts-python/case.build +++ b/scripts-python/case.build @@ -510,7 +510,8 @@ def case_build(caseroot, testmode): # Load modules env_module = EnvModule(mach, compiler, cimeroot, caseroot, mpilib, debug) env_module.load_env_for_case() - + # Need to flush case xml to disk before calling preview_namelists + case.flush() run_cmd("./preview_namelists") build_checks(case, build_threaded, comp_interface, use_esmf_lib, mpilib, diff --git a/scripts-python/check_input_data b/scripts-python/check_input_data index 578a37d66f8..7f735fe1dfd 100755 --- a/scripts-python/check_input_data +++ b/scripts-python/check_input_data @@ -117,29 +117,32 @@ def check_input_data(svn_loc, input_data_root, data_list_dir, download): if (line and not line.startswith("#")): tokens = line.split('=') description, full_path = tokens[0].strip(), tokens[1].strip() - + if(full_path): # expand xml variables - full_path = case.get_resolved_value(full_path) - rel_path = full_path.replace(input_data_root, "") - - if (not os.path.exists(full_path)): - model = os.path.basename(data_list_file).split('.')[0] - logging.warning("Model %s missing file %s = '%s'" % (model,description,full_path)) - - if (download): - success = download_if_in_repo(svn_loc, input_data_root, rel_path) - if (not success): - # If ACME, try CESM repo as backup - if (get_model() == "acme" and svn_loc != SVN_LOCS["cesm"]): - success = download_if_in_repo(SVN_LOCS["cesm"], input_data_root, rel_path) - if (not success): + full_path = case.get_resolved_value(full_path) + rel_path = full_path.replace(input_data_root, "") + + if (not os.path.exists(full_path)): + model = os.path.basename(data_list_file).split('.')[0] + logging.warning("Model %s missing file %s = '%s'" % (model,description,full_path)) + + if (download): + success = download_if_in_repo(svn_loc, input_data_root, rel_path) + if (not success): + # If ACME, try CESM repo as backup + if (get_model() == "acme" and svn_loc != SVN_LOCS["cesm"]): + success = download_if_in_repo(SVN_LOCS["cesm"], input_data_root, rel_path) + if (not success): + no_files_missing = False + else: no_files_missing = False else: no_files_missing = False - else: - no_files_missing = False + else: + logging.info("Already had input file: '%s'" % full_path) else: - logging.info("Already had input file: '%s'" % full_path) + model = os.path.basename(data_list_file).split('.')[0] + logging.warning("Model %s no file specified for %s"%(model,description)) return no_files_missing diff --git a/scripts-python/xmlchange b/scripts-python/xmlchange index b6d51f9b47d..9e21e962bc0 100755 --- a/scripts-python/xmlchange +++ b/scripts-python/xmlchange @@ -84,7 +84,7 @@ def xmlchange(caseroot, listofsettings=None, xmlfile=None, xmlid=None, xmlval=No case = Case(caseroot) if(listofsettings ): for setting in listofsettings: - (xmlid, xmlval) = setting.split('=') + (xmlid, xmlval) = setting.split('=', 1) if(append is True): value = case.get_value(xmlid, resolved=False, subgroup=subgroup) xmlval = "%s %s" %(xmlval, value)