Index: trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS
===================================================================
--- trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS	(revision 4687)
+++ trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-X64_MOBILIS	(revision 4687)
@@ -0,0 +1,72 @@
+#!/bin/bash
+#SBATCH -N NODES
+#SBATCH --time=00:59:00 
+
+module purge
+module load shared
+module load gcc
+module load intel/compiler/64/14.0/2013_sp1.2.144
+module load openmpi/intel/64/1.6.5
+module load slurm/2.5.7
+
+#
+  export OMP_NUM_THREADS=1
+  export OCORES=NPROCS
+  export XCORES=NOT_USED
+  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 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`
+#
+#
+#  Run the parallel MPI executable 
+#
+echo time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
+                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $OCORES --bynode  \
+                         --mca mpi_paffinity_alone 1 ./opa 
+#
+     time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
+                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $OCORES --bynode  \
+                         --mca mpi_paffinity_alone 1 ./opa 
+#
+#
+  post_test_tidyup
+# END_BODY
+# Don't remove neither change the previous line
+  exit
Index: trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-mpmd-X64_MOBILIS
===================================================================
--- trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-mpmd-X64_MOBILIS	(revision 4687)
+++ trunk/NEMOGCM/SETTE/BATCH_TEMPLATE/batch-mpmd-X64_MOBILIS	(revision 4687)
@@ -0,0 +1,83 @@
+#!/bin/bash
+#SBATCH -N NODES
+#SBATCH --time=00:59:00 
+
+module purge
+module load shared
+module load gcc
+module load intel/compiler/64/14.0/2013_sp1.2.144
+module load openmpi/intel/64/1.6.5
+module load slurm/2.5.7
+
+#
+  export OMP_NUM_THREADS=1
+  export OCORES=NPROCS
+  export XCORES=NXIOPROCS
+  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 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 [ ! -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 the parallel MPI executable 
+#
+echo time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
+                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $XCORES ./xios_server.exe \
+                        : -np $OCORES --bynode  --mca mpi_paffinity_alone 1 ./opa 
+#
+     time `which mpirun` --report-bindings -x MALLOC_MMAP_MAX_=-1 \
+                         -x MALLOC_TRIM_THRESHOLD_=33554432 -np $XCORES ./xios_server.exe \
+                        : -np $OCORES --bynode  --mca mpi_paffinity_alone 1 ./opa 
+#
+#
+  post_test_tidyup
+# END_BODY
+# Don't remove neither change the previous line
+  exit
Index: trunk/NEMOGCM/SETTE/prepare_job.sh
===================================================================
--- trunk/NEMOGCM/SETTE/prepare_job.sh	(revision 4528)
+++ trunk/NEMOGCM/SETTE/prepare_job.sh	(revision 4687)
@@ -182,20 +182,20 @@
 fi
 
-# example for NOCS Altix system using PBS batch submission (requires ${SETTE_DIR}/sette_batch_template file)
+# example for NOCS ClusterVision system using SLURM batch submission (requires ${SETTE_DIR}/sette_batch_template file)
 #
   #  if [ ${MPI_FLAG} == "no" ] ; then
 		case ${COMPILER} in 
-			ALTIX_NAUTILUS_MPT)
-                                NB_REM=$( echo $NB_PROC $NXIO_PROC | awk '{print ( $1 + $2 ) % 4}')
+			X64_MOBILIS)
+                                NB_REM=$( echo $NB_PROC $NXIO_PROC | awk '{print ( $1 + $2 ) % 16}')
 		        	if [ ${NB_REM} == 0 ] ; then
-					# number of processes required is an integer multiple of 4
+					# number of processes required is an integer multiple of 16
 					#
-					NB_NODES=$( echo $NB_PROC $NXIO_PROC | awk '{print ($1 + $2 ) / 4}')
+					NB_NODES=$( echo $NB_PROC $NXIO_PROC | awk '{print ($1 + $2 ) / 16}')
 				else
 					#
-					# number of processes required is not an integer multiple of 4
+					# number of processes required is not an integer multiple of 16
 					# round up the number of nodes required.
 					#
-					NB_NODES=$( echo $NB_PROC $NXIO_PROC | awk '{printf("%d",($1 + $2 ) / 4 + 1 )}')
+					NB_NODES=$( echo $NB_PROC $NXIO_PROC | awk '{printf("%d",($1 + $2 ) / 16 + 1 )}')
 	       			fi
 				;;
Index: trunk/NEMOGCM/SETTE/sette_rpt
===================================================================
--- trunk/NEMOGCM/SETTE/sette_rpt	(revision 4528)
+++ trunk/NEMOGCM/SETTE/sette_rpt	(revision 4687)
@@ -17,9 +17,6 @@
   cd $NEMO_VALID
 #
-# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory
-# found in the WGYRE_LONG directory
-#
-  set dorv = `ls -1rtd ./WGYRE_LONG/{$mach}/* | tail -1l `
-  set dorv = $dorv:t
+# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory
+#
 #
 # Now loop through all the test directories. On the second pass the user can optionally examine any mismatched
@@ -30,4 +27,6 @@
 foreach pass (0 1 )
   if ( -d ./WGYRE_LONG ) then
+    set dorv = `ls -1rtd ./WGYRE_LONG/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WGYRE_LONG/{$mach}/{$dorv}/LONG/ocean.output
     set f1s = ./WGYRE_LONG/{$mach}/{$dorv}/LONG/solver.stat
@@ -39,7 +38,7 @@
     cmp -s f1.tmp$$ $f2s
     if ( $status == 0 ) then
-      echo "GYRE     restartability  passed"
-    else
-      echo "GYRE     restartability  FAILED"
+      echo "GYRE        restartability  passed"
+    else
+      echo "GYRE        restartability  FAILED"
       if ( $pass == 1 ) then
         echo "<return> to view solver.stat differences"
@@ -57,4 +56,6 @@
   
   if ( -d ./WORCA2LIMPIS_LONG ) then
+    set dorv = `ls -1rtd ./WORCA2LIMPIS_LONG/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WORCA2LIMPIS_LONG/{$mach}/{$dorv}/LONG/ocean.output
     set f1s = ./WORCA2LIMPIS_LONG/{$mach}/{$dorv}/LONG/solver.stat
@@ -84,4 +85,6 @@
 
   if ( -d ./WORCA2OFFPIS_LONG ) then
+    set dorv = `ls -1rtd ./WORCA2OFFPIS_LONG/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WORCA2OFFPIS_LONG/{$mach}/{$dorv}/LONG/ocean.output
     set f1s = ./WORCA2OFFPIS_LONG/{$mach}/{$dorv}/LONG/tracer.stat
@@ -111,4 +114,6 @@
   
   if ( -d ./WAMM12_LONG ) then
+    set dorv = `ls -1rtd ./WAMM12_LONG/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WAMM12_LONG/{$mach}/{$dorv}/LONG/ocean.output
     set f1s = ./WAMM12_LONG/{$mach}/{$dorv}/LONG/solver.stat
@@ -136,8 +141,47 @@
     rm f1.tmp$$
   endif
-
+NEXT0:
+  if ( -d ./WSAS_LONG ) then
+    set dorv = `ls -1rtd ./WSAS_LONG/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
+    set f1o = ./WSAS_LONG/{$mach}/{$dorv}/LONG/ocean.output
+    set f1s = ./WSAS_LONG/{$mach}/{$dorv}/LONG/solver.stat
+    set f2o = ./WSAS_LONG/{$mach}/{$dorv}/SHORT/ocean.output
+    set f2s = ./WSAS_LONG/{$mach}/{$dorv}/SHORT/solver.stat
+
+    foreach f ( $f1o $f1s $f2o $f2s )
+     if ( ! -f $f ) then
+      echo 'SAS         restartability  inconclusive ( ' $f:t ' not found )'
+      goto NEXT
+     endif
+    end
+
+    set nl = `wc -l $f2s`
+    tail -$nl[1] $f1s > f1.tmp$$
+    cmp -s f1.tmp$$ $f2s
+    if ( $status == 0 ) then
+      echo "SAS         restartability  passed"
+    else
+      echo "SAS         restartability  FAILED"
+      if ( $pass == 1 ) then
+        echo "<return> to view solver.stat differences"
+        set y = $<
+        sdiff f1.tmp$$ $f2s
+        echo "<return> to view ocean.output differences"
+        set y = $<
+        sdiff $f1o $f2o | grep "|"
+        echo "<return> to continue"
+        set y = $<
+      endif
+    endif
+    rm f1.tmp$$
+  endif
+
+NEXT:
 echo
   
   if ( -d ./WGYRE_4 ) then
+    set dorv = `ls -1rtd ./WGYRE_4/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WGYRE_4/{$mach}/{$dorv}/REPRO_1_4/ocean.output
     set f1s = ./WGYRE_4/{$mach}/{$dorv}/REPRO_1_4/solver.stat
@@ -147,7 +191,7 @@
     cmp -s $f1s $f2s
     if ( $status == 0 ) then
-      echo "GYRE     reproducibility passed"
-    else
-      echo "GYRE     reproducibility FAILED"
+      echo "GYRE        reproducibility passed"
+    else
+      echo "GYRE        reproducibility FAILED"
       if ( $pass == 1 ) then
         echo "<return> to view solver.stat differences"
@@ -164,4 +208,6 @@
   
   if ( -d ./WORCA2LIMPIS_16 ) then
+    set dorv = `ls -1rtd ./WORCA2LIMPIS_16/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WORCA2LIMPIS_16/{$mach}/{$dorv}/REPRO_2_8/ocean.output
     set f1s = ./WORCA2LIMPIS_16/{$mach}/{$dorv}/REPRO_2_8/solver.stat
@@ -188,4 +234,6 @@
 
   if ( -d ./WORCA2OFFPIS_16 ) then
+    set dorv = `ls -1rtd ./WORCA2OFFPIS_16/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WORCA2OFFPIS_16/{$mach}/{$dorv}/REPRO_2_8/ocean.output
     set f1s = ./WORCA2OFFPIS_16/{$mach}/{$dorv}/REPRO_2_8/tracer.stat
@@ -212,4 +260,6 @@
   
   if ( -d ./WAMM12_32 ) then
+    set dorv = `ls -1rtd ./WAMM12_32/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WAMM12_32/{$mach}/{$dorv}/REPRO_4_8/ocean.output
     set f1s = ./WAMM12_32/{$mach}/{$dorv}/REPRO_4_8/solver.stat
@@ -235,5 +285,41 @@
   endif
 
+  if ( -d ./WSAS_32 ) then
+    set dorv = `ls -1rtd ./WSAS_32/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
+    set f1o = ./WSAS_32/{$mach}/{$dorv}/REPRO_4_8/ocean.output
+    set f1s = ./WSAS_32/{$mach}/{$dorv}/REPRO_4_8/solver.stat
+    set f2o = ./WSAS_32/{$mach}/{$dorv}/REPRO_8_4/ocean.output
+    set f2s = ./WSAS_32/{$mach}/{$dorv}/REPRO_8_4/solver.stat
+
+    foreach f ( $f1o $f1s $f2o $f2s )
+     if ( ! -f $f ) then
+      echo 'SAS         reproducibility inconclusive ( ' $f:t ' not found )'
+      goto NEXT1
+     endif
+    end
+
+    cmp -s $f1s $f2s
+    if ( $status == 0 ) then
+      echo "SAS reproducibility passed"
+    else
+      echo "SAS reproducibility FAILED"
+      if ( $pass == 1 ) then
+        echo "<return> to view solver.stat differences"
+        set y = $<
+        sdiff $f1s $f2s
+        echo "<return> to view ocean.output differences"
+        set y = $<
+        sdiff $f1o $f2o | grep "|"
+        echo "<return> to continue"
+        set y = $<
+      endif
+    endif
+  endif
+NEXT1:
+
   if ( -d ./WORCA2AGUL_1_2 ) then
+    set dorv = `ls -1rtd ./WORCA2AGUL_1_2/{$mach}/* | tail -1l `
+    set dorv = $dorv:t
     set f1o = ./WORCA2AGUL_1_2/{$mach}/{$dorv}/SHORT/ocean.output
     set f1s = ./WORCA2AGUL_1_2/{$mach}/{$dorv}/SHORT/solver.stat
Index: trunk/NEMOGCM/SETTE/sette_xios.sh
===================================================================
--- trunk/NEMOGCM/SETTE/sette_xios.sh	(revision 4528)
+++ trunk/NEMOGCM/SETTE/sette_xios.sh	(revision 4687)
@@ -104,4 +104,13 @@
 CMP_NAM=${1:-$COMPILER}
 # Copy job_batch_COMPILER file for specific compiler into job_batch_template
+#=================================================================================
+# Note this script sets up and submits a mixture of SPMD and MPMD jobs corresponding 
+# to ATTACHED and DETACHED mode, XIOS jobs. In general, the launch command for these
+# jobs is different and is accommodated here by employing two different batch-file
+# templates. This script expects to find both a BATCH_TEMPLATE/batch-${COMPILER} and
+# a BATCH_TEMPLATE/batch-mpmd-${COMPILER} template. If your test system doesn't 
+# require this distinction, simply make both files identical.
+#=================================================================================
+# Initially copy standard (SPMD) template for attached mode tests
 cd ${SETTE_DIR}
 cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
@@ -124,7 +133,7 @@
     . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_LR -r GYRE_XIOS -j 8 
     cd ${SETTE_DIR}
-    . param.cfg
-    . all_functions.sh
-    . prepare_exe_dir.sh
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -154,5 +163,5 @@
     export USING_MPMD="false"
     cd ${SETTE_DIR} 
-    . prepare_exe_dir.sh
+    . ./prepare_exe_dir.sh
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -182,5 +191,9 @@
     export USING_MPMD="true"
     cd ${SETTE_DIR}
-    . prepare_exe_dir.sh
+#
+# Copy MPMD job_batch_COMPILER file for specific compiler into job_batch_template
+    cp BATCH_TEMPLATE/batch-mpmd-${COMPILER} job_batch_template || exit
+#
+    . ./prepare_exe_dir.sh
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -209,5 +222,5 @@
     export USING_MPMD="true"
     cd ${SETTE_DIR}
-    . prepare_exe_dir.sh
+    . ./prepare_exe_dir.sh
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -246,7 +259,12 @@
     . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRE_XIOS_HR -r GYRE_XIOS -j 8
     cd ${SETTE_DIR}
-    . param.cfg
-    . all_functions.sh
-    . prepare_exe_dir.sh
+#
+# Copy SPMD job_batch_COMPILER file for specific compiler into job_batch_template
+    cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
+#
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+#
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -278,5 +296,10 @@
     export USING_MPMD="false"
     cd ${SETTE_DIR}
-    . prepare_exe_dir.sh
+#
+# Copy SPMD job_batch_COMPILER file for specific compiler into job_batch_template
+    cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
+#
+    . ./prepare_exe_dir.sh
+#
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -306,5 +329,10 @@
     export USING_MPMD="true"
     cd ${SETTE_DIR}
-    . prepare_exe_dir.sh
+#
+# Copy MPMD job_batch_COMPILER file for specific compiler into job_batch_template
+    cp BATCH_TEMPLATE/batch-mpmd-${COMPILER} job_batch_template || exit
+#
+    . ./prepare_exe_dir.sh
+#
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
@@ -334,5 +362,5 @@
     export USING_MPMD="true"
     cd ${SETTE_DIR}
-    . prepare_exe_dir.sh
+    . ./prepare_exe_dir.sh
     JOB_FILE=${EXE_DIR}/run_job.sh
     if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
