Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/martin.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/martin.cfg	(revision 8796)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/martin.cfg	(revision 8797)
@@ -5,19 +5,36 @@
 ## Default settings
 ##---------------------------------------------------
-[ -z "${TRUS_BRAN}" ] && TRUS_BRAN='trunk'
-TRUS_CKOT=( 'ARCH           CONFIG          NEMO               \
-             EXTERNAL/AGRIF EXTERNAL/fcm    EXTERNAL/IOIPSL    \
-             TOOLS/COMPILE  TOOLS/maketools TOOLS/REBUILD_NEMO  ' )
+TRUS_CKOT=( 'ARCH           CONFIG          NEMO
+             EXTERNAL/AGRIF EXTERNAL/fcm    EXTERNAL/IOIPSL
+             TOOLS/COMPILE  TOOLS/maketools TOOLS/REBUILD_NEMO' )
 
-[ -z "${TRUS_REFE}" ] && TRUS_REFE='ORCA2_LIM_PISCES'
 TRUS_CONF=${TRUS_REFE}'_trust'
 
-[ -z "${TRUS_TARF}" ] && TRUS_TARF='ORCA2_LIM_nemo_v3.6.tar'
-[ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ] && TRUS_TARF='INPUTS_ORCA1_LIM3_PISCES_V10.tar'
-[ ${TRUS_REFE} == 'AMM12'             ] && TRUS_TARF='AMM12_v3.6.tar'
+if   [ -z "${TRUS_BRAN}"                      ]; then
+    TRUS_BRAN='trunk'
+
+    if   [ -z ${TRUS_REFE}            ]; then
+	TRUS_REFE='ORCA2_LIM3_PISCES'
+    elif [    ${TRUS_REFE} == 'AMM12' ]; then
+	TRUS_TARF='AMM12_v3.7.tar'
+    fi
+
+    [ -z ${TRUS_TARF} ] && TRUS_TARF='ORCA2_LIM_nemo_v3.7.tar
+                                      INPUTS_PISCES_v3.6st.tar'
+elif [     ${TRUS_BRAN} == 'nemo_v3_6_STABLE' ]; then
+
+    if   [ -z "${TRUS_REFE}"                       ]; then
+	TRUS_REFE='ORCA2_LIM_PISCES'
+    elif [     ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ]; then
+	TRUS_TARF='INPUTS_ORCA1_LIM3_PISCES_V10.tar'
+    elif [     ${TRUS_REFE} == 'AMM12'             ]; then
+	TRUS_TARF='AMM12_v3.6.tar'
+    fi
+
+fi
 
 TRUS_KEYA=''; TRUS_KEYD=''
-[ ${TRUS_REFE} == 'ORCA2_LIM' ] && TRUS_KEYA='key_add key_agrif' && TRUS_KEYD='key_del key_zdftmx'
 
+[ -z "${TRUS_TARF}" ] && TRUS_TARF='ORCA2_LIM_nemo_v3.6.tar'
 
 ## User environment
@@ -29,13 +46,16 @@
 TRUS_XIOS=$CCCWORKDIR/XIOS/xios-1.0
 
-[ ${TRUS_REFE} == 'ORCA2_LIM_PISCES'  ] && TRUS_CONF='O2LP_trust'
-[ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ] && TRUS_CONF='O1L3P_trust' && TRUS_XIOS=${TRUS_WORK}/XIOS/XIOS_DEV_CMIP6
-[ ${TRUS_REFE} == 'ORCA2_LIM'         ] && TRUS_CONF='O2LA_trust'
-
-if [ ${TRUS_BRAN} == 'trunk' ]; then
-    TRUS_XIOS=$CCCWORKDIR/XIOS/trunk
-    TRUS_TARF='ORCA2_LIM_nemo_v3.7.tar INPUTS_PISCES_v3.6st.tar'
-    [ ${TRUS_REFE} == 'AMM12'  ] && TRUS_TARF='AMM12_v3.7.tar'
+if   [ ${TRUS_REFE} == 'ORCA2_LIM_PISCES'  ]; then
+    TRUS_CONF='O2LP_trust'
+elif [ ${TRUS_REFE} == 'ORCA2_LIM3_PISCES' ]; then
+    TRUS_CONF='O2L3P_trust'
+elif [ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ]; then
+    TRUS_CONF='O1L3P_trust'
+    TRUS_XIOS=$CCCWORKDIR/XIOS/XIOS_DEV_CMIP6
 fi
 
-[ -z "${TRUS_MAIL}" ] && TRUS_MAIL='nicolas.martin@upmc.fr claire.levy@locean-ipsl.upmc.fr officers@nemo-ocean.eu'
+[ ${TRUS_BRAN} == 'trunk' ] && TRUS_XIOS=$CCCWORKDIR/XIOS/trunk
+
+[ -z "${TRUS_MAIL}" ] && TRUS_MAIL='nicolas.martin@upmc.fr
+                                    claire.levy@locean-ipsl.upmc.fr
+                                    officers@nemo-ocean.eu'
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/user_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/user_template.cfg	(revision 8796)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/cfg/user_template.cfg	(revision 8797)
@@ -16,6 +16,6 @@
 
 ## Minimal content for code checkout/update
-TRUS_CKOT=( 'ARCH           CONFIG          NEMO               \
-             EXTERNAL/AGRIF EXTERNAL/fcm    EXTERNAL/IOIPSL    \
+TRUS_CKOT=( 'ARCH           CONFIG          NEMO               
+             EXTERNAL/AGRIF EXTERNAL/fcm    EXTERNAL/IOIPSL    
              TOOLS/COMPILE  TOOLS/maketools TOOLS/REBUILD_NEMO  ' )
 
@@ -39,5 +39,5 @@
                  ## ...../${TRUS_REFE}/${TRUS_BRAN}/${TRUS_DATE} recommended
 TRUS_STOR=     ## Benchmark folder where target files for comparison have been stored, ie:
-               ## Inputs  (all) : CPP_*, namelist_*, *.xml et inputs_list.txt (created by initial test)
+               ## Inputs  (all) : cpp_*, namelist_*, *.xml et inputs_list.txt (created by initial test)
                ## Outputs (any) : *.stat, ocean.output, restarts
                  ## ...../${TRUS_REFE}/${TRUS_BRAN} recommended (same layout as ${TRUS_SCRA})
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env	(revision 8796)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env	(revision 8797)
@@ -7,5 +7,5 @@
 export TRUS_DATE=$( date -ud "$dat" +"%Y%m%d%Z%H%M" )
 export TRUS_NAME=${TRUS_USER}'_'${TRUS_HPCC}
-export TRUS_SVNH='https://forge.ipsl.jussieu.fr/nemo/svn'
+export TRUS_SVNR='https://forge.ipsl.jussieu.fr/nemo/svn'
 
 
@@ -28,3 +28,7 @@
 
 
+## 
+##---------------------------------------------------
 export TRUS_NGCM=${TRUS_WORK}/${TRUS_BRAN}/NEMOGCM
+export TRUS_HIST=${TRUS_STOR}/trusting_${TRUS_NAME}.txt
+export TRUS_ARCH=trusting_${TRUS_DATE}_${TRUS_NAME}.tgz
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh	(revision 8796)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh	(revision 8797)
@@ -4,5 +4,5 @@
 ## Messenger filenames
 file_date=mesg_01_date.txt  ; file_rslt=mesg_02_result.txt
-file_stat=mesg_03_state.txt ; file_nemo=mesg_04_nemo.txt
+file_stat=mesg_03_status.txt; file_nemo=mesg_04_nemo.txt
 file_xios=mesg_05_xios.txt  ; file_cmpf=mesg_06_compiler.txt
 file_lmpi=mesg_07_mpi.txt   ; file_ncdf=mesg_08_netcdf.txt
@@ -10,7 +10,4 @@
 file_memy=mesg_11_memory.txt; file_note=mesg_12_comments.txt
 
-## Trusting timestamped logfile & archive
-TRUS_FILE=trusting_${TRUS_DATE}_$TRUS_NAME.txt; TRUS_ARCH=trusting_${TRUS_DATE}_$TRUS_NAME.tgz
-
 
 ## Functions in order of use
@@ -24,5 +21,5 @@
 init_files() {
     echo 'Date'        	      > ${file_date}; echo 'Result'           > ${file_rslt}
-    echo 'State'      	      > ${file_stat}; echo 'NEMOGCM rev.'     > ${file_nemo}
+    echo 'Status'      	      > ${file_stat}; echo 'NEMOGCM rev.'     > ${file_nemo}
     echo 'XIOS rev.'   	      > ${file_xios}; echo 'Fortran compiler' > ${file_cmpf}
     echo 'MPI libs'    	      > ${file_lmpi}; echo 'NetCDF libs'      > ${file_ncdf}
@@ -118,12 +115,27 @@
 
 get_inputs() {
-    ## Extract archive or copy files in case of personal inputs
-    [ -z "${TRUS_TARF}" ] && get_io="cp ${TRUS_FORC}/* ." || get_io="tar -vxf ${TRUS_FORC}/${TRUS_TARF}"
-
-    ${get_io} > /dev/null
-    [ $? -ne 0 ] && get_out 3 || echo 'Success'
-    [ $( find -name '*.gz' -print -quit ) ] && find . -name '*.gz' -exec gzip -d {} \;
-
-    ls -lh > inputs_list.txt
+    # List archive content & extract it by default
+    local get_iol=$( eval "
+	for archive in ${TRUS_TARF}; do
+	    tar -tvf ${TRUS_FORC}/\$archive >> inputs_list.txt;
+	done
+	" )
+    local get_iof=$( eval "
+	for archive in ${TRUS_TARF}; do
+	    tar -vxf ${TRUS_FORC}/\$archive > /dev/null;
+	done
+	" )
+
+    ## List & copy files in case of personal inputs
+    if [ -z "${TRUS_TARF}" ]; then
+	get_iol="ls ${TRUS_FORC}/*"
+	get_iof="\cp ${TRUS_FORC}/* ."
+    fi
+
+    ${get_iol}; ${get_iof}
+
+    if [ `find -name '*.gz' -print -quit` ]; then
+	find . -name '*.gz' -exec gzip -d {} \;
+    fi
 }
 
@@ -196,70 +208,53 @@
 
 diff_restart() {
-    local base_name comp dif file list_comp list_tmsp nb_dom time_step tmsp
-    local files_list='' dif_sum=0
-
-    ## Stop if no benchmark files (ie time.step)
-    [ ! -e ${TRUS_STOR}/time.step ] && { TRUS_RSLT='FAILED'; get_out 7; }
-    time_step=$( cat ${TRUS_STOR}/time.step | tr -d [:space:] )
+    local dif filebase filebases ndomain out
+    local files_list='' dif_sum='undef'
 
     ## Find all restart files to rebuild
     if [ $( find -regex ".*_restart.*[0-9]\.nc" -print -quit ) ]; then
-	base_name=$( find -regex ".*_restart.*[0-9]\.nc"                       \
-	             | sed "s#^\./\(.*\)_[0-9]*_restart.*#\1#"       | sort -u   )
-	list_comp=$( find -regex ".*_restart.*[0-9]\.nc"                       \
-	             | sed "s#^.*\(restart[a-z_]*\)_[0-9].*\.nc#\1#" | sort -u   )
-	list_tmsp=$( find -regex ".*_restart.*[0-9]\.nc"                       \
-	             | sed "s#^.*\([0-9]\{8\}\)_restart.*#\1#"       | sort -u   )
-
-	## Loop on each time step
-	for tmsp in ${list_tmsp}; do
-
-	    for comp in ${list_comp}; do
-		file=${base_name}_${tmsp}_${comp}
-		nb_dom=$( find -name "${file}_[0-9]*.nc" | wc -l | awk '{ print $1 }' )
-
-		if   [ ${nb_dom} -gt 1 ]; then
-		    ${TRUS_NGCM}/TOOLS/REBUILD_NEMO/rebuild_nemo -t ${TRUS_NPRO} $file ${nb_dom} \
-			> /dev/null
-
-		     ## Possibility of remaining decomposed restarts (even after rebuild)
-		    [ $? -eq 0 ] && rm -f ${file}_[0-9]*.nc \
-                        > /dev/null
-
-		elif [ ${nb_dom} -eq 0 ]; then
-		    TRUS_RSLT='FAILED' && get_out 8
+	filebases=$( find -regextype sed -regex ".*_[0-9]\{4\}\.nc" \
+	             | sed 's/\(.*\)_.*/\1/' | sort -u                )
+
+	for filebase in ${filebases}; do
+
+	    ndomain=$( find -regex ".*${name}_[0-9]*.nc" | wc -l | awk '{print $1}' )
+
+	    [ ${ndomain} -eq 0 ] && TRUS_RSLT='FAILED' && get_out 8
+
+	    ${TRUS_NGCM}/TOOLS/REBUILD_NEMO/rebuild_nemo \
+		-t ${TRUS_NPRO} $filebase ${ndomain}     \
+		> /dev/null
+
+	    ## Possibility of remaining decomposed restarts (even after rebuild)
+	    [ $? -eq 0 ] && rm -f ${file}_[0-9]*.nc \
+                > /dev/null
+
+	    dif=''
+
+            ## Stop if no benchmark files (restart file)
+	    if [ -e ${TRUS_STOR}/$file.nc ]; then
+
+		out=$( $TRUS_CDOD $name.nc ${TRUS_STOR}/$name.nc 2>&1 )
+		dif=$( echo $out | grep -o "[0-9]* of [0-9]* records" )
+
+		## Fix for cdo aborting on restarts with different inputs
+		if [[ $out =~ 'Abort' ]]; then
+		    dif=$( echo $out | awk -F: '{print $NF}' )
 		fi
 
-		## Compare restart files at same time step
-		if [ $tmsp -eq ${time_step} ]; then
-
-                    ## Stop if no benchmark files (restart file)
-		    if [ -e ${TRUS_STOR}/$file.nc ]; then
-
-	                ## UNIX `cmp` not suitable (timestamp in .nc file)
-			dif=$( $TRUS_CDOD $file.nc ${TRUS_STOR}/$file.nc 2> /dev/null          \
-			       | awk '/records/ {print $0}' | sed '2 s/^/,/' | tr -d '\n' )
-
-			## CDO can return void stdout with no difference
-			if [[ -n "$dif" && $( echo $dif | awk '{print $1}' ) -ne 0 ]]; then
-			    TRUS_RSLT='FAILED'
-			    files_list+=$comp' ' && let dif_sum+=$( echo $dif | awk '{print $1}' )
-			    echo $file.nc': '$dif
-			fi
-
-		    else
-			TRUS_RSLT='FAILED' && get_out 7
-		    fi
-
-		else
-		    continue
+		if [ -n "$dif" ]; then
+		    export TRUS_RSLT='FAILED'
+		    files_list+=$name' ' && echo $name'.nc: '$dif
+		    let dif_sum+=$( echo $dif | awk '{print $1}' )
 		fi
 
-	    done
-
 	done
 
+    ## Stop if no benchmark files (ie time.step)
+	if   [ ${dif_sum} == 'undef' ]; then
+	    TRUS_RSLT='FAILED'
+	    get_out 7
         ## List different files for web comment with sum of different records
-	if [ ${dif_sum} -ne 0 ]; then
+	elif [ ${dif_sum} -ne 0      ]; then
 	    echo 'Restarts: '${files_list}${dif_sum}' record(s) differ<br>' \
 		>> temp_${file_note}
@@ -328,8 +323,8 @@
 
 	## Create or append trusting logfile
-	if [ -f ${TRUS_STOR}/trusting_$TRUS_NAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi
-
-	$cmd ${TRUS_FILE}                            \
-	    >> ${TRUS_STOR}/trusting_$TRUS_NAME.txt
+	if [ -f ${TRUS_HIST} ]; then cmd='tail -1'; else cmd='cat'; fi
+
+	$cmd ${TRUS_FILE}   \
+	    >> ${TRUS_HIST}
 
         ## Send mail only when FAILED
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh	(revision 8796)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh	(revision 8797)
@@ -46,5 +46,5 @@
 printf "\nWhat branch do you want to install in "${TRUS_WORK}" for trusting test ? "
 echo 'Enter 0 to abort'
-select branch in 'trunk' $( svn ls ${TRUS_SVNH}/branches/2015 | tr -d / | sort -r ); do
+select branch in 'trunk' $( svn ls ${TRUS_SVNR}/branches/2015 | tr -d / | sort -r ); do
 
     if [ $REPLY -eq 0 ]; then exit 1; else export TRUS_BRAN=$branch; fi
@@ -74,8 +74,8 @@
 
     if [ $elmt == 'TOOLS/maketools' ]; then
-	svn co -q ${TRUS_SVNH}/${svn_bran}/NEMOGCM/TOOLS --depth empty
+	svn co -q ${TRUS_SVNR}/${svn_bran}/NEMOGCM/TOOLS --depth empty
 	svn up -q $elmt
     else
-	svn co -q ${TRUS_SVNH}/${svn_bran}/NEMOGCM/$elmt $elmt
+	svn co -q ${TRUS_SVNR}/${svn_bran}/NEMOGCM/$elmt $elmt
     fi
 
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh	(revision 8796)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh	(revision 8797)
@@ -54,5 +54,5 @@
     ## If -v|--version option has been set, modify default SVN action on directories
     if   [ $( echo ${TRUS_SVNV} | grep  "HEAD\|up\|update"                     ) ]; then
-	TRUS_SVNA='svn update -r HEAD --accept=theirs-conflict'
+	TRUS_SVNA='svn update -r HEAD'
     elif [ $( echo ${TRUS_SVNV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) ]; then
 	TRUS_SVNA='svn update -r     '$( echo ${TRUS_SVNV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' )
