You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During hybrid or branch runs, MOSART buildnml sometime complained the element finidat_rtm and nrevn_rtm is too long. The reason is that the finidat_rtm for hybrid and nrevsn_rtm for branch are specified with their absolute paths, thus in some cases, the lengths of the paths are longer than 256 causing the error.
The quick fix is to use "os.path.basename" to get the relative paths as follows:
if run_type == "hybrid": infile_text += "finidat_rtm = '{}'\n".format(os.path.basename(fncheck))
if run_type == "branch": infile_text += "nrevsn_rtm = '{}'\n".format(os.path.basename(fncheck))
The original code:
fncheck = "{}/{}.mosart{}.r.{}-{}.nc".format(rundir, run_refcase, inst_string, run_refdate, run_reftod)
if not os.path.exists(fncheck):
fncheck = "{}/{}.mosart.r.{}-{}.nc".format(rundir, run_refcase, run_refdate, run_reftod)
if not os.path.exists(fncheck):
fncheck = "{}/{}.clm2{}.r.{}-{}.nc".format(rundir, run_refcase, inst_string, run_refdate, run_reftod)
if not os.path.exists(fncheck):
fncheck = "{}/{}.clm2.r.{}-{}.nc".format(rundir, run_refcase, run_refdate, run_reftod)
expect(os.path.exists(fncheck), "ERROR mosart.buildnml: could not find restart file for branch or hybrid start")
if run_type == "hybrid": infile_text += "finidat_rtm = '{}'\n".format(fncheck)
if run_type == "branch": infile_text += "nrevsn_rtm = '{}'\n".format(fncheck)
The text was updated successfully, but these errors were encountered:
During hybrid or branch runs, MOSART buildnml sometime complained the element
finidat_rtm
andnrevn_rtm
is too long. The reason is that thefinidat_rtm
for hybrid andnrevsn_rtm
for branch are specified with their absolute paths, thus in some cases, the lengths of the paths are longer than 256 causing the error.The quick fix is to use "os.path.basename" to get the relative paths as follows:
The original code:
The text was updated successfully, but these errors were encountered: