ESCOMP / RTM

River Transport Model, RTM, part of the Community Earth System Model
http://www.cesm.ucar.edu/
Other
1 stars 13 forks source link

Can't set finidat_rtm to blank indicating a cold-start #14

Closed ekluzek closed 5 years ago

ekluzek commented 5 years ago

If you set finidat_rtm=' ' (indicating a cold-start) it tries to read a blank file with $DIN_LOC_ROOT tacked onto the front of it. So you can't actually run a coldstart, unless it does by default for that compset.

This is with the latest RTM rtm1_0_67, but would also be a problem in earlier versions.

ekluzek commented 5 years ago

Here's the suggested fix. This sets the input to " " for the FORTRAN source to interpret as a coldstart, and also works so that the check_input_data doesn't search for it as a valid file, nor add the inputdata directory to the front of it.

diff --git a/cime_config/buildnml b/cime_config/buildnml
index 1738359..2b0545c 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -77,9 +77,11 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
             nmlgen.add_default("finidat_rtm", value=filename, ignore_abs_path=True)
         else:
             nmlgen.add_default("nrevsn_rtm", value=filename)
+    elif nmlgen.get_value("finidat_rtm").strip() == '':
+        nmlgen.set_value('finidat_rtm', value=' ')
     else:
         if nmlgen.get_default('finidat_rtm') == 'UNSET':
-            nmlgen.add_default('finidat_rtm', value='', ignore_abs_path=True)
+            nmlgen.add_default('finidat_rtm', value=' ', ignore_abs_path=True)
         else:
             nmlgen.add_default("finidat_rtm")