Index: branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
===================================================================
--- branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/SETTE/trusting.sh	(revision 5286)
+++ branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5292)
@@ -11,12 +11,13 @@
 DEBUG=0; PUBLISH=0; status='OK'
 
-# Get options && replace some initials settings
+# Get options to replace some initials settings
 while [ $# -ne 0 ]; do
     case $1 in
         -b|--branch ) NEMO_BRAN=$2         ; shift 2;; -d|--debug  ) set -vx; DEBUG=1     ; shift  ;;
 	-e|--email  ) MAIL=$2              ; shift 2;; -j|--job    ) NPROC=$2             ; shift 2;;
-	-h|--help   ) cat trusting_help.txt; exit   ;; -m|--machine) ARCH=$2              ; shift 2;;
+	-h|--help   ) cat trusting_help.txt; exit   ;; -m|--machine) CFG_ARCH=$2          ; shift 2;;
 	-n|--newconf) CONF_TEST=$2         ; shift 2;; -r|--refconf) CONF_REFE=$2         ; shift 2;;
 	-t|--time   ) TIME_LIMI=$2         ; shift 2;; -p|--publish) PUBLISH=1            ; shift  ;;
+        -u|--user   ) CFG_USER=$2          ; shift 2;; -v|--version) NEMO_REVI=$2         ; shift 2;;
                    *) cat trusting_help.txt; exit   ;;
     esac
@@ -24,5 +25,5 @@
 
 # Set super-computer & user environment
-[[ ! -z "$ARCH" && . trusting.env ]] || { ./trusting.sh -h && exit; }
+[[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]] && . trusting.env || { ./trusting.sh -h && exit; }
 export DEBUG PUBLISH
 
@@ -34,7 +35,7 @@
 cd ${DIR_TEST}
 datestr1=$( LC_ALL=C date -d"$DATE_STR" +%Y-%m-%dT%H:%M )
-printf "Date\n%s\n"       $datestr1 > mesg_01_date.txt
+printf "Date\n%s\n"       $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt
 
-printf "Status\nFAILED\n"           > mesg_02_status.txt # Only at end status will change to OK
+printf "Status\nFAILED\n"           > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt # Only at end status will change to OK
 
 . trusting_func.sh
@@ -45,5 +46,5 @@
 #=============================================
 for rel in $CDO $COMPILER $MPI $NETCDF; do
-    printf "Step......................\nGet $rel release\n" > mesg_03_step.txt
+    printf "Step......................\nGet $rel release\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
                              arch_rel=$( echo $LOADEDMODULES | sed "s#.*:$rel/\([^:]*\).*#\1#" )
     [ -z "${arch_rel}"  ] && arch_rel=$( echo $PATH          | sed "s#.*$rel/\([^/]*\).*#\1#"  )
@@ -52,16 +53,22 @@
 done
 
-sed -n 1p model.log | sed 'i\Fortran compiler' > mesg_04_curiec.txt
-sed -n 2p model.log | sed 'i\MPI libraries   ' > mesg_05_mpicurie.txt
-sed -n 3p model.log | sed 'i\NetCDF libraries' > mesg_06_netcdf_curie.txt
+sed -n 1p model.log | sed 'i\Fortran compiler' > mesg_04_compiler_${CFG_USER}_${CFG_ARCH}.txt
+sed -n 2p model.log | sed 'i\MPI libraries   ' > mesg_05_mpi_${CFG_USER}_${CFG_ARCH}.txt
+sed -n 3p model.log | sed 'i\NetCDF libraries' > mesg_06_netcdf_${CFG_USER}_${CFG_ARCH}.txt
 
 
 #---------------------------------------------
-printf "Step......................\nCheckout XIOS, FCM-make(/EXTERNAL/fcm), NEMO engines (/NEMO) & configuration (/CONFIG)\n" > mesg_03_step.txt
+printf "Step......................\nCheckout XIOS, FCM-make(/EXTERNAL/fcm), NEMO engines (/NEMO) & configuration (/CONFIG)\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+svn_cmd='svn status'
+
+# If -v|--version option has been set, modify svn command
+[ $( echo ${NEMO_VERS} | grep  "up\|update"         ) ] && svn_cmd='svn update'
+[ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ] && svn_cmd='svn update -r '$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' )
+
 rev=0
-for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_SETT} ${NEMO_TCMP}; do
-    svn up $dir
+for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_TRUS} ${NEMO_TCMP}; do
+    [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue
+    ${svn_cmd} $dir
     rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' )
-    [ $dir == ${DIR_XIOS} ] && echo 'XIOS '${rev_loc} >> model.log && continue
     (( ${rev_loc} >= $rev )) && rev=${rev_loc}
 done
@@ -70,5 +77,5 @@
 
 #---------------------------------------------
-printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step.txt
+printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 cd ${NEMO_CONF}
 . ${ARCH_ENV}     # Sourcing architecture environment
@@ -79,5 +86,5 @@
 
 #---------------------------------------------
-printf "Step......................\nPreparing job\n" > mesg_03_step.txt
+printf "Step......................\nPreparing job\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 cd ${DIR_TEST}
 find ${NEMO_CONF}/${CONF_TEST}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \;
@@ -94,5 +101,5 @@
 
 #---------------------------------------------
-printf "Step......................\nRunning\n"       > mesg_03_step.txt
+printf "Step......................\nRunning\n"       > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 #${JOB_SUB} ${DIR_TEST}/../../batch.sh
 job_num=$( ${JOB_SUB} ${DIR_TEST}/../../batch.sh | awk '{print $NF}')
@@ -110,5 +117,5 @@
 
 #---------------------------------------------
-printf "Step......................\nTest if ASCII output files exist\n"   > mesg_03_step.txt
+printf "Step......................\nTest if ASCII output files exist\n"   > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 if      [ ! -f ${output_test} ]; then
 
@@ -116,11 +123,11 @@
 else if [  ]
 
-    grep 'E R R O R' ocean.output    >> mesg_11_comments.txt
-    sed 's/^/Time step :/' time.step >> mesg_11_comments.txt
+    grep 'E R R O R' ocean.output    >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt
+    sed 's/^/Time step :/' time.step >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt
 fi
 
 
 #---------------------------------------------
-printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step.txt
+printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 for file in ocean.output solver.stat tracer.stat; do
     diff $file ${DIR_REFE}/$file
@@ -130,5 +137,5 @@
 
 #---------------------------------------------
-printf "Step......................\nTest last restart files difference\n" > mesg_03_step.txt
+printf "Step......................\nTest last restart files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 diff_trusting 2>/dev/null
 [ $? -ne 0 ] && status='FAILED'
@@ -136,24 +143,24 @@
 
 #---------------------------------------------
-echo 'Comments'                    >  mesg_11_comments.txt
-grep 'W A R N I N G:' ocean.output >> mesg_11_comments.txt
+echo 'Comments'                    >  mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt
+grep 'W A R N I N G:' ocean.output >> mesg_11_comments_${CFG_USER}_${CFG_ARCH}.txt
 
 
 #---------------------------------------------
 if [ $status != 'FAILED' ]; then
-    printf "Step......................\nGet Real CPU time\n" > mesg_03_step.txt
+    printf "Step......................\nGet Real CPU time\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
     real_cpu_time=$( ${JOB_VIEW} $job_num | awk 'END{print $9}')
-    printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime.txt
+    printf "Real CPU time\n%s\n" ${real_cpu_time} > mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt
 else
-    printf "Step......................\nTest InputFiles difference\n" > mesg_03_step.txt
+    printf "Step......................\nTest InputFiles difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
     diff inputs_list.txt ${DIR_REFE}/inputs_list.txt
     [ $? -ne 0 ] && getout
-    [[ $? -ne 0 && printf "InputFiles\n%s\n" "Different" > mesg_09_inputfiles.txt ]] || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles.txt
+    [[ $? -ne 0 && printf "InputFiles\n%s\n" "Different" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt ]] || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
 fi
 
 
 #---------------------------------------------
-printf "Status\nOK\n" > mesg_02_status.txt
-printf "Step......................\nCode is reliable\n" > mesg_03_step.txt
+printf "Status\nOK\n" > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt
+printf "Step......................\nCode is reliable\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 
 #---------------------------------------------
