[Dart-dev] [6559] DART/trunk/models: Consistency and grammar changes.

nancy at ucar.edu nancy at ucar.edu
Fri Nov 1 12:04:23 MDT 2013


Revision: 6559
Author:   thoar
Date:     2013-11-01 12:04:22 -0600 (Fri, 01 Nov 2013)
Log Message:
-----------
Consistency and grammar changes.
The xxx_perfect_model.csh scripts look like their 
xxx/shell_scripts/perfect_model.csh counterparts as much as possible.

In the setup scripts, the biggest change is the documentation
and moving the single-instance pointer files OUT of a loop over instances.

Modified Paths:
--------------
    DART/trunk/models/CESM/shell_scripts/cam_perfect_model.csh
    DART/trunk/models/CESM/shell_scripts/clm_perfect_model.csh
    DART/trunk/models/CESM/shell_scripts/pop_perfect_model.csh
    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/cam/shell_scripts/CESM1_1_1_setup_hybrid
    DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_pmo
    DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_hybrid
    DART/trunk/models/clm/shell_scripts/CESM1_1_1_setup_pmo

-------------- next part --------------
Modified: DART/trunk/models/CESM/shell_scripts/cam_perfect_model.csh
===================================================================
--- DART/trunk/models/CESM/shell_scripts/cam_perfect_model.csh	2013-10-31 21:51:22 UTC (rev 6558)
+++ DART/trunk/models/CESM/shell_scripts/cam_perfect_model.csh	2013-11-01 18:04:22 UTC (rev 6559)
@@ -59,7 +59,6 @@
 #-------------------------------------------------------------------------
 
 set FILE = `head -n 1 rpointer.atm`
-set FILE = $FILE:t
 set FILE = $FILE:r
 set ATM_DATE_EXT = `echo $FILE:e`
 set ATM_DATE     = `echo $FILE:e | sed -e "s#-# #g"`
@@ -105,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}
 
@@ -118,80 +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}/cam_input.nml ) then
+   echo "ERROR ... DART required file ${CASEROOT}/cam_input.nml not found ... ERROR"
+   echo "ERROR ... DART required file ${CASEROOT}/cam_input.nml not found ... ERROR"
+   exit -2
+endif
 
-   if ( ! -e   ${CASEROOT}/cam_input.nml ) then
-      echo "ERROR ... DART required file ${CASEROOT}/cam_input.nml not found ... ERROR"
-      echo "ERROR ... DART required file ${CASEROOT}/cam_input.nml not found ... ERROR"
-      exit -2
-   endif
+sed -e "s#dart_ics#perfect_ics#" < ${CASEROOT}/cam_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}/cam_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 a 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_cam || exit -7
-echo "`date` -- END   CAM PERFECT_MODEL_OBS"
 
+${EXEROOT}/perfect_model_obs_cam
 
-${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
+if ($status != 0) then
+   echo "ERROR ... DART died in 'perfect_model_obs_cam' ... ERROR"
+   echo "ERROR ... DART died in 'perfect_model_obs_cam' ... 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"
+
 #=========================================================================
 # Block 4: Update the cam restart file
 #=========================================================================
@@ -204,20 +205,17 @@
 
 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
-# we (DART) do not need these files, and CESM does not need them either
-# to continue a run.  if we remove them here they do not get moved to
-# the short-term archiver.
 #-------------------------------------------------------------------------
 
-# ${REMOVE} ${RUNDIR}/*.rh0.*
-# ${REMOVE} ${RUNDIR}/*.rs1.*
+# Eat the cookie regardless
+${REMOVE} ../cam_inflation_cookie
+${REMOVE} perfect_ics dart_log.nml
 
 echo "`date` -- END   GENERATE CAM TRUE STATE"
 

Modified: DART/trunk/models/CESM/shell_scripts/clm_perfect_model.csh
===================================================================
--- DART/trunk/models/CESM/shell_scripts/clm_perfect_model.csh	2013-10-31 21:51:22 UTC (rev 6558)
+++ DART/trunk/models/CESM/shell_scripts/clm_perfect_model.csh	2013-11-01 18:04:22 UTC (rev 6559)
@@ -18,7 +18,7 @@
 
 # The FORCE options are not optional.
 # The VERBOSE options are useful for debugging though
-# some systems don't like the -v option to any of the following 
+# some systems don't like the -v option to any of the following
 switch ("`hostname`")
    case be*:
       # NCAR "bluefire"
@@ -72,7 +72,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.
@@ -136,7 +136,7 @@
 # The only ugly part here is if the first advance and subsequent advances are
 # not the same length. The observations _may_ come from different directories.
 #
-# The contents of the file must match the history file contents if one is using 
+# The contents of the file must match the history file contents if one is using
 # the obs_def_tower_mod or could be the 'traditional' +/- 12Z ... or both.
 # Since the history file contains the previous days' history ... so must the obs file.
 #-----------------------------------------------------------------------------
@@ -158,38 +158,55 @@
 endif
 
 #=========================================================================
-# Block 1: Populate a run-time directory with the input needed to run DART,
-# and Block 2: Convert 1 CLM 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.lnd
+# 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,
 # &clm_to_dart_nml:        clm_to_dart_output_file = 'dart_ics'
 #=========================================================================
 
-echo "`date` -- BEGIN CLM-TO-DART"
+if ( ! -e ${CASEROOT}/clm_input.nml ) then
+   echo "ERROR ... DART required file ${CASEROOT}/clm_input.nml not found ... ERROR"
+   echo "ERROR ... DART required file ${CASEROOT}/clm_input.nml not found ... ERROR"
+   exit -2
+endif
 
-   if ( ! -e   ${CASEROOT}/clm_input.nml ) then
-      echo "ERROR ... DART required file ${CASEROOT}/clm_input.nml not found ... ERROR"
-      echo "ERROR ... DART required file ${CASEROOT}/clm_input.nml not found ... ERROR"
-      exit -2
-   endif
+sed -e "s#dart_ics#perfect_ics#" < ${CASEROOT}/clm_input.nml >! input.nml
 
-   # make sure there are no old output logs hanging around
-   $REMOVE output.clm_to_dart
+# 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.
 
-   set  LND_RESTART_FILENAME = ../${CASE}.clm2.r.${LND_DATE_EXT}.nc
-   set  LND_HISTORY_FILENAME = ../${CASE}.clm2.h0.${LND_DATE_EXT}.nc
-   set DART_IC_FILENAME = perfect_ics
+set  LND_RESTART_FILENAME = ${CASE}.clm2.r.${LND_DATE_EXT}.nc
+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
 
-   sed -e "s#dart_ics#${DART_IC_FILENAME}#" < ${CASEROOT}/clm_input.nml >! input.nml
+${LINK} ../$LND_RESTART_FILENAME clm_restart.nc
+${LINK} ../$LND_HISTORY_FILENAME clm_history.nc
 
-   ${LINK} $LND_RESTART_FILENAME clm_restart.nc
-   ${LINK} $LND_HISTORY_FILENAME clm_history.nc
+if (  -e   ../$OBS1_HISTORY_FILENAME) then
+   ${LINK} ../$OBS1_HISTORY_FILENAME $OBS2_HISTORY_FILENAME
+endif
 
-   # patch the CLM restart files to ensure they have the proper
-   # _FillValue and missing_value attributes.
+#=========================================================================
+# Block 2: Convert 1 CLM restart file to a DART initial conditions file.
+# At the end of the block, we have a 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
 #  ncatted -O -a missing_value,frac_sno,o,d,1.0e+36   clm_restart.nc
 #  ncatted -O -a    _FillValue,DZSNO,o,d,1.0e+36      clm_restart.nc
@@ -201,58 +218,53 @@
 #  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
 
-   ${EXEROOT}/clm_to_dart >! output.clm_to_dart 
+${EXEROOT}/clm_to_dart
 
-   if ($status != 0) then
-      echo "ERROR ... DART died in 'clm_to_dart' ... ERROR"
-      echo "ERROR ... DART died in 'clm_to_dart' ... ERROR"
-      exit -6
-   endif
+if ($status != 0) then
+   echo "ERROR ... DART died in 'clm_to_dart' ... ERROR"
+   echo "ERROR ... DART died in 'clm_to_dart' ... ERROR"
+   exit -3
+endif
 
 echo "`date` -- END CLM-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 CLM PERFECT_MODEL_OBS"
-${EXEROOT}/perfect_model_obs_clm || exit -7
-echo "`date` -- END   CLM PERFECT_MODEL_OBS"
 
+${EXEROOT}/perfect_model_obs_clm
 
-${MOVE} True_State.nc      ../clm_True_State.${LND_DATE_EXT}.nc
-${MOVE} obs_seq.perfect    ../clm_obs_seq.${LND_DATE_EXT}.perfect
-${MOVE} dart_log.out       ../clm_dart_log.${LND_DATE_EXT}.out
+if ($status != 0) then
+   echo "ERROR ... DART died in 'perfect_model_obs_clm' ... ERROR"
+   echo "ERROR ... DART died in 'perfect_model_obs_clm' ... ERROR"
+   exit -4
+endif
 
+${MOVE} True_State.nc    ../clm_True_State.${LND_DATE_EXT}.nc
+${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   CLM PERFECT_MODEL_OBS"
+
 #=========================================================================
 # Block 4: Update the clm restart file
 #=========================================================================
 
 # not needed ... perfect_model_obs does not update the model state.
 
-
 #-------------------------------------------------------------------------
 # Cleanup
 #-------------------------------------------------------------------------
 
+${REMOVE} perfect_ics dart_log.nml
+
 echo "`date` -- END   GENERATE CLM TRUE STATE"
 
 exit 0

Modified: DART/trunk/models/CESM/shell_scripts/pop_perfect_model.csh
===================================================================
--- DART/trunk/models/CESM/shell_scripts/pop_perfect_model.csh	2013-10-31 21:51:22 UTC (rev 6558)
+++ DART/trunk/models/CESM/shell_scripts/pop_perfect_model.csh	2013-11-01 18:04:22 UTC (rev 6559)
@@ -18,7 +18,7 @@
 
 # The FORCE options are not optional.
 # The VERBOSE options are useful for debugging though
-# some systems don't like the -v option to any of the following 
+# some systems don't like the -v option to any of the following
 switch ("`hostname`")
    case be*:
       # NCAR "bluefire"
@@ -52,7 +52,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}.pop.r.2000-01-06-00000.nc"
 #
 # Piping stuff through 'bc' strips off any preceeding zeros.
@@ -118,88 +118,92 @@
 endif
 
 #=========================================================================
-# Block 1: Populate a run-time directory with the input needed to run DART,
-# and Block 2: Convert 1 POP 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.ocn.restart
+# 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,
 # &pop_to_dart_nml:        pop_to_dart_output_file = 'dart_ics'
 #=========================================================================
 
-echo "`date` -- BEGIN POP-TO-DART"
+if ( ! -e ${CASEROOT}/pop_input.nml ) then
+   echo "ERROR ... DART required file ${CASEROOT}/pop_input.nml not found ... ERROR"
+   echo "ERROR ... DART required file ${CASEROOT}/pop_input.nml not found ... ERROR"
+   exit -2
+endif
 
-   if ( ! -e   ${CASEROOT}/pop_input.nml ) then
-      echo "ERROR ... DART required file ${CASEROOT}/pop_input.nml not found ... ERROR"
-      echo "ERROR ... DART required file ${CASEROOT}/pop_input.nml not found ... ERROR"
-      exit -2
-   endif
+sed -e "s#dart_ics#perfect_ics#" < ${CASEROOT}/pop_input.nml >! input.nml
 
-   # make sure there are no old output logs hanging around
-   $REMOVE output.pop_to_dart
+set OCN_RESTART_FILENAME = ${CASE}.pop.r.${OCN_DATE_EXT}.nc
+set     OCN_NML_FILENAME = pop2_in
 
-   set OCN_RESTART_FILENAME = ../${CASE}.pop.r.${OCN_DATE_EXT}.nc
-   set     OCN_NML_FILENAME = ../pop2_in
-   set     DART_IC_FILENAME = perfect_ics
+${LINK} ../$OCN_RESTART_FILENAME pop.r.nc
+${LINK} ../$OCN_NML_FILENAME     pop_in
 
-   sed -e "s#dart_ics#${DART_IC_FILENAME}#" < ${CASEROOT}/pop_input.nml >! input.nml
+#=========================================================================
+# Block 2: Convert 1 POP restart file to a DART initial conditions file.
+# At the end of the block, we have a DART initial condition file  perfect_ics
+# that came from the contents of the pointer file ../rpointer.ocn.restart
+#=========================================================================
 
-   ${LINK} $OCN_RESTART_FILENAME pop.r.nc
-   ${LINK} $OCN_NML_FILENAME     pop_in
+echo "`date` -- BEGIN POP-TO-DART"
 
-   ${EXEROOT}/pop_to_dart >! output.pop_to_dart
+${EXEROOT}/pop_to_dart
 
-   if ($status != 0) then
-      echo "ERROR ... DART died in 'pop_to_dart' ... ERROR"
-      echo "ERROR ... DART died in 'pop_to_dart' ... ERROR"
-      exit -3
-   endif
+if ($status != 0) then
+   echo "ERROR ... DART died in 'pop_to_dart' ... ERROR"
+   echo "ERROR ... DART died in 'pop_to_dart' ... ERROR"
+   exit -3
+endif
 
 echo "`date` -- END POP-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 POP PERFECT_MODEL_OBS"
-${EXEROOT}/perfect_model_obs_pop || exit -7
-echo "`date` -- END   POP PERFECT_MODEL_OBS"
 
+${EXEROOT}/perfect_model_obs_pop
 
-${MOVE} True_State.nc      ../pop_True_State.${OCN_DATE_EXT}.nc
-${MOVE} obs_seq.perfect    ../pop_obs_seq.${OCN_DATE_EXT}.perfect
-${MOVE} dart_log.out       ../pop_dart_log.${OCN_DATE_EXT}.out
+if ($status != 0) then
+   echo "ERROR ... DART died in 'perfect_model_obs_pop' ... ERROR"
+   echo "ERROR ... DART died in 'perfect_model_obs_pop' ... ERROR"
+   exit -4
+endif
 
+${MOVE} True_State.nc    ../pop_True_State.${OCN_DATE_EXT}.nc
+${MOVE} obs_seq.perfect  ../pop_obs_seq.${OCN_DATE_EXT}.perfect
+${MOVE} dart_log.out     ../pop_dart_log.${OCN_DATE_EXT}.out
+
+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.
 
-
 #-------------------------------------------------------------------------
 # Cleanup
 #-------------------------------------------------------------------------
 
+# Eat the cookie regardless
+${REMOVE} ../pop_inflation_cookie
+${REMOVE} perfect_ics dart_log.nml
+
 echo "`date` -- END   GENERATE POP TRUE STATE"
 
 exit 0

Modified: DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid	2013-10-31 21:51:22 UTC (rev 6558)
+++ DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_hybrid	2013-11-01 18:04:22 UTC (rev 6559)
@@ -151,7 +151,7 @@
 # assim_n       Number of time units between assimilations
 #
 # If the long-term archiver is off, you get a chance to examine the files before
-# they get moved to long-term storage. You can always submit $CASE.l_archive
+# they get moved to long-term storage. You can always submit $case.l_archive
 # whenever you want to free up space in the short-term archive directory.
 #
 # ==============================================================================
@@ -525,15 +525,15 @@
    echo "fillmask = 'nomask','nomask'"      >> $fname
    echo "mapalgo  = 'bilinear','bilinear'"  >> $fname
    echo "mapmask  = 'nomask','nomask'"      >> $fname
-   echo "streams  = 'datm.streams.txt.CPLHIST3HrWx.Solar$inst_string             $stream_year_align $stream_year_first $stream_year_last'," >> $fname
-   echo "           'datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip$inst_string $stream_year_align $stream_year_first $stream_year_last'"  >> $fname
+   echo "streams  = 'datm.streams.txt.CPLHIST3HrWx.Solar${inst_string}             $stream_year_align $stream_year_first $stream_year_last'," >> $fname
+   echo "           'datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip${inst_string} $stream_year_align $stream_year_first $stream_year_last'"  >> $fname
    echo "taxmode  = 'cycle','cycle'"        >> $fname
    echo "tintalgo = 'linear','linear'"      >> $fname
    echo "restfils = 'unset'"                >> $fname
    echo "restfilm = 'unset'"                >> $fname
 
    # ===========================================================================
-   set fname = "user_nl_cice$inst_string"
+   set fname = "user_nl_cice${inst_string}"
    # ===========================================================================
    # CICE Namelists
    # this is only used for a hybrid start, else rpointers are used.
@@ -541,7 +541,7 @@
    echo "ice_ic = '${run_refcase}.cice${inst_string}.r.2004-01-10-00000.nc'" >> $fname
 
    # ===========================================================================
-   set fname = "user_nl_pop2$inst_string"
+   set fname = "user_nl_pop2${inst_string}"
    # ===========================================================================
 
    # POP Namelists
@@ -694,9 +694,7 @@
 
       @ inst=1
       while (\$inst <= $num_instances)
-
          set inst_string = \`printf _%04d \$inst\`
-         echo "${CASE}.cpl.r.\${restart_time}.nc"                    >! rpointer.drv
          echo "${CASE}.datm\${inst_string}.r.\${restart_time}.nc"    >! rpointer.atm\${inst_string}
          echo "${CASE}.datm\${inst_string}.rs1.\${restart_time}.bin" >> rpointer.atm\${inst_string}
          echo "${CASE}.drof\${inst_string}.r.\${restart_time}.nc"    >! rpointer.rof\${inst_string}
@@ -716,6 +714,10 @@
 
          @ inst ++
       end
+
+      # This has nothing to do with instances.
+      echo "${CASE}.cpl.r.\${restart_time}.nc" >! rpointer.drv
+
    endif
 
    exit 0
@@ -732,12 +734,10 @@
 # and it certainly has more files than we need.
 # This stages only the minimum number of instances and files.
 #
-# Remember - when CONTINUE_RUN = FALSE,
+# Remember - in a hybrid case - when CONTINUE_RUN = FALSE,
 # the run_refdate and the time in the filenames can be unrelated.
 #----------------------------------------------------------------------
 
-set filedir = ${POP_stagedir}
-
 @ inst=1
 while (\$inst <= $num_instances)
 
@@ -747,9 +747,9 @@
    echo "Staging restarts for instance \$inst of $num_instances"
 
    #TH: The cice fname must match that in the user_nl_cice file
-   ${LINK} \${filedir}/${run_refcase}.cice\${inst_string}.r.\${restart_time}.nc .
-   ${LINK} \${filedir}/${run_refcase}.pop\${inst_string}.r.\${restart_time}.nc  .
-   ${LINK} \${filedir}/${run_refcase}.pop\${inst_string}.ro.\${restart_time}    .
+   ${LINK} ${POP_stagedir}/${run_refcase}.cice\${inst_string}.r.\${restart_time}.nc .
+   ${LINK} ${POP_stagedir}/${run_refcase}.pop\${inst_string}.r.\${restart_time}.nc  .
+   ${LINK} ${POP_stagedir}/${run_refcase}.pop\${inst_string}.ro.\${restart_time}    .
 
    echo "${run_refcase}.pop\${inst_string}.ro.\${restart_time}"   >! rpointer.ocn\${inst_string}.ovf
    echo "${run_refcase}.pop\${inst_string}.r.\${restart_time}.nc" >! rpointer.ocn\${inst_string}.restart

Modified: DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo
===================================================================
--- DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo	2013-10-31 21:51:22 UTC (rev 6558)
+++ DART/trunk/models/POP/shell_scripts/CESM1_1_1_setup_pmo	2013-11-01 18:04:22 UTC (rev 6559)
@@ -46,6 +46,8 @@
 #    This script sets up a CESM single instance run as we understand them and
 #    it has almost nothing to do with DART. This is intentional.
 #
+# -- Examine the whole script to identify things to change for your experiments.
+#
 # -- Edit and run this script in the $DART/models/CESM/shell_scripts directory
 #    or copy it to somewhere that it will be preserved and run it there.
 #    It will create a CESM 'CASE' directory, where the model will be built,
@@ -53,7 +55,6 @@
 #    take place.  The short term archiver will use a third directory for
 #    storage of model output until it can be moved to long term storage (HPSS)
 #
-# -- Examine the whole script to identify things to change for your experiments.
 #
 # -- Provide the CESM initial file needed by your run.
 #
@@ -166,7 +167,7 @@
 # assim_n       Number of time units between assimilations
 #
 # If the long-term archiver is off, you get a chance to examine the files before
-# they get moved to long-term storage. You can always submit $CASE.l_archive
+# they get moved to long-term storage. You can always submit $case.l_archive
 # whenever you want to free up space in the short-term archive directory.
 #
 # ==============================================================================
@@ -520,29 +521,29 @@
    set fname = "user_nl_datm${inst_string}"
    # ===========================================================================
 
-   echo "dtlimit  = 1.5, 1.5"               >> $fname
-   echo "fillalgo = 'nn', 'nn'"             >> $fname
-   echo "fillmask = 'nomask','nomask'"      >> $fname
-   echo "mapalgo  = 'bilinear','bilinear'"  >> $fname
-   echo "mapmask  = 'nomask','nomask'"      >> $fname
-   echo "streams  = 'datm.streams.txt.CPLHIST3HrWx.Solar$inst_string             $stream_year_align $stream_year_first $stream_year_last'," >> $fname
-   echo "           'datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip$inst_string $stream_year_align $stream_year_first $stream_year_last'"  >> $fname
-   echo "taxmode  = 'cycle','cycle'"        >> $fname
-   echo "tintalgo = 'linear','linear'"      >> $fname
-   echo "restfils = 'unset'"                >> $fname
-   echo "restfilm = 'unset'"                >> $fname
+   echo "dtlimit  = 1.5, 1.5"               >> ${fname}
+   echo "fillalgo = 'nn', 'nn'"             >> ${fname}
+   echo "fillmask = 'nomask','nomask'"      >> ${fname}
+   echo "mapalgo  = 'bilinear','bilinear'"  >> ${fname}
+   echo "mapmask  = 'nomask','nomask'"      >> ${fname}
+   echo "streams  = 'datm.streams.txt.CPLHIST3HrWx.Solar${inst_string}             $stream_year_align $stream_year_first $stream_year_last'," >> ${fname}
+   echo "           'datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip${inst_string} $stream_year_align $stream_year_first $stream_year_last'"  >> ${fname}
+   echo "taxmode  = 'cycle','cycle'"        >> ${fname}
+   echo "tintalgo = 'linear','linear'"      >> ${fname}
+   echo "restfils = 'unset'"                >> ${fname}
+   echo "restfilm = 'unset'"                >> ${fname}
 
    # ===========================================================================
-   set fname = "user_nl_cice$inst_string"
+   set fname = "user_nl_cice${inst_string}"
    # ===========================================================================
    # CICE Namelists
    # this is only used for a hybrid start, else rpointers are used.
 
    set   instance = `printf _%04d $TRUTHinstance`
-   echo "ice_ic = '${POP_stagedir}/${run_refcase}.cice${instance}.r.2004-01-10-00000.nc'" >> $fname
+   echo "ice_ic = '${POP_stagedir}/${run_refcase}.cice${instance}.r.2004-01-10-00000.nc'" >> ${fname}
 
    # ===========================================================================
-   set fname = "user_nl_pop2$inst_string"
+   set fname = "user_nl_pop2${inst_string}"
    # ===========================================================================
 
    # POP Namelists
@@ -571,7 +572,7 @@
    # Default copies of SourceMods/src.pop2/ocn.*.tavg.csh files are provided in the
    # DART_SourceMods_cesm1_1_1.tar bundle.
 
-   echo "init_ts_suboption  = 'data_assim'"             >> $fname
+   echo "init_ts_suboption  = 'data_assim'" >> ${fname}
 
    @ inst ++
 end
@@ -610,8 +611,8 @@
          echo "Precipitation in nonSolarNonPrecip stream.txt file - not ${FNAME}"
          breaksw
       default:
-         ${COPY} $FILE user_$FNAME
-         chmod   644   user_$FNAME
+         ${COPY} $FILE user_${FNAME}
+         chmod   644   user_${FNAME}
          breaksw
    endsw
 
@@ -625,23 +626,23 @@
 # drive the TRUTH.
 
 foreach FNAME (user*streams*)
-   set name_parse = `echo $FNAME | sed 's/\_/ /g'`
+   set name_parse = `echo ${FNAME} | sed 's/\_/ /g'`
    @ filename_index = $#name_parse
    set streamname = $name_parse[$filename_index]
    set   instance = `echo $TRUTHinstance | bc`
 
    if (-e $dartroot/models/POP/shell_scripts/user_$streamname*template) then
 
-      echo "Copying DART template for $FNAME and changing instance."
+      echo "Copying DART template for ${FNAME} and changing instance."
 
-      ${COPY} $dartroot/models/POP/shell_scripts/user_$streamname*template $FNAME
+      ${COPY} $dartroot/models/POP/shell_scripts/user_$streamname*template ${FNAME}
 
-      sed s/NINST/$instance/g $FNAME >! out.$$
-      ${MOVE} out.$$ $FNAME
+      sed s/NINST/$instance/g ${FNAME} >! out.$$
+      ${MOVE} out.$$ ${FNAME}
 
    else
-      echo "DIED Looking for a DART stream txt template for $FNAME"
-      echo "DIED Looking for a DART stream txt template for $FNAME"
+      echo "DIED Looking for a DART stream txt template for ${FNAME}"
+      echo "DIED Looking for a DART stream txt template for ${FNAME}"
       exit -3
    endif
 
@@ -701,7 +702,6 @@
       while (\$inst <= 1)
 
          set inst_string = ''
-         echo "${CASE}.cpl.r.\${restart_time}.nc"                    >! rpointer.drv
          echo "${CASE}.datm\${inst_string}.r.\${restart_time}.nc"    >! rpointer.atm\${inst_string}
          echo "${CASE}.datm\${inst_string}.rs1.\${restart_time}.bin" >> rpointer.atm\${inst_string}
          echo "${CASE}.drof\${inst_string}.r.\${restart_time}.nc"    >! rpointer.rof\${inst_string}
@@ -721,6 +721,10 @@
 
          @ inst ++
       end
+
+      # This has nothing to do with instances.
+      echo "${CASE}.cpl.r.\${restart_time}.nc" >! rpointer.drv
+
    endif
 
    exit 0
@@ -737,7 +741,7 @@
 # and it certainly has more files than we need.
 # This stages only the minimum number of instances and files.
 #
-# Remember - when CONTINUE_RUN = FALSE,
+# Remember - in a hybrid case - when CONTINUE_RUN = FALSE,
 # the run_refdate and the time in the filenames can be unrelated.
 #----------------------------------------------------------------------
 

Modified: DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid
===================================================================
--- DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid	2013-10-31 21:51:22 UTC (rev 6558)
+++ DART/trunk/models/cam/shell_scripts/CESM1_1_1_setup_hybrid	2013-11-01 18:04:22 UTC (rev 6559)
@@ -10,9 +10,10 @@
 # Purpose
 # ---------------------
 #
-# This script is designed to set up, stage, and build a multi-instance run of CESM
-# using an F compset where CAM and CLM are active. The initial states
-# come from a single multi-instance reference case so a CESM hybrid setup is used.
+# This script is designed to set up, stage, and build a multi-instance run
+# of CESM using an F compset where CAM and CLM are active. The initial states
+# come from a single multi-instance reference case so a CESM hybrid setup
+# is used.
 #
 # DOCN: We are using a single data ocean.
 #
@@ -20,21 +21,21 @@
 # the methodology here reflects that. All of CESM stops every 6 hours
 # so that a CAM output file would be available for assimilation.
 #
-# This script results in a viable setup for a CESM multi-instance experiment. You
-# are STRONGLY encouraged to run the multi-instance CESM a few times and experiment
-# with different settings BEFORE you try to assimilate observations. The amount of
-# data volume is quite large and you should become comfortable using CESM's restart
-# capability to re-stage files in your RUN directory
+# CESM/DART requires some modifications to the CESM source code EVEN IF YOU
+# ARE NOT USING DART. The modifications for CAM require a change to the CESM
+# ${CASE}.run script to invoke a DART script that will allow CAM to cycle
+# correctly with the source code modifications.
 #
-# CESM/DART requires some modifications to the CESM source code EVEN IF YOU ARE NOT
-# assimilating. The modifications for CAM require a modification to the
-# CESM ${CASE}.run script. The modifications will invoke a DART script that will
-# either assimilate or 'do nothing'. It is strongly recommended that you configure
-# the ${CASE}.run script to 'do nothing' initially. This is the default behavior.
+# This script results in a viable setup for a CESM multi-instance experiment.
+# You are STRONGLY encouraged to run the multi-instance CESM a few times and
+# experiment with different settings BEFORE you try to assimilate observations.
+# The data volume is quite large and you should become comfortable using
+# CESM's restart capability to re-stage files in your RUN directory.
 #
-# CASEROOT/CESM_DART_config will augment the CESM case with the required setup
-# and configuration to perform a DART assimilation and modify the ${CASE}.run script
-# as mentioned previously - after it makes a backup copy.
+# ${CASEROOT}/CESM_DART_config is automatically run by this script and will
+# augment the CESM case with the required setup and configuration to use DART
+# to perform an assimilation. CESM_DART_config will insert a few dozen
+# lines into the ${case}.run script after it makes a backup copy.
 #
 # This script relies heavily on the information in:
 # http://www.cesm.ucar.edu/models/cesm1.1/cesm/doc/usersguide/book1.html
@@ -59,10 +60,13 @@
 #    3) a bld directory for the executables.
 #
 #    This script also executes ${CASEROOT}/CESM_DART_config to modify
-#    the $CASEROOT/${CASE}.run script so that the SourceMods for CAM
+#    the ${CASEROOT}/${CASE}.run script so that the SourceMods for CAM
 #    are effective. CESM_DART_config will also augment the case with all
 #    the pieces necessary to run DART when the time comes.
 #
+# -- (if running DART) Edit the DART input.nml that appears in the ${CASEROOT}
+#    directory.
+#
 # -- Submit the job using ${CASEROOT}/${CASE}.submit
 #
 # ---------------------
@@ -536,11 +540,11 @@
 
    # preserve the original version of the files
    if ( ! -e  ${caseroot}/Buildconf/clm.buildnml.csh.original ) then
-      ${MOVE} ${caseroot}/Buildconf/clm.buildnml.csh \
+      ${COPY} ${caseroot}/Buildconf/clm.buildnml.csh \
               ${caseroot}/Buildconf/clm.buildnml.csh.original
    endif
    if ( ! -e  ${caseroot}/preview_namelists.original ) then
-      ${MOVE} ${caseroot}/preview_namelists \
+      ${COPY} ${caseroot}/preview_namelists \
               ${caseroot}/preview_namelists.original
    endif
 
@@ -668,7 +672,6 @@
 
 # ==============================================================================
 # Stage the restarts now that the run directory exists
-# THIS IS THE STAGING SECTION - MAKE SURE THIS MATCHES THE NAMELISTS.
 # ==============================================================================
 
 cat << EndOfText >! stage_cesm_files
@@ -705,7 +708,8 @@
    if (  \$DOUT_S   == TRUE ) then
 
       # the restarts should be in the short term archive directory
-      # http://www.cesm.ucar.edu/models/cesm1.1/cesm/doc/usersguide/x1631.html#running_ccsm_restart_back

@@ Diff output truncated at 40000 characters. @@


More information about the Dart-dev mailing list