[Dart-dev] [5508] DART/branches/development/models/cam/shell_scripts: This group does not depend on the CAM pointer file, it uses logic

nancy at ucar.edu nancy at ucar.edu
Thu Jan 12 20:44:31 MST 2012


Revision: 5508
Author:   thoar
Date:     2012-01-12 20:44:31 -0700 (Thu, 12 Jan 2012)
Log Message:
-----------
This group does not depend on the CAM pointer file, it uses logic
more similar to the hybrid case to determine the cam initial filename
as well as the cam history file (source of the PHIS field). 
It also stages a copy of the necessary DART bits in the caseroot
directory - facilitating concurrent cases/experiments.
The assimilate script grabs the bits from the caseroot directory
instead of the DART directory.

Mariana also suggested a SourceMod that prevents the coupler from
writing a restart file. The pointer file to the coupler restart is
also not written - but was used by the short-term archive script to
create a unique directory for staging restarts. I have modified the
short-term archive script to get that information from the 
Posterior_Diag.YYYY-MM-DD-SSSSS.nc file.

Modified Paths:
--------------
    DART/branches/development/models/cam/shell_scripts/CESM_setup_startup.csh
    DART/branches/development/models/cam/shell_scripts/assimilate.csh
    DART/branches/development/models/cam/shell_scripts/assimilate.startup.csh

-------------- next part --------------
Modified: DART/branches/development/models/cam/shell_scripts/CESM_setup_startup.csh
===================================================================
--- DART/branches/development/models/cam/shell_scripts/CESM_setup_startup.csh	2012-01-13 03:34:33 UTC (rev 5507)
+++ DART/branches/development/models/cam/shell_scripts/CESM_setup_startup.csh	2012-01-13 03:44:31 UTC (rev 5508)
@@ -51,12 +51,12 @@
 # ====  Set case options
 # ====================================================================
 
-setenv case                 startup1
+setenv case                 startup0
 setenv compset              F_2000
 setenv ccsmtag              cesm1_1_beta04
 setenv resolution           f09_f09
-setenv num_instances        80
-setenv reuse_existing_case  true
+setenv num_instances        4
+setenv reuse_existing_case  false
 
 # ================================
 # define machines and directories
@@ -145,15 +145,49 @@
 # on a bluefire node ... capable of 64 tasks.
 set num_tasks_per_atm_instance = 16
 set nthreads = 1
-@ total_atm = $num_tasks_per_atm_instance * $num_instances
-@ total_ice = $num_tasks_per_atm_instance * $num_instances / 4
-@ total_cpl = $num_tasks_per_atm_instance * $num_instances / 4
-@ total_ocn = $num_tasks_per_atm_instance * 4
-@ ice_start = $total_cpl
-@ ocn_start = $total_cpl + $total_ice
-@ lnd_start = $ocn_start + $total_ocn
-@ total_lnd = $total_atm - $lnd_start
 
+# PE LAYOUT: 
+#   total number of tasks  = 1280 
+#   maximum threads per task = 1 
+#   cpl ntasks = 320  nthreads=1 rootpe=  0 ninst=1 
+#   cam ntasks =1280  nthreads=1 rootpe=  0 ninst=80 
+#   clm ntasks = 576  nthreads=1 rootpe=704 ninst=80 
+#   cice ntasks= 320  nthreads=1 rootpe=320 ninst=80 
+#   docn ntasks=  64  nthreads=1 rootpe=640 ninst=1 
+#   sglc ntasks=  64  nthreads=1 rootpe=  0 ninst=1 
+#   
+#   total number of hw pes = 1280 
+#     cpl hw pe range ~ from 0 to 319 
+#     cam hw pe range ~ from 0 to 1279 
+#     clm hw pe range ~ from 704 to 1279 
+#     cice hw pe range ~ from 320 to 639 
+#     docn hw pe range ~ from 640 to 703 
+#     sglc hw pe range ~ from 0 to 63 
+
+if ( $num_instances == 4 ) then
+   @ total_atm = 128
+   @ total_ice = 32
+   @ total_cpl = 32
+   @ total_ocn = 32
+   @ ice_start = $total_cpl
+   @ ocn_start = $total_cpl + $total_ice
+   @ lnd_start = $ocn_start + $total_ocn
+   @ total_lnd = $total_atm - $lnd_start
+else
+   @ total_atm = $num_tasks_per_atm_instance * $num_instances
+   @ total_ice = $num_tasks_per_atm_instance * $num_instances / 4
+   @ total_cpl = $num_tasks_per_atm_instance * $num_instances / 4
+   @ total_ocn = $num_tasks_per_atm_instance * 4
+   @ ice_start = $total_cpl
+   @ ocn_start = $total_cpl + $total_ice
+   @ lnd_start = $ocn_start + $total_ocn
+   @ total_lnd = $total_atm - $lnd_start
+endif
+
+echo "Node layout"
+echo "[0 ......................... ATM ..................... $total_atm]"
+echo "[0 ... CPL ... $total_cpl ... ICE ... $ocn_start ... OCN ... $lnd_start ... LND ... $total_atm]"
+
 # Tony: "if f19_g16, i'd recommend using 320 for cice, 32 for
 # docn, 320 for cpl, and then the rest for clm as a starting point."
 # I'm changing the ratios ... not sure about using half a node
@@ -282,7 +316,7 @@
 endif
 
 # ====================================================================
-# Stage a copy of the DART assimilate.csh script HERE
+# Stage the required parts of DART in the caseroot directory.
 # ====================================================================
 
 cd ${caseroot}
@@ -293,6 +327,10 @@
 \cp -f ${ccsmroot}/scripts/ccsm_utils/Tools/lt_archive.csh Tools/.
 
 \cp -f ${DARTdir}/models/cam/shell_scripts/assimilate.startup.csh assimilate.csh
+\cp -f ${DARTdir}/models/cam/work/input.nml    .
+\cp -f ${DARTdir}/models/cam/work/filter       .
+\cp -f ${DARTdir}/models/cam/work/cam_to_dart  .
+\cp -f ${DARTdir}/models/cam/work/dart_to_cam  .
 
 # ====================================================================
 # Update the scripts that build the namelists.
@@ -494,13 +532,11 @@
 # Submit job
 # ====================================================================
 
-set MYSTRING = `grep "set DARTDIR" assimilate.csh`
-set DARTDIR = $MYSTRING[4]
-
 echo ''
-echo 'case is ready to submit after you check the'
-echo "DART settings in ${DARTDIR}/input.nml"
-echo 'After you check them,'
-echo "cd into ${caseroot} and run: ./$case.$mach.submit"
+echo 'Time to check the case.'
+echo "cd ${caseroot}"
+echo "Modify what you like in input.nml, make sure the observation directory"
+echo 'names built in assimilate.csh match those on your system, submit the job:'
+echo "./$case.$mach.submit"
 echo ''
 

Modified: DART/branches/development/models/cam/shell_scripts/assimilate.csh
===================================================================
--- DART/branches/development/models/cam/shell_scripts/assimilate.csh	2012-01-13 03:34:33 UTC (rev 5507)
+++ DART/branches/development/models/cam/shell_scripts/assimilate.csh	2012-01-13 03:44:31 UTC (rev 5508)
@@ -1,4 +1,4 @@
-#!/bin/csh
+#!/bin/csh -f
 #
 # DART software - Copyright 2004 - 2011 UCAR. This open source software is
 # provided by UCAR, "as is", without charge, subject to all terms of use at
@@ -6,13 +6,40 @@
 #
 # $Id$
 
-# The FORCE options are not optional.
-# the VERBOSE options are useful for debugging.
-set   MOVE = '/usr/local/bin/mv -fv'
-set   COPY = '/usr/local/bin/cp -fv --preserve=timestamps'
-set   LINK = '/usr/local/bin/ln -fvs'
-set REMOVE = '/usr/local/bin/rm -fr'
+# This block is an attempt to localize all the machine-specific 
+# changes to this script such that the same script can be used
+# on multiple platforms. This will help us maintain the script.
 
+echo "starting assimilate script at "`date`
+
+switch ("`hostname`")
+   case be*:
+      # NCAR "bluefire"
+      # The FORCE options are not optional.
+      # the VERBOSE options are useful for debugging.
+      set   MOVE = '/usr/local/bin/mv -fv'
+      set   COPY = '/usr/local/bin/cp -fv --preserve=timestamps'
+      set   LINK = '/usr/local/bin/ln -fvs'
+      set REMOVE = '/usr/local/bin/rm -fr'
+
+      set BASEOBSDIR = /glade/proj3/image/Observations/ACARS
+      set DARTDIR    = ${HOME}/svn/DART/dev
+      set LAUNCHCMD  = mpirun.lsf
+
+   breaksw
+   default:
+      # NERSC "hopper"
+      set   MOVE = 'mv -fv'
+      set   COPY = 'cp -fv --preserve=timestamps'
+      set   LINK = 'ln -fvs'
+      set REMOVE = 'rm -fr'
+
+      set BASEOBSDIR = /scratch/scratchdirs/nscollin/ACARS
+      set DARTDIR    = ${HOME}/devel
+      set LAUNCHCMD  = "aprun -n $NTASKS"
+   breaksw
+endsw 
+
 set ensemble_size = ${NINST_ATM}
 
 # Create temporary working directory for the assimilation
@@ -23,10 +50,10 @@
 
 #-------------------------------------------------------------------------
 # Determine time of model state ... from file name of first member
-# of the form "./${CASE}.cam_${ensemble_member}.r.2000-01-06-00000.nc"
+# of the form "./${CASE}.cam_${ensemble_member}.i.2000-01-06-00000.nc"
 #-------------------------------------------------------------------------
 
-set FILE = `head -1 ../rpointer.atm_0001`
+set FILE = `ls -1t ../*.cam_0001.i.* | head -1`
 set FILE = $FILE:t
 set FILE = $FILE:r
 set MYCASE = `echo $FILE | sed -e "s#\..*##"`
@@ -45,27 +72,23 @@
 # Set variables containing various directory names where we will GET things
 #-----------------------------------------------------------------------------
 
-set DARTDIR = ${HOME}/svn/DART/dev
-
 set DART_OBS_DIR = ${MODEL_YEAR}${MODEL_MONTH}_6H
-set  OBSDIR = /glade/proj3/image/Observations/ACARS/${DART_OBS_DIR}
+set OBSDIR       = ${BASEOBSDIR}/${DART_OBS_DIR}
 
-#-------------------------------------------------------------------------
-# DART COPY BLOCK
-# Populate a run-time directory with the bits needed to run DART
-#-------------------------------------------------------------------------
+#=========================================================================
+# Block 1: Populate a run-time directory with the bits needed to run DART.
+#=========================================================================
 
 foreach FILE ( input.nml filter cam_to_dart dart_to_cam )
-   if (  -e   ${DARTDIR}/models/cam/work/${FILE} ) then
-      ${COPY} ${DARTDIR}/models/cam/work/${FILE} .
+   if (  -e   ${CASEROOT}/${FILE} ) then
+      ${COPY} ${CASEROOT}/${FILE} .
    else
-      echo "DART required file ${DARTDIR}/${FILE} not found ... ERROR"
+      echo "ERROR ... DART required file ${CASEROOT}/${FILE} not found ... ERROR"
+      echo "ERROR ... DART required file ${CASEROOT}/${FILE} not found ... ERROR"
       exit 1
    endif
 end
 
-${COPY} /glade/proj3/DART/raeder/FV1deg_4.0/cam_phis.nc .
-
 # Modify the DART input.nml such that
 # the DART ensemble size matches the CESM number of instances
 # WARNING: the output files contain ALL enemble members ==> BIG
@@ -77,13 +100,13 @@
 wq
 ex_end
 
-#-------------------------------------------------------------------------
-# DART SAMPLING ERROR CORRECTION BLOCK
-# This stages the files needed for the sampling error correction.
+#=========================================================================
+# Block 2: Stage the files needed for SAMPLING ERROR CORRECTION
+#
 # Each ensemble size has its own (static) file which does not need to be archived.
 # It is only needed if
 # input.nml:&assim_tools_nml:sampling_error_correction = .true.,
-#-------------------------------------------------------------------------
+#=========================================================================
 
 set  MYSTRING = `grep sampling_error_correction input.nml`
 set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"`
@@ -103,8 +126,8 @@
    echo "Sampling Error Correction not requested for this assimilation."
 endif
 
-#-------------------------------------------------------------------------
-# DART INFLATION BLOCK
+#=========================================================================
+# Block 3: DART INFLATION
 # This stages the files that contain the inflation values.
 # The inflation values change through time and should be archived.
 #
@@ -136,7 +159,7 @@
 # the CESM rundir to be used for subsequent assimilations. If the short-term
 # archiver has worked correctly, only the LATEST files will available. Of
 # course, it is not required to have short-term archiving turned on, so ...
-#-------------------------------------------------------------------------
+#=========================================================================
 
 set  MYSTRING = `grep inf_flavor input.nml`
 set  MYSTRING = `echo $MYSTRING | sed -e "s#[=,]# #g"`
@@ -222,20 +245,21 @@
    echo "Posterior Inflation not requested for this assimilation."
 endif
 
-#-------------------------------------------------------------------------
-# Block 1: convert N cam restart files to DART initial conditions file(s)
+#=========================================================================
+#
+# Block 4: Convert CAM restart files to DART initial condition files.
 # cam_to_dart is serial code, we can do all of these at the same time
-# and just wait for them to finish IFF it were not for the fact we'd have
-# to have unique namelists for all of them.
+# as long as we can have unique namelists for all of them.
 #
-# At the end of the block, we have DART restart files  filter_ic_old.[1-N]
+# At the end of this block, we have DART restart files  filter_ic_old.[1-N]
 # that came from pointer files ../rpointer.atm_[1-N]
 #
 # DART namelist settings appropriate/required:
 # &filter_nml:           restart_in_file_name    = 'filter_ic_old'
 # &ensemble_manager_nml: single_restart_file_in  = '.false.'
 # &cam_to_dart_nml:      cam_to_dart_output_file = 'dart_ics',
-#-------------------------------------------------------------------------
+#
+#=========================================================================
 
 set member = 1
 while ( ${member} <= ${ensemble_size} )
@@ -249,13 +273,11 @@
    mkdir -p $MYTEMPDIR
    cd $MYTEMPDIR
 
-   set POINTER_FILENAME = `printf rpointer.atm_%04d ${member}`
-   set MODEL_RESTART_FILENAME = `head -1 ../../${POINTER_FILENAME}`
-   set MODEL_INITIAL_FILENAME = `echo ${MODEL_RESTART_FILENAME} | sed "s#\.r\.#\.i\.#"`
-   ${LINK} ../../$MODEL_INITIAL_FILENAME caminput.nc
-   ${LINK} ../cam_phis.nc .
+   set ATM_INITIAL_FILENAME = `printf ../../${MYCASE}.cam_%04d.i.${MODEL_DATE_EXT}.nc ${member}`
+   set ATM_HISTORY_FILENAME = `ls -1t ../../${MYCASE}.cam*.h0.* | head -1`
 
-   # TJH can we use a .h0. file instead of some arbitrary cam_phis.nc
+   ${LINK} $ATM_INITIAL_FILENAME caminput.nc
+   ${LINK} $ATM_HISTORY_FILENAME cam_phis.nc
 
    set DART_IC_FILE = `printf ../filter_ic_old.%04d ${member}`
 
@@ -272,8 +294,14 @@
 
 wait
 
-#-------------------------------------------------------------------------
-# Block 2: Actually run the assimilation.
+if ($status != 0) then
+   echo "ERROR ... DART died in 'cam_to_dart' ... ERROR"
+   echo "ERROR ... DART died in 'cam_to_dart' ... ERROR"
+   exit 7
+endif
+
+#=========================================================================
+# Block 5: Actually run the assimilation.
 # Will result in a set of files : 'filter_restart.xxxx'
 #
 # DART namelist settings required:
@@ -291,17 +319,16 @@
 # &filter_nml:           last_obs_seconds       = -1,
 # &ensemble_manager_nml: single_restart_file_in = .false.
 #
-#-------------------------------------------------------------------------
+#=========================================================================
 
-# cam always needs a cam_initial.nc and a cam_history.nc to start.
+# CAM:static_init_model() always needs a caminput.nc and a cam_phis.nc
+# for geometry information, etc.
 
-set MODEL_RESTART_FILENAME = `head -1 ../rpointer.atm_0001`
-set MODEL_INITIAL_FILENAME = `echo ${MODEL_RESTART_FILENAME} | sed "s#\.r\.#\.i\.#"`
-set MODEL_HISTORY_FILENAME = `echo ${MODEL_RESTART_FILENAME} | sed "s#\.r\.#\.h0\.#"`
+set ATM_INITIAL_FILENAME =         ../${MYCASE}.cam_0001.i.${MODEL_DATE_EXT}.nc
+set ATM_HISTORY_FILENAME = `ls -1t ../${MYCASE}.cam_0001.h0.* | head -1`
 
-${LINK} ../$MODEL_INITIAL_FILENAME caminput.nc
-#${LINK} ../$MODEL_RESTART_FILENAME cam_restart.nc
-#${LINK} ../$MODEL_HISTORY_FILENAME cam_history.nc
+${LINK} $ATM_INITIAL_FILENAME caminput.nc
+${LINK} $ATM_HISTORY_FILENAME cam_phis.nc
 
 # Determine proper observation sequence file.
 
@@ -310,22 +337,10 @@
 
 ${LINK} ${OBS_FILE} obs_seq.out
 
-# FIXME: special for trying out non-monotonic task layouts.
-# TJH setenv ORG_PATH "${PATH}"
-# TJH setenv LSF_BINDIR /contrib/lsf/tgmpatch
-# TJH setenv PATH ${LSF_BINDIR}:${PATH}
-# TJH setenv ORG_TASK_GEOMETRY "${LSB_PJL_TASK_GEOMETRY}"
+echo "assimilate:starting filter at "`date`
+$LAUNCHCMD ./filter || exit 7
+echo "assimilate:finished filter at "`date`
 
-# layout: flat
-setenv NANCY_GEOMETRY_54_1NODE \
-	"{(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)}";
-
-# TJH setenv LSB_PJL_TASK_GEOMETRY "${NANCY_GEOMETRY_54_1NODE}"
-
-which mpirun.lsf
-
-mpirun.lsf ./filter || exit 7
-
 ${MOVE} Prior_Diag.nc      ../Prior_Diag.${MODEL_DATE_EXT}.nc
 ${MOVE} Posterior_Diag.nc  ../Posterior_Diag.${MODEL_DATE_EXT}.nc
 ${MOVE} obs_seq.final      ../obs_seq.${MODEL_DATE_EXT}.final
@@ -344,12 +359,8 @@
    endif
 end
 
-# FIXME: special for trying out non-monotonic task layouts.
-# TJH setenv PATH "${ORG_PATH}"
-# TJH setenv LSB_PJL_TASK_GEOMETRY "${ORG_TASK_GEOMETRY}"
-
-#-------------------------------------------------------------------------
-# Block 3: Update the cam restart files ... simultaneously ...
+#=========================================================================
+# Block 6: Update the cam restart files. 
 #
 # DART namelist settings required:
 # &filter_nml:           restart_out_file_name  = 'filter_ic_new'
@@ -357,57 +368,69 @@
 # &dart_to_cam_nml:      dart_to_cam_input_file = 'temp_ic',
 # &dart_to_cam_nml:      advance_time_present   = .false.
 # &atm_in_xxxx:ncdata = 'cam_initial_x.nc'
-#-------------------------------------------------------------------------
+#=========================================================================
 
 set member = 1
 while ( ${member} <= ${ensemble_size} )
 
-   # Each member will do its job in its own directory.
-   # Cannot do these simultaneously -
+   # Each member will do its job in its own directory, which already exists
+   # and has the required input files remaining from 'Block 4'
 
-   set MYTEMPDIR = member_${member}
-   mkdir -p $MYTEMPDIR
-   cd $MYTEMPDIR
+   cd member_${member}
 
    set DART_RESTART_FILE = `printf filter_ic_new.%04d ${member}`
    ${LINK} ../$DART_RESTART_FILE temp_ic
 
-   set ATM_POINTER_FILENAME = `printf rpointer.atm_%04d ${member}`
-   set LND_POINTER_FILENAME = `printf rpointer.lnd_%04d ${member}`
-   set ICE_POINTER_FILENAME = `printf rpointer.ice_%04d ${member}`
+   echo "starting dart_to_cam for member ${member} at "`date`
+   ../dart_to_cam >! output.${member}.dart_to_cam &
+   echo "finished dart_to_cam for member ${member} at "`date`
 
-   set ATM_RESTART_FILENAME = `head -1 ../../${ATM_POINTER_FILENAME}`
-   set LND_RESTART_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.cam_#\.clm2_#"`
-   set ICE_RESTART_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.cam_#\.cice_#"`
+   cd ..
 
-   set ATM_INITIAL_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.r\.#\.i\.#"`
+   @ member++
+end
 
-#  set ATM_HISTORY_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.r\.#\.h0\.#"`
-#  ${LINK} ../../$ATM_RESTART_FILENAME cam_restart.nc
-#  ${LINK} ../../$ATM_HISTORY_FILENAME cam_history.nc
-   ${LINK} ../../$ATM_INITIAL_FILENAME caminput.nc
+wait
 
-   echo "starting dart_to_cam for member ${member} at "`date`
-   ../dart_to_cam >! output.${member}.dart_to_cam
-   echo "finished dart_to_cam for member ${member} at "`date`
+if ($status != 0) then
+   echo "ERROR ... DART died in 'dart_to_cam' ... ERROR"
+   echo "ERROR ... DART died in 'dart_to_cam' ... ERROR"
+   exit 8
+endif
 
-   # The initial filenames are static and come from the atm_in_xxxx namelist.
-   # We must rename the updated initial files to the static names.
-   # I do not want to stymy the archive scripts.
+#-------------------------------------------------------------------------
+# Block 4: The cam files have now been updated, move them into position.
+#-------------------------------------------------------------------------
+
+set member = 1
+while ( ${member} <= ${ensemble_size} )
+
+   cd member_${member}
+
+   set LND_POINTER_FILENAME = `printf rpointer.lnd_%04d ${member}`
+   set ICE_POINTER_FILENAME = `printf rpointer.ice_%04d ${member}`
+
+   set LND_RESTART_FILENAME = `head -1 ../../${LND_POINTER_FILENAME}`
+   set ICE_RESTART_FILENAME = `head -1 ../../${ICE_POINTER_FILENAME}`
+   set ATM_INITIAL_FILENAME = `printf ../../${MYCASE}.cam_%04d.i.${MODEL_DATE_EXT}.nc ${member}`
+   set ATM_HISTORY_FILENAME = `ls -1t ../../${MYCASE}.cam*.h0.* | head -1`
+
+   # As implemented, the input filenames are static in the namelists.
+   # In order to archive the 'dynamic' files (i.e. with the dates) 
+   # and restage the 'static' files, we must copy the updated files 
+   # to the static names.
    #
    # IMPORTANT: The Tools/st_archive.sh script must be substantially modified.
 
-   ${COPY} ../../$ATM_INITIAL_FILENAME ../../cam_initial_${member}.nc
-   ${COPY} ../../$LND_RESTART_FILENAME ../../clm_restart_${member}.nc
-   ${COPY} ../../$ICE_RESTART_FILENAME ../../ice_restart_${member}.nc
+   ${MOVE} ../../$LND_RESTART_FILENAME ../../clm_restart_${member}.nc
+   ${MOVE} ../../$ICE_RESTART_FILENAME ../../ice_restart_${member}.nc
+   ${MOVE} ../../$ATM_INITIAL_FILENAME ../../cam_initial_${member}.nc
 
    cd ..
 
    @ member++
 end
 
-wait
-
 #-------------------------------------------------------------------------
 # Now that everything is staged, we have to communicate the current
 # model time to the drv_in&seq_timemgr_inparm namelist
@@ -420,9 +443,20 @@
 wq
 ex_end
 
+# 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} ../*.rs.*
+${REMOVE} ../*.rh0.*
+${REMOVE} ../*.rs1.*
+${REMOVE} ../*cam.r.*
+${REMOVE} ../PET*ESMF_Logfile
+
+
 #-------------------------------------------------------------------------
 # Cleanup
 #-------------------------------------------------------------------------
+echo "finished assimilate script at "`date`
 
 exit 0
 

Modified: DART/branches/development/models/cam/shell_scripts/assimilate.startup.csh
===================================================================
--- DART/branches/development/models/cam/shell_scripts/assimilate.startup.csh	2012-01-13 03:34:33 UTC (rev 5507)
+++ DART/branches/development/models/cam/shell_scripts/assimilate.startup.csh	2012-01-13 03:44:31 UTC (rev 5508)
@@ -1,4 +1,4 @@
-#!/bin/csh
+#!/bin/csh -f
 #
 # DART software - Copyright 2004 - 2011 UCAR. This open source software is
 # provided by UCAR, "as is", without charge, subject to all terms of use at
@@ -29,10 +29,10 @@
    breaksw
    default:
       # NERSC "hopper"
-      set   MOVE = 'mv -fv'                                                                    
-      set   COPY = 'cp -fv --preserve=timestamps'                                              
-      set   LINK = 'ln -fvs'                                                                   
-      set REMOVE = 'rm -fr' 
+      set   MOVE = 'mv -fv'
+      set   COPY = 'cp -fv --preserve=timestamps'
+      set   LINK = 'ln -fvs'
+      set REMOVE = 'rm -fr'
 
       set BASEOBSDIR = /scratch/scratchdirs/nscollin/ACARS
       set DARTDIR    = ${HOME}/devel
@@ -50,10 +50,10 @@
 
 #-------------------------------------------------------------------------
 # Determine time of model state ... from file name of first member
-# of the form "./${CASE}.cam_${ensemble_member}.r.2000-01-06-00000.nc"
+# of the form "./${CASE}.cam_${ensemble_member}.i.2000-01-06-00000.nc"
 #-------------------------------------------------------------------------
 
-set FILE = `head -1 ../rpointer.atm_0001`
+set FILE = `ls -1t ../*.cam_0001.i.* | head -1`
 set FILE = $FILE:t
 set FILE = $FILE:r
 set MYCASE = `echo $FILE | sed -e "s#\..*##"`
@@ -80,11 +80,11 @@
 #=========================================================================
 
 foreach FILE ( input.nml filter cam_to_dart dart_to_cam )
-   if (  -e   ${DARTDIR}/models/cam/work/${FILE} ) then
-      ${COPY} ${DARTDIR}/models/cam/work/${FILE} .
+   if (  -e   ${CASEROOT}/${FILE} ) then
+      ${COPY} ${CASEROOT}/${FILE} .
    else
-      echo "ERROR ... DART required file ${DARTDIR}/${FILE} not found ... ERROR"
-      echo "ERROR ... DART required file ${DARTDIR}/${FILE} not found ... ERROR"
+      echo "ERROR ... DART required file ${CASEROOT}/${FILE} not found ... ERROR"
+      echo "ERROR ... DART required file ${CASEROOT}/${FILE} not found ... ERROR"
       exit 1
    endif
 end
@@ -273,15 +273,12 @@
    mkdir -p $MYTEMPDIR
    cd $MYTEMPDIR
 
-   set POINTER_FILENAME = `printf rpointer.atm_%04d ${member}`
+   set ATM_INITIAL_FILENAME = `printf ../../${MYCASE}.cam_%04d.i.${MODEL_DATE_EXT}.nc ${member}`
+   set ATM_HISTORY_FILENAME = `ls -1t ../../${MYCASE}.cam*.h0.* | head -1`
 
-   set ATM_HISTORY_FILENAME = `ls   -1 ../../*.cam_????.h0.* | head -1`
-   set ATM_RESTART_FILENAME = `head -1 ../../${POINTER_FILENAME}`
-   set ATM_INITIAL_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.r\.#\.i\.#"`
+   ${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
-
    set DART_IC_FILE = `printf ../filter_ic_old.%04d ${member}`
 
    sed -e "s#dart_ics#${DART_IC_FILE}#" < ../input.nml >! input.nml
@@ -327,12 +324,11 @@
 # CAM:static_init_model() always needs a caminput.nc and a cam_phis.nc
 # for geometry information, etc.
 
-set ATM_RESTART_FILENAME = `head -1 ../rpointer.atm_0001`
-set ATM_INITIAL_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.r\.#\.i\.#"`
-set ATM_HISTORY_FILENAME = `ls   -1 ../*.cam_0001.h0.* | head -1`
+set ATM_INITIAL_FILENAME =         ../${MYCASE}.cam_0001.i.${MODEL_DATE_EXT}.nc
+set ATM_HISTORY_FILENAME = `ls -1t ../${MYCASE}.cam_0001.h0.* | head -1`
 
-${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
 
 # Determine proper observation sequence file.
 
@@ -413,12 +409,11 @@
 
    set LND_POINTER_FILENAME = `printf rpointer.lnd_%04d ${member}`
    set ICE_POINTER_FILENAME = `printf rpointer.ice_%04d ${member}`
-   set ATM_POINTER_FILENAME = `printf rpointer.atm_%04d ${member}`
 
    set LND_RESTART_FILENAME = `head -1 ../../${LND_POINTER_FILENAME}`
    set ICE_RESTART_FILENAME = `head -1 ../../${ICE_POINTER_FILENAME}`
-   set ATM_RESTART_FILENAME = `head -1 ../../${ATM_POINTER_FILENAME}`
-   set ATM_INITIAL_FILENAME = `echo ${ATM_RESTART_FILENAME} | sed "s#\.r\.#\.i\.#"`
+   set ATM_INITIAL_FILENAME = `printf ../../${MYCASE}.cam_%04d.i.${MODEL_DATE_EXT}.nc ${member}`
+   set ATM_HISTORY_FILENAME = `ls -1t ../../${MYCASE}.cam*.h0.* | head -1`
 
    # As implemented, the input filenames are static in the namelists.
    # In order to archive the 'dynamic' files (i.e. with the dates) 


More information about the Dart-dev mailing list