From 29bb217d70aaf570482e287adf09c6baf4c4054f Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 1 Apr 2024 02:41:01 -0600 Subject: [PATCH 1/2] put in changes needed for addition of new dglc component --- cime_config/buildnml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 84e1581406..d2e7ddc886 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -60,6 +60,7 @@ def buildnml(case, caseroot, compname): run_reftod = case.get_value("RUN_REFTOD") glc_nec = case.get_value("GLC_NEC") cism_use_antarctica = case.get_value("CISM_USE_ANTARCTICA") + dglc_use_antarctica = case.get_value("DGLC_USE_ANTARCTICA") mask = case.get_value("MASK_GRID") driver = case.get_value("COMP_INTERFACE").lower() @@ -144,8 +145,8 @@ def buildnml(case, caseroot, compname): or clm_usrdat_name is "NEON.PRISM" ): logger.warning( - "WARNING: Do you have approriprate initial conditions for this simulation?" - + " Check that the finidat file used in the lnd_in namelist is apprporiately spunup for your case" + "WARNING: Do you have appropriate initial conditions for this simulation?" + + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" ) if comp_atm != "datm": @@ -153,20 +154,30 @@ def buildnml(case, caseroot, compname): else: nomeg = "" - if cism_use_antarctica is None: - # This is the case for compsets without CISM, where the CISM_USE_ANTARCTICA xml - # variable isn't defined + + glc_use_antarctica = cism_use_antarctica + if glc_use_antarctica is None: + glc_use_antarctica = dglc_use_antarctica + if glc_use_antarctica is None: + # This is the case for compsets without CISM or DGLC, where the + # CISM_USE_ANTARCTICA and DGLC_USE_ANTARCTICA xml variables are not defined glc_use_antarctica_flag = "" - elif isinstance(cism_use_antarctica, bool): - if cism_use_antarctica: + elif isinstance(glc_use_antarctica, bool): + if glc_use_antarctica: glc_use_antarctica_flag = "-glc_use_antarctica" else: glc_use_antarctica_flag = "" else: - expect( - False, - "Unexpected value for CISM_USE_ANTARCTICA: {}".format(cism_use_antarctica), - ) + if cism_use_antarctia: + expect( + False, + "Unexpected value for CISM_USE_ANTARCTICA: {}".format(cism_use_antarctica), + ) + else: + expect( + False, + "Unexpected value for DGLC_USE_ANTARCTICA: {}".format(dglc_use_antarctica), + ) if clm_nml_use_case != "UNSET": usecase = "-use_case %s" % clm_nml_use_case From fbe35c2f28097c8aafa567fe964baaec3bde982a Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Tue, 2 Apr 2024 13:02:36 +0200 Subject: [PATCH 2/2] make black happy --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index d2e7ddc886..547682d0bb 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -27,6 +27,7 @@ _config_cache_template = """ """ + ############################################################################### def buildnml(case, caseroot, compname): ############################################################################### @@ -154,7 +155,6 @@ def buildnml(case, caseroot, compname): else: nomeg = "" - glc_use_antarctica = cism_use_antarctica if glc_use_antarctica is None: glc_use_antarctica = dglc_use_antarctica