[Dart-dev] [5533] DART/branches/development/models/cam/shell_scripts/assimilate.hybrid .csh: Work in progress ...

nancy at ucar.edu nancy at ucar.edu
Wed Jan 25 11:52:30 MST 2012


Revision: 5533
Author:   thoar
Date:     2012-01-25 11:52:30 -0700 (Wed, 25 Jan 2012)
Log Message:
-----------
Work in progress ... could be correct.

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

-------------- next part --------------
Modified: DART/branches/development/models/cam/shell_scripts/assimilate.hybrid.csh
===================================================================
--- DART/branches/development/models/cam/shell_scripts/assimilate.hybrid.csh	2012-01-25 15:57:59 UTC (rev 5532)
+++ DART/branches/development/models/cam/shell_scripts/assimilate.hybrid.csh	2012-01-25 18:52:30 UTC (rev 5533)
@@ -53,7 +53,7 @@
 # of the form "./${CASE}.cam_${ensemble_member}.i.2000-01-06-00000.nc"
 #-------------------------------------------------------------------------
 
-set FILE = `ls -1t ../*.cam_0001.i.* | head -1`
+set FILE = `ls -1t ../*.cam_0001.i.* | head -n 1`
 set FILE = $FILE:t
 set FILE = $FILE:r
 set MYCASE = `echo $FILE | sed -e "s#\..*##"`
@@ -76,18 +76,16 @@
 set OBSDIR       = ${BASEOBSDIR}/${DART_OBS_DIR}
 
 #=========================================================================
-# Block 1: Populate a run-time directory with the bits needed to run DART.
+# Block 1: Populate a run-time directory with the input 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} .
-   else
-      echo "ERROR ... DART required file ${DARTDIR}/${FILE} not found ... ERROR"
-      echo "ERROR ... DART required file ${DARTDIR}/${FILE} not found ... ERROR"
-      exit 1
-   endif
-end
+if (  -e   ${CASEROOT}/input.nml ) then
+   ${COPY} ${CASEROOT}/input.nml .
+else
+   echo "ERROR ... DART required file ${CASEROOT}/${FILE} not found ... ERROR"
+   echo "ERROR ... DART required file ${CASEROOT}/${FILE} not found ... ERROR"
+   exit 1
+endif
 
 # Modify the DART input.nml such that
 # the DART ensemble size matches the CESM number of instances
@@ -266,22 +264,26 @@
    # they all read their OWN 'input.nml' ... the output
    # filenames must inserted into the appropriate input.nml
 
+   # Turns out the .h0. files are timestamped with the START of the 
+   # run, which is *not* MODEL_DATE_EXT ...  I just link to a whatever 
+   # is convenient (since the info is static).
+
    set MYTEMPDIR = member_${member}
    mkdir -p $MYTEMPDIR
    cd $MYTEMPDIR
 
    set ATM_INITIAL_FILENAME = `printf ../../${MYCASE}.cam_%04d.i.${MODEL_DATE_EXT}.nc ${member}`
-   set ATM_HISTORY_FILENAME = `printf ../../${MYCASE}.cam_%04d.h0.${MODEL_DATE_EXT}.nc ${member}`
+   set ATM_HISTORY_FILENAME = `ls -1t ../../${MYCASE}.cam*.h0.* | head -n 1`
+   set DART_IC_FILE = `printf ../filter_ic_old.%04d ${member}`
 
    ${LINK} $ATM_INITIAL_FILENAME caminput.nc
    ${LINK} $ATM_HISTORY_FILENAME cam_phis.nc
+   ${LINK} $DART_IC_FILE         dart_ics
 
-   set DART_IC_FILE = `printf ../filter_ic_old.%04d ${member}`
+   cp ../input.nml .
 
-   sed -e "s#dart_ics#${DART_IC_FILE}#" < ../input.nml >! input.nml
-
    echo "starting cam_to_dart for member ${member} at "`date`
-   ../cam_to_dart >! output.${member}.cam_to_dart &
+   ${EXEROOT}/cam_to_dart >! output.${member}.cam_to_dart &
    echo "finished cam_to_dart for member ${member} at "`date`
 
    cd ..
@@ -322,7 +324,7 @@
 # for geometry information, etc.
 
 set ATM_INITIAL_FILENAME = ../${MYCASE}.cam_0001.i.${MODEL_DATE_EXT}.nc
-set ATM_HISTORY_FILENAME = ../${MYCASE}.cam_0001.h0.${MODEL_DATE_EXT}.nc
+set ATM_HISTORY_FILENAME = `ls -1t ../${MYCASE}.cam_0001.h0.* | head -n 1`
 
 ${LINK} $ATM_INITIAL_FILENAME caminput.nc
 ${LINK} $ATM_HISTORY_FILENAME cam_phis.nc
@@ -335,7 +337,7 @@
 ${LINK} ${OBS_FILE} obs_seq.out
 
 echo "assimilate:starting filter at "`date`
-$LAUNCHCMD ./filter || exit 7
+${LAUNCHCMD} ${EXEROOT}/filter || exit 7
 echo "assimilate:finished filter at "`date`
 
 ${MOVE} Prior_Diag.nc      ../Prior_Diag.${MODEL_DATE_EXT}.nc
@@ -375,11 +377,11 @@
 
    cd member_${member}
 
-   set DART_RESTART_FILE = `printf filter_ic_new.%04d ${member}`
-   ${LINK} ../$DART_RESTART_FILE temp_ic
+   set DART_RESTART_FILE = `printf ../filter_ic_new.%04d ${member}`
+   ${LINK} $DART_RESTART_FILE temp_ic
 
    echo "starting dart_to_cam for member ${member} at "`date`
-   ../dart_to_cam >! output.${member}.dart_to_cam &
+   ${EXEROOT}/dart_to_cam >! output.${member}.dart_to_cam &
    echo "finished dart_to_cam for member ${member} at "`date`
 
    cd ..
@@ -396,17 +398,19 @@
 endif
 
 #-------------------------------------------------------------------------
-# Now that all instances are updated, we have to communicate the current
+# Now that everything is staged, we have to communicate the current
 # model time to the drv_in&seq_timemgr_inparm namelist
 # which is built from CASEROOT/user_nl_drv by the *.run script
 #-------------------------------------------------------------------------
-
 set mydir = `pwd`
 cd ${CASEROOT}
-./xmlchange -file env_conf.xml -id RUN_REFDATE -val ${MODEL_YEAR}-${MODEL_MONTH}-${MODEL_DAY}
-./xmlchange -file env_conf.xml -id RUN_REFTOD  -val ${MODEL_SECONDS}
+./xmlchange -file env_run.xml  -id START_TOD     -val ${MODEL_SECONDS}
+./xmlchange -file env_conf.xml -id RUN_STARTDATE -val ${MODEL_YEAR}-${MODEL_MONTH}-${MODEL_DAY}
+./xmlchange -file env_conf.xml -id RUN_REFDATE   -val ${MODEL_YEAR}-${MODEL_MONTH}-${MODEL_DAY}
+./xmlchange -file env_conf.xml -id RUN_REFTOD    -val ${MODEL_SECONDS}
 ${COPY} env_conf.xml LockedFiles/env_conf.xml.locked
-cd $mydir 
+cd $mydir
+
 # 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.


More information about the Dart-dev mailing list