Index: utils/CI/sette/BATCH_TEMPLATE/batch-X86_ARCHER2-Cray
===================================================================
--- utils/CI/sette/BATCH_TEMPLATE/batch-X86_ARCHER2-Cray	(revision 14823)
+++ utils/CI/sette/BATCH_TEMPLATE/batch-X86_ARCHER2-Cray	(revision 14825)
@@ -1,95 +1,6 @@
 #!/bin/bash
-#SBATCH --job-name=sette_test
-#SBATCH --time=0:20:0
-#SBATCH --nodes=NODES
-#SBATCH --ntasks=TOTAL_NPROCS
-#SBATCH --account=n01
-#SBATCH --partition=standard
-#SBATCH --qos=standard
-##BATCH --reservation=shortqos
-##BATCH --qos=short
-module -s restore /work/n01/shared/acc/n01_modules/ucx_env
 #
-  export XIO_HOME=/work/n01/shared/acc/xios-2.5
+# A batch script will be generated using:
+# /work/n01/shared/acc/mkslurm_settejob -S $NXIO_PROC -s 8 -m 4 -C $NB_PROC -g 2 -a n01-CLASS -j sette_job -t 20:00 > ${SETTE_DIR}/job_batch_template
+# by prepare_job.sh
 #
-  export OMP_NUM_THREADS=1
-  export OCORES=NPROCS
-  export XCORES=NXIOPROCS
-  export SETTE_DIR=DEF_SETTE_DIR
-#
-# load sette functions (only post_test_tidyup needed)
-#
-  . ${SETTE_DIR}/all_functions.sh
-###############################################################
-#
-# set up mpp computing environment
-#
-#
-# Local settings. These settings are for a particular machine (the MOBILIS ClusterVision 
-# system at NOCS) at a particular stage of that machine's evolution. This template file
-# is provided for illustration purposes only and will not work on any other machine. There
-# should, however, be sufficient similarity with other MPP platforms and batch systems
-# for this example to provide a useful guide for experienced users
-#
-# Don't remove neither change the following line
-# BODY
-#
-# Test specific settings. Do not hand edit these lines; the fcm_job.sh script will set these
-# (via sed operating on this template job file). Note that the number of compute nodes required
-# is also set by the fcm_job.sh on the PBS select header line above.
-#
-# These variables are needed by post_test_tidyup function in all_functions.sh
-#
-  export INPUT_DIR=DEF_INPUT_DIR
-  export CONFIG_DIR=DEF_CONFIG_DIR
-  export TOOLS_DIR=DEF_TOOLS_DIR
-  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION
-  export NEW_CONF=DEF_NEW_CONF
-  export CMP_NAM=DEF_CMP_NAM
-  export TEST_NAME=DEF_TEST_NAME
-  export EXE_DIR=DEF_EXE_DIR
-#
-# end of set up
-###############################################################
-#
-# change to the working directory 
-#
-  cd $EXE_DIR
-  echo Directory is `pwd`
-  if [ $XCORES -eq 0 ]; then
-#
-# Run SPMD case
-#
-       echo srun --cpu-bind=v,rank_ldom -n $OCORES ./nemo
-       srun --cpu-bind=v,rank_ldom -n $OCORES ./nemo
-  else
-       if [ ! -f ./xios_server.exe ] && [ -f ${XIO_HOME}/bin/xios_server.exe ]; then
-          cp ${XIO_HOME}/bin/xios_server.exe .
-       fi
-       if [ ! -f ./xios_server.exe ]; then
-          echo "./xios_server.exe not found"
-          echo "run aborted"
-          exit
-       fi
-#
-#  Run MPMD case
-#
-cat > myscript_wrapper2.sh << EOFB
-#!/bin/ksh
-#
-set -A map ./xios_server.exe ./nemo
-exec_map=( 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
-#
-exec \${map[\${exec_map[\$SLURM_PROCID]}]}
-##
-EOFB
-chmod u+x ./myscript_wrapper2.sh
-#
-srun --mem-bind=local --cpu-bind=v,map_cpu:00,0x4,0x8,0xc,0x10,0x12,0x14,0x16,0x18,0x1a,0x1c,0x1e,0x20,0x22,0x24,0x26,0x28,0x2a,0x2c,0x2e,0x30,0x32,0x34,0x36,0x38,0x3a,0x3c,0x3e,0x40,0x42,0x44,0x46,0x48,0x4a,0x4c,0x4e,0x50,0x52,0x54,0x56,0x58,0x5a,0x5c,0x5e,0x60,0x62,0x64,0x66,0x68,0x6a,0x6c,0x6e,0x70,0x72,0x74,0x76,0x78,0x7a,0x7c,0x7e, ./myscript_wrapper2.sh
-#
-  fi
-#
-  post_test_tidyup
-# END_BODY
-# Don't remove neither change the previous line
-  exit
Index: utils/CI/sette/BATCH_TEMPLATE/batch-X86_ARCHER2-Cray_DEBUG
===================================================================
--- utils/CI/sette/BATCH_TEMPLATE/batch-X86_ARCHER2-Cray_DEBUG	(revision 14825)
+++ utils/CI/sette/BATCH_TEMPLATE/batch-X86_ARCHER2-Cray_DEBUG	(revision 14825)
@@ -0,0 +1,1 @@
+link batch-X86_ARCHER2-Cray
Index: utils/CI/sette/BATCH_TEMPLATE/batch-XC_ARCHER_INTEL
===================================================================
--- utils/CI/sette/BATCH_TEMPLATE/batch-XC_ARCHER_INTEL	(revision 14823)
+++ 	(revision )
@@ -1,95 +1,0 @@
-#!/bin/bash 
-#!
-#PBS -N nemo_sette
-#PBS -l walltime=00:59:00
-#PBS -l select=NODES
-#PBS -j oe
-#PBS -A n01-Global
-
-
-  export PBS_O_WORKDIR=$(readlink -f $PBS_O_WORKDIR)               
-  export OMP_NUM_THREADS=1
-  cd $PBS_O_WORKDIR
-#
-  echo " ";
-  export OMP_NUM_THREADS=1
-  O_PER_NODE=24
-  X_PER_NODE=4
-  OCORES=NPROCS
-  if [ $OCORES -le 23 ] ; then O_PER_NODE=$OCORES; fi
-  XCORES=NXIOPROCS
-  if [ $XCORES -le 3 ] ; then X_PER_NODE=$XCORES; fi
-  export SETTE_DIR=DEF_SETTE_DIR
-  export XIO_HOME=/home/acc/XIOS
-###############################################################
-#
-#
-# load sette functions (only post_test_tidyup needed)
-#
-  . ${SETTE_DIR}/all_functions.sh
-###############################################################
-#
-# set up mpp computing environment
-#
-#
-# Local settings. These settings are for a particular machine (the MOBILIS ClusterVision 
-# system at NOCS) at a particular stage of that machine's evolution. This template file
-# is provided for illustration purposes only and will not work on any other machine. There
-# should, however, be sufficient similarity with other MPP platforms and batch systems
-# for this example to provide a useful guide for experienced users
-#
-# Don't remove neither change the following line
-# BODY
-#
-# Test specific settings. Do not hand edit these lines; the fcm_job.sh script will set these
-# (via sed operating on this template job file). Note that the number of compute nodes required
-# is also set by the fcm_job.sh on the PBS select header line above.
-#
-# These variables are needed by post_test_tidyup function in all_functions.sh
-#
-  export INPUT_DIR=DEF_INPUT_DIR
-  export CONFIG_DIR=DEF_CONFIG_DIR
-  export TOOLS_DIR=DEF_TOOLS_DIR
-  export NEMO_VALIDATION_DIR=DEF_NEMO_VALIDATION
-  export NEW_CONF=DEF_NEW_CONF
-  export CMP_NAM=DEF_CMP_NAM
-  export TEST_NAME=DEF_TEST_NAME
-  export EXE_DIR=DEF_EXE_DIR
-  ulimit -c unlimited
-  ulimit -s unlimited
-  export FORT_FMT_RECL=132
-#
-# end of set up
-###############################################################
-#
-# change to the working directory 
-#
-  cd $EXE_DIR
-  echo Directory is `pwd`
-  if [ $XCORES -eq 0 ]; then
-#
-# Run SPMD case
-#
-       echo time aprun -b  -n $OCORES -N $O_PER_NODE ./nemo
-            time aprun -b  -n $OCORES -N $O_PER_NODE ./nemo
-  else
-       if [ ! -f ./xios_server.exe ] && [ -f ${XIO_HOME}/bin/xios_server.exe ]; then
-          cp ${XIO_HOME}/bin/xios_server.exe .
-       fi
-       if [ ! -f ./xios_server.exe ]; then
-          echo "./xios_server.exe not found"
-          echo "run aborted"
-          exit
-       fi
-#
-#  Run MPMD case
-#
-       echo time aprun -b -n $XCORES -N $X_PER_NODE ./xios_server.exe : -n $OCORES -N $O_PER_NODE ./nemo
-            time aprun -b -n $XCORES -N $X_PER_NODE ./xios_server.exe : -n $OCORES -N $O_PER_NODE ./nemo
-#
-  fi
-#
-  post_test_tidyup
-# END_BODY
-# Don't remove neither change the previous line
-  exit
Index: utils/CI/sette/prepare_job.sh
===================================================================
--- utils/CI/sette/prepare_job.sh	(revision 14823)
+++ utils/CI/sette/prepare_job.sh	(revision 14825)
@@ -200,49 +200,6 @@
 				;;
 			X86_ARCHER2*)
-                                OSPACE=2
-                                SSPACE=4
-                                NB_REM=$( echo $NB_PROC $OSPACE $NXIO_PROC $SSPACE | awk '{print ( $1 * $2 + $3 * $4 ) % 128}')
-                                echo "NB_REM= "$NB_REM
-		        	if [ ${NB_REM} == 0 ] ; then
-					# number of processes required is an integer multiple of 128
-					#
-					NB_NODES=$( echo $NB_PROC $OSPACE $NXIO_PROC $SSPACE | awk '{print ( $1 * $2 + $3 * $4 ) / 128}')
-				else
-					#
-					# number of processes required is not an integer multiple of 128
-					# round up the number of nodes required.
-					#
-					NB_NODES=$( echo $NB_PROC $OSPACE $NXIO_PROC $SSPACE | awk '{printf("%d",( $1 * $2 + $3 * $4 ) / 128 + 1 )}')
-	       			fi
+                                MK_TEMPLATE=$( /work/n01/shared/acc/mkslurm_settejob -S $NXIO_PROC -s 8 -m 4 -C $NB_PROC -g 2 -a n01-CLASS -j sette_job -t 20:00 > ${SETTE_DIR}/job_batch_template )
 				;;
-                        XC_ARCHER_INTEL)
-                                # ocean cores are packed 24 to a node
-                                NB_REM=$( echo $NB_PROC | awk '{print ( $1 % 24 ) }')
-                                if [ ${NB_REM} == 0 ] ; then
-                                        # number of processes required is an integer multiple of 24
-                                        #
-                                        NB_NODES=$( echo $NB_PROC $NXIO_PROC | awk '{print ($1) / 24}')
-                                else
-                                        #
-                                        # number of processes required is not an integer multiple of 24
-                                        # round up the number of nodes required.
-                                        #
-                                        NB_NODES=$( echo $NB_PROC | awk '{printf("%d",($1) / 24 + 1 )}')
-                                fi
-                                # xios cores are sparsely packed at 4 to a node
-                                # but can not share nodes with the ocean cores
-                                NB_REM=$( echo $NXIO_PROC | awk '{print ( $2 % 4 ) }')
-                                if [ ${NB_REM} == 0 ] ; then
-                                        # number of processes required is an integer multiple of 4                           
-                                        #
-                                        NB_NODES=$( echo $NB_NODES $NXIO_PROC | awk '{print ($1 + ( $2 / 4 ))}')                    
-                                else
-                                        #
-                                        # number of processes required is not an integer multiple of 4                             
-                                        # round up the number of nodes required.
-                                        #
-                                        NB_NODES=$( echo $NB_NODES $NXIO_PROC | awk '{print ($1 + ( $2 / 4 ) + 1)}') 
-                                fi
-                                ;;
                         XC40_METO*) #Setup for Met Office XC40 with any compiler
                                 # ocean cores are packed 32 to a node
Index: utils/CI/sette/sette_rpt.sh
===================================================================
--- utils/CI/sette/sette_rpt.sh	(revision 14823)
+++ utils/CI/sette/sette_rpt.sh	(revision 14825)
@@ -25,4 +25,8 @@
 function get_ktdiff() {
   ktdiff=`diff ${1} ${2} | head -2 | grep it | awk '{ print $4 }'`
+}
+
+function get_ktdiff2() {
+  ktdiff=`diff ${1} ${2} |  head -2 | tail -1l | awk '{print $2}'`
 }
 
@@ -107,5 +111,5 @@
         fi
       else
-        get_ktdiff f1.tmp$$ $f2t
+        get_ktdiff2 f1.tmp$$ $f2t
         printf "\e[38;5;196m%-27s %s %s %s %-5s %s\e[0m\n" $nam  " tracer.stat    restartability  FAILED : " $dorv " (results are different after " $ktdiff " time steps)"
 #
@@ -213,5 +217,5 @@
         fi
       else
-        get_ktdiff $f1t $f2t
+        get_ktdiff2 $f1t $f2t
         printf "\e[38;5;196m%-27s %s %s %s %-5s %s\e[0m\n" $nam  " tracer.stat reproducibility FAILED : " $dorv " (results are different after " $ktdiff " time steps)"
 #
@@ -266,6 +270,8 @@
     f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
     f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
+    f1a=$vdir/$nam/$mach/$dorv/LONG/timing.output
     f2s=$vdirref/$nam/$mach/$dorvref/LONG/run.stat
     f2t=$vdirref/$nam/$mach/$dorvref/LONG/tracer.stat
+    f2a=$vdirref/$nam/$mach/$dorvref/LONG/timing.output
     if  [ ! -f $f1s ] && [ ! -f $f1t ] ; then
       printf "%-20s %s\n" $nam " incomplete test";
@@ -310,5 +316,5 @@
         fi
       else
-        get_ktdiff $f1t $f2t
+        get_ktdiff2 $f1t $f2t
         printf "%-20s %s %s %-5s %s\n" $nam  " tracer.stat files are DIFFERENT (results are different after " $ktdiff " time steps) "
 #
@@ -319,4 +325,21 @@
           read y
           sdiff $f1t $f2t
+        fi
+      fi
+    fi
+#
+# Report average CPU time differences (if available)
+#
+    if  [ -f $f1a ] && [ -f $f2a ] ; then
+      tnew=$(grep 'Average ' $f1a  | awk '{print $5}')
+      tref=$(grep 'Average ' $f2a  | awk '{print $5}')
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then
+          tdif=$( echo ${tnew} ${tref} | awk '{print $1 - $2}')
+          if (( $(echo "$tnew > $tref" |bc -l) )); then
+            printf "%-20s %14s %10s %14s %10s %14s \\e[41;33;196m%10s\\e[0m\n" $nam  " ref. time:" $tref "cur. time:" $tnew "diff.:" $tdif
+          else
+            printf "%-20s %14s %10s %14s %10s %14s \\e[42;01;196m%10s\\e[0m\n" $nam  " ref. time:" $tref "cur. time:" $tnew "diff.:" $tdif
+          fi
         fi
       fi
