diff --git a/cime_config/buildnml b/cime_config/buildnml index 68fcb89d..16dcdfbc 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -15,7 +15,7 @@ import logging CIMEROOT = os.environ.get("CIMEROOT") if CIMEROOT is None: raise SystemExit("ERROR: must set CIMEROOT environment variable") -sys.path.append(os.path.join(CIMEROOT, "scripts", "Tools")) +sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools")) # The scope of the following path expansion is limited to this script only, # and is needed to import MOM6 input file classes: @@ -433,7 +433,15 @@ def buildnml(case, caseroot, compname): # Build the component namelist if compname != "mom": raise AttributeError - + # add the FMS library to the list of cesm support libraries for the case + # designed to be backward compatible in case cmeps does not define CASE_SUPPORT_LIBRARIES + try: + libs = case.get_values("CASE_SUPPORT_LIBRARIES") + if libs is not None and "FMS" not in libs: + libs.extend(["gptl","pio","csm_share","FMS"]) + case.set_value("CASE_SUPPORT_LIBRARIES", ",".join(libs)) + except: + pass ninst = case.get_value("NINST_OCN") inst_suffixes = ( ["_{:04d}".format(i + 1) for i in range(ninst)] if ninst > 1 else [""] @@ -460,7 +468,7 @@ def buildnml(case, caseroot, compname): def _main_func(): caseroot = parse_input(sys.argv) - with Case(caseroot) as case: + with Case(caseroot, read_only=False) as case: buildnml(case, caseroot, "mom")