Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/banner.txt
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/banner.txt	(revision 5788)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/banner.txt	(revision 5788)
@@ -0,0 +1,33 @@
+<pre style="font: 2px/1px monospace;">
+@@@@@@O$$$$$$@@@@@@#$$$$$$&@#$$$$$$$$$$$$$$$&@O$$$$$$&@@@@@@@@@$$$$$$O@@@@@@@@@@@O$$%$O@@@@@@@@@@@@@
+@@@@@@?!!!!!!#@@@@@O!!!!!!#@$!!!!!!!!!!!!!!!#@%!!!!!!?&@@@@@@@$!!!!!!?@@@@@@@@&O#&&&&%??$#@@@@@@@@@@
+@@@@@@?!!!!!!?@@@@@O!!!!!!#@$!!!!!!!!!!!!!!!#@%!!!!!!!%@@@@@@O!!!!!!!?@@@@@@@O#@@&%??!!!!!$@@@@@@@@@
+@@@@@@?!!!!!!!O@@@@O!!!!!!#@$!!!!!!?????????&@%!!!!!!!!$@@@@#!!!!!!!!?@@@@@&O&@&&O$$?!!!!!!%&@@@@@@@
+@@@@@@?!!!!!!!!#@@@O!!!!!!#@$!!!!!!#&&&&&&&&@@%!!!!!!!!!$@@&?!!!!!!!!?@@@@@O&@&??&@@&O!!!!!!%@@@@@@@
+@@@@@@?!!!!!!!!?&@@O!!!!!!#@$!!!!!!#@@@@@@@@@@%!!!!!!!!!!O@%!!!!!!!!!?@@@@O&@@O!O@@@@&O!!!!!!$@@@@@@
+@@@@@@?!!!!!!!!!?#@O!!!!!!#@$!!!!!!#@@@@@@@@@@%!!!!!!!!!!!%!!!!!!!!!!?@@@&O@@$!!O&@@@@&O!!!!!!#@@@@@
+@@@@@@?!!!!!!!!!!!OO!!!!!!#@$!!!!!!$OOOOO@@@@@%!!!!!!!!!!!!!!!!!!!!!!?@@@O@&%!!!!!%#&&@&?!!!!!%@@@@@
+@@@@@@?!!!!!!!!!!!!!!!!!!!#@$!!!!!!!!!!!?@@@@@%!!!!!!!!!!!!!!!!!!!!!!?@@@O&!!!!!!%%eO&@$!!!!!!%&@@@@
+@@@@@@?!!!!!!!!!!!!!!!!!!!#@$!!!!!!!!!!!?@@@@@%!!!!!!!!!!!!!!!!!!!!!!?@@&&$!!!?$O$Oe$@@!!!!!!eO#@@@@
+@@@@@@?!!!!!!!!!!!!!!!!!!!#@$!!!!!!?%%%%$@@@@@%!!!!!!!!!!!!!!!!!!!!!!?@@O&!!!!$&$#%!#@@?!!!!!!$O@@@@
+@@@@@@?!!!!!!!!!!!!!!!!!!!#@$!!!!!!#@@@@@@@@@@%!!!!!!!!!!!!!!!!!!!!!!?@@O&!!!!%?O@%&&&@$!!!!!!?O@@@@
+@@@@@@?!!!!!?#!!!!!!!!!!!!#@$!!!!!!#@@@@@@@@@@%!!!!!!#!!!!!!!!O?!!!!!?@@O#!!!!!!?@@@@@OO!!!!$e?O@@@@
+@@@@@@?!!!!!?@#?!!!!!!!!!!#@$!!!!!!#@@@@@@@@@@%!!!!!!&#!!!!!!%&?!!!!!?@@OOO?!!!%%@@@@@#?!%$#O%%$@@@@
+@@@@@@?!!!!!?@@&%!!!!!!!!!#@$!!!!!!?????????&@%!!!!!!&@O!!!!?&@?!!!!!?@@#&##%$&&&@@@@@@$%#&O!??O@@@@
+@@@@@@?!!!!!?@@@@#?!!!!!!!#@$!!!!!!!!!!!!!!!#@%!!!!!!&@@$!!!&@@?!!!!!?@@&#$&@@@@@@@@@@@?O%%?!!!#@@@@
+@@@@@@?!!!!!?@@@@@@#%!!!!!#@$!!!!!!!!!!!!!!!#@%!!!!!!&@@@$!O@@@?!!!!!?@@@O#&&@@@@@@@@@@O?!!!!!?&@@@@
+@@@@@@?!!!!!?@@@@@@@@&O$%%#@#O##&&&&&&&&##OO&@$!!!!!!&@@@@O@@@@?!!!!!?@@@O&&#&@@@@@@@@@$!!!!!!$@@@@@
+@@@@@@?!!!!!?@@@@@@@@@@@@@@&&#O$$$%%%%$$$OO#&@@&#O%?!&@@@@@@@@@?!!!!!?@@@@OOO@@@@@@@@@&!!!!!!!&@@@@@
+@@@@@@?!!!!!?@@@@@@@@@&#$%?!!!!!!!!!!!!!!!!!!!?%O#@@#@@@@@@@@@@?!!!!!?@@@@#!!%&@@@@@@@%!!!!!!O@@@@@@
+@@@@@@?!!!!!?@@@@@@#$?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%$&@@@@@@@@@?!!!!!?@@@@@#!!%@@@@@@@O!!$&$$@@@@@@@
+@@@@@@?!!!!!?@@@O%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!?$#@@@@@@?!!!!!?@@@@@@O!!?@@@@@@@&&@#O@@@@@@&&
+@@@@@@?!!!?O&#$?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!?$#@@@$?!!!!?@@@@@@@&%!?$#@@@@@&O#@@@@@#O&@
+@@@@@@?!?O&#%!!!!!!!!!??%%$$$OOOOOOOOOO$$%%??!!!!!!!!!!!!!!!?%O&&&O$%%@@@@@@@@@#%?%####O#@@@&#$$#@@@
+@@@@@@%O&#%!!!!!?%$O#&&@@@@@@@@@@@@@@@@@@@@@&&#O$%?!!!!!!!!!!!!!?$O&&&@@@@@@@@@@@&&&&&&&&#$%?%#@@@@@
+@@@@@@&#%!!!?$#&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&#O%?!!!!!!!!!!!!??%$OOO#######OO$%??!!?%#@@@@@@@
+@@@@@&$!?%O&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#O$%?!!!!!!!!!!!!!!!!!!!!!!!!!?$#&@@@@@@@@@
+@@@@O?%O&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&#OO$%????!!!!!!!!??%%O#&@@@@@@@@@@@@@
+@@&$$&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&@@@@@@@@@@@@@@@@@@@@
+@#O&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+</pre>
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_ADA.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_ADA.sh	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_ADA.sh	(revision 5788)
@@ -6,7 +6,7 @@
 # @ job_type = parallel
 # Fichier de sortie standard
-# @ output = NEMO_CI
-# Fichier de sortie erreur (le meme)
-# @ error  = NEMO_CI
+# @ output = $(job_name)_$(jobid)
+# Fichier de sortie erreur
+# @ error  = $(job_name)_$(jobid)
 # Nombre de processus demande
 # @ total_tasks = 32
Index: anches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_ADA_at.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_ADA_at.sh	(revision 5787)
+++ 	(revision )
@@ -1,21 +1,0 @@
-#!/bin/bash
-
-# Nom de la requete
-# @ job_name = NEMO_CI
-# Type de travail
-# @ job_type = parallel
-# Fichier de sortie standard
-# @ output = NEMO_CI
-# Fichier de sortie erreur (le meme)
-# @ error  = NEMO_CI
-# Nombre de processus demande
-# @ total_tasks = 32
-# Temps CPU max. par processus MPI hh:mm:ss
-# @ wall_clock_limit = 0:30:00
-# Fin de l entete
-# @ queue
-
-cd $LOADL_STEP_INITDIR
-
-# running the job in parallel mode
-poe ./opa
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_CURIE.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_CURIE.sh	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_CURIE.sh	(revision 5788)
@@ -3,7 +3,7 @@
 #Config ccc_msub
 #MSUB -A  gen7451
-#MSUB -r  Trust
-#MSUB -o  Trust_%I
-#MSUB -e  Trust_%I
+#MSUB -r  NEMO_CI
+#MSUB -o  NEMO_CI_%I
+#MSUB -e  NEMO_CI_%I
 #MSUB -oe
 #MSUB -q  xlarge
Index: anches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_CURIE_cron.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/batch/X64_CURIE_cron.sh	(revision 5787)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#!/bin/bash
-
-#Config ccc_msub
-#MSUB -A  gen7451
-#MSUB -r  Trust
-#MSUB -o  Trust_%I
-#MSUB -e  Trust_%I
-#MSUB -oe
-#MSUB -q  xlarge
-#MSUB -n  128
-#MSUB -N  1
-#MSUB -T  1800
-##MSUB -@  ntmlod@locean-ipsl.upmc.fr:begin,end
-ccc_mprun ./opa
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_ADA.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_ADA.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_ADA.cfg	(revision 5788)
@@ -1,25 +1,23 @@
 ## Ada configuration
-##------------------
+##---------------------------------------------------
 
-## Available softwares:
-CDO='cdo'
-COMPILER='ifort'
-MPI='intel'
-NETCDF='netcdf/mpi'
+ARCH_ENV=${DIR_XIOS}/arch/arch-${TRUS_HPCC}.env
 
-## Job commands: LoadLeveler
-JOB_SUBM="llsubmit ${NEMO_TRUS}/batch/${NEMO_HPCC}.sh | grep -oe '\<[0-9]*\>'"
-JOB_LIST=llq
-JOB_INFO='llq -x'
-JOB_TIME="idrllsummary -j \${JOB_ID} | awk '/Step User Time/ {print \$4}' | cut -d. -f1"
-JOB_DELE=llcancel
+CMPF='ifort'
+STR_CDOD='cdo/'
+STR_LMPI='intel/impi/'
+STR_NCDF='netcdf/'
 
-## Compiling & computing settings
-[ -z "$NPROC"       ] && NPROC=16
-[ -z "${TIME_LIMI}" ] && TIME_LIMI=10800 # 3h
+JOB_SUBM="llsubmit ${TRUS_DIR}/batch/${TRUS_HPCC}.sh | grep -oe '\<[0-9]*\>'"
+JOB_STAT="llq      | grep \${JOB_ID}"
+JOB_INFO="llq -x          \${JOB_ID}"
+JOB_KILL="llcancel        \${JOB_ID}"
 
-## Architecture environment (be careful with compliance with XIOS)
-ARCH_ENV=${DIR_XIOS}/arch/arch-${NEMO_HPCC}.env
+[ -z "${TRUS_NPRO}"   ] && TRUS_NPRO='16'
+[ -z "$TIMEOUT" ] && TIMEOUT='10800'
 
-## $CDO command to compare 2 datasets
+JOB_TIME="grep IdrisMemMPI NEMO_CI_\${JOB_ID} | cut -d, -f1 | awk '{print \$(NF-1),\$NF}'"
+JOB_PMEM="grep IdrisMemMPI NEMO_CI_\${JOB_ID} | cut -d, -f3 | awk '{print \$3,\$4}'"
+JOB_VMEM="grep IdrisMemMPI NEMO_CI_\${JOB_ID} | cut -d, -f2 | awk '{print \$3,\$4}'"
+
 CDOD='cdo diffn'
Index: anches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_ADA_at.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_ADA_at.cfg	(revision 5787)
+++ 	(revision )
@@ -1,25 +1,0 @@
-## Ada configuration
-##------------------
-
-## Available softwares:
-CDO='cdo/'
-COMPILER='ifort'
-MPI='intel/impi/'
-NETCDF='netcdf/'
-
-## Job commands: LoadLeveler
-JOB_SUBM="llsubmit ${NEMO_TRUS}/batch/${NEMO_HPCC}.sh | grep -oe '\<[0-9]*\>'"
-JOB_LIST=llq
-JOB_INFO='llq -x'
-JOB_TIME="idrllsummary -j \${JOB_ID} | awk '/Step User Time/ {print \$4}' | cut -d. -f1"
-JOB_DELE=llcancel
-
-## 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-${NEMO_HPCC}.env
-
-## $CDO command to compare 2 datasets
-CDOD='cdo diffn'
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_CURIE.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_CURIE.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_CURIE.cfg	(revision 5788)
@@ -1,25 +1,23 @@
 ## Curie configuration
-##--------------------
+##---------------------------------------------------
 
-## Available softwares:
-CDO='cdo'
-COMPILER='ifort'
-MPI='bullxmpi'
-NETCDF='netcdf'
+ARCH_ENV=${DIR_XIOS}/arch/arch-${TRUS_HPCC}.env
 
-## Job commands: ccc_*
-JOB_SUBM="ccc_msub ${NEMO_TRUS}/batch/${NEMO_HPCC}.sh | grep -oe '\<[0-9]*\>'"
-JOB_LIST=ccc_mpp
-JOB_INFO=ccc_macct
+CMPF='ifort'
+STR_CDOD='netcdf-utils-'
+STR_LMPI='bullxmpi/'
+STR_NCDF='netcdf-'
+
+JOB_SUBM="ccc_msub ${TRUS_DIR}/batch/${TRUS_HPCC}.sh | grep -oe '\<[0-9]*\>'"
+JOB_STAT="ccc_mpp   | grep  \${JOB_ID}"
+JOB_INFO="ccc_macct         \${JOB_ID}"
+JOB_KILL="ccc_mdel          \${JOB_ID}"
+
+[ -z "${TRUS_NPRO}"   ] && TRUS_NPRO='16'
+[ -z "$TIMEOUT" ] && TIMEOUT='10800'
+
 JOB_TIME="ccc_macct \${JOB_ID} | awk '/opa/ {print \$9}'"
-JOB_DELE=ccc_mdel
+JOB_PMEM="ccc_macct \${JOB_ID} | awk "
+JOB_VMEM="ccc_macct \${JOB_ID} | awk "
 
-## 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-${NEMO_HPCC}.env
-
-## $CDO command to compare 2 datasets
 CDOD='cdo diffn'
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_CURIE_cron.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_CURIE_cron.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/X64_CURIE_cron.cfg	(revision 5788)
@@ -1,25 +1,23 @@
-## Curie configuration
-##--------------------
+## Curie configuration (`cron` version)
+##---------------------------------------------------
 
-## Available softwares:
-CDO='netcdf-utils-'
-COMPILER='ifort'
-MPI='bullxmpi/'
-NETCDF='netcdf-'
+ARCH_ENV=${DIR_XIOS}/arch/arch-${TRUS_HPCC}.env
 
-## Job commands: ccc_*
-JOB_SUBM="ccc_msub ${NEMO_TRUS}/batch/${NEMO_HPCC}.sh | grep -oe '\<[0-9]*\>'"
-JOB_LIST=ccc_mpp
+STR_CDOD='netcdf-utils-'
+CMPF='ifort'
+STR_LMPI='bullxmpi/'
+STR_NCDF='netcdf-'
+
+JOB_SUBM="ccc_msub ${TRUS_DIR}/batch/${TRUS_HPCC}.sh | grep -oe '\<[0-9]*\>'"
+JOB_STAT=ccc_mpp
 JOB_INFO=ccc_macct
+JOB_KILL=ccc_mdel
+
+[ -z "${TRUS_NPRO}"       ] && TRUS_NPRO='16'
+[ -z "${TIMEOUT}" ] && TIMEOUT='10800'
+
 JOB_TIME="ccc_macct \${JOB_ID} | awk '/opa/ {print \$9}'"
-JOB_DELE=ccc_mdel
+JOB_PMEM="ccc_macct \${JOB_ID} | awk "
+JOB_VMEM="ccc_macct \${JOB_ID} | awk "
 
-## 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-${NEMO_HPCC}.env
-
-## $CDO command to compare 2 datasets
 CDOD='cdo diffn'
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/arch_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/arch_template.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/arch_template.cfg	(revision 5788)
@@ -1,34 +1,56 @@
-## Copy to ./${NEMO_HPCC}.cfg, fill in according to your machine
+## HPC configuration template
+##---------------------------------------------------
 
-## Super-computer configuration
+## Copy to root (./config) and rename it by keeping '.cfg' extension, then fill in according to your (super)computer
+## Will be called by its name without the extension
 
 
-## Architecture environment
-ARCH_ENV=''    ##  (be careful with compliance with XIOS)
-                  ## ex: "${DIR_XIOS}/arch/arch-${NEMO_HPCC}.env"
+## Mandatory 
+##---------------------------------------------------
+
+## (Super)Computer environment
+ARCH_ENV=''    		## *.env, *.path or modulesfile to source (let void if $PATH has already been setted)
+               		     ## ex: "${DIR_XIOS}/arch/arch-${TRUS_HPCC}.env"
+
+## Job commands (use with `eval ${JOB_....}`), may need to use "\${JOB_ID}" variable as the job ID returned from submission:
+JOB_SUBM=''    		## Submit a job and get his ID in return (will became ${JOB_ID})
+        		     ## ex: `llsubmit ${TRUS_DIR}/batch/${TRUS_HPCC}.sh | grep -oe '\<[0-9]*\>'`, use absolute path
+JOB_STAT=''    		## Test state of the submitted job (true -> pending/running or false -> completed/crashed)
+                             ## ex: "llq | grep \${JOB_ID}"
+JOB_KILL=''    		## Kill the submitted job
+                             ## ex: "llcancel   \${JOB_ID}"
+
+## Compiling (number of tasks) and computation (timeout in s)
+[ -z "${TRUS_NPRO}"     ] && TRUS_NPRO='1'
+[ -z "${TIMEOUT}" ] && TIMEOUT='10800'
+
+## $CDO command to compare 2 datasets in argument
+CDOD=''                 ## Essential to check a difference between NetCDF restart files
 
 
-## Available softwares (pattern to search before release number):
-CDO=''         ## CDO (Climate Data Operators) (string appears in $LOADEDMODULES or $PATH)
-                  ## ex: 'cdo'/'nco'/...
-COMPILER=''    ## Fortran compiler (use with `$COMPILER --version`)
-                  ## ex: 'ifort'/'gfortran'/'pgfortran'/...
-MPI=''         ## MPI    libraries             (   " "     ""  ""       ""       ""  " " )
-                  ## ex: 'opempi'/'mpich'/...
-NETCDF=''      ## NetCDF    " "                (   " "     ""  ""       ""       ""  " " )
-                  ## ex: 'netcdf42'/'netcdf-parallel'/...
+## Interest when monitoring HPC center
+##---------------------------------------------------
+
+## Software releases (string pattern to match just before the number in $LOADEDMODULES or $PATH):
+STR_CDOD=''    		## CDO (Climate Data Operators)
+               		     ## ex: 'cdo'||'nco'||...
+STR_LMPI=''    		## MPI    libraries            
+               		     ## ex: 'openmpi'||'mpich'||...
+STR_NCDF=''    		## NetCDF    " "               
+               		     ## ex: 'netcdf'||'netcdf-parallel'||...
+
+## Fortran compiler version (use with `$COMPILER --version`)
+CMPF=''    		     ## ex: 'ifort'||'gfortran'||'pgfortran'||...
 
 
-## Job commands (works with job ID):
-JOB_SUBM=''    ## Submit a job && get his ID in return
-                  ## ex: "cmd ${NEMO_TRUS}/batch/${NEMO_HPCC}.sh | awk '{print \$NF}'"
-JOB_LIST=''    ## List all submitted jobs to determine if a job is completed or not
-JOB_INFO=''    ## Get job informations to fill in a log file (job ID as argument)
-JOB_TIME=''    ## Get real CPU time computation with `eval "${JOB_INFO} ${JOB_ID} | ${JOB_TIME}"`
-                  ## ex: "awk '/opa/ END{print \$9}'"
-JOB_DELE=''    ## Kill submitted job (job ID as argument)
+## Optional (can be void if no alternative or need)
+##---------------------------------------------------
 
-
-## Compiling & computation
-[ -z "$NPROC"       ] && NPROC=1         ## Processing units for compilation
-[ -z "${TIME_LIMI}" ] && TIME_LIMI=''    ## Utmost time in seconds to wait for completed job
+## Computational performances of finished job (use with `eval ${JOB_....}`)
+JOB_INFO=''    		## Get job informations to fill in a logfile during computation
+                             ## ex: "llq -x     \${JOB_ID}"
+JOB_TIME=''    		## Get CPU elapsed time
+                             ## ex: `grep IdrisMemMPI NEMO_CI_\${JOB_ID} | cut -d, -f1 | awk '{print \$(NF-1),\$NF}'`
+JOB_PMEM=''    		## Get max physical memory
+                             ## ex: `grep IdrisMemMPI NEMO_CI_\${JOB_ID} | cut -d, -f3 | awk '{print \$3,\$4}'`
+JOB_VMEM=''    		## Get " " virtual    ""  
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/martin.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/martin.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/martin.cfg	(revision 5788)
@@ -2,43 +2,31 @@
 ##-------------------
 
-
-## Global Directories:
 DIR_WORK=$CCCWORKDIR
 DIR_SCRA=$SCRATCHDIR/trusting
 DIR_STOR=$CCCSTOREDIR/trusting_sav
 
+if [ -z "${TRUS_WKCY}" ]; then branch='trunk'; else branch=${TRUS_WKCY}; fi
+TRUS_WKCY=${DIR_WORK}/NEMO/$branch/NEMOGCM
+[ -z "${TRUS_REFE}" ] && TRUS_REFE='ORCA2_LIM_PISCES'
+TRUS_BHMK=${DIR_STOR}/${TRUS_REFE}/${TRUS_WKCY}
+TEST_DIR=${DIR_SCRA}/${TRUS_REFE}/${TRUS_WKCY}/trusting_${DATE}
 
-## NEMO overall installation:
-[ -z "${NEMO_BRAN}" ] && NEMO_BRAN='trunk'
-NEMO_HOME=${DIR_WORK}/NEMO/${NEMO_BRAN}/NEMOGCM
+DIR_XIOS=${DIR_WORK}/XIOS/xios-1.0
 
-### Reference/'Trusting' configuration
-[ -z "${REFE_CONF}" ] && REFE_CONF='ORCA2_LIM_PISCES'
-TEST_CONF=${REFE_CONF}'_trust'
+TRUS_TEST=${TRUS_REFE}'_trust'
+[ ${TRUS_REFE} == 'ORCA2_LIM_PISCES'  ] && TRUS_TEST='O2LP_trust'
+[ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ] && TRUS_TEST='O1L3P_trust'
+
 KEYS_ADD=''; KEYS_DEL=''
-[ ${REFE_CONF} == 'ORCA2_LIM_PISCES'  ] && TEST_CONF='O2LP_trust'
-[ ${REFE_CONF} == 'ORCA1_LIM3_PISCES' ] && TEST_CONF='O1L3P_trust'
-if [ ${REFE_CONF} == 'ORCA2_LIM' ]; then
-    TEST_CONF='O2LA_trust'
+
+if [ ${TRUS_REFE} == 'ORCA2_LIM' ]; then
+    TRUS_TEST='O2LA_trust'
     KEYS_ADD='key_add key_agrif' && KEYS_DEL='key_del key_zdftmx'
 fi
 
-### Inputs
-NEMO_FORC=${DIR_WORK}/NEMO/FORC
-[ -z "${NEMO_TARF}" ] && NEMO_TARF='ORCA2_LIM_nemo_v3.6.tar'
-[ ${REFE_CONF} == 'ORCA1_LIM3_PISCES' ] && NEMO_TARF='INPUTS_ORCA1_LIM3_PISCES_V6.tar'
-[ ${REFE_CONF} == 'AMM12'             ] && NEMO_TARF='AMM12_v3.6.tar'
+TRUS_FORC=${DIR_WORK}/NEMO/FORC
+[ -z "${TRUS_TARF}" ] && TRUS_TARF='ORCA2_LIM_nemo_v3.6.tar'
+[ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ] && TRUS_TARF='INPUTS_ORCA1_LIM3_PISCES_V6.tar'
+[ ${TRUS_REFE} == 'AMM12'             ] && TRUS_TARF='AMM12_v3.6.tar'
 
-
-## Comparatives directories path:
-REFE_DIR=${DIR_STOR}/${REFE_CONF}/${NEMO_BRAN}
-TEST_DIR=${DIR_SCRA}/${REFE_CONF}/${NEMO_BRAN}/trusting_${DATE}
-
-
-## External softs directories:
-DIR_XIOS=${DIR_WORK}/XIOS/xios-1.0
-#DIR_OASI=${DIR_WORK}/OASIS
-
-
-## Mailing list to inform of a failure (-p|--publish option required)
-[ -z "$EMAIL" ] && EMAIL='ntmlod@locean-ipsl.upmc.fr'
+[ -z "$TRUS_MAIL" ] && TRUS_MAIL='ntmlod@locean-ipsl.upmc.fr'
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/romr005.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/romr005.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/romr005.cfg	(revision 5788)
@@ -2,43 +2,31 @@
 ##-------------------
 
-
-## Global Directories:
 DIR_WORK=$WORKDIR
 DIR_SCRA=$WORKDIR/NEMO/trusting
 DIR_STOR=$WORKDIR/NEMO/trusting_sav
 
+if [ -z "${TRUS_WKCY}" ]; then branch='trunk'; else branch=${TRUS_WKCY}; fi
+TRUS_WKCY=${DIR_WORK}/NEMO/$branch/NEMOGCM
+[ -z "${TRUS_REFE}" ] && TRUS_REFE='ORCA2_LIM_PISCES'
+TRUS_BHMK=${DIR_STOR}/${TRUS_REFE}/$branch
+TEST_DIR=${DIR_SCRA}/${TRUS_REFE}/$branch/trusting_${DATE}
 
-## NEMO overall installation:
-[ -z "${NEMO_BRAN}" ] && NEMO_BRAN='trunk'
-NEMO_HOME=${DIR_WORK}/NEMO/${NEMO_BRAN}/NEMOGCM
+DIR_XIOS=${DIR_WORK}/XIOS/xios-1.0
 
-### Reference/'Trusting' configuration
-[ -z "${REFE_CONF}" ] && REFE_CONF='ORCA2_LIM_PISCES'
-TEST_CONF=${REFE_CONF}'_trust'
+TRUS_TEST=${TRUS_REFE}'_trust'
+[ ${TRUS_REFE} == 'ORCA2_LIM_PISCES'  ] && TRUS_TEST='O2LP_trust'
+[ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ] && TRUS_TEST='O1L3P_trust'
+
 KEYS_ADD=''; KEYS_DEL=''
-[ ${REFE_CONF} == 'ORCA2_LIM_PISCES'  ] && TEST_CONF='O2LP_trust'
-[ ${REFE_CONF} == 'ORCA1_LIM3_PISCES' ] && TEST_CONF='O1L3P_trust'
-if [ ${REFE_CONF} == 'ORCA2_LIM' ]; then
-    TEST_CONF='O2LA_trust'
+
+if [ ${TRUS_REFE} == 'ORCA2_LIM' ]; then
+    TRUS_TEST='O2LA_trust'
     KEYS_ADD='key_add key_agrif' && KEYS_DEL='key_del key_zdftmx'
 fi
 
-### Inputs
-NEMO_FORC=${DIR_WORK}/NEMO/FORC
-[ -z "${NEMO_TARF}" ] && NEMO_TARF='ORCA2_LIM_nemo_v3.6.tar'
-[ ${REFE_CONF} == 'ORCA1_LIM3_PISCES' ] && NEMO_TARF='INPUTS_ORCA1_LIM3_PISCES_V6.tar'
-[ ${REFE_CONF} == 'AMM12'             ] && NEMO_TARF='AMM12_v3.6.tar'
+TRUS_FORC=${DIR_WORK}/NEMO/FORC
+[ -z "${TRUS_TARF}" ] && TRUS_TARF='ORCA2_LIM_nemo_v3.6.tar'
+[ ${TRUS_REFE} == 'ORCA1_LIM3_PISCES' ] && TRUS_TARF='INPUTS_ORCA1_LIM3_PISCES_V6.tar'
+[ ${TRUS_REFE} == 'AMM12'             ] && TRUS_TARF='AMM12_v3.6.tar'
 
-
-## Comparatives directories path:
-REFE_DIR=${DIR_STOR}/${REFE_CONF}/${NEMO_BRAN}
-TEST_DIR=${DIR_SCRA}/${REFE_CONF}/${NEMO_BRAN}/trusting_${DATE}
-
-
-## External softs directories:
-DIR_XIOS=${DIR_WORK}/XIOS/xios-1.0
-#DIR_OASI=${DIR_WORK}/OASIS
-
-
-## Mailing list to inform of a failure (-p|--publish option required)
-[ -z "$EMAIL" ] && EMAIL='ntmlod@locean-ipsl.upmc.fr'
+[ -z "$TRUS_MAIL" ] && TRUS_MAIL='ntmlod@locean-ipsl.upmc.fr'
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/user_template.cfg
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/user_template.cfg	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/config/user_template.cfg	(revision 5788)
@@ -1,56 +1,48 @@
-## Copy to ./${NEMO_USER}.cfg, fill in according to your installation
+## User configuration
+##---------------------------------------------------
 
-## User configuration
-##-------------------
+## Copy to root (./config) and rename it by keeping '.cfg' extension, then fill in according to your installation
+## Will be called by its name without extension
 
 
-## Global Directories:
-#DIR_WORK=''
-#DIR_SCRA=''
-#DIR_STOR=''
+## Mandatory
+##---------------------------------------------------
+
+## Few settings can be changed from directly from command line to reduce the creation of user configuration file
+## See `./trusting.sh [-h|--help]`
+
+## Directories path
+TRUS_BHMK=''           ## Benchmark folder where target files for comparison have been stored
+                         ## Inputs  (all) : CPP_*, namelist_*, *.xml et inputs_file.txt (formed by first test)
+                         ## Outputs (any) : *.stat, ocean.output, restarts
+TEST_DIR=''	      ## Testing folder for computation
+                         ## ex: ".../trusting_${DATE}"
+TRUS_WKCY=''          ## Working copy of branch test
+                         ## ex: ".../NEMOGCM"
+DIR_XIOS=''	      ## XIOS installation
+
+## NEMO configurations
+TRUS_REFE=''          ## Reference configuration to test
+TRUS_TEST=''          ## Testing configuration name
+
+## Forcing files
+TRUS_FORC=''          ## Directory with forcing archive to extract (combined use with ${TRUS_TARF}) or
+                      ##    " "     ""  all inputs files to copy into ${TEST_DIR}
 
 
-## NEMO overall installation:
-[ -z "${NEMO_BRAN}" ] && NEMO_BRAN=''    ## NEMO SVN branch to test
-                                            ## ex: 'trunk', 'nemo_v3_6_STABLE', ...
-NEMO_HOME=''                             ## NEMOGCM directory (includes ./ARCH, ./CONFIG, ...)
-                                            ## ex: "${DIR_WORK}/NEMO/${NEMO_BRAN}/NEMOGCM", ...
-## ${NEMO_BRAN} must be consistent with URL branch that have been checkout by SVN to build ${NEMO_HOME}
+## Possible use 
+##---------------------------------------------------
+
+## Archive inputs name, let void if not requested
+TRUS_TARF=''
+
+## CPP keys to add or remove from reference configuration
+KEYS_ADD=''
+KEYS_DEL=''
 
 
-### Reference/'Trusting' configuration
-[ -z "${REFE_CONF}" ] && REFE_CONF=''    ## Reference configuration to test
-                                            ## ex: 'ORCA2_LIM_PISCES', 'GYRE', ...
-TEST_CONF=''                             ## Testing configuration name
-KEYS_ADD=''; KEYS_DEL=''                 ## CPP keys to add or remove from reference configuration
-                                            ## ex: 'key_mpp_rep key_tide', ...
-#if [ ${REFE_CONF} == '' ]; then
-#    TEST_CONF=''
-#    KEYS_ADD='key_add ...' && KEYS_DEL='key_del ...'
-#elif ...
-#else ...
-#fi
+## Optional (can be void if no alternative or need)
+##---------------------------------------------------
 
-
-### Inputs
-NEMO_FORC=''                             ## Directory with forcing archive from DODS/ESGF server to extract or
-                                         ##    " "     ""  all inputs files to copy into ${TEST_DIR}
-[ -z "${NEMO_TARF}" ] && NEMO_TARF=''    ## Archive inputs name, let blank if not requested
-                                            ## ex: 'ORCA2_LIM_nemo_v3.6.tar', 'AMM12_v3.6.tar', ...
-#[ ${REFE_CONF} == '' ] && NEMO_TARF=''
-
-
-## Comparative directories path:
-REFE_DIR=''			      	 ## "Standard" folder where benchmark result files have been stored for comparison
-                                            ## ex: "${DIR_STOR}/${REFE_CONF}/${NEMO_BRAN}"
-TEST_DIR=''			      	 ## Testing    folder for computation
-                                            ## ex: "${DIR_SCRA}/${REFE_CONF}/${NEMO_BRAN}/trusting_${DATE}"
-
-
-## External softs directories:
-DIR_XIOS=''			      	    ## ex: '${DIR_WORK}/XIOS/xios-1.0'
-#DIR_OASI=''			      	    ## ex: '${DIR_WORK}/OASIS'
-
-
-## Mailing list to inform of a failure (-p|--publish required)
-[ -z "$EMAIL"] && EMAIL=''
+## Mailing list to notify of a failure (-p|--prod required)
+TRUS_MAIL=''
Index: anches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_dir.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_dir.sh	(revision 5787)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#!/bin/bash
-
-#settings
-/ccc/work/cont003/gen7451/martin/NEMO/
-NEMO_BRAN=branches/2015/nemo_v3_6_STABLE
-
-X64_CURIE_cron
-
-cd /ccc/work/cont003/gen7451/martin/NEMO
-mkdir -p ${}/NEMOGCM
-
-for elmt in 'ARCH' 'CONFIG' 'NEMO' 'EXTERNAL/IOIPSL' 'EXTERNAL/fcm' 'TOOLS' 'TRUST'; do
-    svn_bran=${NEMO_BRAN}; rev=''
-    [ "$elmt" == 'TRUST' ] && svn_bran='branches/2015/dev_r5092_CNRS_SETTE' && rev='-r 5671'
-    svn co $rev http://forge.ipsl.jussieu.fr/nemo/svn/${svn_bran}/NEMOGCM/$elmt ${}/NEMOGCM/$elmt
-
-done
-
-cd NEMOGCM/TOOLS
-
-for elmt in $( ls * ); do
-    if [ ! $( echo $elmt | grep "COMPILE\|maketools\|REBUILD_NEMO" ) ]; then
-	echo $elmt && rm -rf $elmt > /dev/null
-    fi
-done
-
-if [ find ../ARCH -name  ]
-./maketools -m ${} -n REBUILD_NEMO > /dev/null
-
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 5788)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/install_new_branch.sh	(revision 5788)
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+
+HELP=0; NEMO_BRAN='trunk'; NPROC=1
+SVN_URL='https://forge.ipsl.jussieu.fr/nemo/svn'
+
+while [ $# -ne 0 ]; do
+    case $1 in
+	'-b'|'--branch') NEMO_BRAN=$2; shift 2;; '-d'|'--directory') INSTALL_DIR=$2; shift 2;;
+	'-j'|'--job'   ) NPROC=$2    ; shift 2;; '-m'|'--machine'  ) NEMO_HPCC=$2  ; shift 2;;
+	'-h'|'--help'  ) HELP=1      ; shift  ;; '-u'|'--username' ) SVN_USER=$2   ; shift 2;;
+	"*"            ) HELP=1      ; shift  ;;
+    esac
+done
+
+if [[ -z "${INSTALL_DIR}" || -z "${NEMO_HPCC}" || $HELP == 1 ]]; then
+    echo 'Error'
+    exit 1
+fi
+
+if   [ ${NEMO_BRAN} == 'trunk' ]; then
+    svn_bran=${NEMO_BRAN}
+elif [ $( svn ls ${SVN_URL}/branches/2015 | grep -oe "\<${NEMO_BRAN}\>") ]; then
+    svn_bran=branches/2015/${NEMO_BRAN}
+else
+    printf "\nNEMO branch name \033[0;31m%s\033[0m given is not recognized\n\n" ${NEMO_BRAN}
+    echo 'List of existing branches on repository in branches/2015:'
+    svn ls ${SVN_URL}/branches/2015 | tr -d / | xargs -n 3 printf "%-35s\t%-35s\t%-35s\n"
+    echo
+    exit 1
+fi
+
+printf "\nInstallation of NEMO trusting monitoring in %s on %s branch for %s\n\n" \
+    ${INSTALL_DIR} ${NEMO_BRAN} ${NEMO_HPCC}
+
+echo 'Initial checkout of '${NEMO_BRAN}' branch'
+mkdir -p ${INSTALL_DIR}/${NEMO_BRAN}/NEMOGCM && cd ${INSTALL_DIR}/${NEMO_BRAN}/NEMOGCM
+
+for elmt in 'ARCH' 'CONFIG' 'NEMO' 'EXTERNAL' 'TOOLS' 'TRUST'; do
+    rev=''
+    printf "%s " $elmt
+    [ $elmt == 'TRUST' ] && svn_bran='branches/2015/dev_r5092_CNRS18_TRUST' && rev='-r 5697'
+    svn co -q $rev ${SVN_URL}/${svn_bran}/NEMOGCM/$elmt
+done
+
+printf "\n\nCleaning EXTERNAL directory\n"
+cd EXTERNAL
+printf 'Remove '
+
+for elmt in $( find -maxdepth 1 -type d -name '[^.]*' ); do
+    if [ ! $( echo $elmt | grep "AGRIF\|IOIPSL\|fcm" ) ]; then
+	printf "%s " $elmt && rm -rf $elmt > /dev/null
+    fi
+done
+printf "\n"
+
+
+printf "\nCleaning TOOLS directory\n"
+cd ../TOOLS
+printf 'Remove '
+
+for elmt in $( find -maxdepth 1 -type d -name '[^.]*' ); do
+    if [ ! $( echo $elmt | grep "COMPILE\|maketools\|REBUILD_NEMO" ) ]; then
+	printf "%s " $elmt && rm -rf $elmt > /dev/null
+    fi
+done
+printf "\n\n"
+
+if [ $( find ../ARCH -name arch-${NEMO_HPCC}.fcm ) ]; then
+    echo 'Compile NEMO rebuild tool'
+    ./maketools -n REBUILD_NEMO -m ${NEMO_HPCC} -j $NPROC >& /dev/null
+    [ $? -eq 0 ] && printf "\033[0;32mOK\033[0m" || printf "\033[0;31mKO\033[0m"
+    printf "\n\n"
+else
+    printf "\033[0;31mNo arch file found to compile NEMO rebuild tool\033[0m\n\n"
+fi
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.env
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.env	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.env	(revision 5788)
@@ -2,37 +2,26 @@
 
 
-## Patterns (time-stamp & filename)
+## Patterns (UTC time-stamp & filename)
 ##--------------------------------------
 dat=$( date )
-## UTC time zone for timestamping
 export DATE=$( date -ud "$dat" +"%Y%m%d%Z%H%M" )
-export PATTERNAME=${NEMO_USER}'_'${NEMO_HPCC}
+export PATTERNAME=${TRUS_USER}'_'${TRUS_HPCC}
+
+## Source (super)computer configuration
+##---------------------------------------------------
+. ${TRUS_DIR}/config/${TRUS_HPCC}.cfg
+export ARCH_ENV
+export JOB_INFO JOB_KILL JOB_PMEM JOB_STAT JOB_SUBM JOB_TIME JOB_VMEM
+export TRUS_NPRO    TIMEOUT
+export CDOD
+export STR_CDOD STR_LMPI STR_NCDF
+export CMPF
 
 ## Source user configuration
 ##---------------------------------------------------
-. ${NEMO_TRUS}/config/${NEMO_USER}.cfg
-export NEMO_HOME NEMO_BRAN
-export REFE_CONF TEST_CONF KEYS_ADD KEYS_DEL
-export NEMO_FORC NEMO_TARF
-export REFE_DIR  TEST_DIR
-export DIR_XIOS  #DIR_OASI
-export EMAIL
-
-## Only interest for essential NEMO directories
-NEMO_ARCH=${NEMO_HOME}/ARCH          ; NEMO_CONF=${NEMO_HOME}/CONFIG            
-NEMO_ENGI=${NEMO_HOME}/NEMO
-NEMO_EAGR=${NEMO_HOME}/EXTERNAL/AGRIF; NEMO_EIOI=${NEMO_HOME}/EXTERNAL/IOIPSL   
-NEMO_EFCM=${NEMO_HOME}/EXTERNAL/fcm
-NEMO_TCMP=${NEMO_HOME}/TOOLS/COMPILE ; NEMO_TRBD=${NEMO_HOME}/TOOLS/REBUILD_NEMO
-export NEMO_ARCH NEMO_CONF NEMO_ENGI
-export NEMO_EAGR NEMO_EIOI NEMO_EFCM
-export NEMO_TCMP NEMO_TRBD
-
-## Source super-computer configuration
-##---------------------------------------------------
-. ${NEMO_TRUS}/config/${NEMO_HPCC}.cfg
-export CDO      COMPILER MPI      NETCDF
-export JOB_SUBM JOB_LIST JOB_INFO JOB_TIME JOB_DELE
-export NPROC    TIME_LIMI
-export ARCH_ENV
-export CDOD
+. ${TRUS_DIR}/config/${TRUS_USER}.cfg
+export TRUS_BHMK  TEST_DIR  TRUS_REFE TRUS_TEST
+export TRUS_WKCY DIR_XIOS
+export TRUS_FORC TRUS_TARF
+export KEYS_ADD  KEYS_DEL
+export TRUS_MAIL
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting.sh	(revision 5788)
@@ -6,9 +6,8 @@
 ## Set defaults
 ##---------------------------------------------------
-NEMO_TRUS=$PWD
-DEBUG=0; PUBLISH=0
-IMOD=0; ST='FAILED'  ## No modules system & 'FAILED' status
-SVN_CMD='svn status' ## No update on directories
-trus_help='trusting_help.txt'
+DBG=0; PROD=0; HELP=0
+TRUS_DIR=$PWD; TRUS_RSLT='FAILED'; SVN_CMD='svn status' # ('FAILED' result & no update on directories)
+xios_mode='--full'; stdout_redir='>&'
+revi=$( svn info | awk '(NR == 9) {print $NF}' )
 
 
@@ -16,61 +15,65 @@
 ##---------------------------------------------------
 while [ $# -ne 0 ]; do
-
     case $1 in
-	'-a'|'--archive') NEMO_TARF=$2    ; shift 2;; '-b'|'--branch ') NEMO_BRAN=$2    ; shift 2;;
-	'-d'|'--debug  ') set -vx; DEBUG=1; shift  ;; '-e'|'--email  ') EMAIL=$2        ; shift 2;;
-	'-j'|'--job    ') NPROC=$2        ; shift 2;; '-h'|'--help   ') cat ${help_file}; exit  1;;
-	'-m'|'--machine') NEMO_HPCC=$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   ') NEMO_USER=$2    ; shift 2;;
-	'-v'|'--version') NEMO_VERS=$2    ; shift 2;; "*"             ) cat ${help_file}; exit  1;;
+	'-a'|'--archive') TRUS_TARF=$2  ; shift 2;; '-b'|'--branch' ) TRUS_WKCY=$2; shift 2;;
+	'-d'|'--debug'  ) set -vx; DBG=1; shift  ;; '-e'|'--email'  ) TRUS_MAIL=$2; shift 2;;
+	'-j'|'--job'    ) TRUS_NPRO=$2  ; shift 2;; '-h'|'--help'   ) HELP=1      ; shift  ;;
+	'-m'|'--machine') TRUS_HPCC=$2  ; shift 2;; '-n'|'--newconf') TRUS_TEST=$2; shift 2;;
+	'-r'|'--refconf') TRUS_REFE=$2  ; shift 2;; '-t'|'--time'   ) TIMEOUT=$2  ; shift 2;;
+	'-p'|'--prod'   ) PROD=1        ; shift  ;; '-u'|'--user'   ) TRUS_USER=$2; shift 2;;
+	'-v'|'--version') TRUS_VERS=$2  ; shift 2;; "*"             ) HELP=1      ; shift  ;;
     esac
-
 done
 
-## DEBUG options to speed up & expand verbosity of compilation
-xios_full='--full'; stderr_redir='>&'
-[ $DEBUG -eq 1 ] && { xios_full=''; stderr_redir='>'; }
 
-## If -v|--version option has been set, modify default SVN action on directories
-if   [ $( echo ${NEMO_VERS} | grep  "HEAD\|up\|update"                     ) ]; then
-    SVN_CMD='svn update -r HEAD'
-elif [ $( echo ${NEMO_VERS} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) ]; then
-    SVN_CMD='svn update -r '$( echo ${NEMO_VERS} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' )
-elif [ $( echo ${NEMO_VERS} | grep -o '[0-9]*'                             ) ]; then
-    SVN_CMD='svn update -r '$( echo ${NEMO_VERS} | grep -o '[0-9]*'                             )
-fi
+## Initialization (HPC & user environment)
+##---------------------------------------------------
+if [[ ! $( find config -name ${TRUS_USER}'.cfg' && find config -name ${TRUS_HPCC}'.cfg' ) || $HELP -eq 1 ]]; then
+    cat trusting_help.txt
 
-
-## Initialization (super-computer & user environment)
-##---------------------------------------------------
-if [[ ! -z "${NEMO_HPCC}" && ! -z "${NEMO_USER}" ]]; then
-
-    if   [ ! $( find ${NEMO_TRUS}/config -name ${NEMO_USER}'.cfg' ) ]; then
-	echo 'No configuration file (.cfg) in '${NEMO_TRUS}'/config for '${NEMO_USER}
-	exit 1
-    elif [ ! $( find ${NEMO_TRUS}/config -name ${NEMO_HPCC}'.cfg' ) ]; then
-	echo 'No configuration file (.cfg) in '${NEMO_TRUS}'/config for '${NEMO_HPCC}
-	exit 1
-    else
-	. ${NEMO_TRUS}/trusting.env
+    if [ $HELP -eq 0 ]; then
+	printf "\n\nAt least one configuration file is missing or misspelled: %s.cfg %s.cfg" \
+	    ${TRUS_USER} ${TRUS_HPCC}
     fi
 
+    printf "\n\nContent of config folder:"
+    find config -name *.cfg | cut -d/ -f2 | xargs -n 3 printf "%-30s\t%-30s\t%-30s\n"
+    exit 1
 else
-    cat ${NEMO_TRUS}/${trus_help}
-    exit 1
+    . trusting.env && . trusting_func.sh
+
+    ## DEBUG options to speed up & expand verbosity of compilation
+    [ $DBG -eq 1 ] && { xios_mode=''; stdout_redir='>'; }
+
+    ## If -v|--version option has been set, modify default SVN action on directories
+    if   [ $( echo ${TRUS_VERS} | grep  "HEAD\|up\|update"                     ) ]; then
+	SVN_CMD='svn update -r HEAD'
+    elif [ $( echo ${TRUS_VERS} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) ]; then
+	SVN_CMD='svn update -r '$( echo ${TRUS_VERS} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' )
+    elif [ $( echo ${TRUS_VERS} | grep -o '[0-9]*'                             ) ]; then
+	SVN_CMD='svn update -r '$( echo ${TRUS_VERS} | grep -o '[0-9]*'                             )
+    fi
+
 fi
-
-. ./trusting_func.sh
 
 
 ## Display contextual summary of trusting test
 ##---------------------------------------------------
-echo 'NEMO Trusting test:'
-echo '-------------------'
-echo 'Testing '${TEST_CONF}' based on '${REFE_CONF}' from '${NEMO_BRAN}
-echo 'NEMO installation: '${NEMO_USER}
-echo 'Computing architecture: '${NEMO_HPCC}
-echo 'Trusting SVN version: '$( svn info | awk '(NR == 9) {print $NF}' )
+echo
+cat banner.txt
+echo
+echo '****************************************************************************************************'
+echo '*                                                                                                  *'
+echo '*                           NEMO Trusting (Continuous Integration Tool)                            *'
+echo "*                                             ver.$revi                                             *"
+echo '*                                                                                                  *'
+echo '****************************************************************************************************'
+echo
+echo '  - Testing configuration   '${TRUS_TEST}' based on '${TRUS_REFE}
+echo '  - Working copy            '${TRUS_WKCY}
+echo '  - Benchmark folder        '${TRUS_BHMK}
+echo '  - (Super)Computer         '${TRUS_HPCC}
+echo '  - User installation       '${TRUS_USER}
+echo
 
 
@@ -78,5 +81,5 @@
 ##---------------------------------------------------
 print_step 'Timestamped testing directory'
-mkdir -p ${TEST_DIR} ${REFE_DIR}
+mkdir -p ${TEST_DIR} ${TRUS_BHMK}
 cd ${TEST_DIR} && echo ${TEST_DIR}
 init_files
@@ -92,9 +95,8 @@
 ## Check softwares versions (after sourced arch environment)
 ##---------------------------------------------------
-print_step 'Get softwares releases'
-[ -e ${ARCH_ENV} ] && . ${ARCH_ENV} > /dev/null
-[ $? -eq 0 ] && export IMOD=1
+print_step 'Get testing environement'
 get_soft_rel
 cat model.log
+env | sort > env.log
 
 
@@ -103,6 +105,6 @@
 print_step 'Compile XIOS'
 cd ${DIR_XIOS}
-eval ./make_xios ${xios_full} --arch ${NEMO_HPCC} --job $NPROC \
-    ${stderr_redir} /dev/null
+eval ./make_xios ${xios_mode} --arch ${TRUS_HPCC} --job ${TRUS_NPRO} \
+    ${stdout_redir} /dev/null
 [ ! -e lib/libxios.a ] && get_out 1 || echo 'Success'
 
@@ -110,15 +112,15 @@
 ## NEMO compilation from scratch
 ##---------------------------------------------------
-print_step "Compile ${REFE_CONF} configuration"
-cd ${NEMO_CONF}
-[[ -d ${TEST_CONF} && $DEBUG -eq 0 ]] && ./makenemo -n ${TEST_CONF} clean_config \
+print_step "Compile ${TRUS_REFE} configuration"
+cd ${TRUS_WKCY}/CONFIG
+[[ -d ${TRUS_TEST} && $DBG -eq 0 ]] && ./makenemo -n ${TRUS_TEST} clean_config \
     > /dev/null <<EOF
 y
 EOF
 
-eval ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m ${NEMO_HPCC} -j $NPROC \
-                   ${KEYS_ADD} ${KEYS_DEL}                                \
-    ${stderr_redir} /dev/null
-[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 2 || echo 'Success'
+eval ./makenemo -n ${TRUS_TEST} -r ${TRUS_REFE} -m ${TRUS_HPCC} -j ${TRUS_NPRO} \
+                   ${KEYS_ADD} ${KEYS_DEL}                                      \
+    ${stdout_redir} /dev/null
+[ ! -e ${TRUS_TEST}/BLD/bin/nemo.exe ] && get_out 2 || echo 'Success'
 
 
@@ -127,7 +129,7 @@
 print_step 'Set job (copying or extracting inputs)'
 cd ${TEST_DIR}
-cp ${NEMO_CONF}/${TEST_CONF}/cpp_* .
-find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(_cfg\|.in\|opa\|_ref\|.xml\)' \
-                                     -exec  cp {} . \;
+cp   ${TRUS_WKCY}/CONFIG/${TRUS_TEST}/cpp_* .
+find ${TRUS_WKCY}/CONFIG/${TRUS_TEST}/EXP00 -regex '.*\(_cfg\|.in\|opa\|_ref\|.xml\)' \
+                                            -exec  cp {} . \;
 get_inputs
 [ $? -ne 0 ] && get_out 3 || echo 'Success'
@@ -137,5 +139,5 @@
 ## Check inputs
 ##---------------------------------------------------
-print_step 'Compare inputs to benchmark files'
+print_step 'Compare inputs'
 diff_inputs
 
@@ -151,20 +153,21 @@
 
 
-## Check job state & get computing time if succeeded
+## Check job state & get computation performances if succeeded
 ##---------------------------------------------------
 print_step 'Test job state'
 [[ ! -e time.step || $( grep 'E R R O R' ocean.output ) ]] && get_out 5 || echo 'Success'
-print_step 'Get real CPU time'
-get_cpu_time
+print_step 'Get job performances'
+get_time
+get_memy
 
 
 ## Check outputs
 ##---------------------------------------------------
-ST='OK' ## 'OK' by default
-print_step 'Compare new outputs to benchmark files'
+TRUS_RSLT='OK' ## 'OK' by default
+print_step 'Compare outputs'
 diff_results
-print_step 'Compare new restarts to benchmark files'
+print_step 'Compare restarts'
 diff_restart
-[ $ST == 'FAILED' ] && get_out 8
+[ $TRUS_RSLT == 'FAILED' ] && get_out 8
 
 
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting_func.sh
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting_func.sh	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting_func.sh	(revision 5788)
@@ -3,33 +3,37 @@
 
 ## Messenger filenames
-FILE_DATE=mesg_01_date_$PATTERNAME.txt    ; FILE_STAT=mesg_02_status_$PATTERNAME.txt
-FILE_RESU=mesg_03_result_$PATTERNAME.txt  ; FILE_NEMO=mesg_04_nemogcm_$PATTERNAME.txt
-FILE_XIOS=mesg_05_xios_$PATTERNAME.txt    ; FILE_COMP=mesg_06_compiler_$PATTERNAME.txt
-FILE_MPIN=mesg_07_mpi_$PATTERNAME.txt     ; FILE_NCDF=mesg_08_netcdf_$PATTERNAME.txt
-FILE_INPT=mesg_09_inputs_$PATTERNAME.txt  ; FILE_CPUT=mesg_10_cputime_$PATTERNAME.txt
-FILE_COMM=mesg_11_comments_$PATTERNAME.txt;
-
-## Timestamped outcome & archive filenames
-FILE_TRUS=trusting_${DATE}_$PATTERNAME.txt; FILE_ARCH=trusting_${DATE}_$PATTERNAME.tar.gz
-
-
-print_step() { printf "\nStep.....\n$1\n"; }
-
+FILE_DATE=mesg_01_date_$PATTERNAME.txt  ; FILE_TRUS_RSLT=mesg_02_result_$PATTERNAME.txt
+FILE_STAT=mesg_03_state_$PATTERNAME.txt ; FILE_NEMO=mesg_04_nemo_$PATTERNAME.txt
+FILE_XIOS=mesg_05_xios_$PATTERNAME.txt  ; FILE_CMPF=mesg_06_compiler_$PATTERNAME.txt
+FILE_LMPI=mesg_07_mpi_$PATTERNAME.txt   ; FILE_NCDF=mesg_08_netcdf_$PATTERNAME.txt
+FILE_INPT=mesg_09_inputs_$PATTERNAME.txt; FILE_TIME=mesg_10_time_$PATTERNAME.txt
+FILE_MEMY=mesg_11_memory_$PATTERNAME.txt; FILE_NOTE=mesg_12_comments_$PATTERNAME.txt
+
+## Timestamped logfile & archive filenames
+FILE_TRUS=trusting_${DATE}_$PATTERNAME.txt; FILE_ARCH=trusting_${DATE}_$PATTERNAME.tgz
+
+
+## Functions in order of use
+print_step() {
+    local char_nb=$( echo "$1" | wc -c )
+    local outline=$( printf "%${char_nb}s" )
+
+    printf "\nStep.....\n%s\n%s\n" "$1" ${outline// /-}
+}
 
 init_files() {
-    echo 'Date'        	 >  ${FILE_DATE}; echo 'Status'           >  ${FILE_STAT}
-    echo 'Result'      	 >  ${FILE_RESU}; echo 'NEMOGCM rev.'     >  ${FILE_NEMO}
-    echo 'XIOS rev.'   	 >  ${FILE_XIOS}; echo 'Fortran compiler' >  ${FILE_COMP}
-    echo 'MPI libs'    	 >  ${FILE_MPIN}; echo 'NetCDF libs'      >  ${FILE_NCDF}
-    echo 'Input files' 	 >  ${FILE_INPT}; echo 'Real CPU time'    >  ${FILE_CPUT}
-    echo 'Comments'    	 >  ${FILE_COMM}
+    echo 'Date'        	      > ${FILE_DATE}; echo 'Result'           > ${FILE_TRUS_RSLT}
+    echo 'State'      	      > ${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}
+    echo 'Input files' 	      > ${FILE_INPT}; echo 'Elapsed time'     > ${FILE_TIME}
+    echo 'Memory usage (P/V)' > ${FILE_MEMY}; echo 'Comments'         > ${FILE_NOTE}
 
     ## 'Failed' status with 'Unknown error' by default
-    echo $ST             \
+    echo $TRUS_RSLT           \
+	>> ${FILE_TRUS_RSLT}
+    echo 'Unknown error' \
 	>> ${FILE_STAT}
-    echo 'Unknown error' \
-	>> ${FILE_RESU}
-}
-
+}
 
 get_date() {
@@ -37,18 +41,14 @@
     local dat=$( date -ud "${DATE}" +"%F %R %Z" )
 
-    echo $dat          \
+    echo $dat           \
 	>> ${FILE_DATE}
 }
-
 
 get_nemo_rev() {
     local dir rev_loc
-    local rev=0
-
-    ## Loop on essential directories
-    for dir in ${NEMO_ARCH} ${NEMO_CONF} ${NEMO_ENGI} \
-               ${NEMO_EAGR} ${NEMO_EIOI} ${NEMO_EFCM} \
-	       ${NEMO_TCMP} ${NEMO_TRBD}              \
-	       ${DIR_XIOS}                             ; do
+    local rev=0 list=( 'ARCH CONFIG NEMO EXTERNAL/AGRIF EXTERNAL/IOIPSL EXTERNAL/fcm TOOLS/COMPILE TOOLS/REBUILD_NEMO' )
+
+    ## Loop on essential NEMO directories
+    for dir in $list ${DIR_XIOS}; do
 
 	## For time being, just get revision from XIOS with no action on directory
@@ -62,6 +62,6 @@
 	fi
 
-	echo $dir && ${SVN_CMD} $dir
-	rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' )
+	echo $dir && ${SVN_CMD} ${TRUS_WKCY}/$dir
+	rev_loc=$( svn info ${TRUS_WKCY}/$dir | awk '(NR == 9) {print $NF}' )
 
 	## Keep last rev. nb
@@ -75,23 +75,15 @@
 }
 
-
 get_soft_rel() {
     local soft soft_rel
 
-    for soft in $CDO $COMPILER $MPI $NETCDF; do
+    ## Sourcing environment modulefile only if module function is set
+    [[ -e ${ARCH_ENV} && $( declare -F | grep ' module' ) ]] && . ${ARCH_ENV}
+
+    for soft in $CMPF ${STR_CDOD} ${STR_LMPI} ${STR_NCDF}; do
 	soft_rel=''
 
-	## Software strings to identify depends on use (sed is case-insensitive)
-        if [ $IMOD -eq 1 ]; then
-	    ## Modules system: next word after "$soft/"
-	    soft_rel=$( echo $LOADEDMODULES | sed "s#.*$soft/\([0-9.a-z_]*\).*#\1#i" )
-	    ## LOADEDMODULES=netcdf/mpi/4.1.3:cdo/1.5.9:intel/2013.0
-	    ## LOADEDMODULES=bullxmpi/1.2.8.2:netcdf/4.3.3.1_hdf5_parallel:cdo/1.6.7
-	else
-	    ## Hard-coded paths: next word after "$soft"
-	    soft_rel=$( echo $PATH          | sed "s#.*$soft\([0-9.a-z_]*\).*#\1#i"  )
-	    ## PATH=/smplocal/intel/impi/4.1.0.024/intel64/bin:/smplocal/pub/cdo/1.5.9/bin:/smplocal/pub/NetCDF/4.1.3/mpi/bin
-	    ## PATH=/usr/local/netcdf-4.3.3.1_hdf5_parallel/bin:/opt/mpi/bullxmpi/1.2.8.2/bin:/usr/local/netcdf-utils-4.3.3.1_hdf5/bin
-	fi
+	## Software release: next word after "$soft" in $PATH (case-insensitive)
+	soft_rel=$( echo $PATH | sed "s#.*$soft\([0-9.a-z_]*\).*#\1#i" )
 
 	## option --version would work for main compilers (gfortran, intel, pgfortran, ...)
@@ -106,23 +98,21 @@
 
     sed -n 4p model.log \
-	>> ${FILE_COMP}
+	>> ${FILE_CMPF}
     sed -n 5p model.log \
-	>> ${FILE_MPIN}
+	>> ${FILE_LMPI}
     sed -n 6p model.log \
 	>> ${FILE_NCDF}
 }
 
-
 get_inputs() {
     # List archive content & extract it by default
-    local cmd_iol="tar -tvf ${NEMO_FORC}/${NEMO_TARF}" cmd_iof="tar -vxf ${NEMO_FORC}/${NEMO_TARF}"
+    local cmd_iol="tar -tvf ${TRUS_FORC}/${TRUS_TARF}" cmd_iof="tar -vxf ${TRUS_FORC}/${TRUS_TARF}"
 
     ## List & copy files in case of personal inputs
-    [ -z "${NEMO_TARF}" ] && { cmd_iol="ls ${NEMO_FORC}/*"; cmd_iof="\cp ${NEMO_FORC}/* ."; }
+    [ -z "${TRUS_TARF}" ] && { cmd_iol="ls ${TRUS_FORC}/*"; cmd_iof="\cp ${TRUS_FORC}/* ."; }
 
     ${cmd_iol} > inputs_list.txt
     ${cmd_iof} > /dev/null
 }
-
 
 diff_inputs() {
@@ -135,22 +125,18 @@
 
 	## Continue even if input file is not in here (see after)
-	if [ -e ${REFE_DIR}/$file ]; then dif=$( diff -q $file ${REFE_DIR}/$file ); else dif=0; fi
+	if [ -e ${TRUS_BHMK}/$file ]; then dif=$( diff -q $file ${TRUS_BHMK}/$file ); else dif=0; fi
 
 	## Pass over useless file omission in benckmark directory
-	if [[ -n "$dif" && "$dif" != '0' ]]; then
-	    mesg='Different'; echo $dif; files_list+=$file' '
-	fi
-
+	[[ -n "$dif" && "$dif" != '0' ]] && ( mesg='Different'; echo $dif; files_list+=$file' ' )
     done
 
     [ $mesg == 'Same' ] && echo $mesg
-    echo $mesg         \
+    echo $mesg          \
 	>> ${FILE_INPT}
 
     ## List different files for web comment
     [ -n "${files_list}" ] && echo 'Inputs  : '${files_list}'differ<br>' \
-	>> temp_${FILE_COMM}
-}
-
+	>> temp_${FILE_NOTE}
+}
 
 job_pending() {
@@ -160,8 +146,8 @@
 
     ## Append a log file while pending
-    while [[ $( ${JOB_LIST} | grep ${JOB_ID} ) && ${time_elapsed} -lt ${TIME_LIMI} ]]; do
+    while [[ $( eval ${JOB_STAT} ) && ${time_elapsed} -lt $TIMEOUT ]]; do
 	printf "\n%s\n" ${outline// /#} \
 	    >> computation.log
-	${JOB_INFO} ${JOB_ID}           \
+	eval ${JOB_INFO}                \
 	    >> computation.log
 	sleep ${time_increment}
@@ -172,7 +158,6 @@
 
     ## Kill remaining job & stop the test if it's too long
-    [ ${time_elapsed} -eq ${TIME_LIMI} ] && { ${JOB_DELE} ${JOB_ID} &> /dev/null; get_out 6; }
-}
-
+    [ ${time_elapsed} -eq $TIMEOUT ] && { eval ${JOB_DELE} &> /dev/null; get_out 6; }
+}
 
 diff_results() {
@@ -182,12 +167,11 @@
     ## Simple diff
     for file in 'ocean.output' *.stat; do
-
 	## Stop if no benchmark files (ocean.output, eventual stat files)
-	[ ! -e ${REFE_DIR}/$file ] && { export ST='FAILED'; get_out 7; }
-
-	diff -q $file ${REFE_DIR}/$file
+	[ ! -e ${TRUS_BHMK}/$file ] && { export TRUS_RSLT='FAILED'; get_out 7; }
+
+	diff -q $file ${TRUS_BHMK}/$file
 
 	## Continue even if it differs
-	[ $? -ne 0 ] && { export ST='FAILED'; mesg='Different'; files_list+=$file' '; }
+	[ $? -ne 0 ] && { export TRUS_RSLT='FAILED'; mesg='Different'; files_list+=$file' '; }
     done
 
@@ -196,7 +180,6 @@
     ## List different files for web comment
     [ -n "${files_list}" ] && echo 'Results : '${files_list}'differ<br>' \
-	>> temp_${FILE_COMM}
-}
-
+	>> temp_${FILE_NOTE}
+}
 
 diff_restart() {
@@ -205,18 +188,19 @@
 
     ## Stop if no benchmark files (ie time.step)
-    [ ! -e ${REFE_DIR}/time.step ] && { export ST='FAILED'; get_out 7; }
-    time_step=$( cat ${REFE_DIR}/time.step | tr -d [:space:] )
+    [ ! -e ${TRUS_BHMK}/time.step ] && { export TRUS_RSLT='FAILED'; get_out 7; }
+    time_step=$( cat ${TRUS_BHMK}/time.step | tr -d [:space:] )
 
     ## 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 )
+	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}
@@ -224,8 +208,8 @@
 
 		if   [ ${nb_dom} -gt 1 ]; then
-		    ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom} > /dev/null
-		    [ $? -eq 0 ] && rm -f ${file}_[0-9]*.nc             > /dev/null
+		    ${TRUS_WKCY}/TOOLS/REBUILD_NEMO/rebuild_nemo -t ${TRUS_NPRO} $file ${nb_dom} > /dev/null
+		    [ $? -eq 0 ] && rm -f ${file}_[0-9]*.nc                                > /dev/null
 		elif [ ${nb_dom} -eq 0 ]; then
-		    export ST='FAILED' && get_out 8
+		    export TRUS_RSLT='FAILED' && get_out 8
 		fi
 
@@ -234,19 +218,19 @@
 
                     ## Stop if no benchmark files (restart file)
-		    if [ -e ${REFE_DIR}/$file.nc ]; then
+		    if [ -e ${TRUS_BHMK}/$file.nc ]; then
 
 	                ## UNIX `cmp` not suitable (timestamp in .nc file)
-			dif=$( $CDOD $file.nc ${REFE_DIR}/$file.nc 2> /dev/null          \
+			dif=$( $CDOD $file.nc ${TRUS_BHMK}/$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
-			    export ST='FAILED'
-			    files_list+=$comp' ' && let dift+=$( echo $dif | awk '{print $1}' )
+			    export TRUS_RSLT='FAILED'
+			    files_list+=$comp' ' && let dif_sum+=$( echo $dif | awk '{print $1}' )
 			    echo $file.nc': '$dif
 			fi
 
 		    else
-			export ST='FAILED' && get_out 7
+			export TRUS_RSLT='FAILED' && get_out 7
 		    fi
 
@@ -256,10 +240,11 @@
 
 	    done
+
 	done
 
         ## List different files for web comment with sum of different parameters
-	if [ $dift -ne 0 ]; then
-	    echo 'Restarts: '${files_list}$dift' record(s) differ<br>' \
-		>> temp_${FILE_COMM}
+	if [ ${dif_sum} -ne 0 ]; then
+	    echo 'Restarts: '${files_list}${dif_sum}' record(s) differ<br>' \
+		>> temp_${FILE_NOTE}
 	else
 	    echo 'Same'
@@ -267,17 +252,24 @@
 
     else
-	export ST='FAILED'
-    fi
-
-}
-
-
-get_cpu_time() {
-    ## Interest for checking unusual time computing
-    local real_cpu_time=$( eval ${JOB_TIME} )
-
-    echo ${real_cpu_time} | tee -a ${FILE_CPUT}
-}
-
+	export TRUS_RSLT='FAILED'
+    fi
+
+}
+
+get_time() {
+    ## Interest for checking unusual time computation
+    local time_cpu=$( eval ${JOB_TIME} )
+
+    printf "Elapsed time: "
+    echo ${time_cpu} | tee -a ${FILE_TIME}
+}
+
+get_memy() {
+    ## Interest for checking unusual memory usage
+    local memory_pmax=$( eval ${JOB_PMEM} ) memory_vmax=$( eval ${JOB_VMEM} )
+
+    printf "Memory max usage (physical/virtual): "
+    echo ${memory_pmax}' / '${memory_vmax} | tee -a ${FILE_MEMY}
+}
 
 comments() {
@@ -286,5 +278,5 @@
 
     if [ -e ocean.output ]; then
-        ## 'W A R N I N G' by default
+        ## 'W A R N I N G' pattern by default
 	opat="-A2 \"^ $state\""
 	[ "$state" == 'E R R O R' ] && opat="-A4 \"$state\""
@@ -292,55 +284,59 @@
         ## Select first occurence for web comment
 	line=$( eval grep -m1 $opat ocean.output | tr -d '\n' )
-	echo $line
-    fi
-
-    printf "$line<br>"      \
-	>> temp_${FILE_COMM}
-}
-
-
-mesg_make() {
+    fi
+
+    [ -n "$line" ] && ( echo $line; printf "$line<br>" \
+	>> temp_${FILE_NOTE} )
+}
+
+log_make() {
     ## Format comments for web
-    [ -e temp_${FILE_COMM} ] && cat temp_${FILE_COMM} | tr -d '\n' | sed 's/<br>$//' \
-	>> ${FILE_COMM}
-
-    ## Construct txt file for web with all messenger files
+    [ -e temp_${FILE_NOTE} ] && cat temp_${FILE_NOTE} | tr -d '\n' | sed 's/<br>$//' \
+	>> ${FILE_NOTE}
+
+    ## Construct txt file with all messenger files
     paste -d ';' mesg_*.txt | tee ${FILE_TRUS}
 }
 
-
-mesg_publish() {
+prod_publish() {
     local cmd
-
-    ## Production mode (-p|--publish)
-    if [ $PUBLISH -eq 1 ]; then
-
-	## Create or append historical trusting file
-	if [ -f ${REFE_DIR}/trusting_$PATTERNAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi
+    local rev=$( awk '/NEMOGCM/ {print $NF}' model.log )
+
+    ## Production mode (-p|--prod)
+    if [ $PROD -eq 1 ]; then
+
+	## Create or append trusting logfile
+	if [ -f ${TRUS_BHMK}/trusting_$PATTERNAME.txt ]; then cmd='tail -1'; else cmd='cat'; fi
 
 	$cmd ${FILE_TRUS}                           \
-	    >> ${REFE_DIR}/trusting_$PATTERNAME.txt
+	    >> ${TRUS_BHMK}/trusting_$PATTERNAME.txt
 
         ## Send mail only when FAILED
-	if [[ ! -z "$EMAIL" && $ST == 'FAILED' ]]; then
+	if [[ ! -z "$TRUS_MAIL" && $TRUS_RSLT == 'FAILED' ]]; then
 
 	    ## Content
-	    cat <<END_MAIL \
+	    cat <<END_MAIL      \
 		> trusting.mail
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-
-Dear $USER,
-
-The trusting sequence for ${REFE_CONF} has failed.
-Directory: ${TEST_DIR}
-Archive created: ${FILE_ARCH} in ${REFE_DIR}
-
-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-
-`cat ${TEST_DIR}/${FILE_TRUS}`
+Dear all,
+
+
+The trusting sequence has not completed successfully on new configuration ${TRUS_TEST} based on ${TRUS_REFE}.
+
+Here is the model summary:
+`cat model.log`
+
+First checking would be on the trusting environment files:
+${TRUS_USER}.cfg & ${TRUS_HPCC}.cfg
+
+For more details, look into the testing directory at:
+${TEST_DIR}
+
+An archive has been created to share the questionable configuration for further studies:
+${TRUS_BHMK}/${FILE_ARCH}
+
 END_MAIL
 
 	    ## Send with detailed subject
-	    mail -s "[NEMO Trusting ${NEMO_HPCC} ${REFE_CONF} ${NEMO_BRAN}] $ST $ERR" $EMAIL \
+	    mail -s "[NEMO Trusting][$rev][${TRUS_WKCY}][${TRUS_REFE}] $TRUS_RSLT $ERR" $TRUS_MAIL \
 		<  trusting.mail
 	fi
@@ -349,5 +345,4 @@
 }
 
-
 get_out() {
     local time_step=0
@@ -355,10 +350,10 @@
     ERR=$1
 
-    print_step 'End of trusting test'
+    printf "\n\nEnd of test\n"
 
     ## In case of compilation error
     cd ${TEST_DIR}
 
-    if [ $ST == 'FAILED' ]; then
+    if [ $TRUS_RSLT == 'FAILED' ]; then
 	echo 'Failure'
 
@@ -369,10 +364,8 @@
 	    ## Submission
 	    '3') ERR='Missing input files'     ;; '4') ERR='Job submission error'   ;;
-	    ## Running
+	    ## Computation
 	    '5') ERR='Crashed at time step'    ;; '6') ERR='Exceeded time limit'    ;;
 	    ## Results
 	    '7') ERR='Missing previous outputs';; '8') ERR='New outputs differ'     ;;
-	    ## Undefined
-	    "*") ERR='Unknown error'           ;;
 	esac
 
@@ -384,26 +377,27 @@
     if [ "$ERR" == 'Crashed at time step' ]; then
 	comments 'E R R O R'
-	[ -e time.step ] && time_step=$( cat time.step | tr -d ' ' )
+	[ -e time.step ] && time_step=$( grep -o [0-9]* time.step )
 	ERR+=' '$time_step
     else
 	comments 'W A R N I N G'
-	[ "$ERR" == 'Exceeded time limit' ] && ERR+=' '$(( ${TIME_LIMIT}/3600 ))'h'
+	[ "$ERR" == 'Exceeded time limit' ] && ERR+=' '$(( ${TIMEOUTT}/3600 ))'h'
     fi
 
     ## Last messenger files
     export ERR
-    sed -i "2 s/.*/$ST/" ${FILE_STAT}; sed -i "2 s/.*/$ERR/" ${FILE_RESU}
-
-    ## Save tested configuration if trusting failed in production mode (-p|--publish)
-    if [[ $ST == 'FAILED' && $PUBLISH -eq 1 ]]; then
-	echo 'Creating archive '${FILE_ARCH}' under '${REFE_DIR}
-	tar -czf ${REFE_DIR}/${FILE_ARCH} * ${NEMO_HOME}/CONFIG/${TEST_CONF}/MY_SRC \
-	                                    ${NEMO_HOME}/CONFIG/${TEST_CONF}/WORK
-    fi
-
-    ## Share trusting result (.txt file/mail)
-    print_step 'Trusting digest'
-    mesg_make
-    mesg_publish
+    sed -i "2 s/.*/$TRUS_RSLT/" ${FILE_TRUS_RSLT}; sed -i "2 s/.*/$ERR/" ${FILE_STAT}
+
+    ## Save tested configuration if trusting failed in production mode (-p|--prod)
+    if [[ $TRUS_RSLT == 'FAILED' && $PROD -eq 1 ]]; then
+	echo 'Creating archive '${FILE_ARCH}' under '${TRUS_BHMK}
+	tar -czf ${TRUS_BHMK}/${FILE_ARCH}              *                    \
+	    -C ${TRUS_WKCY}/CONFIG/${TRUS_TEST}/MY_SRC .                    \
+	    -C ${TRUS_WKCY}/CONFIG/${TRUS_TEST}        cpp_${TRUS_TEST}.fcm
+    fi
+
+    ## Logfile construct & eventual sending of notification email
+    printf "\nTrusting digest:\n----------------\n"
+    log_make
+    prod_publish
 
     exit 0
Index: /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting_help.txt
===================================================================
--- /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting_help.txt	(revision 5787)
+++ /branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/trusting_help.txt	(revision 5788)
@@ -5,27 +5,28 @@
 Mandatory (default settings):
     Files to source in ./config ($ARCH.cfg & $USER.cfg)
-    -m,--machine    Architecture settings (environment configuration)
-    -u,--user       User            ""    (NEMO directories & settings)		   
+    -m,--machine     Architecture environment (compilation & computation settings)
+    -u,--user        User             ""      (NEMO & XIOS installation)		   
 
+Other options (modify default settings)
 SVN working copy:
-    -b,--branch	    SVN branch to test (trunk|nemo_v3_6_STABLE|...
-    -v,--version    Action on working copy ('svn status' by default)
-  		       	'{'YYYY-MM-DD'}' Update to revision available at this date
-		       	[0-9]*	           ""   "" revision number
-		       	HEAD|up|update     ""   "" last revision
-		       	st|status	 Show differences with repository
+    -b,--branch	     SVN branch name to test (trunk|nemo_v3_6_STABLE|...)
+    -v,--version     Action on working copy ('status' by default)
+  		        	'{'YYYY-MM-DD'}' Update to revision available at this date
+		        	[0-9]*	           ""   "" revision number
+		        	HEAD|up|update     ""   "" last revision
+		        	st|status	 Show differences with repository
 
-NEMO Configuration:
-    -a,--archive    Forcing input files archive to extract downloaded from ESGF/DODS server 
-    -n,--newconf    Testing   configuration created in ./CONFIG
-    -r,--refconf    Reference      " "     
+NEMO configuration:
+    -a,--archive     Forcing input files archive to extract downloaded from ESGF/DODS server 
+    -n,--new_conf    Testing   configuration created in ./CONFIG
+    -r,--ref_conf    Reference      " "     
 
 Compiling & computation:
-    -j,--job        Number of processes for compiling
-    -t,--time       Timeout for computation (s)
+    -j,--job         Number of processes for compiling
+    -t,--time        Timeout for computation (s)
 
 Output control:
-    -d,--debug      Verbose output for debugging purpose (`set -vx`)
-    -e,--email      Email trusting digest report to following addresses only on failure
-    -h,--help       Print this help & exit
-    -p,--publish    Share trusting result
+    -d,--debug       Verbose output for debugging purpose (`set -vx`)
+    -e,--email       Email trusting digest report to following addresses only on failure
+    -h,--help        Print this help & exit
+    -p,--prod        Production mode (append trusting logfile)
