[Dart-dev] [6557] DART/trunk/models: Integrated the best comments from each of the files into all of the files.
nancy at ucar.edu
nancy at ucar.edu
Thu Oct 31 15:04:48 MDT 2013
Revision: 6557
Author: thoar
Date: 2013-10-31 15:04:48 -0600 (Thu, 31 Oct 2013)
Log Message:
-----------
Integrated the best comments from each of the files into all of the files.
whitespace and formatting changes only, no executable changes.
Modified Paths:
--------------
DART/trunk/models/POP/shell_scripts/perfect_model.csh
DART/trunk/models/cam/shell_scripts/perfect_model.csh
DART/trunk/models/clm/shell_scripts/perfect_model.csh
-------------- next part --------------
Modified: DART/trunk/models/POP/shell_scripts/perfect_model.csh
===================================================================
--- DART/trunk/models/POP/shell_scripts/perfect_model.csh 2013-10-31 20:09:53 UTC (rev 6556)
+++ DART/trunk/models/POP/shell_scripts/perfect_model.csh 2013-10-31 21:04:48 UTC (rev 6557)
@@ -50,7 +50,7 @@
endsw
#-------------------------------------------------------------------------
-# Determine time of model state ... from file name of first member
+# Determine time of model state ... from file name
# of the form "./${MYCASE}.pop.r.2000-01-06-00000.nc"
#
# Piping stuff through 'bc' strips off any preceeding zeros.
@@ -72,7 +72,7 @@
echo "valid time of model is $OCN_YEAR $OCN_MONTH $OCN_DAY $OCN_HOUR (hours)"
#-------------------------------------------------------------------------
-# Create temporary working directory for the assimilation and go there
+# Create temporary working directory for the perfect model and go there
#-------------------------------------------------------------------------
set temp_dir = pmo_pop
@@ -116,7 +116,6 @@
# &perfect_model_obs_nml: last_obs_days = -1,
# &perfect_model_obs_nml: last_obs_seconds = -1,
# &pop_to_dart_nml: pop_to_dart_output_file = 'dart_ics'
-#
#=========================================================================
if ( ! -e ${CASEROOT}/input.nml ) then
@@ -134,9 +133,9 @@
${LINK} ../$OCN_NML_FILENAME pop_in
#=========================================================================
-# Block 2: convert 1 pop restart file to a DART initial conditions file.
-# At the end of the block, we have a DART restart file perfect_ics
-# that came from the pointer file ../rpointer.ocn.restart
+# Block 2: Convert 1 POP restart file to a DART initial conditions file.
+# At the end of the block, we have DART initial condition file perfect_ics
+# that came from the contents of the pointer file ../rpointer.ocn.restart
#=========================================================================
echo "`date` -- BEGIN POP-TO-DART"
@@ -153,9 +152,11 @@
#=========================================================================
# Block 3: Advance the model and harvest the synthetic observations.
-# Will result in a single file : 'perfect_restart' which we don't need
-# for a perfect model experiment with CESM.
-#
+# output files are:
+# True_state.nc ...... the DART state
+# obs_seq.perfect ...... the synthetic observations
+# dart_log.out ...... run-time output of all DART routines
+# perfect_restart ...... which we don't need
#=========================================================================
echo "`date` -- BEGIN POP PERFECT_MODEL_OBS"
@@ -175,7 +176,7 @@
echo "`date` -- END POP PERFECT_MODEL_OBS"
#=========================================================================
-# Block 4: Update the pop restart files.
+# Block 4: Update the pop restart file
#=========================================================================
# not needed ... perfect_model_obs does not update the model state.
@@ -186,6 +187,7 @@
# Eat the cookie regardless
${REMOVE} ../pop_inflation_cookie
+${REMOVE} perfect_ics dart_log.nml
echo "`date` -- END GENERATE POP TRUE STATE"
Modified: DART/trunk/models/cam/shell_scripts/perfect_model.csh
===================================================================
--- DART/trunk/models/cam/shell_scripts/perfect_model.csh 2013-10-31 20:09:53 UTC (rev 6556)
+++ DART/trunk/models/cam/shell_scripts/perfect_model.csh 2013-10-31 21:04:48 UTC (rev 6557)
@@ -104,7 +104,7 @@
# The observation file names have a time that matches the stopping time of CAM.
#-----------------------------------------------------------------------------
-set YYYYMM = `printf %04d%02d ${ATM_YEAR} ${ATM_MONTH}`
+set YYYYMM = `printf %04d%02d ${ATM_YEAR} ${ATM_MONTH}`
set OBSFNAME = `printf obs_seq%04d%02d%02d%02d ${ATM_YEAR} ${ATM_MONTH} ${ATM_DAY} ${ATM_HOUR}`
set OBS_FILE = ${BASEOBSDIR}/${YYYYMM}_6H/${OBSFNAME}
@@ -117,78 +117,82 @@
endif
#=========================================================================
-# Block 1: Populate a run-time directory with the input needed to run DART,
-# and Block 2: Convert 1 CAM restart file to DART initial conditions file.
-# At the end of the block, we have DART initial condition file perfect_ics
-# that came from pointer file ../rpointer.atm
+# Block 1: Populate a run-time directory with the input needed to run DART.
#
-# REQUIRED DART namelist settings:
+# DART namelist settings required:
# &perfect_model_obs_nml: restart_in_file_name = 'perfect_ics'
+# &perfect_model_obs_nml: obs_sequence_in_name = 'obs_seq.in'
+# &perfect_model_obs_nml: obs_sequence_out_name = 'obs_seq.perfect'
+# &perfect_model_obs_nml: init_time_days = -1,
+# &perfect_model_obs_nml: init_time_seconds = -1,
+# &perfect_model_obs_nml: first_obs_days = -1,
+# &perfect_model_obs_nml: first_obs_seconds = -1,
+# &perfect_model_obs_nml: last_obs_days = -1,
+# &perfect_model_obs_nml: last_obs_seconds = -1,
# &cam_to_dart_nml: cam_to_dart_output_file = 'dart_ics'
#=========================================================================
-echo "`date` -- BEGIN CAM-TO-DART"
+if ( ! -e ${CASEROOT}/input.nml ) then
+ echo "ERROR ... DART required file ${CASEROOT}/input.nml not found ... ERROR"
+ echo "ERROR ... DART required file ${CASEROOT}/input.nml not found ... ERROR"
+ exit -2
+endif
- if ( ! -e ${CASEROOT}/input.nml ) then
- echo "ERROR ... DART required file ${CASEROOT}/input.nml not found ... ERROR"
- echo "ERROR ... DART required file ${CASEROOT}/input.nml not found ... ERROR"
- exit -2
- endif
+sed -e "s#dart_ics#perfect_ics#" < ${CASEROOT}/input.nml >! input.nml
- # Turns out the .h0. files are timestamped with the START of the
- # run, which is *not* ATM_DATE_EXT ... I just link to a whatever
- # is convenient (since the info is static).
- # make sure there are no old output logs hanging around
- $REMOVE output.cam_to_dart
+# Turns out the .h0. files are timestamped with the START of the
+# run, which is *not* ATM_DATE_EXT ... I just link to a whatever
+# is convenient (since the info is static).
- set ATM_INITIAL_FILENAME = "../${CASE}.cam.i.${ATM_DATE_EXT}.nc"
- set ATM_HISTORY_FILENAME = `ls -1t ../${CASE}.cam*.h0.* | head -n 1`
- set DART_IC_FILENAME = perfect_ics
+set ATM_INITIAL_FILENAME = "../${CASE}.cam.i.${ATM_DATE_EXT}.nc"
+set ATM_HISTORY_FILENAME = `ls -1t ../${CASE}.cam*.h0.* | head -n 1`
- sed -e "s#dart_ics#${DART_IC_FILENAME}#" < ${CASEROOT}/input.nml >! input.nml
+${LINK} $ATM_INITIAL_FILENAME caminput.nc
+${LINK} $ATM_HISTORY_FILENAME cam_phis.nc
- ${LINK} $ATM_INITIAL_FILENAME caminput.nc
- ${LINK} $ATM_HISTORY_FILENAME cam_phis.nc
+#=========================================================================
+# Block 2: Convert 1 CAM restart file to a DART initial conditions file.
+# At the end of the block, we have DART initial condition file perfect_ics
+# that came from the contents of the pointer file ../rpointer.atm
+#=========================================================================
- ${EXEROOT}/cam_to_dart >! output.cam_to_dart
+echo "`date` -- BEGIN CAM-TO-DART"
- if ($status != 0) then
- echo "ERROR ... DART died in 'cam_to_dart' ... ERROR"
- echo "ERROR ... DART died in 'cam_to_dart' ... ERROR"
- exit -6
- endif
+${EXEROOT}/cam_to_dart
+if ($status != 0) then
+ echo "ERROR ... DART died in 'cam_to_dart' ... ERROR"
+ echo "ERROR ... DART died in 'cam_to_dart' ... ERROR"
+ exit -3
+endif
+
echo "`date` -- END CAM-TO-DART"
#=========================================================================
-# Block 3: Run perfect_model_obs and harvest the synthetic observations
-# and diagnostic files.
-#
-# DART namelist settings required:
-# &perfect_model_obs_nml: async = 0,
-# &perfect_model_obs_nml: adv_ens_command = "no_advance_script",
-# &perfect_model_obs_nml: output_restart = .false.,
-# &perfect_model_obs_nml: restart_in_file_name = 'perfect_ics'
-# &perfect_model_obs_nml: restart_out_file_name = 'not_created'
-# &perfect_model_obs_nml: obs_sequence_in_name = 'obs_seq.in'
-# &perfect_model_obs_nml: obs_sequence_out_name = 'obs_seq.perfect'
-# &perfect_model_obs_nml: init_time_days = -1,
-# &perfect_model_obs_nml: init_time_seconds = -1,
-# &perfect_model_obs_nml: first_obs_days = -1,
-# &perfect_model_obs_nml: first_obs_seconds = -1,
-# &perfect_model_obs_nml: last_obs_days = -1,
-# &perfect_model_obs_nml: last_obs_seconds = -1,
-#
+# Block 3: Advance the model and harvest the synthetic observations.
+# output files are:
+# True_state.nc ...... the DART state
+# obs_seq.perfect ...... the synthetic observations
+# dart_log.out ...... run-time output of all DART routines
+# perfect_restart ...... which we don't need
#=========================================================================
echo "`date` -- BEGIN CAM PERFECT_MODEL_OBS"
-${EXEROOT}/perfect_model_obs || exit -7
+
+${EXEROOT}/perfect_model_obs
+
+if ($status != 0) then
+ echo "ERROR ... DART died in 'perfect_model_obs' ... ERROR"
+ echo "ERROR ... DART died in 'perfect_model_obs' ... ERROR"
+ exit -4
+endif
+
+${MOVE} True_State.nc ../cam_True_State.${ATM_DATE_EXT}.nc
+${MOVE} obs_seq.perfect ../cam_obs_seq.${ATM_DATE_EXT}.perfect
+${MOVE} dart_log.out ../cam_dart_log.${ATM_DATE_EXT}.out
+
echo "`date` -- END CAM PERFECT_MODEL_OBS"
-${MOVE} True_State.nc ../cam_True_State.${ATM_DATE_EXT}.nc
-${MOVE} obs_seq.perfect ../cam_obs_seq.${ATM_DATE_EXT}.perfect
-${MOVE} dart_log.out ../cam_dart_log.${ATM_DATE_EXT}.out
-
#=========================================================================
# Block 4: Update the cam restart file
#=========================================================================
@@ -201,15 +205,18 @@
cd ${RUNDIR}
- set ATM_INITIAL_FILENAME = ${CASE}.cam.i.${ATM_DATE_EXT}.nc
+set ATM_INITIAL_FILENAME = ${CASE}.cam.i.${ATM_DATE_EXT}.nc
- ${LINK} ${ATM_INITIAL_FILENAME} cam_initial.nc || exit -9
+${LINK} ${ATM_INITIAL_FILENAME} cam_initial.nc || exit -5
-
#-------------------------------------------------------------------------
# Cleanup
#-------------------------------------------------------------------------
+# Eat the cookie regardless
+${REMOVE} ../cam_inflation_cookie
+${REMOVE} perfect_ics dart_log.nml
+
echo "`date` -- END GENERATE CAM TRUE STATE"
exit 0
Modified: DART/trunk/models/clm/shell_scripts/perfect_model.csh
===================================================================
--- DART/trunk/models/clm/shell_scripts/perfect_model.csh 2013-10-31 20:09:53 UTC (rev 6556)
+++ DART/trunk/models/clm/shell_scripts/perfect_model.csh 2013-10-31 21:04:48 UTC (rev 6557)
@@ -70,7 +70,7 @@
endsw
#-------------------------------------------------------------------------
-# Determine time of model state ... from file name of first member
+# Determine time of model state ... from file name
# of the form "./${CASE}.clm2.r.2000-01-06-00000.nc"
#
# Piping stuff through 'bc' strips off any preceeding zeros.
@@ -90,7 +90,7 @@
echo "valid time of model is $LND_YEAR $LND_MONTH $LND_DAY $LND_HOUR (hours)"
#-------------------------------------------------------------------------
-# Create temporary working directory for the assimilation and go there
+# Create temporary working directory for the perfect model and go there
#-------------------------------------------------------------------------
set temp_dir = pmo_clm
@@ -148,7 +148,6 @@
# &perfect_model_obs_nml: last_obs_days = -1,
# &perfect_model_obs_nml: last_obs_seconds = -1,
# &clm_to_dart_nml: clm_to_dart_output_file = 'dart_ics'
-#
#=========================================================================
if ( ! -e ${CASEROOT}/input.nml ) then
@@ -157,6 +156,8 @@
exit -2
endif
+sed -e "s#dart_ics#perfect_ics#" < ${CASEROOT}/input.nml >! input.nml
+
# DART/CLM routines all need a clm_restart.nc, clm_history.nc, etc.
# The flux tower forward operator looks for a CLM history file with
# an instance number in the filename.
@@ -165,7 +166,6 @@
set LND_HISTORY_FILENAME = ${CASE}.clm2.h0.${LND_DATE_EXT}.nc
set OBS1_HISTORY_FILENAME = ${CASE}.clm2.h1.${LND_DATE_EXT}.nc
set OBS2_HISTORY_FILENAME = ${CASE}.clm2_0001.h1.${LND_DATE_EXT}.nc
-set DART_IC_FILENAME = perfect_ics
${LINK} ../$LND_RESTART_FILENAME clm_restart.nc
${LINK} ../$LND_HISTORY_FILENAME clm_history.nc
@@ -174,14 +174,14 @@
${LINK} ../$OBS1_HISTORY_FILENAME $OBS2_HISTORY_FILENAME
endif
-sed -e "s#dart_ics#${DART_IC_FILENAME}#" < ${CASEROOT}/input.nml >! input.nml
-
#=========================================================================
-# Block 2: convert 1 clm restart file to a DART initial conditions file.
-# At the end of the block, we have a DART file "perfect_ics"
+# Block 2: Convert 1 CLM restart file to a DART initial conditions file.
+# At the end of the block, we have DART initial condition file perfect_ics
# that came from the contents of the pointer file ../rpointer.lnd
#=========================================================================
+echo "`date` -- BEGIN CLM-TO-DART"
+
# patch the CLM restart files to ensure they have the proper
# _FillValue and missing_value attributes.
# ncatted -O -a _FillValue,frac_sno,o,d,1.0e+36 clm_restart.nc
@@ -195,8 +195,6 @@
# ncatted -O -a _FillValue,T_SOISNO,o,d,1.0e+36 clm_restart.nc
# ncatted -O -a missing_value,T_SOISNO,o,d,1.0e+36 clm_restart.nc
-echo "`date` -- BEGIN CLM-TO-DART"
-
${EXEROOT}/clm_to_dart
if ($status != 0) then
@@ -209,14 +207,14 @@
#=========================================================================
# Block 3: Advance the model and harvest the synthetic observations.
-# output iles are:
+# output files are:
# True_state.nc ...... the DART state
# obs_seq.perfect ...... the synthetic observations
# dart_log.out ...... run-time output of all DART routines
# perfect_restart ...... which we don't need
#=========================================================================
-echo "`date` -- BEGIN PERFECT_MODEL_OBS"
+echo "`date` -- BEGIN CLM PERFECT_MODEL_OBS"
${EXEROOT}/perfect_model_obs
@@ -230,10 +228,10 @@
${MOVE} obs_seq.perfect ../clm_obs_seq.${LND_DATE_EXT}.perfect
${MOVE} dart_log.out ../clm_dart_log.${LND_DATE_EXT}.out
-echo "`date` -- END PERFECT_MODEL_OBS"
+echo "`date` -- END CLM PERFECT_MODEL_OBS"
#=========================================================================
-# Block 4: Update the clm restart files.
+# Block 4: Update the clm restart file
#=========================================================================
# not needed ... perfect_model_obs does not update the CLM model state.
More information about the Dart-dev
mailing list