Skip to content

Commit

Permalink
undo black changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing committed Aug 21, 2024
1 parent 0f5819f commit b6fc52f
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ def buildnml(case, caseroot, compname):
clm_phys = case.get_value("CLM_PHYSICS_VERSION")

config_cache_text = _config_cache_template.format(clm_phys=clm_phys)
config_cache_path = os.path.join(
caseroot, "Buildconf", compname + "conf", "config_cache.xml"
)
config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml")
with open(config_cache_path, "w") as config_cache_file:
config_cache_file.write(config_cache_text)

Expand Down Expand Up @@ -293,17 +291,13 @@ def buildnml(case, caseroot, compname):
if (yr_start != None) and (yr_end != None):
nyr = yr_end - yr_start + 1
if (yr_end <= 0) or (yr_start <= 0):
logger.error(
"ERROR: Year start and end are both negative and should not be"
)
logger.error("ERROR: Year start and end are both negative and should not be")
clm_namelist_opts = "nyr_forcing={} {}".format(nyr, clm_namelist_opts)
else:
logger.warning(
"WARNING: It does not make sense to do a SASU spinup with a prognostic atmosphere model"
)
logger.warning(
" as it expects regular atmosphere forcing that is cycled over"
)
logger.warning(" as it expects regular atmosphere forcing that is cycled over")

infile = os.path.join(ctsmconf, "namelist")

Expand All @@ -317,9 +311,7 @@ def buildnml(case, caseroot, compname):
lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file)
lndfrac_setting = "-lnd_frac " + lndfrac_file

config_cache_file = os.path.join(
caseroot, "Buildconf", compname + "conf", "config_cache.xml"
)
config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml")

# -----------------------------------------------------
# Clear out old data
Expand Down Expand Up @@ -389,9 +381,7 @@ def buildnml(case, caseroot, compname):
break

if not os.path.exists(os.path.join(rundir, clm_startfile)):
logger.warning(
"WARNING: Could NOT find a start file named " + clm_startfile
)
logger.warning("WARNING: Could NOT find a start file named " + clm_startfile)
clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile)
else:
clm_icfile = ""
Expand All @@ -402,9 +392,7 @@ def buildnml(case, caseroot, compname):
user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string)
namelist_infile = os.path.join(ctsmconf, "namelist")

create_namelist_infile(
case, user_nl_file, namelist_infile, "\n".join(infile_lines)
)
create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines))

cmd = os.path.join(lnd_root, "bld", "build-namelist")

Expand Down

0 comments on commit b6fc52f

Please sign in to comment.