Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/X64_CURIE.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/X64_CURIE.cfg	(revision 5354)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/X64_CURIE.cfg	(revision 5355)
@@ -3,5 +3,5 @@
 # Available softwares:
 CDO=cdo 
-COMPILER=ifort
+COMPILER=intel
 MPI=bullxmpi
 NETCDF=netcdf
@@ -13,8 +13,8 @@
 JOB_DELE=ccc_mdel                          
 
-#
-[ -z "$NPROC"     ] && NPROC=1
-[ -z "$TIME_LIMI" ] && TIME_LIMI=10800 # 3h
+# Compiling & computing settings
+[ -z "$NPROC"       ] && NPROC=16
+[ -z "${TIME_LIMI}" ] && TIME_LIMI=10800 # 3h
 
 # Architecture environment (be careful with compliance with XIOS)
-ARCH_ENV=${DIR_XIOS}/arch/arch-${ARCH}.env
+ARCH_ENV=${DIR_XIOS}/arch/arch-${CFG_ARCH}.env
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/arch_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/arch_template.cfg	(revision 5354)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/arch_template.cfg	(revision 5355)
@@ -4,19 +4,19 @@
 
 # Available softwares:
-CDO=''           			# CDO (Climate Data Operators)     (to get application version with `$CDO      --version`)
-COMPILER=''      			# ifort/gfortran/pgfortran/$FC/... ("" " " compiler      " "    ""  `$COMPILER --version`)
-MPI=''           			# MPI    libraries                 (root directory name in $LOADEDMODULES or $PATH variable)
-NETCDF=''        			# NetCDF    " "                    ( ""     " "     ""  ""       ""       ""  " "     ""   )
+CDO=''           			  # CDO (Climate Data Operators) (root directory name in $LOADEDMODULES or $PATH)
+COMPILER=''      			  # ifort/gfortran/pgfortran/... ( ""     " "     ""  ""       ""       ""  " " )
+MPI=''           			  # MPI    libraries             ( ""     " "     ""  ""       ""       ""  " " )
+NETCDF=''        			  # NetCDF    " "                ( ""     " "     ""  ""       ""       ""  " " )
 
 # Job commands:
-JOB_SUBM=''   	 			# Command to submit a job && get his ID in return
-JOB_LIST=''    	 			#   " "   to list submitted jobs  (to know if the job is in progress with his ID)
-JOB_VIEW=''   	 			#   " "   to get job informations (to increment a log during computing from job ID)
-JOB_DELE=''   	 			#   " "   to stop a job           (not used currently)
+JOB_SUBM=''   	 			  # Submit a job && get his ID in return
+JOB_LIST=''    	 			  # List submitted jobs  (to know if the job is in progress with his ID)
+JOB_VIEW=''   	 			  # Get job informations (to increment a log during computing from job ID)
+JOB_DELE=''   	 			  # Stop a job           (not used currently)
 
-# 
-[ -z "$NPROC"     ] && NPROC=1          # Number of processing units for compilation
-[ -z "$TIME_LIMI" ] && TIME_LIMI=''     # Timeout in s for computation (pending & running)
+# Compiling & computing settings
+[ -z "$NPROC"       ] && NPROC=1          # Number of processing units
+[ -z "${TIME_LIMI}" ] && TIME_LIMI=''     # Timeout in s (pending & running)
 
 # Architecture environment (be careful with compliance with XIOS)
-ARCH_ENV=''                             # ${DIR_WORK}/XIOS/arch/arch-${ARCH}.env
+ARCH_ENV=''                               # ${DIR_WORK}/XIOS/arch/arch-${CFG_ARCH}.env
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/user_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/user_template.cfg	(revision 5354)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/cfg/user_template.cfg	(revision 5355)
@@ -11,12 +11,12 @@
 # NEMO overall configuration:
 [ -z "${NEMO_BRAN}" ] && NEMO_BRAN=''     # trunk, dev_v3_4_STABLE_2012, ...
-[ -z "${CONF_REFE}" ] && CONF_REFE=''     # ORCA2_LIM_PISCES, GYRE, ...
-[ -z "${CONF_TEST}" ] && CONF_TEST=''     # ${CONF_REFE}_trust, ...
+[ -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, ...)
 
 # Comparatives directories localization:
-DIR_REFE=''			      	  # ${DIR_STOR}/${CONF_REFE}/${NEMO_BRAN}
-DIR_TEST=''			      	  # ${DIR_SCRA}/${CONF_REFE}/${NEMO_BRAN}/trusting_${DATE_STR}
+REFE_DIR=''			      	  # ${DIR_STOR}/${CONF_REFE}/${NEMO_BRAN}
+TEST_DIR=''			      	  # ${DIR_SCRA}/${CONF_REFE}/${NEMO_BRAN}/trusting_${DATE_STR}
 
 # External softs directories:
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env	(revision 5354)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.env	(revision 5355)
@@ -7,26 +7,23 @@
 
 # Sourcing user configuration
-[ ! find ./cfg        -name ${CFG_USER}.cfg ] && { echo 'No configuration file in ./cfg for '${CFG_USER}; exit; }
-. cfg/${CFG_USER}.cfg
+#--------------------------------------
+. ${NEMO_TRUS}/cfg/${CFG_USER}.cfg
 export DIR_WORK  DIR_SCRA  DIR_STOR
-export NEMO_HOME NEMO_BRAN CONF_REFE CONF_TEST
-export DIR_REFE  DIR_TEST
+export NEMO_HOME NEMO_BRAN
+export REFE_CONF TEST_CONF REFE_DIR TEST_DIR
 export DIR_XIOS  DIR_OASI
 export NEMO_FORC FORC_TARF
 
-NEMO_ARCH=${NEMO_HOME}/ARCH         ; NEMO_CONF=${NEMO_HOME}/CONFIG         ; NEMO_ENGI=${NEMO_HOME}/NEMO
-NEMO_EFCM=${NEMO_HOME}/EXTERNAL/fcm ; NEMO_IPSL=${NEMO_HOME}/EXTERNAL/IOIPSL; NEMO_TRUS=${NEMO_HOME}/SETTE
-NEMO_TCMP=${NEMO_HOME}/TOOLS/COMPILE
+# Only interest for essential NEMO directories
+NEMO_ARCH=${NEMO_HOME}/ARCH        ; NEMO_CONF=${NEMO_HOME}/CONFIG         ; NEMO_ENGI=${NEMO_HOME}/NEMO
+NEMO_EFCM=${NEMO_HOME}/EXTERNAL/fcm; NEMO_IPSL=${NEMO_HOME}/EXTERNAL/IOIPSL; NEMO_TCMP=${NEMO_HOME}/TOOLS/COMPILE
 export NEMO_ARCH NEMO_CONF NEMO_EFCM
-export NEMO_ENGI NEMO_IPSL NEMO_TRUS
-export NEMO_TCMP
+export NEMO_ENGI NEMO_IPSL NEMO_TCMP
 
 # Sourcing super-computer configuration
-[ ! find ./cfg        -name ${CFG_ARCH}.cfg ] && { echo 'No configuration file in ./cfg for '${CFG_ARCH}; exit; }
-. cfg/${CFG_ARCH}.cfg
+#--------------------------------------
+. ${NEMO_TRUS}/cfg/${CFG_ARCH}.cfg
 export CDO      COMPILER  MPI      NETCDF
 export JOB_SUBM JOB_LIST  JOB_VIEW JOB_DELE
 export NPROC    TIME_LIMI
 export ARCH_ENV
-
-[ ! find ${NEMO_ARCH} -name arch-$ARCH.fcm  ] && { echo 'No fcm file in '${NEMO_ARCH}' for '$ARCH       ; exit; }
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5354)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5355)
@@ -9,63 +9,78 @@
 
 # Set defaults
+#---------------------------------------------------
+NEMO_TRUS=$( pwd $( dirname $0 ) )
 DEBUG=0; PUBLISH=0; status='OK'
 
-# Get options to replace some initials settings
+# Get options for replacing 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) CFG_ARCH=$2          ; shift 2;;
-	-n|--newconf) CONF_TEST=$2         ; shift 2;; -r|--refconf) CONF_REFE=$2         ; shift 2;;
+	-h|--help   ) cat trusting_help.txt; exit  1;; -m|--machine) CFG_ARCH=$2          ; shift 2;;
+	-n|--newconf) TEST_CONF=$2         ; shift 2;; -r|--refconf) REFE_CONF=$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   ;;
+                   *) cat trusting_help.txt; exit  1;;
     esac
 done
 
-# Set super-computer & user environment
-[[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]] && . trusting.env || { ./trusting.sh -h && exit; }
-export DEBUG PUBLISH
-
-# Initialization
-#=============================================
-
-echo ${DIR_TEST}
-mkdir -p ${DIR_TEST} ${DIR_REFE}
-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_${CFG_USER}_${CFG_ARCH}.txt
-
-printf "Status\nFAILED\n"           > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt # Only at end status will change to OK
-
-. trusting_func.sh
-#=============================================
+#export DEBUG PUBLISH
 
 
-# 
-#=============================================
+# Initialization (super-computer & user environment)
+#---------------------------------------------------
+if [[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]]; then
+
+    if   [ ! $( find ${NEMO_TRUS}/cfg -name ${CFG_USER}.cfg ) ]; then
+	echo 'No configuration file in '${NEMO_TRUS}'/cfg for '${CFG_USER}; exit 1
+    elif [ ! $( find ${NEMO_TRUS}/cfg -name ${CFG_ARCH}.cfg ) ]; then
+	echo 'No configuration file in '${NEMO_TRUS}'/cfg for '${CFG_ARCH}; exit 1
+    else
+	. ${NEMO_TRUS}/trusting.env
+    fi
+
+else
+    cat ${NEMO_TRUS}/trusting_help.txt; exit 1
+fi
+
+datestr1=$( LC_ALL=C date -d"${DATE_STR}" +%Y-%m-%dT%H:%M )
+. ./trusting_func.sh
+
+mkdir -p ${TEST_DIR} ${REFE_DIR}
+echo ${TEST_DIR} && cd ${TEST_DIR}
+printf "Date\n%s\n"       $datestr1 > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt
+# Only at end status will change to OK
+printf "Status\nFAILED\n"           > mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt
+
+
+# Check softwares versions
+#---------------------------------------------------
+printf "Step......................\nGet softwares release\n"                     | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 for rel in $CDO $COMPILER $MPI $NETCDF; do
-    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#"  )
-    [ $( echo $rel | grep "$CDO\|$COMPILER" ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' )
+#    [ $( echo $rel | grep $COMPILER ) ] && arch_rel=$( $rel --version | grep -m1 -o ' [0-9.]* ' >/dev/null )
     echo $rel ${arch_rel} >> model.log
 done
 
-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
+sed -n 2p model.log | sed 'i\Fortran compiler' > mesg_04_compiler_${CFG_USER}_${CFG_ARCH}.txt
+sed -n 3p model.log | sed 'i\MPI libraries   ' > mesg_05_mpi_${CFG_USER}_${CFG_ARCH}.txt
+sed -n 4p 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_${CFG_USER}_${CFG_ARCH}.txt
+# SVN action on XIOS & NEMO essentials directories
+#---------------------------------------------------
 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:]' )
 
+printf "Step......................\nGet NEMO SVN revision with: ${svn_cmd}\n"    | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 rev=0
+
 for dir in ${DIR_XIOS} ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_EFCM} ${NEMO_ENGI} ${NEMO_IPSL} ${NEMO_TRUS} ${NEMO_TCMP}; do
+    # For time being, just get revision number from XIOS
     [ $dir == ${DIR_XIOS} ] && echo 'XIOS '$( svn info $dir | awk '(NR == 9) {print $NF}' ) >> model.log && continue
     ${svn_cmd} $dir
@@ -76,22 +91,24 @@
 
 
-#---------------------------------------------
-printf "Step......................\nCompilation NEMO configuration %s\n" ${CONF_REF} > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+# NEMO config compiled from scratch
+#---------------------------------------------------
+printf "Step......................\nCompiling ${CONF_REF} configuration\n"       | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 cd ${NEMO_CONF}
-. ${ARCH_ENV}     # Sourcing architecture environment
-#[ -d ${CONF_TEST} ] && ./makenemo -n ${CONF_TEST} clean
-./makenemo -n ${CONF_TEST} -r ${CONF_REFE} -m $ARCH -j $NPROC #> /dev/null 2>&1
-[ ! -e ${CONF_TEST}/BLD/bin/nemo.exe ] && getout
+. ${ARCH_ENV} > /dev/null    # Sourcing architecture environment
+#[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean
+./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC > /dev/null 2>&1
+[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out
 
 
-#---------------------------------------------
-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 {} . \;
+# Get namelists, xml & forced files for running
+#---------------------------------------------------
+printf "Step......................\nPreparing job\n"                             | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+cd ${TEST_DIR}
+find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \;
 
 if [ ! -z "${NEMO_FORC}" ]; then
     cp ${NEMO_FORC}/${FORC_TAR} .
-    tar -tvf ${FORC_TAR} > inputs_list.txt && tar -vxf ${FORC_TAR}
-    [ $? -ne 0 ] && getout
+    tar -tvf ${FORC_TAR} > inputs_list.txt && tar -vxf ${FORC_TAR} > /dev/null
+    [ $? -ne 0 ] && get_out
     gunzip *.gz
 else
@@ -100,13 +117,13 @@
 
 
-#---------------------------------------------
-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}')
-[ $? -ne 0 ] && getout
+# Job submission & computing
+#---------------------------------------------------
+printf "Step......................\nRunning\n"                                   | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt; echo ${JOB_SUBM}
+job_num=$( ${JOB_SUBM} | awk '{print $NF}' )
+[ $? -ne 0 ] && get_out
 
-time_elapsed=0; time_increment=300
+time_elapsed=0; time_increment=30
 sleep ${time_increment}
-while [[ $( ${JOB_LIST} | grep $job_num ) && ${time_elapsed} -lt ${TIME_LIMI} ]] ; do
+while [[ $( ${JOB_LIST} | grep $job_num ) && ${time_elapsed} -lt ${TIME_LIMI} ]]; do
     printf "\n####################################################" >> computation.log
     ${JOB_VIEW} $job_num                                            >> computation.log
@@ -116,52 +133,67 @@
 
 
-#---------------------------------------------
-printf "Step......................\nTest if ASCII output files exist\n"   > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
-if      [ ! -f ${output_test} ]; then
-
-    getout
-else if [  ]
-
-    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
+# Eventual crash during computing
+#---------------------------------------------------
+printf "Step......................\nTest if ASCII output files exist\n"          | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+if   [ ! -f ocean.output                  ]; then
+    printf "Step......................\nOpa crashed at initialization\n"         | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+    status='FAILED'
+elif [ $( grep 'E R R O R' ocean.output ) ]; then
+    printf "Step......................\nOpa crashed\n"                           | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.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
+    status='FAILED'
 fi
 
 
-#---------------------------------------------
-printf "Step......................\nTest ASCII output files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+# Inspect output text files
+#---------------------------------------------------
+printf "Step......................\nTest ASCII output files difference\n"        | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 for file in ocean.output solver.stat tracer.stat; do
-    diff $file ${DIR_REFE}/$file
+    diff $file ${REFE_DIR}/$file
     [ $? -ne 0 ] && status='FAILED'
 done
 
 
-#---------------------------------------------
-printf "Step......................\nTest last restart files difference\n" > mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
-diff_trusting 2>/dev/null
+# Inspect output NetCDF files
+#---------------------------------------------------
+printf "Step......................\nTest last restart NetCDF files difference\n" | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+diff_restart 2>/dev/null
 [ $? -ne 0 ] && status='FAILED'
 
 
-#---------------------------------------------
+# Comments
+#---------------------------------------------------
 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
 
 
-#---------------------------------------------
+# Finals tests
+#---------------------------------------------------
 if [ $status != 'FAILED' ]; then
-    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 "Step......................\nGet real CPU time\n"                     | tee 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_${CFG_USER}_${CFG_ARCH}.txt
 else
-    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_${CFG_USER}_${CFG_ARCH}.txt ]] || printf "InputFiles\n%s\n" "Same" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
+    printf "Step......................\nTest input files difference\n"           | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
+    diff inputs_list.txt ${REFE_DIR}/inputs_list.txt
+
+    if [ $? -ne 0]; then
+	printf "Input files\nDifferent" > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
+    else
+	printf "Input files\nSame"      > mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
+    fi
+
+    get_out
 fi
 
 
-#---------------------------------------------
+# So far, everything is good
+#---------------------------------------------------
 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
+printf "Step......................\nCode is reliable\n"                          | tee mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt
 
-#---------------------------------------------
-getout
+
+# End
+#---------------------------------------------------
+get_out
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh	(revision 5354)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh	(revision 5355)
@@ -1,5 +1,5 @@
 #!/bin/bash
 
-function mesg_make { 
+function mesg_make {
     paste -d ';' mesg_*_${CFG_USER}_${CFG_ARCH}.txt > trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt
     cat trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt
@@ -7,24 +7,24 @@
 
 #=============================================
-function mesg_publish { 
+function mesg_publish {
   
 if [ $PUBLISH -eq 1 ]; then
 
-  if [ -f ${DIR_TEST}/trusting_${CFG_USER}_${CFG_ARCH}.txt ] ; then
-      tail -1 trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt >> ${DIR_TEST}/trusting_${CFG_USER}_${CFG_ARCH}.txt
+  if [ -f ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt ] ; then
+      tail -1 trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt >> ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt
   else
-      cp      trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt    ${DIR_TEST}/trusting_${CFG_USER}_${CFG_ARCH}.txt
+      cp      trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt    ${TEST_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt
   fi
 
-  cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${DIR_TEST}
-#  chmod o+r ${DIR_TEST}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt
+  cp trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt ${TEST_DIR}
+#  chmod o+r ${TEST_DIR}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.txt
   
 #  rm -rf              ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF}
-#  cp -alf ${DIR_TEST} ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF}
+#  cp -alf ${TEST_DIR} ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF}
 #  chmod o+rX          ${DIR_WORK}/../../dods/public/${LOGNAME}/trusting/${CONF_REF}
   
   # Send mail only when FAILED
-  if [[ grep 'FAILED' mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt && ! -z $MAIL ]]; then
-      cat << END_MAIL > ${DIR_TEST}/trusting.mail
+  if [[ $( grep 'FAILED' mesg_02_status_${CFG_USER}_${CFG_ARCH}.txt ) && ! -z $MAIL ]]; then
+      cat << END_MAIL > ${TEST_DIR}/trusting.mail
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 Dear $USER,
@@ -34,10 +34,10 @@
 
 Failed at step: `tail -n 1 mesg_03_step_${CFG_USER}_${CFG_ARCH}.txt`
-Directory : ${DIR_TEST}
+Directory : ${TEST_DIR}
 
 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
 END_MAIL
-      mail -s "[trusting ${CONF_REF}] FAILED" $MAIL < ${DIR_TEST}/trusting.mail
+      mail -s "[trusting ${CONF_REF}] FAILED" $MAIL < ${TEST_DIR}/trusting.mail
   fi
 
@@ -47,6 +47,6 @@
 
 #=============================================
-function getout { 
-	cd ${DIR_TEST}
+function get_out {
+	cd ${TEST_DIR}
         mesg_make; mesg_publish
 
@@ -60,9 +60,9 @@
 
 #=============================================
-function diffnc {
+function diff_nc {
     stat=100; file1=$1; file2=$2
 
     cdo diffv $file1 $file2 > out_tmp
-    ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 "records differ" out_tmp | awk '-Fof' '{print $1}' )
+    ( [ $? -ne 0 ] && stat=100 ) || stat=$( grep -m 1 'records differ' out_tmp | awk -Fof '{print $1}' )
     [ -f out_tmp ] && rm out_tmp
 
@@ -71,36 +71,23 @@
 
 #---------------------------------------------
-function diff_trusting {
-
-    name_first=${JOB_NAME}
-    name_second=EXP00C
-    rep_ref=EXP00C_REFE
-    experiment_name=trusting
-    tagname=TEST
-    #listcomp="ATM SBG SRF CPL ICE MBG OCE"
-    listcomp="ATM SRF CPL ICE MBG OCE"
+function diff_restart {
+    last_time_step=$( cat ${REFE_DIR}/time.step )
     result_final=0
 
-# Output  
-    cd ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${experiment_name}/${name_first}
-    for comp in ${listcomp}; do
-	echo ${comp}
-	cd ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${experiment_name}/${name_first}/${comp}/Output
-	listfreq=$(ls -d MO/ DA/)
-	for freq in ${listfreq}; do
-            echo ${freq}
-            cd ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${experiment_name}/${name_first}/${comp}/Output/${freq}
-            listfile=$( ls *.nc )
-            for file in ${listfile}; do
-		var=$( echo $file | sed -e "s/^${name_first}//" )
-		result=$( diffnc ${name_first}${var} ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/${tagname}/${CONFIG_WORK}/${rep_ref}/${comp}/Output/${freq}${name_second}${var} )
-		result=$?
-		echo 'diffnc '${name_first}${var} ${DIR_SCRA}/IGCM_OUT/${CONFIG_WORK}/TEST/${CONFIG_WORK}/${rep_ref}/${comp}/Output/${freq}${name_second}${var}
-		echo $result
-		(( result_final = result_final + result ))
-            done
+    echo 'Last time step: '${last_time_step}
+
+    if [ $( find ${REFE_DIR} -name *restart*_${last_time_step}.nc ) ]; then
+
+	for file in find ${REFE_DIR} -name *restart*_${last_time_step}.nc; do
+	    echo ${TEST_DIR}'/*'${file}'_'${last_time_step}'.nc: '
+	    result=$( diff_nc $file )
+	    printf "diffnc $result\n"
+	    (( result_final = result_final + result ))
 	done
-    done
-    return $result_final
 
+    else
+	echo 'No restart files found for comparison'
+    fi
+
+    return ${result_final}
 }
