[Dart-dev] [6769] DART/trunk/models: More reliable termination if error conditions occur.
nancy at ucar.edu
nancy at ucar.edu
Wed Jan 29 15:15:42 MST 2014
Revision: 6769
Author: thoar
Date: 2014-01-29 15:15:42 -0700 (Wed, 29 Jan 2014)
Log Message:
-----------
More reliable termination if error conditions occur.
The "start_year" is used in the CLM stream text files.
The DATA models use the "stream_year_xxxx" variables
instead of the single 'refyear'.
The CESM_DART_config scripts have better termination
and consistent 'do no DART' behavior, which is compatible
with the comments.
Modified Paths:
--------------
DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid
DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo
DART/trunk/models/CESM/shell_scripts/CESM_DART_config
DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid
DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo
DART/trunk/models/POP/shell_scripts/CESM_DART_config
DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid
DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo
DART/trunk/models/cam/shell_scripts/CESM_DART_config
DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_hybrid
DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_pmo
DART/trunk/models/clm/shell_scripts/CESM_DART_config
-------------- next part --------------
Modified: DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:15:42 UTC (rev 6769)
@@ -714,7 +714,7 @@
@ inst ++
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/CESM/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:15:42 UTC (rev 6769)
@@ -735,7 +735,7 @@
@ inst ++
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/CESM/shell_scripts/CESM_DART_config
===================================================================
--- DART/trunk/models/CESM/shell_scripts/CESM_DART_config 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/CESM/shell_scripts/CESM_DART_config 2014-01-29 22:15:42 UTC (rev 6769)
@@ -221,7 +221,7 @@
EndOfText
chmod 0755 refresh_dart_files
-./refresh_dart_files
+./refresh_dart_files || exit -8
# ==============================================================================
# Ensure the DART namelists are consistent with the ensemble size,
@@ -278,7 +278,7 @@
EndOfText
chmod 0755 update_dart_namelists
-./update_dart_namelists
+./update_dart_namelists || exit -9
#=========================================================================
# Stage the files needed for SAMPLING ERROR CORRECTION - even if not
Modified: DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:15:42 UTC (rev 6769)
@@ -436,9 +436,9 @@
./xmlchange DATM_MODE=CPLHIST3HrWx
./xmlchange DATM_CPLHIST_CASE=$case
-./xmlchange DATM_CPLHIST_YR_ALIGN=$refyear
-./xmlchange DATM_CPLHIST_YR_START=$refyear
-./xmlchange DATM_CPLHIST_YR_END=$refyear
+./xmlchange DATM_CPLHIST_YR_ALIGN=$stream_year_align
+./xmlchange DATM_CPLHIST_YR_START=$stream_year_first
+./xmlchange DATM_CPLHIST_YR_END=$stream_year_last
# The streams files were generated with a NO_LEAP calendar in mind.
# We need to test these with a GREGORIAN calendar.
@@ -650,7 +650,7 @@
#
# ==============================================================================
-./preview_namelists
+./preview_namelists || exit -3
# This gives us a stream txt file for each instance that we can
# modify for our own purpose.
@@ -704,7 +704,7 @@
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:15:42 UTC (rev 6769)
@@ -436,9 +436,9 @@
./xmlchange DATM_MODE=CPLHIST3HrWx
./xmlchange DATM_CPLHIST_CASE=$case
-./xmlchange DATM_CPLHIST_YR_ALIGN=$refyear
-./xmlchange DATM_CPLHIST_YR_START=$refyear
-./xmlchange DATM_CPLHIST_YR_END=$refyear
+./xmlchange DATM_CPLHIST_YR_ALIGN=$stream_year_align
+./xmlchange DATM_CPLHIST_YR_START=$stream_year_first
+./xmlchange DATM_CPLHIST_YR_END=$stream_year_last
# The streams files were generated with a NO_LEAP calendar in mind.
# We need to test these with a GREGORIAN calendar.
@@ -656,7 +656,7 @@
#
# ==============================================================================
-./preview_namelists
+./preview_namelists || exit -3
# This gives us a stream txt file for each instance that we can
# modify for our own purpose.
@@ -713,7 +713,7 @@
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/POP/shell_scripts/CESM_DART_config
===================================================================
--- DART/trunk/models/POP/shell_scripts/CESM_DART_config 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/POP/shell_scripts/CESM_DART_config 2014-01-29 22:15:42 UTC (rev 6769)
@@ -188,7 +188,7 @@
EndOfText
chmod 0755 refresh_dart_files
-./refresh_dart_files
+./refresh_dart_files || exit -8
# ==============================================================================
# Ensure the DART namelists are consistent with the ensemble size,
@@ -218,7 +218,7 @@
EndOfText
chmod 0755 update_dart_namelists
-./update_dart_namelists
+./update_dart_namelists || exit -9
#=========================================================================
# Stage the files needed for SAMPLING ERROR CORRECTION - even if not
@@ -312,8 +312,11 @@
grep 'SUCCESSFUL TERMINATION' $CplLogFile
if ( $status == 0 ) then
- ${CASEROOT}/DARTSCRIPTNAME
+# If you want to use DART, uncomment the line with 'DARTSCRIPTNAME',
+# otherwise, CESM is running as usual.
+# ${CASEROOT}/DARTSCRIPTNAME
+
if ( $status == 0 ) then
echo "`date` -- DART HAS FINISHED"
else
@@ -339,11 +342,13 @@
# modify the "here" document to call the logical DART script.
if ( $num_instances == 1 ) then
- sed -e "s#DARTSCRIPTNAME#perfect_model.csh#" < temp.$$ >! add_to_run.txt
+ set DARTscript = perfect_model.csh
else
- sed -e "s#DARTSCRIPTNAME#assimilate.csh#" < temp.$$ >! add_to_run.txt
+ set DARTscript = assimilate.csh
endif
+sed -e "s#DARTSCRIPTNAME#${DARTscript}#" < temp.$$ >! add_to_run.txt
+
# Now that the "here" document is created,
# determine WHERE to insert it -- ONLY IF it is not already there.
@@ -383,20 +388,41 @@
# What to do next
# ==============================================================================
-echo "Time to check the DART configuration:"
-echo ""
-echo "1) Modify what you need to in the DART namelists. These are "
-echo " ${CASEROOT}/input.nml"
-echo ""
-echo "2) If you have recompiled any part of the DART system, 'refresh_dart_files'"
-echo " will copy them into the correct places."
-echo ""
-echo "3) Make sure the observation directory names in assimilate.csh match"
-echo " those on your system, and submit the CESM job in the normal way."
-echo ""
-echo "4) Inflation files? Observation files for the time of interest?"
-echo ""
+cat << EndOfText >! DART_instructions.txt
+
+-------------------------------------------------------------------------
+
+Check the DART configuration:
+
+1) The default behavior is to _not_ invoke DART and simply run CESM.
+ We recommend that you make sure this works before proceeding.
+
+2) When you want to run DART, make sure the ${CASE}.run script
+ references "$DARTscript".
+
+3) Modify what you need to in the DART namelist file, i.e. ${CASEROOT}/input.nml
+
+4) If you have recompiled any part of the DART system, 'refresh_dart_files'
+ will copy them into the correct places.
+
+5) If you stage your own inflation files, make sure you read the INFLATION section
+ in ${CASEROOT}/CESM_DART_config
+
+6) Make sure the observation directory names in $DARTscript match
+ those on your system.
+
+7) Submit the CESM job in the normal way.
+
+8) You can use ${CASEROOT}/stage_cesm_files
+ to stage files to restart a run.
+
+-------------------------------------------------------------------------
+
+EndOfText
+
+cat DART_instructions.txt
+
exit 0
# <next few lines under version control, do not edit>
Modified: DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:15:42 UTC (rev 6769)
@@ -723,7 +723,7 @@
@ inst ++
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:15:42 UTC (rev 6769)
@@ -717,7 +717,7 @@
@ inst ++
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/cam/shell_scripts/CESM_DART_config
===================================================================
--- DART/trunk/models/cam/shell_scripts/CESM_DART_config 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/cam/shell_scripts/CESM_DART_config 2014-01-29 22:15:42 UTC (rev 6769)
@@ -189,7 +189,7 @@
EndOfText
chmod 0755 refresh_dart_files
-./refresh_dart_files
+./refresh_dart_files || exit -8
# ==============================================================================
# Ensure the DART namelists are consistent with the ensemble size,
@@ -220,7 +220,7 @@
EndOfText
chmod 0755 update_dart_namelists
-./update_dart_namelists
+./update_dart_namelists || exit -9
#=========================================================================
# Stage the files needed for SAMPLING ERROR CORRECTION - even if not
Modified: DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_hybrid 2014-01-29 22:15:42 UTC (rev 6769)
@@ -458,9 +458,9 @@
./xmlchange DATM_MODE=CPLHIST3HrWx
./xmlchange DATM_CPLHIST_CASE=$case
-./xmlchange DATM_CPLHIST_YR_ALIGN=$refyear
-./xmlchange DATM_CPLHIST_YR_START=$refyear
-./xmlchange DATM_CPLHIST_YR_END=$refyear
+./xmlchange DATM_CPLHIST_YR_ALIGN=$stream_year_align
+./xmlchange DATM_CPLHIST_YR_START=$stream_year_first
+./xmlchange DATM_CPLHIST_YR_END=$stream_year_last
./xmlchange CALENDAR=GREGORIAN
@@ -675,7 +675,7 @@
#
# ==============================================================================
-./preview_namelists
+./preview_namelists || exit -3
# This gives us a stream txt file for each instance that we can
# modify for our own purpose.
@@ -710,12 +710,12 @@
if (-e $dartroot/models/clm/shell_scripts/user_$streamname*template) then
- echo "Copying DART template for ${FNAME} and changing instances, refyear"
+ echo "Copying DART template for ${FNAME} and changing instances, runyear"
${COPY} $dartroot/models/clm/shell_scripts/user_$streamname*template ${FNAME}
sed s/NINST/$instance/g ${FNAME} >! out.$$
- sed s/REFYEAR/$refyear/g out.$$ >! ${FNAME}
+ sed s/RUNYEAR/$start_year/g out.$$ >! ${FNAME}
\rm -f out.$$
else
@@ -726,7 +726,7 @@
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_pmo 2014-01-29 22:15:42 UTC (rev 6769)
@@ -453,9 +453,9 @@
./xmlchange DATM_MODE=CPLHIST3HrWx
./xmlchange DATM_CPLHIST_CASE=$case
-./xmlchange DATM_CPLHIST_YR_ALIGN=$refyear
-./xmlchange DATM_CPLHIST_YR_START=$refyear
-./xmlchange DATM_CPLHIST_YR_END=$refyear
+./xmlchange DATM_CPLHIST_YR_ALIGN=$stream_year_align
+./xmlchange DATM_CPLHIST_YR_START=$stream_year_first
+./xmlchange DATM_CPLHIST_YR_END=$stream_year_last
./xmlchange CALENDAR=GREGORIAN
@@ -670,7 +670,7 @@
#
# ==============================================================================
-./preview_namelists
+./preview_namelists || exit -3
# This gives us a stream txt file for each instance that we can
# modify for our own purpose.
@@ -709,12 +709,12 @@
if (-e $dartroot/models/clm/shell_scripts/user_$streamname*template) then
- echo "Copying DART template for ${FNAME} and changing instance, refyear"
+ echo "Copying DART template for ${FNAME} and changing instance, runyear"
${COPY} $dartroot/models/clm/shell_scripts/user_$streamname*template ${FNAME}
sed s/NINST/$instance/g ${FNAME} >! out.$$
- sed s/REFYEAR/$refyear/g out.$$ >! ${FNAME}
+ sed s/RUNYEAR/$start_year/g out.$$ >! ${FNAME}
\rm -f out.$$
else
@@ -725,7 +725,7 @@
end
-./preview_namelists
+./preview_namelists || exit -3
# ==============================================================================
# Stage the restarts now that the run directory exists
Modified: DART/trunk/models/clm/shell_scripts/CESM_DART_config
===================================================================
--- DART/trunk/models/clm/shell_scripts/CESM_DART_config 2014-01-29 22:10:32 UTC (rev 6768)
+++ DART/trunk/models/clm/shell_scripts/CESM_DART_config 2014-01-29 22:15:42 UTC (rev 6769)
@@ -188,7 +188,7 @@
EndOfText
chmod 0755 refresh_dart_files
-./refresh_dart_files
+./refresh_dart_files || exit -8
# ==============================================================================
# Ensure the DART namelists are consistent with the ensemble size,
@@ -223,7 +223,7 @@
EndOfText
chmod 0755 update_dart_namelists
-./update_dart_namelists
+./update_dart_namelists || exit -9
#=========================================================================
# Stage the files needed for SAMPLING ERROR CORRECTION - even if not
@@ -295,7 +295,9 @@
grep 'SUCCESSFUL TERMINATION' $CplLogFile
if ( $status == 0 ) then
- ${CASEROOT}/DARTSCRIPTNAME
+# If you want to use DART, uncomment the line with 'DARTSCRIPTNAME',
+# otherwise, CESM is running as usual.
+# ${CASEROOT}/DARTSCRIPTNAME
if ( $status == 0 ) then
echo "`date` -- DART HAS FINISHED"
More information about the Dart-dev
mailing list