[Dart-dev] [6140] DART/branches/development/models/CESM/shell_scripts/ CESM_setup_hybrid_from_prev_run.csh: fixed up the scripting to be a bit more sane.

nancy at ucar.edu nancy at ucar.edu
Thu May 16 13:27:04 MDT 2013


Revision: 6140
Author:   nancy
Date:     2013-05-16 13:27:03 -0600 (Thu, 16 May 2013)
Log Message:
-----------
fixed up the scripting to be a bit more sane.

Modified Paths:
--------------
    DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh

-------------- next part --------------
Modified: DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh	2013-05-16 16:42:58 UTC (rev 6139)
+++ DART/branches/development/models/CESM/shell_scripts/CESM_setup_hybrid_from_prev_run.csh	2013-05-16 19:27:03 UTC (rev 6140)
@@ -699,14 +699,59 @@
 
 
 # ==============================================================================
-# Construct a couple useful scripts for restarting broken runs without
-# having to run this entire script again and rebuild CESM.
-#  1) restage initial case files to start over
-#  2) restore the last successful cesm fileset to restart in the middle of a run
-#  3) the changes you need to make in the env_run file between steps 1 and 2
-#  4) resetting the env_run file to the first step
+# Construct a set of scripts for restarting broken runs without having to
+# run this entire script again and rebuild CESM.  This section creates 5 scripts
+# which do the following tasks:
+#  1) resetting the xml files to run (or rerun) the first step of the experiment
+#  2) the xml changes you need to make between steps 1 and 2
+#  3) restage initial case files to start over
+#  4) restore the files from the last successful cesm advance to restart 
+#      in the middle of a run
+#  5) restage the dart executables from the dartroot directory to the
+#      CESM bld directory
 # ==============================================================================
 
+
+#-----
+
+cat << EndOfText >! xml_changes_for_step1.sh
+#!/bin/sh
+
+# this script changes the env_run options that are needed for
+# the first job step.
+# this script was autogenerated by $0
+# using the variables set in that script
+
+./xmlchange STOP_OPTION=$stop_option
+./xmlchange STOP_N=$stop_n
+./xmlchange CONTINUE_RUN=FALSE
+./xmlchange RESUBMIT=0
+exit 0
+
+EndOfText
+chmod 0775 xml_changes_for_step1.sh
+
+#-----
+
+cat << EndOfText >! xml_changes_for_stepN.sh
+#!/bin/sh
+
+# this script changes the env_run options that are needed for
+# any jobs step after the first one.
+# this script was autogenerated by $0
+# using the variables set in that script
+
+./xmlchange STOP_OPTION=$stop_option
+./xmlchange STOP_N=$assim_n
+./xmlchange CONTINUE_RUN=TRUE
+./xmlchange RESUBMIT=$resubmit
+exit 0
+
+EndOfText
+chmod 0775 xml_changes_for_stepN.sh
+
+#-----
+
 cat << EndOfText >! reset_step1.sh
 #!/bin/sh
 
@@ -744,17 +789,16 @@
 
 cd ${caseroot}
 
-# reset the env_run options to start a new run over
-./xmlchange STOP_OPTION=$stop_option
-./xmlchange STOP_N=$stop_n
-./xmlchange CONTINUE_RUN=FALSE
-./xmlchange RESUBMIT=0
+# reset the env_run options to start a new run (or start over)
+./xml_changes_for_step1.sh
 
 exit 0
 
 EndOfText
 chmod 0775 reset_step1.sh
 
+#-----
+
 cat << EndOfText >! reset_last_successful_step.sh
 #!/bin/sh
 
@@ -789,52 +833,17 @@
 exit 0
 
 # reset the env_run options for a continue run
-./xmlchange STOP_OPTION=$stop_option
-./xmlchange STOP_N=$assim_n
-./xmlchange CONTINUE_RUN=TRUE
-# ./xmlchange RESUBMIT=$resubmit   # depends on how many runs worked before failing
+./xml_changes_for_stepN.sh
 
+# you may want to reset the RESUBMIT value, depending on how many
+# runs worked before failing.
+# ./xmlchange RESUBMIT=$resubmit
+
 EndOfText
 chmod 0775 reset_last_successful_step.sh
 
-cat << EndOfText >! stepN.sh
-#!/bin/sh
+#-----
 
-# this script changes the env_run options that are needed for
-# any jobs step after the first one.
-# this script was autogenerated by $0
-# using the variables set in that script
-
-./xmlchange STOP_OPTION=$stop_option
-./xmlchange STOP_N=$assim_n
-./xmlchange CONTINUE_RUN=TRUE
-./xmlchange RESUBMIT=$resubmit
-exit 0
-
-EndOfText
-chmod 0775 stepN.sh
-
-cat << EndOfText >! step1.sh
-#!/bin/sh
-
-# this script changes the env_run options that are needed for
-# the first job step.
-# this script was autogenerated by $0
-# using the variables set in that script
-
-./xmlchange STOP_OPTION=$stop_option
-./xmlchange STOP_N=$stop_n
-./xmlchange CONTINUE_RUN=FALSE
-./xmlchange RESUBMIT=0
-exit 0
-
-EndOfText
-chmod 0775 step1.sh
-
-# ==============================================================================
-# Stage the DART executables in the CESM execution root directory: EXEROOT
-# ==============================================================================
-
 cat << EndOfText >! refresh_dart_files.sh
 #!/bin/sh
 
@@ -870,6 +879,10 @@
 EndOfText
 chmod 0775 refresh_dart_files.sh
 
+# ==============================================================================
+# Stage the DART executables in the CESM execution root directory: EXEROOT
+# ==============================================================================
+
 ./refresh_dart_files.sh
 
 # ==============================================================================
@@ -881,22 +894,24 @@
 echo ""
 echo "cd into ${caseroot}"
 echo ""
-echo "Modify what you like in input.nml, make sure the observation directory"
-echo "names set in assimilate.csh match those on your system, and submit"
+echo "Modify what you like in xxx_input.nml, make sure the observation directory"
+echo "names set in xxx_assimilate.csh match those on your system, and submit"
 echo "the CESM job by running:"
 echo "./${case}.submit"
 echo ""
 echo "For continued submissions after the initial (hybrid) startup,"
-echo "make the following changes to the env_run variables:"
+echo " run the xml_changes_for_stepN.sh script, which makes the following"
+echo " changes to the env_run variables:"
 echo ""
 echo "  ./xmlchange CONTINUE_RUN=TRUE"
 echo "  ./xmlchange RESUBMIT=<number_of_cycles_to_run>"
 echo "  ./xmlchange STOP_N=$assim_n"
 echo ""
-echo "The shell script 'stepN.sh' will do this for you."
 echo "If you have to start over, 'reset_step1.sh' will reset the original files"
 echo " for the first timestep. 'reset_last_successful_step.sh' will set up the"
 echo " files from the last fully successful model advance/assimilation."
+echo " If you need to recompile any part of the DART system, 'refresh_dart_files.sh'"
+echo " will copy them into the correct places."
 echo ""
 echo "Check the streams listed in the streams text files.  If more or different"
 echo 'dates need to be added, then do this in the $CASEROOT/user_*files*'


More information about the Dart-dev mailing list