Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5443)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh	(revision 5444)
@@ -11,6 +11,5 @@
 #---------------------------------------------------
 NEMO_TRUS=$( pwd $( dirname $0 ) )
-SVN_OPT='status'
-DEBUG=0; PUBLISH=0; status='OK'
+DEBUG=0; PUBLISH=0; STATUS='OK'
 
 # Get options for replacing some initials settings
@@ -53,5 +52,10 @@
 printf "Date\n$datestr1\n" > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt
 # Only at end status will change to OK
-status='FAILED'
+STATUS='FAILED'
+
+# SVN action on XIOS & NEMO essentials directories
+#---------------------------------------------------
+pstep "Get NEMO SVN state with: ${SVN_OPT}"
+get_nemo_rev
 
 # Check softwares versions (source arch environment)
@@ -60,10 +64,12 @@
 . ${ARCH_ENV} > /dev/null
 get_soft_rel
+cat model.log
 
-# SVN action on XIOS & NEMO essentials directories
+# XIOS compiling
 #---------------------------------------------------
-pstep "Get NEMO SVN state with: ${SVN_OPT}"
-get_nemo_rev
-exit 0
+pstep 'Compiling XIOS'
+cd ${DIR_XIOS}
+#./make_xios --arch $ARCH -job $NPROC >& /dev/null
+
 # NEMO config compiled from scratch
 #---------------------------------------------------
@@ -72,9 +78,10 @@
 #[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean
 ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null
-[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $step $status
+[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out $STEP $STATUS
 
 # Get namelists, xml & forced files for running
 #---------------------------------------------------
 pstep 'Preparing job'
+cd ${TEST_DIR}
 find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \;
 
@@ -86,5 +93,5 @@
 
 ${cmd_iol} > inputs_list.txt && ${cmd_iof} > /dev/null
-[ $? -ne 0 ] && get_out $step $status
+[ $? -ne 0 ] && get_out $STEP $STATUS
 [ $( find . -name '*.gz' -print -quit ) ] && gunzip *.gz
 
@@ -93,10 +100,10 @@
 pstep 'Test input files difference'
 diff_inputs
-
+get_out $STEP $STATUS
 # Job submission & computing
 #---------------------------------------------------
 pstep 'Running'
 job_num=$( ${JOB_SUBM} | awk '{print $NF}' )
-[ $? -ne 0 ] && get_out $step $status
+[ $? -ne 0 ] && get_out $STEP $STATUS
 
 time_elapsed=0; time_increment=30
@@ -115,12 +122,12 @@
 if   [[ ! -f ocean.output || $( grep 'E R R O R' ocean.output ) ]]; then
     ${JOB_DELE} ${job_num} &> /dev/null
-    [ ! -f ocean.output                  ] && step='nemo.exe crashed at initialization'
-    [ $( grep 'E R R O R' ocean.output ) ] && step='nemo.exe crashed'
+    [ ! -f ocean.output                  ] && STEP='nemo.exe crashed at initialization'
+    [ $( grep 'E R R O R' ocean.output ) ] && STEP='nemo.exe crashed'
     comments('E R R O R')
     ${JOB_DELE} ${job_num} >/dev/null 2>&1
-    status='FAILED'
-    get_out $step $status
+    STATUS='FAILED'
+    get_out $STEP $STATUS
 else
-    status='OK'
+    STATUS='OK'
 
     # Inspect output text files
@@ -129,5 +136,5 @@
     for file in ocean.output solver.stat tracer.stat; do
 	diff $file ${REFE_DIR}/$file
-	[ $? -ne 0 ] && status='FAILED'
+	[ $? -ne 0 ] && STATUS='FAILED'
     done
 
@@ -136,5 +143,5 @@
     pstep 'Test last restart NetCDF files diff'
     diff_restart #2> /dev/null
-    [ $? -ne 0 ] && status='FAILED'
+    [ $? -ne 0 ] && STATUS='FAILED'
 
     # Get computation duration
@@ -148,4 +155,4 @@
 # End
 #---------------------------------------------------
-if [ $status == 'FAILED' ]; then step='Test outputs difference'; else step='Code is reliable'; fi
-get_out $step $status
+if [ $STATUS == 'FAILED' ]; then STEP='Test outputs difference'; else STEP='Code is reliable'; fi
+get_out $STEP $STATUS
Index: /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh	(revision 5443)
+++ /branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh	(revision 5444)
@@ -10,5 +10,5 @@
     # Portability !
     real_cpu_time=$( ${JOB_VIEW} ${job_num} | awk 'END{print $9}' )
-    printf "Real CPU time\n%s\n" ${real_cpu_time} | tee mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt
+    printf "Real CPU time\n%s\n" ${real_cpu_time} | tee mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt
 }
 
@@ -21,5 +21,5 @@
     done
 
-    printf "Input files\n$mesg" | tee mesg_09_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
+    printf "Input files\n$mesg" | tee mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt
 }
 
@@ -42,5 +42,5 @@
 	    cmp ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc
 	    if [ $? -ne 0 ]; then
-		status='FAILED'
+		export STATUS='FAILED'
 		printf "$CDO diffn\n"
 		$CDO diffn ${TEST_DIR}/${base_name}_$comp.nc ${REFE_DIR}/${base_name}_$comp.nc 2> /dev/null
@@ -65,20 +65,24 @@
     done
 
-    sed -n 2p model.log | sed 'i\Compiler'    | tee mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt
-    sed -n 3p model.log | sed 'i\MPI libs'    | tee mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt
-    sed -n 4p model.log | sed 'i\NetCDF libs' | tee mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt
+    sed -n 4p model.log | sed 'i\Compiler'    > mesg_05_compiler_${CFG_USER}_${CFG_ARCH}.txt
+    sed -n 5p model.log | sed 'i\MPI libs'    > mesg_06_mpi_${CFG_USER}_${CFG_ARCH}.txt
+    sed -n 6p model.log | sed 'i\NetCDF libs' > mesg_07_netcdf_${CFG_USER}_${CFG_ARCH}.txt
 }
 
 get_nemo_rev() {
-    rev=0
+    svn_opt='status'
 
     # If -v|--version option has been set, modify svn command
-    if   [ $( echo ${NEMO_VERS} | grep  "up\|update"         ) ]; then SVN_OPT='update'
-    elif [ $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) ]; then SVN_OPT='checkout'
-	rev=$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' )
+    if [[    $( echo ${NEMO_VERS} | grep  "HEAD\|up\|update"   ) \
+	  || $( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' )  ]]; then
+	rev=$( echo ${NEMO_VERS} | tr -d '[:alpha:][:punct:]' ) || rev='HEAD'
+	svn_cmd='svn update -r '$rev 
+    else
+	svn_cmd='svn '${svn_opt}
     fi
 
-    for dir in ${DIR_XIOS}  ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} ${NEMO_EIOI} \
-	       ${NEMO_EFCM} ${NEMO_TRUS} ${NEMO_TCMP} ${NEMO_TRBD}               ; do
+    rev=0
+    for dir in ${DIR_XIOS}  ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} \
+	       ${NEMO_EIOI} ${NEMO_EFCM} ${NEMO_TCMP} ${NEMO_TRBD}  ; do
 
 	# For time being, just get revision number from XIOS
@@ -88,19 +92,11 @@
 	fi
 
-	# 
-	if [ $( echo ${SVN_OPT} | grep 'checkout' ) ]; then
-	    cd ../$dir 
-	    url=$( svn info $dir | grep URL | awk '{print $NF}' )
-	    svn ${SVN_OPT} $url -r $rev $dir && cd -
-	else
-	    svn ${SVN_OPT} $dir
-	fi
-
+	${svn_cmd} $dir
 	rev_loc=$( svn info $dir | awk '(NR == 5) {print $NF}' )
 	(( ${rev_loc} >= $rev )) && rev=${rev_loc}
     done
 
-    echo 'NEMO '$rev >> model.log
-    sed -n 6p model.log | sed 'i\NEMOGCM rev.' | tee mesg_02_nemo_${CFG_USER}_${CFG_ARCH}.txt
+    echo 'NEMOGCM '$rev >> model.log
+    sed -n 2p model.log | sed 'i\NEMO rev.' > mesg_02_nemogcm_${CFG_USER}_${CFG_ARCH}.txt
 }
 
@@ -139,21 +135,21 @@
 
 pstep() {
+    STEP=$1
+    export STEP
     printf "Step.....\n$1\n"
 }
 
 get_out() {
-    step=$1; status=$2
     mesg_make; mesg_publish
 
     # Save tested configuration if trusting failed
-    if [ $status == 'FAILED' ]; then
-	touch mesg_08_realcputime_${CFG_USER}_${CFG_ARCH}.txt mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt
-	cd ${REFE_DIR}
-	tar -czf trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.tar.gz ${TEST_DIR}/*
-	cd -
+    if [ "$STATUS" == 'FAILED' ]; then
+	touch mesg_08_inputfiles_${CFG_USER}_${CFG_ARCH}.txt mesg_09_realcputime_${CFG_USER}_${CFG_ARCH}.txt \
+	      mesg_10_comments_${CFG_USER}_${CFG_ARCH}.txt
+	tar -czf ${REFE_DIR}/trusting_${DATE_STR}_${CFG_USER}_${CFG_ARCH}.tar.gz *
     fi
 
-    printf "Status\n$status\n"  > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt
-    printf "Step.....\n$step\n" > mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt
+    printf "Status\n$STATUS\n"  > mesg_03_status_${CFG_USER}_${CFG_ARCH}.txt
+    printf "Step.....\n$STEP\n" > mesg_04_step_${CFG_USER}_${CFG_ARCH}.txt
 
     exit 1
