Skip to content

Commit

Permalink
Update buildnml for accurate restart file time of day
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing authored Aug 8, 2024
1 parent e3f3bff commit 68252ef
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def buildnml(case, caseroot, compname):
clm_force_coldstart = case.get_value("CLM_FORCE_COLDSTART")
lnd_tuning_mode = case.get_value("LND_TUNING_MODE")
clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP")
clm_usrdat_name = case.get_value("CLM_USRDAT_NAME")
comp_atm = case.get_value("COMP_ATM")
lnd_grid = case.get_value("LND_GRID")
ninst_lnd = case.get_value("NINST_LND")
Expand All @@ -59,6 +60,7 @@ def buildnml(case, caseroot, compname):
run_refcase = case.get_value("RUN_REFCASE")
run_refdate = case.get_value("RUN_REFDATE")
run_reftod = case.get_value("RUN_REFTOD")
start_tod = case.get_value("START_TOD")
glc_nec = case.get_value("GLC_NEC")
glc_use_antarctica = case.get_value("GLC_USE_ANTARCTICA")
mask = case.get_value("MASK_GRID")
Expand Down Expand Up @@ -313,13 +315,22 @@ def buildnml(case, caseroot, compname):
if run_type == "hybrid" or run_type == "branch":
compnames = ["clm4", "clm5", "clm2"]
for comp in compnames:
clm_startfile = "%s.%s%s.r.%s-%s.nc" % (
run_refcase,
comp,
inst_string,
run_refdate,
run_reftod,
)
if "PLUMBER2" in clm_usrdat_name:
clm_startfile = "%s.%s%s.r.%s-%s.nc" % (
run_refcase,
comp,
inst_string,
run_refdate,
start_tod,
)
else:
clm_startfile = "%s.%s%s.r.%s-%s.nc" % (
run_refcase,
comp,
inst_string,
run_refdate,
run_reftod,
)
if os.path.exists(os.path.join(rundir, clm_startfile)):
break
else:
Expand All @@ -337,7 +348,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 Down

0 comments on commit 68252ef

Please sign in to comment.