Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/X64_CURIE.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/X64_CURIE.cfg	(revision 5471)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/X64_CURIE.cfg	(revision 5472)
@@ -8,7 +8,8 @@
 
 # Job commands: ccc_*
-JOB_SUBM=ccc_msub
+JOB_SUBM="ccc_msub ${NEMO_TRUS}/batch/${CFG_ARCH}.sh | awk '{print \$NF}'"
 JOB_LIST=ccc_mpp
 JOB_VIEW=ccc_macct
+JOB_RCPU="${JOB_VIEW} ${JOB_ID} | awk 'END{print \$9}'"
 JOB_DELE=ccc_mdel                          
 
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/arch_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/arch_template.cfg	(revision 5471)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/arch_template.cfg	(revision 5472)
@@ -1,26 +1,28 @@
-# Copy to ./$ARCH.cfg, fill in according to your installation
+# Copy to ./${CFG_ARCH}.cfg, fill in according to your installation
 
 # Super-computer configuration
 
 # Available softwares:
-CDO=''           			  # CDO (Climate Data Operators)
-                                           # (root directory name in $LOADEDMODULES or $PATH)
-COMPILER=''      			  # ifort/gfortran/pgfortran/...
-                                           # (to get compiler release with command `$COMPILER --version`)
-MPI=''           			  # MPI    libraries
-                                           # ( ""     " "     ""  ""       ""       ""  " " )
-NETCDF=''        			  # NetCDF    " "   
-                                           # ( ""     " "     ""  ""       ""       ""  " " )
+CDO=''           			  # CDO (Climate Data Operators) (directory name in $LOADEDMODULES or $PATH)
+                                             # ex: 'cdo'/'nco'/...
+COMPILER=''      			  # Fortran compiler (to get compiler release with `$COMPILER --version`)
+                                             # ex: 'ifort'/'gfortran'/'pgfortran'/...
+MPI=''           			  # MPI    libraries             (directory name in $LOADEDMODULES or $PATH)
+                                             # ex: 'opempi'/'mpich'/...
+NETCDF=''        			  # NetCDF    " "                (   " "     ""  ""       ""       ""  " " )
+                                             # ex: 'netcdf42'/'netcdf-parallel'/...
 
 # Job commands (works with job ID):
 JOB_SUBM=''   	 			  # Submit a job && get his ID in return
-JOB_LIST=''    	 			  # List all submitted jobs to search for job ID with `grep`
-JOB_VIEW=''   	 			  # Get job informations (to fill in a log during computing)
-JOB_DELE=''   	 			  # Kill a job (in case of crash or time limit reaching)
+                                             # ex: "cmd ${NEMO_TRUS}/batch/${CFG_ARCH}.sh | awk '{print \$NF}'"
+JOB_LIST=''    	 			  # List all submitted jobs (to determine by `grep` if a job completed or not)
+JOB_INFO=''   	 			  # Get job informations          with job ID as argument (filling a computation log)
+JOB_TIME=''                               # Get real CPU time computation  ""   "  "" ""    ""   
+                                             # ex: "${JOB_VIEW} ${JOB_ID} | awk 'END{print \$9}'"
+JOB_DELE=''   	 			  # Kill submitted job             ""   "  "" ""    ""   
 
 # Compiling & computing settings
 [ -z "$NPROC"       ] && NPROC=1          # Processing units for compilation
-[ -z "${TIME_LIMI}" ] && TIME_LIMI=''     # Utmost time in seconds to wait for finished job
-                                           # (pending & running)
+[ -z "${TIME_LIMI}" ] && TIME_LIMI=''     # Utmost time in seconds to wait for completed job
 
 # Architecture environment (be careful with compliance with XIOS)
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/user_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/user_template.cfg	(revision 5471)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/config/user_template.cfg	(revision 5472)
@@ -1,33 +1,29 @@
-# Copy to ./user.cfg, fill in according to your installation
+# Copy to ./${CFG_USER}.cfg, fill in according to your installation
 
 # User configuration
 
-# Global Directories:
-DIR_WORK=''   	 			  # Directory for compilation
-DIR_SCRA=''    	 			  #    " "    " " computation to increase perfs on some super-computers
-              	 			  # (will copy into it all requested forcing input & ".*(cfg|opa|ref|xml)" files)
-DIR_STOR=''    	 			  #    " "     for comparison (ASCII output & restart files of reference config)
 
 # NEMO overall configuration:
-[ -z "${NEMO_BRAN}" ] && NEMO_BRAN=''     # trunk, dev_v3_4_STABLE_2012, ...
-[ -z "${CONF_REFE}" ] && REFE_CONF=''     # ORCA2_LIM_PISCES, GYRE, ...
-[ -z "${CONF_TEST}" ] && TEST_CONF=''     # ${CONF_REFE}_trust, ...
-NEMO_HOME=''                              # NEMOGCM equivalent root directory to find ./ARCH,./CONFIG, ...
-                                          # (${DIR_WORK}/NEMO/${NEMO_BRAN}/NEMOGCM, ...)
+[ -z "${NEMO_BRAN}" ] && NEMO_BRAN=''        # ex: 'trunk', 'dev_v3_4_STABLE_2012', ...
+NEMO_HOME=''                              # NEMOGCM directory for computation (./ARCH, ./CONFIG, ...)
+                                             # ex: ".../NEMO/${NEMO_BRAN}/NEMOGCM", ...
+[ -z "${CONF_REFE}" ] && REFE_CONF=''        # ex: 'ORCA2_LIM_PISCES', 'GYRE', ...
+[ -z "${CONF_TEST}" ] && TEST_CONF=''        # ex: "${CONF_REFE}_trust", ...
 
 # Comparatives directories localization:
-REFE_DIR=''			      	  # ${DIR_STOR}/${CONF_REFE}/${NEMO_BRAN}
-TEST_DIR=''			      	  # ${DIR_SCRA}/${CONF_REFE}/${NEMO_BRAN}/trusting_${DATE_STR}
+REFE_DIR=''			      	  # "Standard" folder where previous result files are stored for comparison
+                                             # ex: ".../${CONF_REFE}/${NEMO_BRAN}"
+TEST_DIR=''			      	  # Test       folder for computation
+                                             # ex: ".../${CONF_REFE}/${NEMO_BRAN}/trusting_${DATE_STR}"
 
 # External softs directories:
-DIR_XIOS=''			      	  # ${DIR_WORK}/XIOS/xios-1.0
-#DIR_OASI=''			      	  # ${DIR_WORK}/OASIS        
+DIR_XIOS=''			      	     # ex: '.../XIOS/xios-1.0'
+#DIR_OASI=''			      	     # ex: '.../OASIS'
 
-# NEMO inputs (fill in if necessary)
-NEMO_FORC=''                              # Directory with forcing archive to extract from ESGF server
-                                          #        or  ""  all inputs files to copy
-FORC_TARF=''                              # Archive name (ORCA2_LIM_nemo_v3.6.tar, ...)
-                                          # Leave blank if not requested
+# NEMO inputs
+NEMO_FORC=''                              #     Directory with forcing archive from DODS/ESGF server to extract
+                                           # or    " "     ""  all inputs files to copy into ${TEST_DIR}
+FORC_TARF=''                              # Archive name (ex: 'ORCA2_LIM_nemo_v3.6.tar', ...), let blank if not requested
 
-# Mailing list to inform of a failure, -p|--publish option required
-[ -z "$MAIL"] && MAIL=''
+# Mailing list to inform of a failure (-p|--publish option required)
+[ -z "$EMAIL"] && EMAIL=''
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env	(revision 5471)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env	(revision 5472)
@@ -9,5 +9,4 @@
 #--------------------------------------
 . ${NEMO_TRUS}/config/${CFG_USER}.cfg
-export DIR_WORK  DIR_SCRA  DIR_STOR
 export NEMO_HOME NEMO_BRAN
 export REFE_CONF TEST_CONF REFE_DIR TEST_DIR
@@ -27,6 +26,6 @@
 #--------------------------------------
 . ${NEMO_TRUS}/config/${CFG_ARCH}.cfg
-export CDO      COMPILER  MPI      NETCDF
-export JOB_SUBM JOB_LIST  JOB_VIEW JOB_DELE
+export CDO      COMPILER MPI      NETCDF
+export JOB_SUBM JOB_LIST JOB_INFO JOB_TIME JOB_DELE
 export NPROC    TIME_LIMI
 export ARCH_ENV
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5471)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5472)
@@ -55,5 +55,5 @@
 #---------------------------------------------------
 print_step 'Get softwares release'
-. ${ARCH_ENV} > /dev/null
+[ -e ${ARCH_ENV} ] && . ${ARCH_ENV} > /dev/null
 get_soft_rel
 cat model.log
@@ -91,5 +91,5 @@
 #---------------------------------------------------
 print_step 'Submitting job'
-JOB_ID=$( ${JOB_SUBM} | awk '{print $NF}' )
+JOB_ID=$( eval ${JOB_SUBM} )
 [ $? -ne 0 ] && get_out $STATUS $STEP
 print_step 'Holding-Running job'
@@ -97,10 +97,15 @@
 print_step 'Job finished'
 
-# Eventual crash during computing
+# Job state
 #---------------------------------------------------
-print_step 'Test if job crashed'
+print_step 'Test job state'
 if   [[ ! -e ocean.output || $( grep 'E R R O R' ocean.output ) ]]; then
     comments 'E R R O R'
     get_out $STATUS $STEP
+else
+    # Get time computation
+    #---------------------------------------------------
+    print_step 'Get real CPU time'
+    get_cpu_time
 fi
 
@@ -110,5 +115,5 @@
 print_step 'Test ASCII output files diff'
 diff_textfiles
-if [ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP
+[ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP
 
 # Inspect output NetCDF files
@@ -116,10 +121,5 @@
 print_step 'Test last restart NetCDF files diff'
 diff_restart
-if [ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP
-
-# Get computation duration
-#---------------------------------------------------
-print_step 'Get real CPU time'
-get_cpu_time
+[ "$STATUS" == 'FAILED' ] && get_out $STATUS $STEP
 
 # Get comments (ocean.output & diff model.log)
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh	(revision 5471)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh	(revision 5472)
@@ -23,21 +23,4 @@
 }
 
-get_cpu_time() {
-    # Portability !
-    real_cpu_time=$( ${JOB_VIEW} ${JOB_ID} | awk 'END{print $9}' )
-    printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt
-}
-
-get_inputs() {
-    if [ ! -z "${FORC_TAR}" ]; then
-	cmd_iol="tar -tvf ${NEMO_FORC}/${FORC_TAR}"; cmd_iof="tar -vxf ${NEMO_FORC}/${FORC_TAR}"
-    else
-	cmd_iol="ls ${NEMO_FORC}/*"                ; cmd_iof="\cp ${NEMO_FORC}/* ."
-    fi
-
-    ${cmd_iol} > inputs_list.txt
-    ${cmd_iof} > /dev/null
-}
-
 diff_inputs() {
     mesg='Same'
@@ -56,6 +39,6 @@
 
     if [ $( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit ) ]; then
-	base_name=$( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit           \
-	             | awk -F/ '{print $NF}' | sed "s/^\(.*\)$last_time_step\_.*/\1$last_time_step/" )
+	base_name=$( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit         \
+	             | awk -F/ '{print $NF}' | sed "s/^\(.*\)$last_time_step.*/\1$last_time_step/"  )
 
 	for comp in restart restart_ice restart_trc; do
@@ -68,5 +51,5 @@
 
 	    # UNIX `cmp` not suitable (filename & timestamp in .nc file)
-	    nc_diff=$( $CDO diffn ${TEST_DIR}/$file'.nc' ${REFE_DIR}/$file'.nc' 2> /dev/null | sed -n '$p' )
+	    nc_diff=$( $CDO diffn ${TEST_DIR}/$file'.nc' ${REFE_DIR}/$file'.nc' 2> /dev/null | tail -1 )
 	    if [ ! -z "${nc_diff}" ]; then
 		export STATUS='FAILED' STEP='Restart files different'
@@ -86,4 +69,20 @@
 }
 
+get_cpu_time() {
+    real_cpu_time=$( eval ${JOB_TIME} )
+    printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt
+}
+
+get_inputs() {
+    if [ ! -z "${FORC_TAR}" ]; then
+	cmd_iol="tar -tvf ${NEMO_FORC}/${FORC_TAR}"; cmd_iof="tar -vxf ${NEMO_FORC}/${FORC_TAR}"
+    else
+	cmd_iol="ls ${NEMO_FORC}/*"                ; cmd_iof="\cp ${NEMO_FORC}/* ."
+    fi
+
+    ${cmd_iol} > inputs_list.txt
+    ${cmd_iof} > /dev/null
+}
+
 diff_textfiles() {
     for file in ocean.output $( ls *.stat ); do
@@ -101,7 +100,7 @@
     done
 
-    sed -n 4p model.log | sed 'i\Compiler'    > mesg_06_compiler_${CFG_USER}_${CFG_ARCH}.txt
-    sed -n 5p model.log | sed 'i\MPI libs'    > mesg_07_mpi_${CFG_USER}_${CFG_ARCH}.txt
-    sed -n 6p model.log | sed 'i\NetCDF libs' > mesg_08_netcdf_${CFG_USER}_${CFG_ARCH}.txt
+    sed -n 4p model.log | sed 'i\Fortran compiler' > mesg_06_compiler_${CFG_USER}_${CFG_ARCH}.txt
+    sed -n 5p model.log | sed 'i\MPI libs'         > mesg_07_mpi_${CFG_USER}_${CFG_ARCH}.txt
+    sed -n 6p model.log | sed 'i\NetCDF libs'      > mesg_08_netcdf_${CFG_USER}_${CFG_ARCH}.txt
 }
 
@@ -127,6 +126,8 @@
 	if [ "$dir" == "${DIR_XIOS}" ]; then
 	    rev_loc=$( svn info $dir | awk '(NR == 5) {print $NF}' )
-	    echo   'XIOS '${rev_loc}         >> model.log
-	    printf "XIOS rev.\n${rev_loc}\n" >  mesg_05_xios__${CFG_USER}_${CFG_ARCH}.txt
+	    echo   'XIOS '${rev_loc} >> model.log
+	    printf "XIOS rev.\n"     >  mesg_05_xios_${CFG_USER}_${CFG_ARCH}.txt
+	    printf "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\">${rev_loc}</a>" \
+	                             >> mesg_05_xios_${CFG_USER}_${CFG_ARCH}.txt
 	    continue
 	fi
@@ -137,9 +138,9 @@
     done
 
-    echo   'NEMOGCM '$rev         >> model.log
+    echo   'NEMOGCM '$rev   >> model.log
 #   printf "NEMOGCM rev.\n$rev\n" >  mesg_04_nemogcm_${CFG_USER}_${CFG_ARCH}.txt
-    printf "NEMOGCM rev.\n\
-            <a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \
-    >  mesg_04_nemogcm_${CFG_USER}_${CFG_ARCH}.txt
+    printf "NEMOGCM rev.\n" >  mesg_04_nemogcm_${CFG_USER}_${CFG_ARCH}.txt
+    printf "<a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \
+	                    >> mesg_04_nemogcm_${CFG_USER}_${CFG_ARCH}.txt
 }
 
@@ -153,5 +154,5 @@
 if [ $PUBLISH -eq 1 ]; then
 
-  if [ -f ${REFE_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt ]; then cmd='sed -n 2p'; else cmd='cat'; fi
+  if [ -f ${REFE_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt ]; then cmd='tail -1'; else cmd='cat'; fi
 
   $cmd trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.txt >> ${REFE_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt
@@ -161,17 +162,19 @@
       cat << END_MAIL > trusting.mail
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
 Dear $USER,
 
-The trusting sequence for ${CONF_REF} has failed at step:
-`tail -n 1 ${TEST_DIR}/mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt`
-Directory : ${TEST_DIR}
+The trusting sequence for ${REFE_CONF} has failed.
+Directory: ${TEST_DIR}
+Archive: ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz
 
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
 END_MAIL
+#`tail -n 1 ${TEST_DIR}/mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt`
       if [ -e ${TEST_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.txt ]; then
 	  cat ${TEST_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.txt  >> trusting.mail
       fi
-      mail -s "[trusting ${CONF_REF}] $STATUS $STEP" $EMAIL  <  trusting.mail
+      mail -s "[trusting ${REFE_CONF}] $STATUS $STEP" $EMAIL  <  trusting.mail
   fi
 
@@ -188,6 +191,7 @@
     if [ "$STATUS" == 'FAILED' ]; then
 	cd ${TEST_DIR}
-	touch mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt \
-	      mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt
+	printf "Input files\n\n"   > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
+	printf "Real CPU time\n\n" > mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt
+	printf "Comments\n\n"      > mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt
 	#tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz *
     fi
@@ -207,5 +211,5 @@
     while [[ $( ${JOB_LIST} | grep ${JOB_ID} ) && ${time_elapsed} -lt ${TIME_LIMI} ]]; do
 	printf "\n####################################################" >> computation.log
-	${JOB_VIEW} ${JOB_ID}                                           >> computation.log
+	${JOB_INFO} ${JOB_ID}                                           >> computation.log
 	sleep ${time_increment}
 	let time_elapsed+=${time_increment}
