Index: /utils/CI/sette/OLD_SCRIPT/sette_beginner.sh
===================================================================
--- /utils/CI/sette/OLD_SCRIPT/sette_beginner.sh	(revision 11161)
+++ /utils/CI/sette/OLD_SCRIPT/sette_beginner.sh	(revision 11161)
@@ -0,0 +1,167 @@
+#!/bin/bash
+#############################################################
+# Author : Simona Flavoni for NEMO
+# Contact : sflod@locean-ipsl.upmc.fr
+#
+# sette_beginner.sh   : example of script of SET TEsts for NEMO (SETTE)
+# ----------------------------------------------------------------------
+# NEMO/SETTE , NEMO Consortium (2010)
+# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+# ----------------------------------------------------------------------
+#
+#############################################################
+#set -vx
+set -o posix
+#set -u
+#set -e
+#+
+#
+# ===================
+# sette_beginner.sh
+# ===================
+#
+# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory 
+# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
+# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs  
+# INTERACT_FLAG     : flag to run in interactive mode "yes"
+#                           to run in batch mode "no"
+# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
+#                           to run in sequential mode (NB_PROC = 1) "no"
+# USING_XIOS        : flag to control the activation of key_iomput
+#                      "yes" to compile using key_iomput and link to the external XIOS library
+#                      "no"  to compile without key_iomput and link to the old IOIPSL library
+# USING_MPMD        : flag to control the use of stand-alone IO servers
+#                     requires USING_XIOS="yes"
+#                      "yes" to run in MPMD (detached) mode with stand-alone IO servers
+#                      "no"  to run in SPMD (attached) mode without separate IO servers 
+# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
+#                     set to zero if USING_MPMD="no"
+#
+# Principal script is sette.sh, that calls 
+#
+#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe 
+#              and links to nemo in ${CONFIG_NAME}/EXP00)
+#
+#  param.cfg : sets and loads following directories:
+#
+#   FORCING_DIR         : is the directory for forcing files (tarfile)
+#   INPUT_DIR           : is the directory for input files storing 
+#   TMPDIR              : is the temporary directory (if needed)
+#   NEMO_VALIDATION_DIR : is the validation directory
+#
+#   (NOTE: this file is the same for all configrations to be tested with sette)
+#
+#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
+#   set_namelist     : function declared in all_functions that sets namelist parameters 
+#   post_test_tidyup : creates validation storage directory and copies required output files 
+#                      (run.stat and ocean.output) in it after execution of test.
+#
+#  VALIDATION tree is:
+#
+#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
+#
+#  prepare_exe_dir.sh : defines and creates directory where the test is executed
+#                       execution directory takes name of TEST_NAME defined for every test 
+#                       in sette.sh. (each test in executed in its own directory)
+#
+#  prepare_job.sh     : to generate the script run_job.sh
+#
+#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
+#                        see sette.sh and BATCH_TEMPLATE directory
+#
+#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which 
+#        can be found paths to the input tar file)
+#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} 
+#        directory
+#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists 
+#        remain in ${NEW_CONF}/EXP00
+# 
+#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of 
+#        executed commands
+#
+#  NOTE: if sette.sh is stopped in output.sette there is written the last command 
+#        executed by sette.sh
+#
+# example use: ./sette_beginner.sh 
+#########################################################################################
+#
+# Compiler among those in NEMOGCM/ARCH
+COMPILER=x3750_ADA
+export BATCH_COMMAND_PAR="llsubmit"
+export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
+export INTERACT_FLAG="yes"
+export MPIRUN_FLAG="yes"
+
+export DEL_KEYS="key_iomput"
+if [ ${USING_XIOS} == "yes" ]
+ then 
+   export DEL_KEYS=""
+fi
+
+#
+# Settings which control the use of stand alone servers (only relevant if using xios)
+#
+export USING_MPMD="no"
+export NUM_XIOSERVERS=4
+export JOB_PREFIX=batch-mpmd
+#
+if [ ${USING_MPMD} == "no" ] 
+ then
+   export NUM_XIOSERVERS=0
+   export JOB_PREFIX=batch
+fi
+#
+#
+if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no"]
+ then
+   echo "Incompatible choices. MPMD mode requires the XIOS server"
+   exit
+fi
+#
+
+# Directory to run the tests
+SETTE_DIR=$(cd $(dirname "$0"); pwd)
+MAIN_DIR=${SETTE_DIR%/SETTE}
+CONFIG_DIR=${MAIN_DIR}/cfgs
+TOOLS_DIR=${MAIN_DIR}/tools
+
+CMP_NAM=${1:-$COMPILER}
+# Copy job_batch_COMPILER file for specific compiler into job_batch_template
+cd ${SETTE_DIR}
+cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
+
+# Run for GYRE CONFIG
+# small test to start
+# compile GYRE configuration with gfortran_osx compiler run with 4 proc : 
+export TEST_NAME="SHORT_TEST"
+cd ${CONFIG_DIR}
+. ./makenemo -m ${CMP_NAM} -n GYRE_SHORT -r GYRE -j 10 add_key "key_nosignedzero" del_key ${DEL_KEYS}
+cd ${SETTE_DIR}
+. ./param.cfg 
+. ./all_functions.sh
+. ./prepare_exe_dir.sh
+# creation of execution directory
+JOB_FILE=${EXE_DIR}/run_job.sh
+# setting number of procs used
+NPROC=4
+if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+cd ${EXE_DIR}
+# setting namelist parameters
+# experience name
+set_namelist namelist_cfg cn_exp \"GYRE_SHORT\"
+# first time step
+set_namelist namelist_cfg nn_it000 1
+# last time step
+set_namelist namelist_cfg nn_itend 120
+# frequency of creation of a restart file
+set_namelist namelist_cfg nn_stock 60
+if [ ${USING_MPMD} == "yes" ] ; then
+      set_xio_using_server iodef.xml true
+   else
+      set_xio_using_server iodef.xml false
+fi
+cd ${SETTE_DIR}
+. ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+# run job, with 4 processors, test named SHORT (= 60 time steps)
+cd ${SETTE_DIR}   
+. ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
Index: /utils/CI/sette/OLD_SCRIPT/sette_rpt.SAS.sh
===================================================================
--- /utils/CI/sette/OLD_SCRIPT/sette_rpt.SAS.sh	(revision 11161)
+++ /utils/CI/sette/OLD_SCRIPT/sette_rpt.SAS.sh	(revision 11161)
@@ -0,0 +1,316 @@
+#!/bin/bash -f
+#set -vx
+#
+# simple SETTE report generator.
+#
+# This version should be run in the SETTE directory. 
+# The machine name will be picked up from the sette.sh script but the location of the
+# validation directory needs to be set here (currently assumed to reside in the ../cfgs directory)
+#
+#########################################################################################
+######################### Start of function definitions #################################
+##
+
+function restfile() {
+# Rebuild ice restart for SAS CONFIG, and restartability checks. Expects LONG and SHORT run directories.
+# For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files.
+# Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file.
+#
+  vdir=$1
+  nam=$2
+  pass=$3
+#
+  if [ -d $vdir/$nam ]; then
+    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
+    dorv=`echo $dorv | sed -e 's:.*/::'`
+    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 `
+    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l`
+    cd ${SAS_RESTART_DIR}/LONG
+    #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files
+    cd ${TOOLS_DIR}
+    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1
+    cd ${TOOLS_DIR}/REBUILD_NEMO
+    #SF echo "REBUILD LONG restart SAS files, without standard output"
+    ./rebuild_nemo -t 4 ../../cfgs/SAS_LONG/LONG/SAS_00000100_restart_ice  $NPROC > /dev/null 2>&1
+    #SF echo "REBUILD SHORT restart SAS files, without standard output"
+    ./rebuild_nemo -t 4 ../../cfgs/SAS_LONG/SHORT/SAS_00000100_restart_ice $NPROC >&-
+    cd ${SAS_RESTART_DIR}/LONG
+    #SF echo "COPY rebuild restart files"
+    cp SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/.
+    cp ../SHORT/SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/.
+
+    f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000100_restart_ice.nc
+    f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000100_restart_ice.nc
+    if  [ ! -f $f1o ] &&  [ ! -f $f2o ] ; then
+      printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test";
+      return;
+    fi
+    #
+    done_oce=0
+    #
+    if  [  -f $f1o ] && [  -f $f2o ]; then
+      cmp -s $f1o $f2o 
+      #SF  cmp SAS_00000100_restart_ice.nc  ../SHORT/SAS_00000100_restart_ice.nc  > diff_restart.txt
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then
+          printf "%-20s %s %s\n" $nam  " SAS restart files are IDENTICAL :  passed : " $dorv
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " SAS restart files are DIFFERENT : FAILED : " $dorv 
+        #
+	# Offer view of differences on the second pass
+	#
+        if [ $pass == 1 ]; then
+          echo "BE CAREFUL:  NEED cdo to see differences!!!!! "
+          echo "DO which cdo and replace cdo PATH to the cdo command in SETTE_rpt.sh "
+          echo "IF cdo is not available you need to do difference of netcdf file by hand"
+          echo "<return> to view restart_ice.nc differences"
+          read y
+#SF           cdo -diffv $f1o $f2o
+          /smplocal/pub/cdo/1.5.9/bin/cdo -diffv $f1o $f2o
+          done_oce=1
+          #echo "<return> to continue"
+          #read y
+        fi
+      fi
+    fi
+#
+fi
+}
+
+function resttest() { 
+#
+# Restartability checks. Expects LONG and SHORT run directories
+# Compares end of LONG stat files with equivalent entries from the SHORT stat files.
+#
+  vdir=$1
+  nam=$2
+  pass=$3
+#
+  if [ -d $vdir/$nam ]; then
+    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
+    dorv=`echo $dorv | sed -e 's:.*/::'`
+    f1o=$vdir/$nam/$mach/$dorv/LONG/ocean.output
+    f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
+    f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
+    f2o=$vdir/$nam/$mach/$dorv/SHORT/ocean.output
+    f2s=$vdir/$nam/$mach/$dorv/SHORT/run.stat
+    f2t=$vdir/$nam/$mach/$dorv/SHORT/tracer.stat
+
+    if  [ ! -f $f1s ] &&  [ ! -f $f1t ] ; then 
+      printf "%-20s %s\n" $nam " incomplete test";
+      return; 
+    fi
+    if  [ ! -f $f2s ] &&  [ ! -f $f2t ] ; then 
+      printf "%-20s %s\n" $nam " incomplete test";
+      return; 
+    fi
+#
+    done_oce=0
+
+    if  [  -f $f1s ] && [  -f $f2s ]; then 
+      nl=(`wc -l $f2s`)
+      tail -${nl[0]} $f1s > f1.tmp$$
+      cmp -s f1.tmp$$ $f2s
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then 
+          printf "%-20s %s %s\n" $nam  " run.stat restartability  passed : " $dorv
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " run.stat restartability  FAILED : " $dorv 
+#
+# Offer view of differences on the second pass
+#
+        if [ $pass == 1 ]; then
+          echo "<return> to view run.stat differences"
+          read y
+          sdiff f1.tmp$$ $f2s
+          echo "<return> to view ocean.output differences"
+          read y
+          sdiff $f1o $f2o | grep "|"
+          done_oce=1
+          echo "<return> to continue"
+          read y
+        fi
+      fi
+    fi
+#
+# Check tracer.stat files (if they exist)
+#
+    if  [  -f $f1t ] && [  -f $f2t ]; then
+      nl=(`wc -l $f2t`)
+      tail -${nl[0]} $f1t > f1.tmp$$
+      cmp -s f1.tmp$$ $f2t
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then 
+          printf "%-20s %s %s\n" $nam  " tracer.stat restartability  passed : " $dorv
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " tracer.stat restartability  FAILED : " $dorv 
+#
+# Offer view of differences on the second pass
+#
+        if [ $pass == 1 ]; then
+          echo "<return> to view tracer.stat differences"
+          read y
+          sdiff f1.tmp$$ $f2t
+#
+# Only offer ocean.output view if it has not been viewed previously
+#
+          if [ $done_oce == 0 ]; then
+            echo "<return> to view ocean.output differences"
+            read y
+            sdiff $f1o $f2o | grep "|"
+          fi
+          echo "<return> to continue"
+          read y
+        fi
+      fi
+    fi
+    rm f1.tmp$$
+  fi
+}
+
+function reprotest(){
+#
+# Reproducibility checks. Expects REPRO_N_M and REPRO_I_J run directories
+# Compares end of stat files from each
+#
+  vdir=$1
+  nam=$2
+  pass=$3
+#
+  if [ -d $vdir/$nam ]; then
+    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
+    dorv=`echo $dorv | sed -e 's:.*/::'`
+    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 `
+    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l`
+    f1o=$vdir/$nam/$mach/$dorv/$rep1/ocean.output
+    f1s=$vdir/$nam/$mach/$dorv/$rep1/run.stat
+    f1t=$vdir/$nam/$mach/$dorv/$rep1/tracer.stat
+    f2o=$vdir/$nam/$mach/$dorv/$rep2/ocean.output
+    f2s=$vdir/$nam/$mach/$dorv/$rep2/run.stat
+    f2t=$vdir/$nam/$mach/$dorv/$rep2/tracer.stat
+
+    if  [ ! -f $f1s ] && [ ! -f $f1t ] ; then 
+      printf "%-20s %s\n" $nam " incomplete test";
+      return; 
+    fi
+    if  [ ! -f $f2s ] && [ ! -f $f2t ] ; then 
+      printf "%-20s %s\n" $nam " incomplete test";
+      return; 
+    fi
+#
+    done_oce=0
+
+    if  [ -f $f1s ] && [ -f $f2s ] ; then
+      cmp -s $f1s $f2s
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then 
+          printf "%-20s %s %s\n" $nam  " run.stat reproducibility passed : " $dorv
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " run.stat reproducibility FAILED : " $dorv 
+#
+# Offer view of differences on the second pass
+#
+        if [ $pass == 1 ]; then
+          echo "<return> to view run.stat differences"
+          read y
+          sdiff f1.tmp$$ $f2s
+          echo "<return> to view ocean.output differences"
+          read y
+          sdiff $f1o $f2o | grep "|"
+          done_oce=1
+          echo "<return> to continue"
+          read y
+        fi
+      fi
+    fi
+#
+# Check tracer.stat files (if they exist)
+#
+    if  [ -f $f1t ] && [ -f $f2t ] ; then
+      cmp -s $f1t $f2t
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then           printf "%-20s %s %s\n" $nam  " tracer.stat reproducibility passed : " $dorv
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " tracer.stat reproducibility  FAILED : " $dorv
+#
+# Offer view of differences on the second pass
+#
+        if [ $pass == 1 ]; then
+          echo "<return> to view tracer.stat differences"
+          read y
+          sdiff $f1t $f2t
+#
+# Only offer ocean.output view if it has not been viewed previously
+#
+          if [ $done_oce == 0 ]; then
+            echo "<return> to view ocean.output differences"
+            read y
+            sdiff $f1o $f2o | grep "|"
+          fi
+          echo "<return> to continue"
+          read y
+        fi
+      fi
+    fi
+  fi
+}
+########################### END of function definitions #################################
+##                                                                                     ##
+##    Main script                                                                      ##
+##                                                                                     ##
+#########################################################################################
+#
+  mach=`grep "COMPILER=" ./sette.sh | sed -e 's/COMPILER=//'`
+  NEMO_VALID=`grep "NEMO_VALIDATION_DIR=" ./param.cfg | sed -e 's/NEMO_VALIDATION_DIR=//'`
+# Directory to run the tests
+ SETTE_DIR=$(cd $(dirname "$0"); pwd)
+ MAIN_DIR=$(dirname $SETTE_DIR)
+ CONFIG_DIR0=${MAIN_DIR}/cfgs
+ TOOLS_DIR=${MAIN_DIR}/tools
+ NPROC=32
+
+  SAS_RESTART_DIR=${CONFIG_DIR0}/SAS_LONG
+#
+  if [ ! -d $NEMO_VALID ]; then
+    echo "$NEMO_VALID validation directory not found"
+    exit
+  fi
+#
+
+# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory
+#  
+for pass in  0 1 
+do
+#
+ if [ $pass == 1 ]; then echo "---------------2nd pass------------------";fi
+#
+
+# Rebuild and restartability test for SAS
+#
+ for restart_file in WSAS_LONG
+ do
+ #  restfile $SAS_RESTART_DIR LONG $pass
+   restfile $NEMO_VALID $restart_file $pass
+ done
+#
+# Restartability test
+#
+ for restart_test in WGYREPIS_LONG WORCA2ICEPIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WISOMIP_LONG WORCA2AGUL_LONG
+ do
+   resttest $NEMO_VALID $restart_test $pass
+ done
+#
+# Reproducibility tests
+#
+ for repro_test in WGYREPIS_32 WORCA2ICEPIS_32 WORCA2OFFPIS_32 WAMM12_32 WISOMIP_32 WORCA2_ICE_OBS WORCA2AGUL_1_2 WORCA2AGUL_16 WORCA2AGUL_2_2_NAG
+ do
+   reprotest $NEMO_VALID $repro_test $pass
+ done
+#
+done
+exit
Index: /utils/CI/sette/OLD_SCRIPT/sette_xios.sh
===================================================================
--- /utils/CI/sette/OLD_SCRIPT/sette_xios.sh	(revision 11161)
+++ /utils/CI/sette/OLD_SCRIPT/sette_xios.sh	(revision 11161)
@@ -0,0 +1,439 @@
+#!/bin/bash
+############################################################
+# Author : Italo Epicoco - CMCC
+# Contact: italo.epicoco@unisalento.it
+# 2014   : A.C. Coward added new namelist settings for GYRE configuration
+#
+# sette_xios.sh   : additional script of SET TEsts for XIOS within NEMO
+# ----------------------------------------------------------------------
+# NEMO/SETTE , NEMO Consortium (2014)
+# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+# ----------------------------------------------------------------------
+#
+#############################################################
+#set -x
+set -o posix
+#set -u
+#set -e
+# ===========
+# DESCRIPTION
+# ===========
+#
+# Variables to be checked by user:
+#
+# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory 
+# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
+# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs  
+# INTERACT_FLAG     : flag to run in interactive mode "yes"
+#                           to run in batch mode "no"
+# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
+#                           to run in sequential mode (NB_PROC = 1) "no"
+# USING_MPMD        : flag to control the use of stand-alone IO servers
+#                      "true" to run in MPMD (detached) mode with stand-alone IO servers
+#                      "false"  to run in SPMD (attached) mode without separate IO servers 
+# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
+#                     set to zero if USING_MPMD="false"
+#
+# Principal script is sette_xios.sh, that calls 
+#
+#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe 
+#              and links to nemo in ${CONFIG_NAME}/EXP00)
+#
+#  param.cfg : sets and loads following directories:
+#
+#   FORCING_DIR         : is the directory for forcing files (tarfile)
+#   INPUT_DIR           : is the directory for input files storing 
+#   TMPDIR              : is the temporary directory (if needed)
+#   NEMO_VALIDATION_DIR : is the validation directory
+#
+#   (NOTE: this file is the same for all configrations to be tested with sette)
+#
+#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
+#   set_namelist     : function declared in all_functions that sets namelist parameters 
+#   post_test_tidyup : creates validation storage directory and copies required output files 
+#                      (run.stat and ocean.output) in it after execution of test.
+#
+#  VALIDATION tree is:
+#
+#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
+#
+#  prepare_exe_dir.sh : defines and creates directory where the test is executed
+#                       execution directory takes name of TEST_NAME defined for every test 
+#                       in sette.sh. (each test in executed in its own directory)
+#
+#  prepare_job.sh     : to generate the script run_job.sh
+#
+#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
+#                        see sette.sh and BATCH_TEMPLATE directory
+#
+#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which 
+#        can be found paths to the input tar file)
+#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} 
+#        directory
+#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists 
+#        remain in ${NEW_CONF}/EXP00
+# 
+#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of 
+#        executed commands
+#
+#  NOTE: if sette_xios.sh is stopped in output.sette there is written the last command 
+#        executed by sette_xios.sh
+#
+# example use: ./sette_xios.sh 
+#########################################################################################
+#
+# Compiler among those in NEMOGCM/ARCH
+COMPILER=
+export BATCH_COMMAND_PAR="llsubmit"
+export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
+export INTERACT_FLAG="no"
+export MPIRUN_FLAG="yes"
+#
+
+# Directory to run the tests
+SETTE_DIR=$(cd $(dirname "$0"); pwd)
+MAIN_DIR=${SETTE_DIR%/SETTE}
+CONFIG_DIR=${MAIN_DIR}/cfgs
+TOOLS_DIR=${MAIN_DIR}/tools
+
+CMP_NAM=${1:-$COMPILER}
+#
+#=================================================================================
+# Copy job_batch_COMPILER file for specific compiler into job_batch_template
+# Note this batch template needs to be capable of launching both SPMD and MPMD
+# tasks with internal selection depending on the value of NUM_XIOSERVERS
+# (0=SPMD; >0 = MPMD)
+#=================================================================================
+#
+cd ${SETTE_DIR}
+cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
+
+for config in 1 2  
+
+do
+
+#==========================================================
+# TESTS FOR XIOS USING GYRE CONFIGURATION AT LOW RESOLUTION
+#==========================================================
+
+if [ ${config} -eq 1 ] ;  then
+    ## Test of XIOS configured in attached mode with multiple output files (one for each process). 
+    ## $NPROC processes are used 
+
+    NPROC=4
+    jp_cfg=1
+    jpni=2
+    jpnj=2
+    export NUM_XIOSERVERS=0
+    export USING_MPMD="false"
+
+    export TEST_NAME="ATTACHED_MULTIPLE"
+
+    cd ${SETTE_DIR}
+    . ../cfgs/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
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}  
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml multiple_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+
+    ## Test of XIOS configured in attached mode with a single output file. 
+
+    export TEST_NAME="ATTACHED_ONE"
+    export NUM_XIOSERVERS=0
+    export USING_MPMD="false"
+    cd ${SETTE_DIR} 
+    . ./prepare_exe_dir.sh
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml one_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+
+    ## Test of XIOS configured in detached mode with a single output file. 
+    ## $NUM_XIOSERVERS IO server are used.
+    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
+
+    export TEST_NAME="DETACHED_ONE"
+    export NUM_XIOSERVERS=2
+    export USING_MPMD="true"
+    cd ${SETTE_DIR}
+#
+    . ./prepare_exe_dir.sh
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml one_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server). 
+    ## $NUM_XIOSERVERS IO server are used.
+    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
+
+
+    export TEST_NAME="DETACHED_MULTIPLE"
+    export NUM_XIOSERVERS=2
+    export USING_MPMD="true"
+    cd ${SETTE_DIR}
+    . ./prepare_exe_dir.sh
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml multiple_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+fi
+
+#==========================================================
+# TESTS FOR XIOS USING GYRE CONFIGURATION AT HIGH RESOLUTION
+#==========================================================
+
+if [ ${config} -eq 2 ] ;  then
+    ## Test of XIOS configured in attached mode with multiple output files (one for each process). 
+    ## $NPROC processes are used 
+
+    NPROC=64
+    jp_cfg=30
+    jpni=8
+    jpnj=8
+    export NUM_XIOSERVERS=0
+    export USING_MPMD="false"
+
+    export TEST_NAME="ATTACHED_MULTIPLE"
+
+    cd ${SETTE_DIR}
+    . ../cfgs/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
+#
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg nn_bench 1
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml multiple_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+
+    ## Test of XIOS configured in attached mode with a single output file. 
+
+    export TEST_NAME="ATTACHED_ONE"
+    export NUM_XIOSERVERS=0
+    export USING_MPMD="false"
+    cd ${SETTE_DIR}
+#
+    . ./prepare_exe_dir.sh
+#
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg nn_bench 1
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml one_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+
+    ## Test of XIOS configured in detached mode with a single output file. 
+    ## $NUM_XIOSERVERS IO server are used.
+    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
+
+    export TEST_NAME="DETACHED_ONE"
+    export NUM_XIOSERVERS=8
+    export USING_MPMD="true"
+    cd ${SETTE_DIR}
+#
+    . ./prepare_exe_dir.sh
+#
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg nn_bench 1
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml one_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server). 
+    ## $NUM_XIOSERVERS IO server are used.
+    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
+
+    export TEST_NAME="DETACHED_MULTIPLE"
+    export NUM_XIOSERVERS=8
+    export USING_MPMD="true"
+    cd ${SETTE_DIR}
+    . ./prepare_exe_dir.sh
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg nn_bench 1
+    set_namelist namelist_cfg ln_clobber .true.
+    set_namelist namelist_cfg jp_cfg $jp_cfg
+    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
+    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
+    set_namelist namelist_cfg jpni $jpni
+    set_namelist namelist_cfg jpnj $jpnj
+    set_namelist namelist_cfg jpnij $NPROC
+
+    set_xio_using_server iodef.xml $USING_MPMD
+    set_xio_file_type    iodef.xml multiple_file
+
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+fi
+
+done
Index: ils/CI/sette/README
===================================================================
--- /utils/CI/sette/README	(revision 11160)
+++ 	(revision )
@@ -1,81 +1,0 @@
-usage of SETTE package:
-
-principal script is sette.sh (usage: ./sette.sh) 
-
-VERY IMPORTANT : for a verbose debug do:
-./sette.sh 2>&1 | tee out.sette
-this create out.sette file in ${SETTE_DIR}
-
-USER MODIFICATIONS
- in sette.sh script :
-               COMPILER    : compiler among those available in NEMOGCM/ARCH, needed for makenemo (see below)
-                             can also be pass as an argument, e.g. ./sette.sh ifort_osx
-	       BATCH_COMMAND_PAR : command for job submission in batch mode parallel (MMIÂ)
-	       BATCH_COMMAND_SEQ : command for job submission in batch mode sequential (NB_PROC = 1)
-	       INTERACT_FLAG : "yes" if you want to run in interactive mode 
-	       		       "no" if you want to run in batch mode
-	       MPIRUN_FLAG   : "yes" if you want to run in parallel (MPI)
-			       "no" if you want to run in sequential mode (NB_PROC = 1)
-
-               makenemo -m : machine (compilator); see ./makenemo -m help (in NEMOGCM/CONFIG directory)
-                        -n : config name (in examples config_name_nproci_nprocj), see ./makenemo -n help
-                        -r : reference configuration (if you don't give it you have to choise directories to install)
-                        add_key : to add list of keys
-                        del_key : to del list of keys
-               and for more details and options of makenemo see ./makenemo -h
-
-	       set_namelist : to set namelist values 
-			(example : to set 75 time steps for one test : namelist nn_itend 75)
-			(        : to change cn_icerst_in name : namelist_ice cn_icerst_in  \"test_00101231_restart_icemod\")
-			(  	 : to activate control print : namelist ln_ctl false )
-	       prepare_exe_dir.sh creates execution directory for each test
-	       			  : NOTE for EACH JOB EXECUTION it is needed to set TEST_NAME variable
-				    TEST_NAME variable gives name to execution directory (created in prepare_exe_dir.sh)
-				    IT is mandatory to have different TEST_NAME for each job run if not existing files are re-written (for example namelist)
-
-               prepare_job.sh generates the script to be executed 
-			input: INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPIRUN_FLAG JOB_FILE
-
-               fcm_job.sh needs input: TOTAL_NUMBER_OF_PROCS_used JOB_FILE_NAME INTERACT_FLAG MPIRUN_FLAG 
-			(for example if you run with 4 procs JOB_FILE batch parallel 
-			and only run short test ===> ./fcm_job 4 SHORT no    yes   )
-
- in param.cfg :
-               FORCING_DIR 	   : directory in which will be found input.tar file (same name in input_CONFIG_NAME.cfg)
-               INPUT_DIR   	   : directory in which store input files (tar file)
-               TMPDIR      	   : temporary directory NEEDED ONLY FOR IBM machines (put EXP00 directory)
-	       NEMO_VALIDATION_DIR : directory in which create NEMO_VALIDATION tree, and store restart, run.stat, tracer.stat and ocean.output files in
-      			             tree NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
- in fcm_job.sh :
-               IMPORTANT : control that name of tar file in FORCING directory
-               is the same of that in input_REF_CONFIG.cfg, if not change one.
-
-               change in "RUN OPA" if [ ${INTERACT_FLAG} == "yes" ] mpirun command line (some examples are already written)
-	       NOTE: if INTERACT_FLAG="no" it is needed a batch_file (see below to create a new one)
-
-NOTE:
-in case of error you can remove you NEW_CONF directory and all files doing :
-./makenemo -n MY_CONFIG clean_config
-
-if you want recompile nemo but before you want to clean compiled code do :
-./makenemo clean
-
-and if you have already compiled you can re-run all sette.sh and compilation part will be by-passed.
-
-NOTE 2: 
-if you want a completly verbose makenemo you can uncomment "set -x" in makenemo script
-and then launch ./sette.sh 2>&1 | tee out.sette
-
-TO ADD NEW CONFIGURATION:
-1. makenemo -n NEW_CONFIG (see makenemo -h for help) OR
-2. makenemo -n NEW_CONFIG -r REF_CONFIG (if it is based on another reference configuration)
-3. for fcm_job.sh creates a new input_NEW_CONFIG.cfg if you need tar file (if you use same tar file of GYRE, ORCA2_LIM or ORCA2_LIM_PISCES you can use it)
-
-TO ADD NEW MACHINE:
-1. add arch-compiler.fcm in NEMOGCM/ARCH directory
-2. makenemo -m new_compiler  (see makenemo -h for help)
-
-TO ADD NEW BATCH-FILE:
-1. see in SETTE/BATCH_TEMPLATE directory existing examples
-2. create you own batch file like: batch-${COMPILER}
-(note: sette.sh will copy it in job_batch_template if you run tests in INTERACT_FLAG="no")
Index: /utils/CI/sette/README.rst
===================================================================
--- /utils/CI/sette/README.rst	(revision 11161)
+++ /utils/CI/sette/README.rst	(revision 11161)
@@ -0,0 +1,145 @@
+======================
+usage of SETTE package
+======================
+
+INSTALLATION
+============
+* checkout the code as follow:
+.. code-block:: console
+
+        $ svn checkout http://forge.ipsl.jussieu.fr/nemo/svn/utils/CI/sette sette
+
+* The sette directory have to be located in the main directory (at the same level as ``src/`` or ``cfg/``).
+
+MASTER SCRIPT: sette.sh 
+=======================
+* ``sette.sh`` is a simple wrapper that runs tests on the reference configurations, test cases and generates the report at the end.
+* ``sette.sh`` is able n option, to take a list of configurations in argument (sette.sh -t "CFG1 CFG2 CFG3"). 
+       - The list of available configurations is available in running ./sette_list_avail_cfg.sh.
+       - The default for sette is to run all of the reference and test configurations.
+* Users need to set up the ``param.cfg`` file correctly and download input files before running the script.
+
+SECONDARY SCRIPT
+================
+* ``sette_reference-configuration.sh`` runs sette tests on the reference configurations.
+* ``sette_test-cases.sh``              runs sette tests on test cases.
+* ``sette_list_avail_rev.sh``          generates a listing on all the revisions available in the validation directory for each configuration. 
+* ``sette_list_avail_cfg.sh``          generates a listing of all the available configurations.
+* ``sette_rpt.sh``                     generates the report.
+
+USER SETUP (recommended)
+========================
+* in ``param.cfg`` :
+      - variables (NEMO_VALIDATION_REF, NEMO_REV_REF) have to be specified in param.cfg
+      - variables SETTE_(COMPILER, USING_XIOS, USING_MPMD, JOB_PREFIX_MPMD, JOB_PREFIX_NOMPMD, BATCH_CMD, BATCH_STAT, BATCH_NAME, FORCING_DIR, SVN_CMD, NEMO_VALIDATION_DIR, ADD_NOSIGNEDZERO)
+        can be exported from your shell startup files. It is advise to setup the default value in your startup file if it doesn't fit your need.
+        If you prefer not doing so, you need to update the default initialisation
+      - variable NEMO_VALIDATION_DIR is sette by default in MAIN_DIR/NEMO_VALIDATION (this is to avoid overwritting results when running sette on different branches).
+      - description of variables listed in param.cfg (SETTE_):
+                
+        # reference version for bit reproducibility results
+          |  NEMO_VALIDATION_REF : reference directory
+          |  NEMO_REV_REF        : reference revision
+                
+        # compiler information
+          |  COMPILER            : compiler among those available in NEMOGCM/ARCH
+                
+        # XIOS management
+          |  USING_XIOS        : flag to control the activation of key_iomput. 
+                                "yes" to compile using key_iomput and link to the external XIOS library.
+                                "no"  to compile without key_iomput and link to the old IOIPSL library.
+          |  USING_MPMD        : flag to control the use of stand-alone IO servers 
+                                (requires USING_XIOS="yes").
+                                "yes" to run in MPMD (detached) mode with stand-alone IO servers.
+                                "no"  to run in SPMD (attached) mode without separate IO servers. 
+        # generique batch scrip prefix name if MPMD set to true/false
+           | JOB_PREFIX_MPMD
+           | JOB_PREFIX_NOMPMD
+                
+        # batch command needed
+           | BATCH_CMD           : command for job submission in batch mode
+           | BATCH_STAT          : command to check job status
+           | BATCH_NAME          : generic sette job name (as it appears with $BATCH_STAT command)
+                
+        # file storing
+           | FORCING_DIR         : directory where is stored input.tar file (same name in input_CONFIG_NAME.cfg)
+                                   reference configuration input tar file could be found here : https://zenodo.org/record/1472245
+           | NEMO_VALIDATION_DIR : directory where is stored restarts, run.stat, tracer.stat and ocean.output files for each configuration
+                                   ( NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE) )
+           | INPUT_DIR           : directory where is stored input files (DO NOT CHANGE IT)
+                
+        # misc.
+           | SVN_CMD             : svn command use to do svn info (default svn). Could be useful if you are using git svn
+                                 : Reference directory for result comparison will be NEMO_VALIDATION_REF/COMPILER/NEMO_REV_REF
+           | ADD_NODIGNEDZERO    : set "yes" if you need key_nosignedzero to run nemo
+
+USAGE of main scripts
+=====================
+* ``sette.sh``                : it is a simple wrapper to run tests on the reference configurations, test-cases and generate the report at the end.
+          - if no argument is given, sette run all the reference configurations and test cases 
+          - if a list of argument is provided (sette.sh -t "CFG1 CFG2 CFG3"), sette will only run these configurations. 
+             The list of available configurations is available in running ./sette_list_avail_cfg.sh.
+          - user need to set up the param.cfg file correctly and download input file before running the script.
+* ``sette_rpt.sh``            : it generates the sette report.
+          - if no argument is given, the report will be generated on the last changed revision.
+          - if an argument is given (revision number) the report will be generated for this revision only
+          - if 'old' is given as argument the former behavior is applied (the latest revision is check whatever the current revision
+          - it is possible to retreive all the available revision test using sette_list_avail_rev.sh
+          - XXXXX+ means sette results for revision XXXXX contain local modification in src/cfgs/test
+          - it is NOT possible to run sette_rpt.sh for a single configuration.
+* ``sette_list_avail_rev.sh`` : generate a listing on all the revisions available in the validation directory for each configuration.
+          - no argument needed
+          - XXXXX+ means sette results for revision XXXXX contain local modification in src/cfgs/test
+* ``sette_list_avail_cfg.sh`` : generate a listing of all the available configurations.
+          - no argument needed
+
+NOTES
+=====
+* compilation issues:
+   - in case of error you can remove your NEW_CONF directory and all files doing :
+
+     ::
+
+     $ ./makenemo -n MY_CONFIG clean_config
+
+   - if you want recompile nemo but before you want to clean compiled code do :
+
+     ::
+
+     ./makenemo clean
+
+   - if you have already compiled you can re-run all sette.sh and compilation part will be by-passed.
+
+* verbose sette output:
+   - if you want a completly verbose makenemo you can uncomment `set -x` in makenemo script
+     and then launch `./sette.sh 2>&1 | tee out.sette` . This creates out.sette file in ${SETTE_DIR}
+
+TO ADD NEW CONFIGURATION
+=========================
+1. creates a new ``input_NEW_CONFIG.cfg`` if you need tar file (if you use same tar file of GYRE, ORCA2_LIM or ORCA2_LIM_PISCES you can use it)
+2. add a bloc in one of the ``sette_reference-configuration.sh`` or ``sette_test-cases.sh`` script 
+3. add your configuration to the list in ``param.cfg``
+
+TO ADD NEW MACHINE
+===================
+1. add ``arch-compiler.fcm`` in ``NEMOGCM/ARCH`` directory
+2. makenemo -m new_compiler  (see makenemo -h for help)
+3. add new batch-file
+
+TO ADD NEW BATCH-FILE
+======================
+1. see in ``SETTE/BATCH_TEMPLATE`` directory existing examples
+2. create you own batch file like: ``batch-${COMPILER}`` file
+   (note: sette_test-cases.sh and ``sette_cfg-ref.sh`` will copy it in job_batch_template if you run tests in INTERACT_FLAG="no")
+
+EXTRA SETTING POSSIBLE
+======================
+Among the setting that can be modified by the user in sette_cfg-ref.sh and sette_test-cases.sh script,
+there are: sequential/parrallel (default), interacive or not (default) and mpi (default) or not.
+  - | BATCH_COMMAND_PAR is the command for job submission in batch mode parallel (specified in param.cfg).
+  - | BATCH_COMMAND_SEQ is the command for job submission in batch mode sequential (NB_PROC = 1).
+                     the default value is the BATCH_COMMAND_PAR value.
+  - | INTERACT_FLAG : "yes" if you want to run in interactive mode.
+                    "no"  if you want to run in batch mode (default).     
+  - | MPIRUN_FLAG   : "yes" if you want to run in parallel (MPI) (default).
+                    "no"  if you want to run in sequential mode (NB_PROC = 1).
Index: /utils/CI/sette/all_functions.sh
===================================================================
--- /utils/CI/sette/all_functions.sh	(revision 11160)
+++ /utils/CI/sette/all_functions.sh	(revision 11161)
@@ -90,4 +90,33 @@
 usage=" Usage : set_namelist input_namelist variable_name value"
 usage=" if value is a string ths is neede syntax : ./set_namelist namelist_name var_name \"new_value\" "
+
+# define validation dir
+set_valid_dir () {
+    LANG=en_US
+    REVISION_NB=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${SETTE_DIR}/.. | grep "Last Changed Rev" | awk '{print $NF}'`
+    if [ ${#REVISION_NB} -eq 0 ]
+    then
+        echo "some problems with ${SVN_CMD} info command"
+        echo "some problems with ${SVN_CMD} info command" >> ${SETTE_DIR}/output.sette
+        REVISION_NB=`date +%Y%m%d`
+        echo "put in ${REVISION_NB} date"
+        echo "put in ${REVISION_NB} date" >> ${SETTE_DIR}/output.sette
+    else
+    echo "value of revision number of NEMOGCM: ${REVISION_NB}"
+    fi
+    [ `${SVN_CMD} status -q ${SETTE_DIR}/../{cfg,tests,src} | wc -l` -ge 1 ] && REVISION_NB=${REVISION_NB}+
+    NEMO_VALID=${NEMO_VALIDATION_DIR}/W${NEW_CONF}/${CMP_NAM}/${REVISION_NB}/${TEST_NAME}
+}
+
+# clean valid dir (move old ocean_output/run.stat and tracer to avoid checking them in case something wrong happen.
+clean_valid_dir () {
+#   set_valid_dir # already done in sette_ref/sette_test
+   echo "validation directory is : $NEMO_VALID"
+   if [ -d $NEMO_VALID ] ; then
+      [ -f ${NEMO_VALID}/ocean.output ] && mv ${NEMO_VALID}/ocean.output ${NEMO_VALID}/ocean.output_old
+      [ -f ${NEMO_VALID}/run.stat ]     && mv ${NEMO_VALID}/run.stat     ${NEMO_VALID}/run.stat_old
+      [ -f ${NEMO_VALID}/tracer.stat ]  && mv ${NEMO_VALID}/tracer.stat  ${NEMO_VALID}/tracer.stat_old
+   fi
+}
 
 # function to set namelists parameters
@@ -141,7 +170,8 @@
 	fi
 
-        sed -e "s:${VAR_NAME}.*:${VAR_NAME}:" ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
+        ARGS_LST="${@:3}"
+        sed -e "s;${VAR_NAME}.*;${VAR_NAME};" ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
         mv ${EXE_DIR}/$1.tmp ${EXE_DIR}/$1
-        sed -e "s:${VAR_NAME}:$2=$3:"  ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
+        sed -e "s;${VAR_NAME};$2=${ARGS_LST};"  ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
         mv ${EXE_DIR}/$1.tmp ${EXE_DIR}/$1
 
@@ -154,4 +184,7 @@
 # function to tidy up after each test and populate the NEMO_VALIDATION store
 post_test_tidyup () {
+# Save current exit status of caller script 
+    RUN_STATUS=$? 
+    echo "Exit status: ${RUN_STATUS}" 
 #
 # requires the following variables defined and exported from the calling script:
@@ -168,5 +201,5 @@
 echo "EXECUTION directory is : ${EXE_DIR}"
 echo "CONFIG directory is : ${CONFIG_DIR}"
-echo "VALIDATION directory is : ${NEMO_VALIDATION_DIR}"
+echo "VALIDATION directory is : ${NEMO_VALID}"
 echo "NEW CONFIGURATION is : ${NEW_CONF}"
 echo "COMPILER is : ${CMP_NAM}"
@@ -175,8 +208,10 @@
 ################################################################
 # SMALL DEBUG
+    EXIT_STATUS=${RUN_STATUS}
     if [ ! -r ${EXE_DIR}/ocean.output ]
         then
         grep "E R R O R" ${EXE_DIR}/ocean.output && echo "Some ERRORS at execution time, see ${EXE_DIR}/ocean.output"
-        exit 2
+        EXIT_STATUS=2
+        # exit 2 Error now catch in the report 
     fi
 
@@ -185,5 +220,6 @@
         echo "file time.step does not exist"   >> ${SETTE_DIR}/output.sette
         echo "some problems during execution of model"  >> ${SETTE_DIR}/output.sette 
-        exit 1
+        EXIT_STATUS=1
+        # exit 1 Error now catch in the report
     else
         echo "file time.step exists"  >> ${SETTE_DIR}/output.sette
@@ -194,55 +230,54 @@
 
 ################################################################
+#
 # Creation of NEMO_VALIDATION tree
-    export LANG=en_US 
-    REVISION_NB=`svn info ${SETTE_DIR}/../.. | grep -i "Last Changed Rev:" | sed -e "s/ //g" | cut -d ":" -f 2`
-    if [ ${#REVISION_NB} -eq 0 ]
-    then
-    	echo "some problems with svn info command"
-    	echo "some problems with svn info command" >> ${SETTE_DIR}/output.sette
-    	REVISION_NB=`date +%Y%m%d`
-    	echo "put in ${REVISION_NB} date"
-    	echo "put in ${REVISION_NB} date" >> ${SETTE_DIR}/output.sette
-    else
-    echo "value of revision number of NEMOGCM: ${REVISION_NB}"
-    fi
-    cd ${NEMO_VALIDATION_DIR}
-    `mkdir -p ${NEMO_VALIDATION_DIR}/W${NEW_CONF}/${CMP_NAM}/${REVISION_NB}/${TEST_NAME}`
-    NEMO_VALID=${NEMO_VALIDATION_DIR}/W${NEW_CONF}/${CMP_NAM}/${REVISION_NB}/${TEST_NAME}
-    if [ -d ${NEMO_VALID} ] ; then
-	echo "created ${NEMO_VALID} directory"   >> ${SETTE_DIR}/output.sette
+#    set_valid_dir already done in sette_reference_config
+    mkdir -p ${NEMO_VALIDATION_DIR}
+    if [ -d ${NEMO_VALIDATION_DIR} ] ; then
+	echo "created ${NEMO_VALIDATION_DIR} directory"   >> ${SETTE_DIR}/output.sette
     else 
-	echo "problems in creating ${NEMO_VALID} directory"   >> ${SETTE_DIR}/output.sette
+	echo "problems in creating ${NEMO_VALIDATION_DIR} directory"   >> ${SETTE_DIR}/output.sette
 	echo "EXIT,"
 	exit 1
     fi
-    # Save output & debug files in NEMO_VALIDATION tree
+# 
+# Exit before populating validation directory if the model run has 
+# returned a non-zero exit status 
+# On CRAY NEMO exit is not the expected 999 or 123456 (let this bloc in case useful later on).
+#    case ${EXIT_STATUS} in
+#        0|123456|999) echo " NEMO finished with exit code $EXIT_STATUS " ; post_test_tidyup ;;
+#        *) echo " NEMO abort on an unexpected error (segmentation fault or whatever) $EXIT_STATUS "
+#    esac
+
+    [ ${EXIT_STATUS} -ne 0 ] && exit ${EXIT_STATUS}  
+#
+# Save output & debug files in NEMO_VALIDATION tree
     echo "saving ocean & ice output, run.stat, tracer.stat files ...." >> ${SETTE_DIR}/output.sette
     echo "            " >> ${SETTE_DIR}/output.sette
-    [ -f ${EXE_DIR}/ocean.output ] && cp ${EXE_DIR}/*ocean.output ${NEMO_VALID}/.
-    [ -f ${EXE_DIR}/run.stat ] && cp ${EXE_DIR}/*run.stat ${NEMO_VALID}/.
-    [ -f ${EXE_DIR}/output.namelist.dyn ] && cp ${EXE_DIR}/*output.nam* ${NEMO_VALID}/.
-    [ -f ${EXE_DIR}/tracer.stat ] && cp ${EXE_DIR}/*tracer.stat ${NEMO_VALID}/.
-
-    if [ -n "$(ls ${NEMO_VALID}/*run*)" ] ; then
-	echo "moved run.stat in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-	echo "moved run.stat in ${NEMO_VALID} directory"  
+    [ -f ${EXE_DIR}/ocean.output ] && cp ${EXE_DIR}/*ocean.output ${NEMO_VALIDATION_DIR}/.
+    [ -f ${EXE_DIR}/run.stat ] && cp ${EXE_DIR}/*run.stat ${NEMO_VALIDATION_DIR}/.
+    [ -f ${EXE_DIR}/output.namelist.dyn ] && cp ${EXE_DIR}/*output.nam* ${NEMO_VALIDATION_DIR}/.
+    [ -f ${EXE_DIR}/tracer.stat ] && cp ${EXE_DIR}/*tracer.stat ${NEMO_VALIDATION_DIR}/.
+
+    if [ -n "$(ls ${NEMO_VALIDATION_DIR}/*run*)" ] ; then
+	echo "moved run.stat in ${NEMO_VALIDATION_DIR} directory"  >> ${SETTE_DIR}/output.sette
+	echo "moved run.stat in ${NEMO_VALIDATION_DIR} directory"  
     else
-	echo "problem in looking for run.stat file in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-	echo "run.stat IS NOT in ${NEMO_VALID} directory" 
-    fi
-    if [ -n "$(ls ${NEMO_VALID}/*ocean.output*)" ] ; then
-	echo "moved ocean.output in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-	echo "moved ocean.output in ${NEMO_VALID} directory" 
+	echo "problem in looking for run.stat file in ${NEMO_VALIDATION_DIR} directory"  >> ${SETTE_DIR}/output.sette
+	echo "run.stat IS NOT in ${NEMO_VALIDATION_DIR} directory" 
+    fi
+    if [ -n "$(ls ${NEMO_VALIDATION_DIR}/*ocean.output*)" ] ; then
+	echo "moved ocean.output in ${NEMO_VALIDATION_DIR} directory"  >> ${SETTE_DIR}/output.sette
+	echo "moved ocean.output in ${NEMO_VALIDATION_DIR} directory" 
     else
-	echo "problem in looking for ocean.output file in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-	echo "ocean.output IS NOT in ${NEMO_VALID} directory" 
-    fi
-    if [ -n "$(ls ${NEMO_VALID}/*tracer.stat*)" ] ; then
-        echo "moved tracer.stat in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-        echo "moved tracer.stat in ${NEMO_VALID} directory"
+	echo "problem in looking for ocean.output file in ${NEMO_VALIDATION_DIR} directory"  >> ${SETTE_DIR}/output.sette
+	echo "ocean.output IS NOT in ${NEMO_VALIDATION_DIR} directory" 
+    fi
+    if [ -n "$(ls ${NEMO_VALIDATION_DIR}/*tracer.stat*)" ] ; then
+        echo "moved tracer.stat in ${NEMO_VALIDATION_DIR} directory"  >> ${SETTE_DIR}/output.sette
+        echo "moved tracer.stat in ${NEMO_VALIDATION_DIR} directory"
     else
-        echo "problem in looking for tracer.stat file in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-        echo "tracer.stat IS NOT in ${NEMO_VALID} directory"
+        echo "problem in looking for tracer.stat file in ${NEMO_VALIDATION_DIR} directory"  >> ${SETTE_DIR}/output.sette
+        echo "tracer.stat IS NOT in ${NEMO_VALIDATION_DIR} directory"
     fi
 }
Index: /utils/CI/sette/param.cfg
===================================================================
--- /utils/CI/sette/param.cfg	(revision 11160)
+++ /utils/CI/sette/param.cfg	(revision 11161)
@@ -1,8 +1,71 @@
-#- forcing files storing
-FORCING_DIR=$WORKDIR/FORCING
-#- input files storing
+# Computer/user dependant variable needed to run sette
+#
+# REFERENCE run.stat tracer.stat you want to compare with
+# (if no change to the default, no check on result change will be done)
+NEMO_VALIDATION_REF=/path/to/reference/sette/results
+NEMO_REV_REF=0000
+#
+# ------------------------------------------------------------------------------------------
+# IMPORTANT:
+# variables (COMPILER, USING_XIOS, USING_MPMD, BATCH_CMD, BATCH_STAT, BATCH_NAME, FORCING_DIR, SVN_CMD, ADD_NOSIGNEDZERO)
+# can be exported from your shell startup files. 
+# If it is the case, nothing to do
+# otherwise, you need to update the default initialisation
+#
+# ADVISE: setup the default value in your startup file if it doesn't fit your need for at least
+# SETTE_COMPILER, SETTE_BATCH_CMD, SETTE_BATCH_STAT, SETTE_BATCH_NAME, SETTE_FORCING_DIR, 
+#
+# ------------------------------------------------------------------------------------------
+# COMPILER setting
+# Compiler among those in NEMOGCM/ARCH
+COMPILER=${SETTE_COMPILER:-XXXXXXXX}
+# ------------------------------------------------------------------------------------------
+#
+# BATCH command
+# command to submit a job
+BATCH_CMD=${SETTE_BATCH_CMD:-llsubmit}
+# command to check job status
+BATCH_STAT=${SETTE_BATCH_STAT:-llq}
+# generic sette job name (as it appears with $BATCH_STAT command)
+BATCH_NAME=${SETTE_BATCH_NAME:-sette}
+# ------------------------------------------------------------------------------------------
+#
+# FILES STORING paths
+# forcing files storing
+FORCING_DIR=${SETTE_FORCING_DIR:-$WORKDIR/FORCING}
+# validation files storing
+NEMO_VALIDATION_DIR=${SETTE_NEMO_VALIDATION_DIR:-$MAIN_DIR}/NEMO_VALIDATION
+# input files storing (namelist, iodef ...) (DO NOT CHANGE)
 INPUT_DIR=${CONFIG_DIR}/${NEW_CONF}/EXP00
+# ------------------------------------------------------------------------------------------
+#
+# RUN set up
+# USING_XIOS        : flag to control the activation of key_iomput
+#                      "yes" to compile using key_iomput and link to the external XIOS library
+#                      "no"  to compile without key_iomput and link to the old IOIPSL library
+USING_XIOS=${SETTE_XIOS:-"yes"}
+# USING_MPMD        : flag to control the use of stand-alone IO servers
+#                     requires USING_XIOS="yes"
+#                      "yes" to run in MPMD (detached) mode with stand-alone IO servers
+#                      "no"  to run in SPMD (attached) mode without separate IO servers 
+# MPMD
+USING_MPMD=${SETTE_MPMD:-"no"}
+# generique batch scrip prefix name if MPMD set to true/false
+JOB_PREFIX_MPMD=${SETTE_JOB_PREFIX_MPMD:-batch-mpmd}
+JOB_PREFIX_NOMPMD=${SETTE_JOB_PREFIX_NOMPMD:-batch}
+# ------------------------------------------------------------------------------------------
+#
+# MISCELENIOUS
+# command for svn (some people use git svn) 
+# used in sette_rpt and in all_function to display revision and build correct repository name
+SVN_CMD=${SETTE_SVN_CMD:-svn}
+# add key key_nosignedzero at the compilation step
+ADD_NOSIGNEDZERO=${SETTE_ADD_NOSIGNEDZERO:-"yes"}
 #- only for IBM
 #TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00
-#- VALIDATION files storing
-NEMO_VALIDATION_DIR=$WORKDIR/NEMO_VALIDATION
+# ------------------------------------------------------------------------------------------
+#
+# LIST OF CONFIGURATIONS
+# to be updated if you added an new configuration in sette_test-cases.sh or sette_reference-configuration.sh
+TEST_CONFIGS=${SETTE_TEST_CONFIGS:-"ORCA2_ICE_PISCES ORCA2_OFF_PISCES AMM12 AGRIF SPITZ12 GYRE_PISCES SAS ORCA2_ICE_OBS ICE_AGRIF OVERFLOW LOCK_EXCHANGE VORTEX ISOMIP"}
+# ------------------------------------------------------------------------------------------
Index: /utils/CI/sette/prepare_exe_dir.sh
===================================================================
--- /utils/CI/sette/prepare_exe_dir.sh	(revision 11160)
+++ /utils/CI/sette/prepare_exe_dir.sh	(revision 11161)
@@ -68,4 +68,6 @@
 mkdir -p ${NEW_CONF}/${TEST_NAME}
 
+# PREPARE EXEC_DIR
+#==================
 export EXE_DIR=${CONFIG_DIR}/${NEW_CONF}/${TEST_NAME}
 
Index: /utils/CI/sette/prepare_job.sh
===================================================================
--- /utils/CI/sette/prepare_job.sh	(revision 11160)
+++ /utils/CI/sette/prepare_job.sh	(revision 11161)
@@ -94,4 +94,5 @@
 JOB_FILE=$5
 NXIO_PROC=$6
+NEMO_VALID=$7
 
 # export EXE_DIR. This directory is used to execute model 
@@ -303,5 +304,5 @@
              -e"s:DEF_TOOLS_DIR:${TOOLS_DIR}:" \
              -e"s:MPI_FLAG:${MPI_FLAG}:" \
-             -e"s:DEF_NEMO_VALIDATION:${NEMO_VALIDATION_DIR}:" -e"s:DEF_NEW_CONF:${NEW_CONF}:" \
+             -e"s:DEF_NEMO_VALIDATION:${NEMO_VALID}:" -e"s:DEF_NEW_CONF:${NEW_CONF}:" \
              -e"s:DEF_CMP_NAM:${CMP_NAM}:" -e"s:DEF_TEST_NAME:${TEST_NAME}:" > run_sette_test.job
 
Index: /utils/CI/sette/sette.sh
===================================================================
--- /utils/CI/sette/sette.sh	(revision 11160)
+++ /utils/CI/sette/sette.sh	(revision 11161)
@@ -1,1467 +1,72 @@
-#!/bin/bash
-############################################################
-# Author : Simona Flavoni for NEMO
-# Contact: sflod@locean-ipsl.upmc.fr
-# 2013   : A.C. Coward added options for testing with XIOS in dettached mode
+#!/bin/sh
+# initialise user dependent variable
+SETTE_DIR=$(cd $(dirname "$0"); pwd)
+MAIN_DIR=$(dirname $SETTE_DIR)
+
+# Parse command-line arguments
 #
-# sette.sh   : principal script of SET TEsts for NEMO (SETTE)
-# ----------------------------------------------------------------------
-# NEMO/SETTE , NEMO Consortium (2010)
-# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-# ----------------------------------------------------------------------
-#
-#############################################################
-#set -vx
-set -o posix
-#set -u
-#set -e
-# ===========
-# DESCRIPTION
-# ===========
-#
-# Variables to be checked by user:
-#
-# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory 
-# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
-# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs  
-# INTERACT_FLAG     : flag to run in interactive mode "yes"
-#                           to run in batch mode "no"
-# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
-#                           to run in sequential mode (NB_PROC = 1) "no"
-# USING_XIOS        : flag to control the activation of key_iomput
-#                      "yes" to compile using key_iomput and link to the external XIOS library
-#                      "no"  to compile without key_iomput and link to the old IOIPSL library
-# USING_MPMD        : flag to control the use of stand-alone IO servers
-#                     requires USING_XIOS="yes"
-#                      "yes" to run in MPMD (detached) mode with stand-alone IO servers
-#                      "no"  to run in SPMD (attached) mode without separate IO servers 
-# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
-#                     set to zero if USING_MPMD="no"
-#
-# Principal script is sette.sh, that calls 
-#
-#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe 
-#              and links to nemo in ${CONFIG_NAME}/EXP00)
-#
-#  param.cfg : sets and loads following directories:
-#
-#   FORCING_DIR         : is the directory for forcing files (tarfile)
-#   INPUT_DIR           : is the directory for input files storing 
-#   TMPDIR              : is the temporary directory (if needed)
-#   NEMO_VALIDATION_DIR : is the validation directory
-#
-#   (NOTE: this file is the same for all configrations to be tested with sette)
-#
-#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
-#   set_namelist     : function declared in all_functions that sets namelist parameters 
-#   post_test_tidyup : creates validation storage directory and copies required output files 
-#                      (run.stat and ocean.output) in it after execution of test.
-#
-#  VALIDATION tree is:
-#
-#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
-#
-#  prepare_exe_dir.sh : defines and creates directory where the test is executed
-#                       execution directory takes name of TEST_NAME defined for every test 
-#                       in sette.sh. (each test in executed in its own directory)
-#
-#  prepare_job.sh     : to generate the script run_job.sh
-#
-#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
-#                        see sette.sh and BATCH_TEMPLATE directory
-#
-#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which 
-#        can be found paths to the input tar file)
-#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} 
-#        directory
-#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists 
-#        remain in ${NEW_CONF}/EXP00
-# 
-#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of 
-#        executed commands
-#
-#  NOTE: if sette.sh is stopped in output.sette there is written the last command 
-#        executed by sette.sh
-#
-# example use: ./sette.sh 
-#########################################################################################
-#
-# Compiler among those in NEMOGCM/ARCH
-COMPILER=X64_ADA
+#  -t "test configurations": select active test configurations
+#                            (overrides selection made using
+#                            environment variable SETTE_TEST_CONFIGS)
 
-export BATCH_COMMAND_PAR="llsubmit"
-export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR 
-export INTERACT_FLAG="no"
-export MPIRUN_FLAG="yes"
-export USING_XIOS="yes"
-export USING_ICEBERGS="yes"
-#
-export DEL_KEYS="key_iomput"
-if [ ${USING_XIOS} == "yes" ] 
- then 
-   export DEL_KEYS=""
-fi
-#
-# Settings which control the use of stand alone servers (only relevant if using xios)
-#
-export USING_MPMD="no"
-export NUM_XIOSERVERS=4
-export JOB_PREFIX=batch-mpmd
-#
-if [ ${USING_MPMD} == "no" ] 
- then
-   export NUM_XIOSERVERS=0
-   export JOB_PREFIX=batch
-fi
-#
-#
-if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no" ]
- then
-   echo "Incompatible choices. MPMD mode requires the XIOS server"
-   exit
+if [ $# -gt 0 ]; then
+  while getopts :ht: option; do 
+     case $option in
+        t) export SETTE_TEST_CONFIGS=$OPTARG
+           echo ""
+           echo "Configuration $SETTE_TEST_CONFIGS will be tested if they are available"
+           echo "" ;;
+        h | *) echo 'sette.sh allow no arguments (all configuration will be tested or -t "CFG1_to_test CFG2_to_test ..."'; exit 42 ;;
+     esac
+  done
+  shift $((OPTIND - 1))
 fi
 
-# Directory to run the tests
-SETTE_DIR=$(cd $(dirname "$0"); pwd)
-MAIN_DIR=$(dirname $SETTE_DIR)
-CONFIG_DIR0=${MAIN_DIR}/cfgs
-TOOLS_DIR=${MAIN_DIR}/tools
+. ./param.cfg
 
-CMP_NAM=${1:-$COMPILER}
-# Copy job_batch_COMPILER file for specific compiler into job_batch_template
-cd ${SETTE_DIR}
-cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit
-# Description of configuration tested:
-# GYRE_PISCES       :  1 
-# ORCA2_ICE_PISCES  :  2 
-# ORCA2_OFF_PISCES  :  3 
-# AMM12             :  4 
-# SAS               :  5
-# ORCA2_ICE_OBS     :  6
-# AGRIF             :  7 & 8  test AGRIF in a double zoom configuration in the nordic seas + 1 zoom in the eq. Pacific (AGRIF_DEMO)
-#                               and check that key_agrif without zoom = no key_agrif
-# SPITZ12           :  9      regional configuration including sea-ice and tides (Spitzbergen)
-
-for config in 1 2 3 4 5 6 7 8 9
-do
-
-# -----------
-# GYRE_PISCES
-# -----------
-if [ ${config} -eq 1 ] ;  then
-## Restartability tests for GYRE_PISCES
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n GYRE_PISCES_ST -r GYRE_PISCES -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=8
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}  
-    set_namelist namelist_cfg cn_exp \"GYREPIS_LONG\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 1080
-    set_namelist namelist_cfg nn_stock  540
-    set_namelist namelist_cfg ln_linssh .true.
-    set_namelist namelist_cfg jpni 2
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYREPIS_SHORT\"
-    set_namelist namelist_cfg nn_it000 541
-    set_namelist namelist_cfg nn_itend 1080
-    set_namelist namelist_cfg nn_stock 540
-    set_namelist namelist_cfg ln_rstart .true.
-    set_namelist namelist_cfg nn_rstctl 2
-    set_namelist namelist_cfg ln_linssh .true.
-    set_namelist namelist_cfg jpni 2
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_top_cfg ln_rsttr .true.
-    set_namelist namelist_top_cfg nn_rsttr 2
-    set_namelist namelist_cfg cn_ocerst_in \"GYREPIS_LONG_00000540_restart\"
-    set_namelist namelist_top_cfg cn_trcrst_in \"GYREPIS_LONG_00000540_restart_trc\"
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/GYREPIS_LONG_00000540_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/GYREPIS_LONG_00000540_restart_trc_${L_NPROC}.nc .
-    done
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests for GYRE_PISCES
-    export TEST_NAME="REPRO_2_4"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=8
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYREPIS_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 1080
-    set_namelist namelist_cfg ln_linssh .true.
-    set_namelist namelist_cfg jpni 2
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_4_2"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=8
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYREPIS_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 1080
-    set_namelist namelist_cfg ln_linssh .true.
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 2
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
+# run sette on reference configuration
+./sette_reference-configurations.sh
+if [[ $? != 0 ]]; then
+   echo ""
+   echo "--------------------------------------------------------------"
+   echo "./sette_cfg-ref.sh didn't finish properly, need investigations"
+   echo "--------------------------------------------------------------"
+   echo ""
+   exit 42
 fi
 
-# -----------------
-# ORCA2_ICE_PISCES
-# -----------------
-if [ ${config} -eq 2 ] ;  then
-## Restartability tests for ORCA2_ICE_PISCES
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_PISCES_ST -r ORCA2_ICE_PISCES -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"O2L3P_LONG\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 1000
-    set_namelist namelist_cfg nn_stock 500
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_use_calving .true.
-    set_namelist namelist_cfg ln_wave .true.
-    set_namelist namelist_cfg ln_cdgw .true.
-    set_namelist namelist_cfg ln_sdw  .true.
-    set_namelist namelist_cfg nn_sdrift 1
-    set_namelist namelist_cfg ln_stcor .true.
-    set_namelist namelist_cfg ln_tauwoc .true.
-    #
-    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    #
-    set_namelist namelist_ice_cfg ln_icediachk .true.
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"O2L3P_SHORT\"
-    set_namelist namelist_cfg nn_it000 501
-    set_namelist namelist_cfg nn_itend 1000
-    set_namelist namelist_cfg nn_stock 500
-    set_namelist namelist_cfg ln_rstart .true.
-    set_namelist namelist_cfg nn_rstctl 2
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg nn_test_icebergs -1
-    set_namelist namelist_cfg ln_wave .true.
-    set_namelist namelist_cfg ln_cdgw .true.
-    set_namelist namelist_cfg ln_sdw  .true.
-    set_namelist namelist_cfg nn_sdrift 1
-    set_namelist namelist_cfg ln_stcor .true.
-    set_namelist namelist_cfg ln_tauwoc .true.
-    #
-    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    #
-    set_namelist namelist_ice_cfg ln_icediachk .true.
-    set_namelist namelist_top_cfg ln_rsttr .true.
-    set_namelist namelist_top_cfg nn_rsttr 2
-    set_namelist namelist_cfg cn_ocerst_in \"O2L3P_LONG_00000500_restart\"
-    set_namelist namelist_top_cfg cn_trcrst_in \"O2L3P_LONG_00000500_restart_trc\"
-    set_namelist namelist_ice_cfg cn_icerst_in \"O2L3P_LONG_00000500_restart_ice\"
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/O2L3P_LONG_00000500_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/O2L3P_LONG_00000500_restart_trc_${L_NPROC}.nc .
-        ln -sf ../LONG/O2L3P_LONG_00000500_restart_ice_${L_NPROC}.nc .
-        if [ ${USING_ICEBERGS} == "yes" ]
-            then
-             ln -sf ../LONG/O2L3P_LONG_icebergs_00000500_restart_${L_NPROC}.nc O2L3P_LONG_00000500_restart_icebergs_${L_NPROC}.nc
-        fi
-    done
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests for ORCA2_ICE_PISCES
-    export TEST_NAME="REPRO_4_8"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"O2L3P_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 1000
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_wave .true.
-    set_namelist namelist_cfg ln_cdgw .true.
-    set_namelist namelist_cfg ln_sdw  .true.
-    set_namelist namelist_cfg nn_sdrift 1
-    set_namelist namelist_cfg ln_stcor .true.
-    set_namelist namelist_cfg ln_tauwoc .true.
-
-    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_8_4"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"O2L3P_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 1000
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_wave .true.
-    set_namelist namelist_cfg ln_cdgw .true.
-    set_namelist namelist_cfg ln_sdw  .true.
-    set_namelist namelist_cfg nn_sdrift 1
-    set_namelist namelist_cfg ln_stcor .true.
-    set_namelist namelist_cfg ln_tauwoc .true.
-    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+# run sette on test cases
+./sette_test-cases.sh
+if [[ $? != 0 ]]; then
+   echo ""
+   echo "-----------------------------------------------------------------"
+   echo "./sette_test-cases.sh didn't finish properly, need investigations"
+   echo "-----------------------------------------------------------------"
+   echo ""
+   exit 42
 fi
 
-# ----------------
-# ORCA2_OFF_PISCES
-# ----------------
-if [ ${config} -eq 3 ] ;  then
-## Restartability tests for ORCA2_OFF_PISCES
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n ORCA2_OFF_PISCES_ST -r ORCA2_OFF_PISCES -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"OFFP_LONG\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 380
-    set_namelist namelist_cfg nn_stock 190
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_qsr_rgb .true.
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"OFFP_SHORT\"
-    set_namelist namelist_cfg nn_it000 191
-    set_namelist namelist_cfg nn_itend 380
-    set_namelist namelist_cfg nn_stock 190
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_qsr_rgb .true.
-    set_namelist namelist_top_cfg ln_rsttr .true.
-    set_namelist namelist_top_cfg nn_rsttr 2
-    set_namelist namelist_top_cfg cn_trcrst_in \"OFFP_LONG_00000190_restart_trc\"
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/OFFP_LONG_00000190_restart_trc_${L_NPROC}.nc .
-    done
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME}  ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests for ORCA2_OFF_PISCES
-    export TEST_NAME="REPRO_4_8"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"OFFP_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 380
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_qsr_rgb .true.
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_8_4"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"OFFP_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 380
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_qsr_rgb .true.
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    # put ln_pisdmp to false : no restoring to global mean value
-    set_namelist namelist_pisces_cfg ln_pisdmp .false. 
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-fi
-
-# -----
-# AMM12
-# -----
-if [ ${config} -eq 4 ] ;  then
-    ## Restartability tests for AMM12
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n AMM12_ST -r AMM12 -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AMM12_LONG\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 576
-    set_namelist namelist_cfg nn_stock 288
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AMM12_SHORT\"
-    set_namelist namelist_cfg nn_it000 289
-    set_namelist namelist_cfg nn_itend 576
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg ln_rstart .true.
-    set_namelist namelist_cfg nn_rstctl 2
-    set_namelist namelist_cfg cn_ocerst_in \"AMM12_LONG_00000288_restart\"
-    set_namelist namelist_cfg nn_date0 20120102
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/AMM12_LONG_00000288_restart_${L_NPROC}.nc .
-    done
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests for AMM12
-    export TEST_NAME="REPRO_8_4"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AMM12_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 576
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_4_8"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AMM12_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 576
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-fi
-
-
-# ---------
-# ORCA2_SAS
-# ---------
-if [ ${config} -eq 5 ] ;  then
-## Restartability tests
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n ORCA2_SAS_ICE_ST -r ORCA2_SAS_ICE -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"SAS\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 240
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_ice_cfg ln_icediachk .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"SAS\"
-    set_namelist namelist_cfg nn_it000 121
-    set_namelist namelist_cfg nn_itend 240
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg ln_rstart .true.
-    set_namelist namelist_cfg nn_rstctl 2
-    set_namelist namelist_cfg nn_date0 010109
-    set_namelist namelist_cfg cn_ocerst_in \"SAS_00000120_restart\"
-    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_00000120_restart_ice\"
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/SAS_00000120_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/SAS_00000120_restart_ice_${L_NPROC}.nc .
-    done
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests
-    export TEST_NAME="REPRO_4_8"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"SAS_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 75
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_8_4"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"SAS_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 75
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-fi
-
-
-# --------------
-# ORCA2_ICE_OBS
-# --------------
-## Test assimilation interface code, OBS and ASM for reproducibility
-## Restartability not tested (ASM code not restartable while increments are being applied)
-if [ ${config} -eq 6 ] ; then
-## Reproducibility tests
-    export TEST_NAME="REPRO_4_8"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_OBS_ST -r ORCA2_ICE_PISCES -d "OCE ICE"  -j 8 add_key "key_asminc" del_key "key_top"
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"O2L3OBS_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 75
-    set_namelist namelist_cfg ln_read_cfg .true.
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_diaobs .true.
-    set_namelist namelist_cfg ln_t3d .true.
-    set_namelist namelist_cfg ln_s3d .true.
-    set_namelist namelist_cfg ln_sst .true.
-    set_namelist namelist_cfg ln_sla .true.
-    set_namelist namelist_cfg ln_sic .true.
-    set_namelist namelist_cfg ln_vel3d .true.
-    set_namelist namelist_cfg ln_bkgwri .true.
-    set_namelist namelist_cfg ln_trainc .true.
-    set_namelist namelist_cfg ln_dyninc .true.
-    set_namelist namelist_cfg ln_sshinc .true.
-    set_namelist namelist_cfg ln_asmiau .true.
-    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
-    set_namelist namelist_top_cfg ln_trcdta .false. 
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-   cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_8_4"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"O2L3OBS_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 75
-    set_namelist namelist_cfg ln_read_cfg .true.
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    set_namelist namelist_cfg ln_diaobs .true.
-    set_namelist namelist_cfg ln_t3d .true.
-    set_namelist namelist_cfg ln_s3d .true.
-    set_namelist namelist_cfg ln_sst .true.
-    set_namelist namelist_cfg ln_sla .true.
-    set_namelist namelist_cfg ln_sic .true.
-    set_namelist namelist_cfg ln_vel3d .true.
-    set_namelist namelist_cfg ln_bkgwri .true.
-    set_namelist namelist_cfg ln_trainc .true.
-    set_namelist namelist_cfg ln_dyninc .true.
-    set_namelist namelist_cfg ln_sshinc .true.
-    set_namelist namelist_cfg ln_asmiau .true.
-    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
-    set_namelist namelist_top_cfg ln_trcdta .false.
-    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
-    # if not you need input files, and for tests is not necessary
-    set_namelist namelist_pisces_cfg ln_presatm .false.
-    set_namelist namelist_pisces_cfg ln_varpar .false.
-    set_namelist namelist_pisces_cfg ln_dust .false.
-    set_namelist namelist_pisces_cfg ln_solub .false.
-    set_namelist namelist_pisces_cfg ln_river .false.
-    set_namelist namelist_pisces_cfg ln_ndepo .false.
-    set_namelist namelist_pisces_cfg ln_ironsed .false.
-    set_namelist namelist_pisces_cfg ln_ironice .false.
-    set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-fi
-
-# ------------
-# AGRIF ICE
-# -----------
-if [ ${config} -eq 7 ] ;  then
-## Restartability tests
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_ST -r AGRIF_DEMO -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=16
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AGRIF_LONG\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 20
-    set_namelist namelist_cfg nn_stock 10
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 1_namelist_cfg cn_exp \"AGRIF_LONG\"
-    set_namelist 1_namelist_cfg nn_it000 1
-    set_namelist 1_namelist_cfg nn_itend 20
-    set_namelist 1_namelist_cfg nn_stock 10
-    set_namelist 1_namelist_cfg ln_ctl .false.
-    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 2_namelist_cfg cn_exp \"AGRIF_LONG\"
-    set_namelist 2_namelist_cfg nn_it000 1
-    set_namelist 2_namelist_cfg nn_itend 80
-    set_namelist 2_namelist_cfg nn_stock 40
-    set_namelist 2_namelist_cfg ln_ctl .false.
-    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 3_namelist_cfg cn_exp \"AGRIF_LONG\"
-    set_namelist 3_namelist_cfg nn_it000 1
-    set_namelist 3_namelist_cfg nn_itend 240
-    set_namelist 3_namelist_cfg nn_stock 120
-    set_namelist 3_namelist_cfg ln_ctl .false.
-    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
-
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AGRIF_SHORT\"
-    set_namelist namelist_cfg nn_it000 11
-    set_namelist namelist_cfg nn_itend 20
-    set_namelist namelist_cfg nn_stock 10
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg ln_rstart .true.
-    set_namelist namelist_cfg nn_rstctl 2
-    set_namelist 1_namelist_cfg cn_exp \"AGRIF_SHORT\"
-    set_namelist 1_namelist_cfg nn_it000 11
-    set_namelist 1_namelist_cfg nn_itend 20
-    set_namelist 1_namelist_cfg nn_stock 10
-    set_namelist 1_namelist_cfg ln_ctl .false.
-    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 1_namelist_cfg ln_rstart .true.
-    set_namelist 1_namelist_cfg nn_rstctl 2
-    set_namelist 2_namelist_cfg cn_exp \"AGRIF_SHORT\"
-    set_namelist 2_namelist_cfg nn_it000 41
-    set_namelist 2_namelist_cfg nn_itend 80
-    set_namelist 2_namelist_cfg nn_stock 40
-    set_namelist 2_namelist_cfg ln_ctl .false.
-    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 2_namelist_cfg ln_rstart .true.
-    set_namelist 2_namelist_cfg nn_rstctl 2
-    set_namelist 3_namelist_cfg cn_exp \"AGRIF_SHORT\"
-    set_namelist 3_namelist_cfg nn_it000 121
-    set_namelist 3_namelist_cfg nn_itend 240
-    set_namelist 3_namelist_cfg nn_stock 120
-    set_namelist 3_namelist_cfg ln_ctl .false.
-    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 3_namelist_cfg ln_rstart .true.
-    set_namelist 3_namelist_cfg nn_rstctl 2
-    set_namelist namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000010_restart\"
-    set_namelist namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000010_restart_ice\"
-    set_namelist 1_namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000010_restart\"
-    set_namelist 1_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000010_restart_ice\"
-    set_namelist 2_namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000040_restart\"
-    set_namelist 2_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000040_restart_ice\"
-    set_namelist 3_namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000120_restart\"
-    set_namelist 3_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000120_restart_ice\"
-
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/AGRIF_LONG_00000010_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/AGRIF_LONG_00000010_restart_ice_${L_NPROC}.nc .
-        ln -sf ../LONG/1_AGRIF_LONG_00000010_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/1_AGRIF_LONG_00000010_restart_ice_${L_NPROC}.nc .
-        ln -sf ../LONG/2_AGRIF_LONG_00000040_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/2_AGRIF_LONG_00000040_restart_ice_${L_NPROC}.nc .
-        ln -sf ../LONG/3_AGRIF_LONG_00000120_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/3_AGRIF_LONG_00000120_restart_ice_${L_NPROC}.nc .
-    done
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests
-    export TEST_NAME="REPRO_4_8"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AGRIF_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 20
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 1_namelist_cfg cn_exp \"AGRIF_48\"
-    set_namelist 1_namelist_cfg nn_it000 1
-    set_namelist 1_namelist_cfg nn_itend 20
-    set_namelist 1_namelist_cfg jpni 4
-    set_namelist 1_namelist_cfg jpnj 8
-    set_namelist 1_namelist_cfg ln_ctl .false.
-    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 2_namelist_cfg cn_exp \"AGRIF_48\"
-    set_namelist 2_namelist_cfg nn_it000 1
-    set_namelist 2_namelist_cfg nn_itend 80
-    set_namelist 2_namelist_cfg jpni 4
-    set_namelist 2_namelist_cfg jpnj 8
-    set_namelist 2_namelist_cfg ln_ctl .false.
-    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 3_namelist_cfg cn_exp \"AGRIF_48\"
-    set_namelist 3_namelist_cfg nn_it000 1
-    set_namelist 3_namelist_cfg nn_itend 240
-    set_namelist 3_namelist_cfg jpni 4
-    set_namelist 3_namelist_cfg jpnj 8
-    set_namelist 3_namelist_cfg ln_ctl .false.
-    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
-
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_8_4"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"AGRIF_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 20
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 1_namelist_cfg cn_exp \"AGRIF_84\"
-    set_namelist 1_namelist_cfg nn_it000 1
-    set_namelist 1_namelist_cfg nn_itend 20
-    set_namelist 1_namelist_cfg jpni 8
-    set_namelist 1_namelist_cfg jpnj 4
-    set_namelist 1_namelist_cfg ln_ctl .false.
-    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 2_namelist_cfg cn_exp \"AGRIF_84\"
-    set_namelist 2_namelist_cfg nn_it000 1
-    set_namelist 2_namelist_cfg nn_itend 80
-    set_namelist 2_namelist_cfg jpni 8
-    set_namelist 2_namelist_cfg jpnj 4
-    set_namelist 2_namelist_cfg ln_ctl .false.
-    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist 3_namelist_cfg cn_exp \"AGRIF_84\"
-    set_namelist 3_namelist_cfg nn_it000 1
-    set_namelist 3_namelist_cfg nn_itend 240
-    set_namelist 3_namelist_cfg jpni 8
-    set_namelist 3_namelist_cfg jpnj 4
-    set_namelist 3_namelist_cfg ln_ctl .false.
-    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
-    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
-
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## test code corruption with AGRIF (phase 1) ==> Compile with key_agrif but run with no zoom
-    export TEST_NAME="ORCA2"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"ORCA2\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 150
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-
-#   Set the number of fine grids to zero:    
-    sed -i "1s/.*/0/" ${EXE_DIR}/AGRIF_FixedGrids.in
-
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-fi
-
-
-## test code corruption with AGRIF (phase 2) ==> Compile without key_agrif (to be compared with AGRIF_DEMO_ST/ORCA2)
-if [ ${config} -eq 8 ] ;  then
-    export TEST_NAME="ORCA2"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_NOAGRIF_ST -r AGRIF_DEMO -j 8 del_key "key_agrif"
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"ORCA2\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 150
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-#
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-fi
-
-# -------
-# SPITZ12
-# -------
-if [ ${config} -eq 9 ] ;  then
-## Restartability tests
-    export TEST_NAME="LONG"
-    cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n SPITZ12_ST -r SPITZ12 -j 8 del_key ${DEL_KEYS}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"S12_LONG\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 240
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg nn_date0 20020101
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    #set_namelist namelist_ice_cfg ln_icediachk .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    
-    cd ${SETTE_DIR}
-    export TEST_NAME="SHORT"
-    . ./prepare_exe_dir.sh
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"S12_SHORT\"
-    set_namelist namelist_cfg nn_it000 121
-    set_namelist namelist_cfg nn_itend 240
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg ln_rstart .true.
-    set_namelist namelist_cfg nn_rstctl 2
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    set_namelist namelist_cfg cn_ocerst_in \"S12_LONG_00000120_restart\"
-    set_namelist namelist_ice_cfg cn_icerst_in \"S12_LONG_00000120_restart_ice\"
-    for (( i=1; i<=$NPROC; i++)) ; do
-        L_NPROC=$(( $i - 1 ))
-        L_NPROC=`printf "%04d\n" ${L_NPROC}`
-        ln -sf ../LONG/S12_LONG_00000120_restart_${L_NPROC}.nc .
-        ln -sf ../LONG/S12_LONG_00000120_restart_ice_${L_NPROC}.nc .
-    done
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-## Reproducibility tests
-    export TEST_NAME="REPRO_4_8"
-    cd ${MAIN_DIR}
-    cd ${SETTE_DIR}
-    . ./param.cfg
-    . ./all_functions.sh
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"S12_48\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_date0 20020101
-    set_namelist namelist_cfg jpni 4
-    set_namelist namelist_cfg jpnj 8
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    cd ${SETTE_DIR}
-    export TEST_NAME="REPRO_8_4"
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    NPROC=32
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"S12_84\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_date0 20020101
-    set_namelist namelist_cfg jpni 8
-    set_namelist namelist_cfg jpnj 4
-    set_namelist namelist_cfg ln_ctl .false.
-    set_namelist namelist_cfg sn_cfctl%l_config .true.
-    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-fi
-
-
+# run sette report
+echo ""
+echo "-------------------------------------------------------------"
+echo "./sette_rpt.sh (script will wait all nemo_sette run are done)"
+echo "-------------------------------------------------------------"
+echo ""
+NRUN=999
+NIT=0
+while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do
+   nit=$((nit+1))
+   NRUN=$( ${BATCH_STAT} | grep nemo_sette | wc -l ) 
+   if [[ $NRUN -ne 0 ]]; then 
+      printf "%-3d %s\r" $NRUN 'nemo_sette run still in queue or running ...';
+   else
+      printf "%-50s\n" " "
+      ./sette_rpt.sh
+      exit
+   fi
+   sleep 10
 done
+printf "\n"
+echo ""
+echo "Something wrong happened, it tooks more than 3 hours to run all the sette tests"
+echo ""
Index: ils/CI/sette/sette_beginner.sh
===================================================================
--- /utils/CI/sette/sette_beginner.sh	(revision 11160)
+++ 	(revision )
@@ -1,167 +1,0 @@
-#!/bin/bash
-#############################################################
-# Author : Simona Flavoni for NEMO
-# Contact : sflod@locean-ipsl.upmc.fr
-#
-# sette_beginner.sh   : example of script of SET TEsts for NEMO (SETTE)
-# ----------------------------------------------------------------------
-# NEMO/SETTE , NEMO Consortium (2010)
-# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-# ----------------------------------------------------------------------
-#
-#############################################################
-#set -vx
-set -o posix
-#set -u
-#set -e
-#+
-#
-# ===================
-# sette_beginner.sh
-# ===================
-#
-# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory 
-# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
-# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs  
-# INTERACT_FLAG     : flag to run in interactive mode "yes"
-#                           to run in batch mode "no"
-# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
-#                           to run in sequential mode (NB_PROC = 1) "no"
-# USING_XIOS        : flag to control the activation of key_iomput
-#                      "yes" to compile using key_iomput and link to the external XIOS library
-#                      "no"  to compile without key_iomput and link to the old IOIPSL library
-# USING_MPMD        : flag to control the use of stand-alone IO servers
-#                     requires USING_XIOS="yes"
-#                      "yes" to run in MPMD (detached) mode with stand-alone IO servers
-#                      "no"  to run in SPMD (attached) mode without separate IO servers 
-# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
-#                     set to zero if USING_MPMD="no"
-#
-# Principal script is sette.sh, that calls 
-#
-#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe 
-#              and links to nemo in ${CONFIG_NAME}/EXP00)
-#
-#  param.cfg : sets and loads following directories:
-#
-#   FORCING_DIR         : is the directory for forcing files (tarfile)
-#   INPUT_DIR           : is the directory for input files storing 
-#   TMPDIR              : is the temporary directory (if needed)
-#   NEMO_VALIDATION_DIR : is the validation directory
-#
-#   (NOTE: this file is the same for all configrations to be tested with sette)
-#
-#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
-#   set_namelist     : function declared in all_functions that sets namelist parameters 
-#   post_test_tidyup : creates validation storage directory and copies required output files 
-#                      (run.stat and ocean.output) in it after execution of test.
-#
-#  VALIDATION tree is:
-#
-#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
-#
-#  prepare_exe_dir.sh : defines and creates directory where the test is executed
-#                       execution directory takes name of TEST_NAME defined for every test 
-#                       in sette.sh. (each test in executed in its own directory)
-#
-#  prepare_job.sh     : to generate the script run_job.sh
-#
-#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
-#                        see sette.sh and BATCH_TEMPLATE directory
-#
-#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which 
-#        can be found paths to the input tar file)
-#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} 
-#        directory
-#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists 
-#        remain in ${NEW_CONF}/EXP00
-# 
-#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of 
-#        executed commands
-#
-#  NOTE: if sette.sh is stopped in output.sette there is written the last command 
-#        executed by sette.sh
-#
-# example use: ./sette_beginner.sh 
-#########################################################################################
-#
-# Compiler among those in NEMOGCM/ARCH
-COMPILER=x3750_ADA
-export BATCH_COMMAND_PAR="llsubmit"
-export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
-export INTERACT_FLAG="yes"
-export MPIRUN_FLAG="yes"
-
-export DEL_KEYS="key_iomput"
-if [ ${USING_XIOS} == "yes" ]
- then 
-   export DEL_KEYS=""
-fi
-
-#
-# Settings which control the use of stand alone servers (only relevant if using xios)
-#
-export USING_MPMD="no"
-export NUM_XIOSERVERS=4
-export JOB_PREFIX=batch-mpmd
-#
-if [ ${USING_MPMD} == "no" ] 
- then
-   export NUM_XIOSERVERS=0
-   export JOB_PREFIX=batch
-fi
-#
-#
-if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no"]
- then
-   echo "Incompatible choices. MPMD mode requires the XIOS server"
-   exit
-fi
-#
-
-# Directory to run the tests
-SETTE_DIR=$(cd $(dirname "$0"); pwd)
-MAIN_DIR=${SETTE_DIR%/SETTE}
-CONFIG_DIR=${MAIN_DIR}/cfgs
-TOOLS_DIR=${MAIN_DIR}/tools
-
-CMP_NAM=${1:-$COMPILER}
-# Copy job_batch_COMPILER file for specific compiler into job_batch_template
-cd ${SETTE_DIR}
-cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
-
-# Run for GYRE CONFIG
-# small test to start
-# compile GYRE configuration with gfortran_osx compiler run with 4 proc : 
-export TEST_NAME="SHORT_TEST"
-cd ${CONFIG_DIR}
-. ./makenemo -m ${CMP_NAM} -n GYRE_SHORT -r GYRE -j 10 add_key "key_nosignedzero" del_key ${DEL_KEYS}
-cd ${SETTE_DIR}
-. ./param.cfg 
-. ./all_functions.sh
-. ./prepare_exe_dir.sh
-# creation of execution directory
-JOB_FILE=${EXE_DIR}/run_job.sh
-# setting number of procs used
-NPROC=4
-if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-cd ${EXE_DIR}
-# setting namelist parameters
-# experience name
-set_namelist namelist_cfg cn_exp \"GYRE_SHORT\"
-# first time step
-set_namelist namelist_cfg nn_it000 1
-# last time step
-set_namelist namelist_cfg nn_itend 120
-# frequency of creation of a restart file
-set_namelist namelist_cfg nn_stock 60
-if [ ${USING_MPMD} == "yes" ] ; then
-      set_xio_using_server iodef.xml true
-   else
-      set_xio_using_server iodef.xml false
-fi
-cd ${SETTE_DIR}
-. ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-# run job, with 4 processors, test named SHORT (= 60 time steps)
-cd ${SETTE_DIR}   
-. ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
Index: ils/CI/sette/sette_chk_result.sh
===================================================================
--- /utils/CI/sette/sette_chk_result.sh	(revision 11160)
+++ 	(revision )
@@ -1,532 +1,0 @@
-#!/bin/bash -f
-# set -vx
-# simple SETTE report generator.
-#
-# This version should be run in the SETTE directory. 
-# The machine name will be picked up from the sette.sh script but the location of the
-# validation directory needs to be set here (currently assumed to reside in the ../cfgs directory)
-#
-#########################################################################################
-######################### Start of function definitions #################################
-##
-
-function restfile() {
-# Rebuild ice restart for SAS CONFIG, and restartability checks. Expects LONG and SHORT run directories.
-# For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files.
-# Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file.
-#
-# check nco module loaded, and load it if not
-if [ ! $( echo $LOADEDMODULES | grep cdo ) ]; then module load cdo >& /dev/null ; fi
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 `
-    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l`
-    cd ${SAS_RESTART_DIR}/LONG
-    #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files
-    cd ${TOOLS_DIR}
-    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1
-    cd ${TOOLS_DIR}/REBUILD_NEMO
-    #SF echo "REBUILD LONG restart SAS files, without standard output"
-    ./rebuild_nemo -t 4 ../../cfgs/SAS_ST/LONG/SAS_00000240_restart_ice  $NPROC > /dev/null 2>&1
-    #SF echo "REBUILD SHORT restart SAS files, without standard output"
-    ./rebuild_nemo -t 4 ../../cfgs/SAS_ST/SHORT/SAS_00000240_restart_ice $NPROC >&-
-    cd ${SAS_RESTART_DIR}/LONG
-    #SF echo "COPY rebuild restart files"
-    cp SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/.
-    cp ../SHORT/SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/.
-
-    f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000240_restart_ice.nc
-    f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000240_restart_ice.nc
-    if  [ ! -f $f1o ] &&  [ ! -f $f2o ] ; then
-      printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test";
-      return;
-    fi
-    #
-    done_oce=0
-    #
-  if  [  -f $f1o ] && [  -f $f2o ]; then
-## Compare the two netcdf files
-    cdo diffn $f1o $f2o > cdo_diff.out 2> /dev/null
-## Identical if cdo_diff.out exists but has zero size
-    if [ ! -s cdo_diff.out ]; then
-       difi=0
-    else
-## Identical if first character of $dif ==0
-       dif=$( grep -om1 '[0-9]* of [0-9]* records differ' cdo_diff.out )
-# difi contains the first character of summary of cdo dif. if = 0, then 0 record differ between the 2 files    
-       if [ -n "$dif" ]; then
-           difi=`echo $dif | cut -c -1`
-       fi
-    fi
-    \rm cdo_diff.out 
-
-    if [ $difi == 0 ]; then	
-       if [ $pass == 0 ]; then
-         printf "%-20s %s %s\n" $nam  " ice restarts are IDENTICAL  passed : " $dorv
-       fi
-    else
-       printf "%-20s %s %s\n" $nam  " ice restarts are DIFFERENT  FAILED : " $dorv 
-        #
-	# Offer view of differences on the second pass
-	#
-        if [ $pass == 1 ]; then
-          echo "<return> to view restart_ice.nc differences"
-          read y
-          cdo -diffv $f1o $f2o
-          done_oce=1
-          #echo "<return> to continue"
-          #read y
-        fi
-    fi
-  else
-      printf "%-20s %s\n" $nam " incomplete test";
-      return;
-  fi
-#
-fi
-}
-
-function resttest() { 
-#
-# Restartability checks. Expects LONG and SHORT run directories
-# Compares end of LONG stat files with equivalent entries from the SHORT stat files.
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    f1o=$vdir/$nam/$mach/$dorv/LONG/ocean.output
-    f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
-    f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
-    f2o=$vdir/$nam/$mach/$dorv/SHORT/ocean.output
-    f2s=$vdir/$nam/$mach/$dorv/SHORT/run.stat
-    f2t=$vdir/$nam/$mach/$dorv/SHORT/tracer.stat
-
-    if  [ ! -f $f1s ] &&  [ ! -f $f1t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-    if  [ ! -f $f2s ] &&  [ ! -f $f2t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-#
-    done_oce=0
-
-    if  [  -f $f1s ] && [  -f $f2s ]; then 
-      nl=(`wc -l $f2s`)
-      tail -${nl[0]} $f1s > f1.tmp$$
-      cmp -s f1.tmp$$ $f2s
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s\n" $nam  " run.stat    restartability  passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " run.stat    restartability  FAILED : " $dorv 
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view run.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2s
-          echo "<return> to view ocean.output differences"
-          read y
-          sdiff $f1o $f2o | grep "|"
-          done_oce=1
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-#
-# Check tracer.stat files (if they exist)
-#
-    if  [  -f $f1t ] && [  -f $f2t ]; then
-      nl=(`wc -l $f2t`)
-      tail -${nl[0]} $f1t > f1.tmp$$
-      cmp -s f1.tmp$$ $f2t
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s\n" $nam  " tracer.stat restartability  passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " tracer.stat restartability  FAILED : " $dorv 
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view tracer.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2t
-#
-# Only offer ocean.output view if it has not been viewed previously
-#
-          if [ $done_oce == 0 ]; then
-            echo "<return> to view ocean.output differences"
-            read y
-            sdiff $f1o $f2o | grep "|"
-          fi
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-    rm f1.tmp$$
-  fi
-}
-
-function reprotest(){
-#
-# Reproducibility checks. Expects REPRO_N_M and REPRO_I_J run directories
-# Compares end of stat files from each
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -2l | head -1 `
-    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -1l`
-    f1o=$vdir/$nam/$mach/$dorv/$rep1/ocean.output
-    f1s=$vdir/$nam/$mach/$dorv/$rep1/run.stat
-    f1t=$vdir/$nam/$mach/$dorv/$rep1/tracer.stat
-    f2o=$vdir/$nam/$mach/$dorv/$rep2/ocean.output
-    f2s=$vdir/$nam/$mach/$dorv/$rep2/run.stat
-    f2t=$vdir/$nam/$mach/$dorv/$rep2/tracer.stat
-
-    if  [ ! -f $f1s ] && [ ! -f $f1t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-    if  [ ! -f $f2s ] && [ ! -f $f2t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-#
-    done_oce=0
-
-    if  [ -f $f1s ] && [ -f $f2s ] ; then
-      cmp -s $f1s $f2s
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s\n" $nam  " run.stat    reproducibility passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " run.stat    reproducibility FAILED : " $dorv 
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view run.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2s
-          echo "<return> to view ocean.output differences"
-          read y
-          sdiff $f1o $f2o | grep "|"
-          done_oce=1
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-#
-# Check tracer.stat files (if they exist)
-#
-    if  [ -f $f1t ] && [ -f $f2t ] ; then
-      cmp -s $f1t $f2t
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then           printf "%-20s %s %s\n" $nam  " tracer.stat reproducibility passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " tracer.stat reproducibility  FAILED : " $dorv
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view tracer.stat differences"
-          read y
-          sdiff $f1t $f2t
-#
-# Only offer ocean.output view if it has not been viewed previously
-#
-          if [ $done_oce == 0 ]; then
-            echo "<return> to view ocean.output differences"
-            read y
-            sdiff $f1o $f2o | grep "|"
-          fi
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-  fi
-}
-function runcmpres(){
-#
-# compare *.stat file with reference file from a previous sette test or previous version
-# store in NEMO_VALID_REF at revision NEMO_REV_REF
-# Compares end of stat files from each
-#
-  vdir=$1
-  nam=$2
-  vdirref=$3
-  dorvref=$4
-  pass=$5
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
-    f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
-    f2s=$vdirref/$nam/$mach/$dorvref/LONG/run.stat
-    f2t=$vdirref/$nam/$mach/$dorvref/LONG/tracer.stat
-    if  [ ! -f $f1s ] && [ ! -f $f1t ] ; then
-      printf "%-20s %s\n" $nam " incomplete test";
-      return;
-    fi
-    if  [ ! -f $f2s ] && [ ! -f $f2t ] ; then
-      printf "%-20s %s\n" $nam " incomplete test";
-      return;
-    fi
-#
-    done_oce=0
-
-    if  [ -f $f1s ] && [ -f $f2s ] ; then
-      cmp -s $f1s $f2s
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then
-          printf "%-20s %s %s\n" $nam  " run.stat    before/after are similar "
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " run.stat    before/after are DIFFERENT "
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view run.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2s
-          done_oce=1
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-    # Check tracer.stat files (if they exist)
-#
-    if  [ -f $f1t ] && [ -f $f2t ] ; then
-      cmp -s $f1t $f2t
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then          
-          printf "%-20s %s %s\n" $nam  " tracer.stat before/after are similar "
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " tracer.stat before/after are DIFFERENT "
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view tracer.stat differences"
-          read y
-          sdiff $f1t $f2t
-        fi
-      fi
-    fi
-  fi
-}
-
-function runtest(){
-#
-# Run checks.
-# Check presence of E R R O R in ocean.output from each
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -2l | head -1 `
-    f1o=$vdir/$nam/$mach/$dorv/$rep1/ocean.output
-    if  [ ! -f $f1o ] ; then
-      printf "%-20s %s\n" $nam " ocean.output is MISSING : " $dorv
-      return;
-    else 
-      nerr=`grep 'E R R O R' $f1o | wc -l`
-      if [[ $nerr > 0 ]]; then
-        printf "%-20s %s %s\n" $nam " run FAILED : " $dorv
-        if [ $pass == 1 ]; then
-          echo "<return> to view end of ocean.output"
-          read y
-          tail -100 $f1o
-          echo ''
-          echo "full ocean.output available here: $f1o"
-        fi
-      fi
-    fi
-  else
-    printf "%-20s %s %s\n" $nam  " directory is MISSING : " $dorv
-  fi
-}
-
-function identictest(){
-#
-#  checks AGRIF does not corrupe results with no AGRIF zoom. Expects ORCA2AGUL/AGRIFNOZ and ORCA2AGUL_NAGR/AGRIFNO  run directories
-# Compares solver.stat files for each
-#
-  vdir=$1
-  dir1=$2
-  dir2=$3
-  pass=$4
-#
-  if [ -d $vdir/$dir1 ] && [ -d $vdir/$dir2 ]; then
-    dorv1=`ls -1rt $vdir/$dir1/$mach/ | tail -1l `
-    dorv1=`echo $dorv1 | sed -e 's:.*/::'`
-    dorv2=`ls -1rt $vdir/$dir2/$mach/ | tail -1l `
-    dorv2=`echo $dorv2 | sed -e 's:.*/::'`
-
-    rep1=`ls -1rt $vdir/$dir1/$mach/$dorv1/ |  tail -2l | head -1 `
-    rep2=`ls -1rt $vdir/$dir2/$mach/$dorv2/ |  tail -1l`
-    f1s=$vdir/$dir1/$mach/$dorv1/$rep1/run.stat
-    f2s=$vdir/$dir2/$mach/$dorv2/$rep2/run.stat
-
-    if  [ ! -f $f1s ] && [ ! -f $f2s ] ; then 
-      printf "%-20s %s\n" $dir1 $dir2 " incomplete test";
-      return; 
-    fi
-#
-    done_oce=0
-
-    if  [ -f $f1s ] && [ -f $f2s ] ; then
-      cmp -s $f1s $f2s
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s %s %s\n" $rep1 $rep2  " AGRIF: run.stat unchanged - test  passed : " $dorv1 $dorv2
-        fi
-      else
-        printf "%-20s %s %s %s %s\n" $rep1 $rep2  " for AGRIF, run.stat test FAILED : " $dorv1 $dorv2
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view run.stat differences"
-          read y
-          sdiff $f1s $f2s
-          done_oce=1
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-  else
-    printf "%-20s %s\n" $dir1 $dir2 " incomplete test";
-  fi
-}
-########################### END of function definitions #################################
-##                                                                                     ##
-##    Main script                                                                      ##
-##                                                                                     ##
-#########################################################################################
-#
-  mach=`grep "COMPILER=" ./sette.sh | sed -e 's/COMPILER=//'`
-  NEMO_VALID=`grep "NEMO_VALIDATION_DIR=" ./param.cfg | sed -e 's/NEMO_VALIDATION_DIR=//'`
-  NEMO_VALID=`eval "echo $NEMO_VALID"`
-#
-  if [ ! -d $NEMO_VALID ]; then
-    echo "$NEMO_VALID validation directory not found"
-    exit
-  fi
-#
-# Directory to run the tests
-  NEMO_VALID_REF=/path/to/reference/sette/results
-  NEMO_REV_REF=0000
-  SETTE_DIR=$(cd $(dirname "$0"); pwd)
-  MAIN_DIR=$(dirname $SETTE_DIR)
-  CONFIG_DIR0=${MAIN_DIR}/cfgs
-  TOOLS_DIR=${MAIN_DIR}/tools
-  NPROC=32
-  SAS_RESTART_DIR=${CONFIG_DIR0}/SAS_ST
-#
-# Show current revision tag and branch name
-#
-cmd="svn"
-[ ! -d "$SETTE_DIR/.svn" ] && cmd="git $cmd"
-# define revision as in all_function
-revision=`$cmd info ../ | grep -i "Last Changed Rev:" | sed -e "s/ //g" | cut -d ":" -f 2`
-branchname=`$cmd info | grep URL | rev | cut -d "/" -f 3 | rev`
-echo "SETTE validation report : $branchname @ r$revision"
-#
-# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory
-#  
-for pass in  0 1 
-do
-#
- if [ $pass == 1 ]; then echo "---------------2nd pass------------------";fi
-#
-
-# Rebuild and restartability test for SAS
-#
- for restart_file in WSAS_ST
- do
-   restfile $NEMO_VALID $restart_file $pass
- done
-#
-# Restartability test
-#
- for restart_test in WGYREPIS_ST WORCA2ICEPIS_ST WORCA2OFFPIS_ST WAMM12_ST WISOMIP_ST WORCA2AGR_ST
- do
-   resttest $NEMO_VALID $restart_test $pass
- done
-#
-# Reproducibility tests
-#
- for repro_test in WGYREPIS_ST WORCA2ICEPIS_ST WORCA2OFFPIS_ST WAMM12_ST WISOMIP_ST WORCA2_ICE_OBS_ST WORCA2AGR_ST
- do
-   reprotest $NEMO_VALID $repro_test $pass
-   runtest $NEMO_VALID $repro_test $pass
- done
-#
-# AGRIF special check
-#
- dir1=WORCA2AGUL_NOZOOM_ST
- dir2=WORCA2AGUL_NOAGR_ST
- identictest $NEMO_VALID $dir1 $dir2 $pass 
-#
-# before/after tests
-#
- if [ $NEMO_VALID_REF != "/path/to/reference/sette/results" ]; then
-   echo ''
-   echo 'check result differences between :'
-   echo "$NEMO_VALID at rev $revision"
-   echo 'and'
-   echo "$NEMO_VALID_REF at rev $NEMO_REV_REF"
-   for repro_test in WGYREPIS_ST WORCA2ICEPIS_ST WORCA2OFFPIS_ST WAMM12_ST WISOMIP_ST WORCA2_ICE_OBS_ST WORCA2AGR_ST
-   do
-     runcmpres $NEMO_VALID $repro_test $NEMO_VALID_REF $NEMO_REV_REF $pass
-   done
- else
-   echo ''
-   echo 'Result are not compare with any other revision. To do it please fill NEMO_VALID_REF and NEMO_REV_REF in sette_rpt.sh'
-   echo ''
- fi
-
-done
-#
-## Additional checks for ORCA2AGUL/FIRST standalone AGRIF test
-## still to be added
-
-exit
Index: /utils/CI/sette/sette_list_avail_cfg.sh
===================================================================
--- /utils/CI/sette/sette_list_avail_cfg.sh	(revision 11161)
+++ /utils/CI/sette/sette_list_avail_cfg.sh	(revision 11161)
@@ -0,0 +1,19 @@
+#!/bin/sh
+echo ''
+echo 'Reference configurations available are named :'
+printf "%-15s \n" GYRE_PISCES
+printf "%-15s \n" ORCA2_ICE_PISCES
+printf "%-15s \n" ORCA2_OFF_PISCES
+printf "%-15s \n" AMM12
+printf "%-15s \n" SAS
+printf "%-15s \n" ORCA2_ICE_OBS
+printf "%-15s \n" AGRIF
+printf "%-15s \n" SPITZ12
+echo ''
+echo 'Test cases available are named :'
+printf "%-15s \n" OVERFLOW
+printf "%-15s \n" LOCK_EXCHANGE
+printf "%-15s \n" VORTEX
+printf "%-15s \n" ICE_AGRIF
+printf "%-15s \n" ISOMIP
+echo ''
Index: /utils/CI/sette/sette_list_avail_rev.sh
===================================================================
--- /utils/CI/sette/sette_list_avail_rev.sh	(revision 11161)
+++ /utils/CI/sette/sette_list_avail_rev.sh	(revision 11161)
@@ -0,0 +1,65 @@
+#!/bin/bash -f
+# set -vx
+#
+lst_rev () {
+    # get the list of revision available for a configuration
+    if [ ! -d $1 ] ; then 
+       CFGLST=-9999
+    else
+       CFGLST=`ls $1 | sort -u -r ` 
+    fi
+    # config name
+    CONFIG=$2
+    # list of all revision available
+    ALLLST=${@:3}
+    # number of revision total and for CONFIG
+    nrevall=`echo $ALLLST | wc -w`
+    nrevcfg=`echo $CFGLST | wc -w`
+    # display
+    echo ""
+    printf "%-27s : " $CONFIG
+    irev=1
+    irevcfg=1
+    while [[ $irev -le $nrevall ]] ; do
+       rev=`echo $ALLLST | cut -d\  -f ${irev}`
+       cfgrev=`echo $CFGLST | cut -d\  -f ${irevcfg}`
+       if [ $cfgrev == $rev ] ; then
+          printf "%-6s  " $rev
+          irevcfg=$((irevcfg+1))
+       else
+          printf "%-5s  " "***** " 
+       fi
+       irev=$((irev+1))
+    done
+}
+
+  SETTE_DIR=$(cd $(dirname "$0"); pwd)
+  MAIN_DIR=$(dirname $SETTE_DIR)
+  . ./param.cfg
+
+  mach=${COMPILER}
+  NEMO_VALID=${NEMO_VALIDATION_DIR}
+ 
+ # list of all revision available
+ DIRLST=`find ${NEMO_VALID} -maxdepth 3 -mindepth 3 -type d | sed -e 's/.*\/W.*\///' | sort -u -r`
+
+ # display header
+ echo ""
+ echo " Compiler used is : $COMPILER"
+ echo ""
+ printf " List of all avail. rev. is : "
+ for dir in `echo $DIRLST`; do printf "%5s  " $dir ; done
+ printf "\n"
+
+ # start checking configuration revision
+ echo ""
+ echo "   !---- check revision available for each configuration ----!   "
+ for CONFIG in WGYRE_PISCES_ST WORCA2_ICE_PISCES_ST WORCA2_OFF_PISCES_ST WAMM12_ST WORCA2_SAS_ICE_ST WAGRIF_DEMO_ST WSPITZ12_ST WISOMIP_ST WOVERFLOW_ST WLOCK_EXCHANGE_ST WVORTEX_ST WICE_AGRIF_ST 
+ do
+    DIR=${NEMO_VALIDATION_DIR}/${CONFIG}/${COMPILER}
+    lst_rev $DIR $CONFIG $DIRLST
+ done
+ printf "\n"
+ printf "\n"
+#
+exit
Index: /utils/CI/sette/sette_reference-configurations.sh
===================================================================
--- /utils/CI/sette/sette_reference-configurations.sh	(revision 11161)
+++ /utils/CI/sette/sette_reference-configurations.sh	(revision 11161)
@@ -0,0 +1,1547 @@
+#!/bin/bash
+############################################################
+# Author : Simona Flavoni for NEMO
+# Contact: sflod@locean-ipsl.upmc.fr
+# 2013   : A.C. Coward added options for testing with XIOS in dettached mode
+#
+# sette.sh   : principal script of SET TEsts for NEMO (SETTE)
+# ----------------------------------------------------------------------
+# NEMO/SETTE , NEMO Consortium (2010)
+# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+# ----------------------------------------------------------------------
+#
+#############################################################
+#set -vx
+set -o posix
+#set -u
+#set -e
+# ===========
+# DESCRIPTION
+# ===========
+#
+# Variables to be checked by user:
+#
+# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory 
+# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
+# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs  
+# INTERACT_FLAG     : flag to run in interactive mode "yes"
+#                           to run in batch mode "no"
+# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
+#                           to run in sequential mode (NB_PROC = 1) "no"
+# USING_XIOS        : flag to control the activation of key_iomput
+#                      "yes" to compile using key_iomput and link to the external XIOS library
+#                      "no"  to compile without key_iomput and link to the old IOIPSL library
+# USING_MPMD        : flag to control the use of stand-alone IO servers
+#                     requires USING_XIOS="yes"
+#                      "yes" to run in MPMD (detached) mode with stand-alone IO servers
+#                      "no"  to run in SPMD (attached) mode without separate IO servers 
+# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
+#                     set to zero if USING_MPMD="no"
+#
+# Principal script is sette.sh, that calls 
+#
+#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe 
+#              and links to nemo in ${CONFIG_NAME}/EXP00)
+#
+#  param.cfg : sets and loads following directories:
+#
+#   FORCING_DIR         : is the directory for forcing files (tarfile)
+#   INPUT_DIR           : is the directory for input files storing 
+#   TMPDIR              : is the temporary directory (if needed)
+#   NEMO_VALIDATION_DIR : is the validation directory
+#
+#   (NOTE: this file is the same for all configrations to be tested with sette)
+#
+#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
+#   set_namelist     : function declared in all_functions that sets namelist parameters 
+#   post_test_tidyup : creates validation storage directory and copies required output files 
+#                      (run.stat and ocean.output) in it after execution of test.
+#
+#  VALIDATION tree is:
+#
+#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
+#
+#  prepare_exe_dir.sh : defines and creates directory where the test is executed
+#                       execution directory takes name of TEST_NAME defined for every test 
+#                       in sette.sh. (each test in executed in its own directory)
+#
+#  set_valid_dir       : rename ocean.output/run.stat and tracer.stat to avoid checking them in the report 
+#
+#  clean_valid_dir    : rename ocean.output/run.stat and tracer.stat to avoid checking them in the report 
+#                       ( not doing it could lead to false positive )
+#
+#  prepare_job.sh     : to generate the script run_job.sh
+#
+#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
+#                        see sette.sh and BATCH_TEMPLATE directory
+#
+#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which 
+#        can be found paths to the input tar file)
+#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} 
+#        directory
+#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists 
+#        remain in ${NEW_CONF}/EXP00
+# 
+#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of 
+#        executed commands
+#
+#  NOTE: if sette.sh is stopped in output.sette there is written the last command 
+#        executed by sette.sh
+#
+# example use: ./sette.sh 
+#########################################################################################
+#
+# LOAD param value
+SETTE_DIR=$(cd $(dirname "$0"); pwd)
+MAIN_DIR=$(dirname $SETTE_DIR)
+. ./param.cfg
+
+export BATCH_COMMAND_PAR=${BATCH_CMD}
+export BATCH_COMMAND_SEQ=${BATCH_CMD}
+export INTERACT_FLAG="no"
+export MPIRUN_FLAG="yes"
+export USING_ICEBERGS="yes"
+#
+export DEL_KEYS="key_iomput"
+if [ ${USING_XIOS} == "yes" ] 
+ then 
+   export DEL_KEYS=""
+fi
+#
+export ADD_KEYS=""
+if [ ${ADD_NOSIGNEDZERO} == "yes" ]
+ then
+   export ADD_KEYS="key_nosignedzero"
+fi
+#
+# Settings which control the use of stand alone servers (only relevant if using xios)
+#
+export NUM_XIOSERVERS=4
+export JOB_PREFIX=${JOB_PREFIX_MPMD}
+#
+if [ ${USING_MPMD} == "no" ] 
+ then
+   export NUM_XIOSERVERS=0
+   export JOB_PREFIX=${JOB_PREFIX_NOMPMD}
+fi
+#
+#
+if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no" ]
+ then
+   echo "Incompatible choices. MPMD mode requires the XIOS server"
+   exit
+fi
+
+# Directory to run the tests
+CONFIG_DIR0=${MAIN_DIR}/cfgs
+TOOLS_DIR=${MAIN_DIR}/tools
+
+CMP_NAM=${1:-$COMPILER}
+# Copy job_batch_COMPILER file for specific compiler into job_batch_template
+cd ${SETTE_DIR}
+cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit
+# Description of available configurations:
+# GYRE_PISCES       :
+# ORCA2_ICE_PISCES  :
+# ORCA2_OFF_PISCES  :
+# AMM12             :
+# SAS               :
+# ORCA2_ICE_OBS     :
+# AGRIF             : test AGRIF in a double zoom configuration in the nordic seas + 1 zoom in the eq. Pacific (AGRIF_DEMO)
+#                       and check that key_agrif without zoom = no key_agrif
+# SPITZ12           : regional configuration including sea-ice and tides (Spitzbergen)
+
+for config in ${TEST_CONFIGS}
+do
+
+# -----------
+# GYRE_PISCES
+# -----------
+if [ ${config} == "GYRE_PISCES" ] ;  then
+## Restartability tests for GYRE_PISCES
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n GYRE_PISCES_ST -r GYRE_PISCES -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=8
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}  
+    set_namelist namelist_cfg cn_exp \"GYREPIS_LONG\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 1080
+    set_namelist namelist_cfg nn_stock  540
+    set_namelist namelist_cfg ln_linssh .true.
+    set_namelist namelist_cfg jpni 2
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYREPIS_SHORT\"
+    set_namelist namelist_cfg nn_it000 541
+    set_namelist namelist_cfg nn_itend 1080
+    set_namelist namelist_cfg nn_stock 540
+    set_namelist namelist_cfg ln_rstart .true.
+    set_namelist namelist_cfg nn_rstctl 2
+    set_namelist namelist_cfg ln_linssh .true.
+    set_namelist namelist_cfg jpni 2
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_top_cfg ln_rsttr .true.
+    set_namelist namelist_top_cfg nn_rsttr 2
+    set_namelist namelist_cfg cn_ocerst_in \"GYREPIS_LONG_00000540_restart\"
+    set_namelist namelist_top_cfg cn_trcrst_in \"GYREPIS_LONG_00000540_restart_trc\"
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/GYREPIS_LONG_00000540_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/GYREPIS_LONG_00000540_restart_trc_${L_NPROC}.nc .
+    done
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests for GYRE_PISCES
+    export TEST_NAME="REPRO_2_4"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=8
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYREPIS_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 1080
+    set_namelist namelist_cfg ln_linssh .true.
+    set_namelist namelist_cfg jpni 2
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_4_2"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=8
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"GYREPIS_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 1080
+    set_namelist namelist_cfg ln_linssh .true.
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 2
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+fi
+
+# -----------------
+# ORCA2_ICE_PISCES
+# -----------------
+if [ ${config} == "ORCA2_ICE_PISCES" ] ;  then
+## Restartability tests for ORCA2_ICE_PISCES
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_PISCES_ST -r ORCA2_ICE_PISCES -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"O2L3P_LONG\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 992
+    set_namelist namelist_cfg nn_stock 496
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_use_calving .true.
+    set_namelist namelist_cfg ln_wave .true.
+    set_namelist namelist_cfg ln_cdgw .true.
+    set_namelist namelist_cfg ln_sdw  .true.
+    set_namelist namelist_cfg nn_sdrift 1
+    set_namelist namelist_cfg ln_stcor .true.
+    set_namelist namelist_cfg ln_tauwoc .true.
+    #
+    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
+    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
+    #
+    set_namelist namelist_ice_cfg ln_icediachk .true.
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"O2L3P_SHORT\"
+    set_namelist namelist_cfg nn_it000 497
+    set_namelist namelist_cfg nn_itend 992
+    set_namelist namelist_cfg nn_stock 496
+    set_namelist namelist_cfg ln_rstart .true.
+    set_namelist namelist_cfg nn_rstctl 2
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg nn_test_icebergs -1
+    set_namelist namelist_cfg ln_wave .true.
+    set_namelist namelist_cfg ln_cdgw .true.
+    set_namelist namelist_cfg ln_sdw  .true.
+    set_namelist namelist_cfg nn_sdrift 1
+    set_namelist namelist_cfg ln_stcor .true.
+    set_namelist namelist_cfg ln_tauwoc .true.
+    #
+    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
+    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
+    #
+    set_namelist namelist_ice_cfg ln_icediachk .true.
+    set_namelist namelist_top_cfg ln_rsttr .true.
+    set_namelist namelist_top_cfg nn_rsttr 2
+    set_namelist namelist_cfg cn_ocerst_in \"O2L3P_LONG_00000496_restart\"
+    set_namelist namelist_top_cfg cn_trcrst_in \"O2L3P_LONG_00000496_restart_trc\"
+    set_namelist namelist_ice_cfg cn_icerst_in \"O2L3P_LONG_00000496_restart_ice\"
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/O2L3P_LONG_00000496_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/O2L3P_LONG_00000496_restart_trc_${L_NPROC}.nc .
+        ln -sf ../LONG/O2L3P_LONG_00000496_restart_ice_${L_NPROC}.nc .
+        if [ ${USING_ICEBERGS} == "yes" ]
+            then
+             ln -sf ../LONG/O2L3P_LONG_icebergs_00000496_restart_${L_NPROC}.nc O2L3P_LONG_00000496_restart_icebergs_${L_NPROC}.nc
+        fi
+    done
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests for ORCA2_ICE_PISCES
+    export TEST_NAME="REPRO_4_8"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"O2L3P_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 992
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_wave .true.
+    set_namelist namelist_cfg ln_cdgw .true.
+    set_namelist namelist_cfg ln_sdw  .true.
+    set_namelist namelist_cfg nn_sdrift 1
+    set_namelist namelist_cfg ln_stcor .true.
+    set_namelist namelist_cfg ln_tauwoc .true.
+
+    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
+    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
+
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_8_4"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"O2L3P_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 992
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_wave .true.
+    set_namelist namelist_cfg ln_cdgw .true.
+    set_namelist namelist_cfg ln_sdw  .true.
+    set_namelist namelist_cfg nn_sdrift 1
+    set_namelist namelist_cfg ln_stcor .true.
+    set_namelist namelist_cfg ln_tauwoc .true.
+
+    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
+    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
+
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+fi
+
+# ----------------
+# ORCA2_OFF_PISCES
+# ----------------
+if [ ${config} == "ORCA2_OFF_PISCES" ] ;  then
+## Restartability tests for ORCA2_OFF_PISCES
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n ORCA2_OFF_PISCES_ST -r ORCA2_OFF_PISCES -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"OFFP_LONG\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 380
+    set_namelist namelist_cfg nn_stock 190
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_qsr_rgb .true.
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"OFFP_SHORT\"
+    set_namelist namelist_cfg nn_it000 191
+    set_namelist namelist_cfg nn_itend 380
+    set_namelist namelist_cfg nn_stock 190
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_qsr_rgb .true.
+    set_namelist namelist_top_cfg ln_rsttr .true.
+    set_namelist namelist_top_cfg nn_rsttr 2
+    set_namelist namelist_top_cfg cn_trcrst_in \"OFFP_LONG_00000190_restart_trc\"
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/OFFP_LONG_00000190_restart_trc_${L_NPROC}.nc .
+    done
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME}  ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests for ORCA2_OFF_PISCES
+    export TEST_NAME="REPRO_4_8"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"OFFP_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 380
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_qsr_rgb .true.
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_8_4"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"OFFP_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 380
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_qsr_rgb .true.
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    # put ln_pisdmp to false : no restoring to global mean value
+    set_namelist namelist_pisces_cfg ln_pisdmp .false. 
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+fi
+
+# -----
+# AMM12
+# -----
+if [ ${config} == "AMM12" ] ;  then
+    ## Restartability tests for AMM12
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n AMM12_ST -r AMM12 -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AMM12_LONG\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 576
+    set_namelist namelist_cfg nn_stock 288
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AMM12_SHORT\"
+    set_namelist namelist_cfg nn_it000 289
+    set_namelist namelist_cfg nn_itend 576
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg ln_rstart .true.
+    set_namelist namelist_cfg nn_rstctl 2
+    set_namelist namelist_cfg cn_ocerst_in \"AMM12_LONG_00000288_restart\"
+    set_namelist namelist_cfg nn_date0 20120102
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/AMM12_LONG_00000288_restart_${L_NPROC}.nc .
+    done
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests for AMM12
+    export TEST_NAME="REPRO_8_4"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AMM12_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 576
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_4_8"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AMM12_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 576
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+fi
+
+
+# ---------
+# ORCA2_SAS
+# ---------
+if [ ${config} == "SAS" ] ;  then
+## Restartability tests
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n ORCA2_SAS_ICE_ST -r ORCA2_SAS_ICE -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"SAS\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 256
+    set_namelist namelist_cfg nn_stock 128
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_ice_cfg ln_icediachk .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"SAS\"
+    set_namelist namelist_cfg nn_it000 129
+    set_namelist namelist_cfg nn_itend 256
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg ln_rstart .true.
+    set_namelist namelist_cfg nn_rstctl 2
+    set_namelist namelist_cfg nn_date0 010109
+    set_namelist namelist_cfg cn_ocerst_in \"SAS_00000128_restart\"
+    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_00000128_restart_ice\"
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/SAS_00000128_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/SAS_00000128_restart_ice_${L_NPROC}.nc .
+    done
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests
+    export TEST_NAME="REPRO_4_8"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"SAS_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 80
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_8_4"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"SAS_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 80
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+fi
+
+
+# --------------
+# ORCA2_ICE_OBS
+# --------------
+## Test assimilation interface code, OBS and ASM for reproducibility
+## Restartability not tested (ASM code not restartable while increments are being applied)
+if [ ${config} == "ORCA2_ICE_OBS" ] ; then
+## Reproducibility tests
+    export TEST_NAME="REPRO_4_8"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_OBS_ST -r ORCA2_ICE_PISCES -d "OCE ICE"  -j 8 add_key "key_asminc ${ADD_KEYS}" del_key "key_top"
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"O2L3OBS_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 80
+    set_namelist namelist_cfg ln_read_cfg .true.
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_diaobs .true.
+    set_namelist namelist_cfg ln_t3d .true.
+    set_namelist namelist_cfg ln_s3d .true.
+    set_namelist namelist_cfg ln_sst .true.
+    set_namelist namelist_cfg ln_sla .true.
+    set_namelist namelist_cfg ln_sic .true.
+    set_namelist namelist_cfg ln_vel3d .true.
+    set_namelist namelist_cfg ln_bkgwri .true.
+    set_namelist namelist_cfg ln_trainc .true.
+    set_namelist namelist_cfg ln_dyninc .true.
+    set_namelist namelist_cfg ln_sshinc .true.
+    set_namelist namelist_cfg ln_asmiau .true.
+    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
+    set_namelist namelist_top_cfg ln_trcdta .false. 
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+   cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_8_4"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"O2L3OBS_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 80
+    set_namelist namelist_cfg ln_read_cfg .true.
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
+    set_namelist namelist_cfg ln_diaobs .true.
+    set_namelist namelist_cfg ln_t3d .true.
+    set_namelist namelist_cfg ln_s3d .true.
+    set_namelist namelist_cfg ln_sst .true.
+    set_namelist namelist_cfg ln_sla .true.
+    set_namelist namelist_cfg ln_sic .true.
+    set_namelist namelist_cfg ln_vel3d .true.
+    set_namelist namelist_cfg ln_bkgwri .true.
+    set_namelist namelist_cfg ln_trainc .true.
+    set_namelist namelist_cfg ln_dyninc .true.
+    set_namelist namelist_cfg ln_sshinc .true.
+    set_namelist namelist_cfg ln_asmiau .true.
+    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
+    set_namelist namelist_top_cfg ln_trcdta .false.
+    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
+    # if not you need input files, and for tests is not necessary
+    set_namelist namelist_pisces_cfg ln_presatm .false.
+    set_namelist namelist_pisces_cfg ln_varpar .false.
+    set_namelist namelist_pisces_cfg ln_dust .false.
+    set_namelist namelist_pisces_cfg ln_solub .false.
+    set_namelist namelist_pisces_cfg ln_river .false.
+    set_namelist namelist_pisces_cfg ln_ndepo .false.
+    set_namelist namelist_pisces_cfg ln_ironsed .false.
+    set_namelist namelist_pisces_cfg ln_ironice .false.
+    set_namelist namelist_pisces_cfg ln_hydrofe .false.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+fi
+
+# ------------
+# AGRIF ICE
+# -----------
+if [ ${config} == "AGRIF" ] ;  then
+## Restartability tests
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_ST -r AGRIF_DEMO -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=16
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AGRIF_LONG\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 20
+    set_namelist namelist_cfg nn_stock 10
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 1_namelist_cfg cn_exp \"AGRIF_LONG\"
+    set_namelist 1_namelist_cfg nn_it000 1
+    set_namelist 1_namelist_cfg nn_itend 20
+    set_namelist 1_namelist_cfg nn_stock 10
+    set_namelist 1_namelist_cfg ln_ctl .false.
+    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 2_namelist_cfg cn_exp \"AGRIF_LONG\"
+    set_namelist 2_namelist_cfg nn_it000 1
+    set_namelist 2_namelist_cfg nn_itend 80
+    set_namelist 2_namelist_cfg nn_stock 40
+    set_namelist 2_namelist_cfg ln_ctl .false.
+    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 3_namelist_cfg cn_exp \"AGRIF_LONG\"
+    set_namelist 3_namelist_cfg nn_it000 1
+    set_namelist 3_namelist_cfg nn_itend 240
+    set_namelist 3_namelist_cfg nn_stock 120
+    set_namelist 3_namelist_cfg ln_ctl .false.
+    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
+
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AGRIF_SHORT\"
+    set_namelist namelist_cfg nn_it000 11
+    set_namelist namelist_cfg nn_itend 20
+    set_namelist namelist_cfg nn_stock 10
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg ln_rstart .true.
+    set_namelist namelist_cfg nn_rstctl 2
+    set_namelist 1_namelist_cfg cn_exp \"AGRIF_SHORT\"
+    set_namelist 1_namelist_cfg nn_it000 11
+    set_namelist 1_namelist_cfg nn_itend 20
+    set_namelist 1_namelist_cfg nn_stock 10
+    set_namelist 1_namelist_cfg ln_ctl .false.
+    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 1_namelist_cfg ln_rstart .true.
+    set_namelist 1_namelist_cfg nn_rstctl 2
+    set_namelist 2_namelist_cfg cn_exp \"AGRIF_SHORT\"
+    set_namelist 2_namelist_cfg nn_it000 41
+    set_namelist 2_namelist_cfg nn_itend 80
+    set_namelist 2_namelist_cfg nn_stock 40
+    set_namelist 2_namelist_cfg ln_ctl .false.
+    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 2_namelist_cfg ln_rstart .true.
+    set_namelist 2_namelist_cfg nn_rstctl 2
+    set_namelist 3_namelist_cfg cn_exp \"AGRIF_SHORT\"
+    set_namelist 3_namelist_cfg nn_it000 121
+    set_namelist 3_namelist_cfg nn_itend 240
+    set_namelist 3_namelist_cfg nn_stock 120
+    set_namelist 3_namelist_cfg ln_ctl .false.
+    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 3_namelist_cfg ln_rstart .true.
+    set_namelist 3_namelist_cfg nn_rstctl 2
+    set_namelist namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000010_restart\"
+    set_namelist namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000010_restart_ice\"
+    set_namelist 1_namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000010_restart\"
+    set_namelist 1_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000010_restart_ice\"
+    set_namelist 2_namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000040_restart\"
+    set_namelist 2_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000040_restart_ice\"
+    set_namelist 3_namelist_cfg cn_ocerst_in \"AGRIF_LONG_00000120_restart\"
+    set_namelist 3_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_00000120_restart_ice\"
+
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/AGRIF_LONG_00000010_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/AGRIF_LONG_00000010_restart_ice_${L_NPROC}.nc .
+        ln -sf ../LONG/1_AGRIF_LONG_00000010_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/1_AGRIF_LONG_00000010_restart_ice_${L_NPROC}.nc .
+        ln -sf ../LONG/2_AGRIF_LONG_00000040_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/2_AGRIF_LONG_00000040_restart_ice_${L_NPROC}.nc .
+        ln -sf ../LONG/3_AGRIF_LONG_00000120_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/3_AGRIF_LONG_00000120_restart_ice_${L_NPROC}.nc .
+    done
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests
+    export TEST_NAME="REPRO_4_8"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AGRIF_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 20
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 1_namelist_cfg cn_exp \"AGRIF_48\"
+    set_namelist 1_namelist_cfg nn_it000 1
+    set_namelist 1_namelist_cfg nn_itend 20
+    set_namelist 1_namelist_cfg jpni 4
+    set_namelist 1_namelist_cfg jpnj 8
+    set_namelist 1_namelist_cfg ln_ctl .false.
+    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 2_namelist_cfg cn_exp \"AGRIF_48\"
+    set_namelist 2_namelist_cfg nn_it000 1
+    set_namelist 2_namelist_cfg nn_itend 80
+    set_namelist 2_namelist_cfg jpni 4
+    set_namelist 2_namelist_cfg jpnj 8
+    set_namelist 2_namelist_cfg ln_ctl .false.
+    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 3_namelist_cfg cn_exp \"AGRIF_48\"
+    set_namelist 3_namelist_cfg nn_it000 1
+    set_namelist 3_namelist_cfg nn_itend 240
+    set_namelist 3_namelist_cfg jpni 4
+    set_namelist 3_namelist_cfg jpnj 8
+    set_namelist 3_namelist_cfg ln_ctl .false.
+    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
+
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_8_4"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"AGRIF_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 20
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 1_namelist_cfg cn_exp \"AGRIF_84\"
+    set_namelist 1_namelist_cfg nn_it000 1
+    set_namelist 1_namelist_cfg nn_itend 20
+    set_namelist 1_namelist_cfg jpni 8
+    set_namelist 1_namelist_cfg jpnj 4
+    set_namelist 1_namelist_cfg ln_ctl .false.
+    set_namelist 1_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 2_namelist_cfg cn_exp \"AGRIF_84\"
+    set_namelist 2_namelist_cfg nn_it000 1
+    set_namelist 2_namelist_cfg nn_itend 80
+    set_namelist 2_namelist_cfg jpni 8
+    set_namelist 2_namelist_cfg jpnj 4
+    set_namelist 2_namelist_cfg ln_ctl .false.
+    set_namelist 2_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist 3_namelist_cfg cn_exp \"AGRIF_84\"
+    set_namelist 3_namelist_cfg nn_it000 1
+    set_namelist 3_namelist_cfg nn_itend 240
+    set_namelist 3_namelist_cfg jpni 8
+    set_namelist 3_namelist_cfg jpnj 4
+    set_namelist 3_namelist_cfg ln_ctl .false.
+    set_namelist 3_namelist_cfg sn_cfctl%l_config .true.
+    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
+
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## test code corruption with AGRIF (phase 1) ==> Compile with key_agrif but run with no zoom
+    export TEST_NAME="ORCA2"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"ORCA2\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 150
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+
+#   Set the number of fine grids to zero:    
+    sed -i "1s/.*/0/" ${EXE_DIR}/AGRIF_FixedGrids.in
+
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+fi
+
+
+## test code corruption with AGRIF (phase 2) ==> Compile without key_agrif (to be compared with AGRIF_DEMO_ST/ORCA2)
+if [ ${config} == "AGRIF" ] ;  then
+    export TEST_NAME="ORCA2"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_NOAGRIF_ST -r AGRIF_DEMO -j 8 add_key ${ADD_KEYS} del_key "key_agrif"
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"ORCA2\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 150
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+#
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+fi
+
+# -------
+# SPITZ12
+# -------
+if [ ${config} == "SPITZ12" ] ;  then
+## Restartability tests
+    export TEST_NAME="LONG"
+    cd ${MAIN_DIR}
+    . ./makenemo -m ${CMP_NAM} -n SPITZ12_ST -r SPITZ12 -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"S12_LONG\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 240
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg nn_date0 20020101
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    #set_namelist namelist_ice_cfg ln_icediachk .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    
+    cd ${SETTE_DIR}
+    export TEST_NAME="SHORT"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"S12_SHORT\"
+    set_namelist namelist_cfg nn_it000 121
+    set_namelist namelist_cfg nn_itend 240
+    set_namelist namelist_cfg nn_stock 120
+    set_namelist namelist_cfg ln_rstart .true.
+    set_namelist namelist_cfg nn_rstctl 2
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    set_namelist namelist_cfg cn_ocerst_in \"S12_LONG_00000120_restart\"
+    set_namelist namelist_ice_cfg cn_icerst_in \"S12_LONG_00000120_restart_ice\"
+    for (( i=1; i<=$NPROC; i++)) ; do
+        L_NPROC=$(( $i - 1 ))
+        L_NPROC=`printf "%04d\n" ${L_NPROC}`
+        ln -sf ../LONG/S12_LONG_00000120_restart_${L_NPROC}.nc .
+        ln -sf ../LONG/S12_LONG_00000120_restart_ice_${L_NPROC}.nc .
+    done
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+## Reproducibility tests
+    export TEST_NAME="REPRO_4_8"
+    cd ${MAIN_DIR}
+    cd ${SETTE_DIR}
+    . ./param.cfg
+    . ./all_functions.sh
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"S12_48\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_date0 20020101
+    set_namelist namelist_cfg jpni 4
+    set_namelist namelist_cfg jpnj 8
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+
+    cd ${SETTE_DIR}
+    export TEST_NAME="REPRO_8_4"
+    . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
+    JOB_FILE=${EXE_DIR}/run_job.sh
+    NPROC=32
+    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
+    cd ${EXE_DIR}
+    set_namelist namelist_cfg cn_exp \"S12_84\"
+    set_namelist namelist_cfg nn_it000 1
+    set_namelist namelist_cfg nn_itend 120
+    set_namelist namelist_cfg nn_date0 20020101
+    set_namelist namelist_cfg jpni 8
+    set_namelist namelist_cfg jpnj 4
+    set_namelist namelist_cfg ln_ctl .false.
+    set_namelist namelist_cfg sn_cfctl%l_config .true.
+    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
+    if [ ${USING_MPMD} == "yes" ] ; then
+       set_xio_using_server iodef.xml true
+    else
+       set_xio_using_server iodef.xml false
+    fi
+    cd ${SETTE_DIR}
+    . ./prepare_job.sh input_SPITZ12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
+    cd ${SETTE_DIR}
+    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
+fi
+
+
+done
Index: ils/CI/sette/sette_rpt.SAS.sh
===================================================================
--- /utils/CI/sette/sette_rpt.SAS.sh	(revision 11160)
+++ 	(revision )
@@ -1,316 +1,0 @@
-#!/bin/bash -f
-#set -vx
-#
-# simple SETTE report generator.
-#
-# This version should be run in the SETTE directory. 
-# The machine name will be picked up from the sette.sh script but the location of the
-# validation directory needs to be set here (currently assumed to reside in the ../cfgs directory)
-#
-#########################################################################################
-######################### Start of function definitions #################################
-##
-
-function restfile() {
-# Rebuild ice restart for SAS CONFIG, and restartability checks. Expects LONG and SHORT run directories.
-# For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files.
-# Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file.
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 `
-    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l`
-    cd ${SAS_RESTART_DIR}/LONG
-    #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files
-    cd ${TOOLS_DIR}
-    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1
-    cd ${TOOLS_DIR}/REBUILD_NEMO
-    #SF echo "REBUILD LONG restart SAS files, without standard output"
-    ./rebuild_nemo -t 4 ../../cfgs/SAS_LONG/LONG/SAS_00000100_restart_ice  $NPROC > /dev/null 2>&1
-    #SF echo "REBUILD SHORT restart SAS files, without standard output"
-    ./rebuild_nemo -t 4 ../../cfgs/SAS_LONG/SHORT/SAS_00000100_restart_ice $NPROC >&-
-    cd ${SAS_RESTART_DIR}/LONG
-    #SF echo "COPY rebuild restart files"
-    cp SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/.
-    cp ../SHORT/SAS_00000100_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/.
-
-    f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000100_restart_ice.nc
-    f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000100_restart_ice.nc
-    if  [ ! -f $f1o ] &&  [ ! -f $f2o ] ; then
-      printf "%-20s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test";
-      return;
-    fi
-    #
-    done_oce=0
-    #
-    if  [  -f $f1o ] && [  -f $f2o ]; then
-      cmp -s $f1o $f2o 
-      #SF  cmp SAS_00000100_restart_ice.nc  ../SHORT/SAS_00000100_restart_ice.nc  > diff_restart.txt
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then
-          printf "%-20s %s %s\n" $nam  " SAS restart files are IDENTICAL :  passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " SAS restart files are DIFFERENT : FAILED : " $dorv 
-        #
-	# Offer view of differences on the second pass
-	#
-        if [ $pass == 1 ]; then
-          echo "BE CAREFUL:  NEED cdo to see differences!!!!! "
-          echo "DO which cdo and replace cdo PATH to the cdo command in SETTE_rpt.sh "
-          echo "IF cdo is not available you need to do difference of netcdf file by hand"
-          echo "<return> to view restart_ice.nc differences"
-          read y
-#SF           cdo -diffv $f1o $f2o
-          /smplocal/pub/cdo/1.5.9/bin/cdo -diffv $f1o $f2o
-          done_oce=1
-          #echo "<return> to continue"
-          #read y
-        fi
-      fi
-    fi
-#
-fi
-}
-
-function resttest() { 
-#
-# Restartability checks. Expects LONG and SHORT run directories
-# Compares end of LONG stat files with equivalent entries from the SHORT stat files.
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    f1o=$vdir/$nam/$mach/$dorv/LONG/ocean.output
-    f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
-    f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
-    f2o=$vdir/$nam/$mach/$dorv/SHORT/ocean.output
-    f2s=$vdir/$nam/$mach/$dorv/SHORT/run.stat
-    f2t=$vdir/$nam/$mach/$dorv/SHORT/tracer.stat
-
-    if  [ ! -f $f1s ] &&  [ ! -f $f1t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-    if  [ ! -f $f2s ] &&  [ ! -f $f2t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-#
-    done_oce=0
-
-    if  [  -f $f1s ] && [  -f $f2s ]; then 
-      nl=(`wc -l $f2s`)
-      tail -${nl[0]} $f1s > f1.tmp$$
-      cmp -s f1.tmp$$ $f2s
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s\n" $nam  " run.stat restartability  passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " run.stat restartability  FAILED : " $dorv 
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view run.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2s
-          echo "<return> to view ocean.output differences"
-          read y
-          sdiff $f1o $f2o | grep "|"
-          done_oce=1
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-#
-# Check tracer.stat files (if they exist)
-#
-    if  [  -f $f1t ] && [  -f $f2t ]; then
-      nl=(`wc -l $f2t`)
-      tail -${nl[0]} $f1t > f1.tmp$$
-      cmp -s f1.tmp$$ $f2t
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s\n" $nam  " tracer.stat restartability  passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " tracer.stat restartability  FAILED : " $dorv 
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view tracer.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2t
-#
-# Only offer ocean.output view if it has not been viewed previously
-#
-          if [ $done_oce == 0 ]; then
-            echo "<return> to view ocean.output differences"
-            read y
-            sdiff $f1o $f2o | grep "|"
-          fi
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-    rm f1.tmp$$
-  fi
-}
-
-function reprotest(){
-#
-# Reproducibility checks. Expects REPRO_N_M and REPRO_I_J run directories
-# Compares end of stat files from each
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 `
-    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l`
-    f1o=$vdir/$nam/$mach/$dorv/$rep1/ocean.output
-    f1s=$vdir/$nam/$mach/$dorv/$rep1/run.stat
-    f1t=$vdir/$nam/$mach/$dorv/$rep1/tracer.stat
-    f2o=$vdir/$nam/$mach/$dorv/$rep2/ocean.output
-    f2s=$vdir/$nam/$mach/$dorv/$rep2/run.stat
-    f2t=$vdir/$nam/$mach/$dorv/$rep2/tracer.stat
-
-    if  [ ! -f $f1s ] && [ ! -f $f1t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-    if  [ ! -f $f2s ] && [ ! -f $f2t ] ; then 
-      printf "%-20s %s\n" $nam " incomplete test";
-      return; 
-    fi
-#
-    done_oce=0
-
-    if  [ -f $f1s ] && [ -f $f2s ] ; then
-      cmp -s $f1s $f2s
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then 
-          printf "%-20s %s %s\n" $nam  " run.stat reproducibility passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " run.stat reproducibility FAILED : " $dorv 
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view run.stat differences"
-          read y
-          sdiff f1.tmp$$ $f2s
-          echo "<return> to view ocean.output differences"
-          read y
-          sdiff $f1o $f2o | grep "|"
-          done_oce=1
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-#
-# Check tracer.stat files (if they exist)
-#
-    if  [ -f $f1t ] && [ -f $f2t ] ; then
-      cmp -s $f1t $f2t
-      if [ $? == 0 ]; then
-        if [ $pass == 0 ]; then           printf "%-20s %s %s\n" $nam  " tracer.stat reproducibility passed : " $dorv
-        fi
-      else
-        printf "%-20s %s %s\n" $nam  " tracer.stat reproducibility  FAILED : " $dorv
-#
-# Offer view of differences on the second pass
-#
-        if [ $pass == 1 ]; then
-          echo "<return> to view tracer.stat differences"
-          read y
-          sdiff $f1t $f2t
-#
-# Only offer ocean.output view if it has not been viewed previously
-#
-          if [ $done_oce == 0 ]; then
-            echo "<return> to view ocean.output differences"
-            read y
-            sdiff $f1o $f2o | grep "|"
-          fi
-          echo "<return> to continue"
-          read y
-        fi
-      fi
-    fi
-  fi
-}
-########################### END of function definitions #################################
-##                                                                                     ##
-##    Main script                                                                      ##
-##                                                                                     ##
-#########################################################################################
-#
-  mach=`grep "COMPILER=" ./sette.sh | sed -e 's/COMPILER=//'`
-  NEMO_VALID=`grep "NEMO_VALIDATION_DIR=" ./param.cfg | sed -e 's/NEMO_VALIDATION_DIR=//'`
-# Directory to run the tests
- SETTE_DIR=$(cd $(dirname "$0"); pwd)
- MAIN_DIR=$(dirname $SETTE_DIR)
- CONFIG_DIR0=${MAIN_DIR}/cfgs
- TOOLS_DIR=${MAIN_DIR}/tools
- NPROC=32
-
-  SAS_RESTART_DIR=${CONFIG_DIR0}/SAS_LONG
-#
-  if [ ! -d $NEMO_VALID ]; then
-    echo "$NEMO_VALID validation directory not found"
-    exit
-  fi
-#
-
-# The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory
-#  
-for pass in  0 1 
-do
-#
- if [ $pass == 1 ]; then echo "---------------2nd pass------------------";fi
-#
-
-# Rebuild and restartability test for SAS
-#
- for restart_file in WSAS_LONG
- do
- #  restfile $SAS_RESTART_DIR LONG $pass
-   restfile $NEMO_VALID $restart_file $pass
- done
-#
-# Restartability test
-#
- for restart_test in WGYREPIS_LONG WORCA2ICEPIS_LONG WORCA2OFFPIS_LONG WAMM12_LONG WISOMIP_LONG WORCA2AGUL_LONG
- do
-   resttest $NEMO_VALID $restart_test $pass
- done
-#
-# Reproducibility tests
-#
- for repro_test in WGYREPIS_32 WORCA2ICEPIS_32 WORCA2OFFPIS_32 WAMM12_32 WISOMIP_32 WORCA2_ICE_OBS WORCA2AGUL_1_2 WORCA2AGUL_16 WORCA2AGUL_2_2_NAG
- do
-   reprotest $NEMO_VALID $repro_test $pass
- done
-#
-done
-exit
Index: /utils/CI/sette/sette_rpt.sh
===================================================================
--- /utils/CI/sette/sette_rpt.sh	(revision 11160)
+++ /utils/CI/sette/sette_rpt.sh	(revision 11161)
@@ -11,99 +11,40 @@
 ##
 
-function restfile() {
-# Rebuild ice restart for SAS CONFIG, and restartability checks. Expects LONG and SHORT run directories.
-# For Stand Alone Surface configuration ocean is not running, just run ice model; so no outputs ocean files.
-# Compares LONG rebuild restart ice file with equivalent entry from the SHORT rebuild restart ice file.
-#
-# check nco module loaded, and load it if not
-if [ ! $( echo $LOADEDMODULES | grep cdo ) ]; then module load cdo >& /dev/null ; fi
+function get_dorv() {
+  if [ $lastchange == 'old' ] ; then 
+    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
+    dorv=`echo $dorv | sed -e 's:.*/::'`
+  else
+    dorv=$lastchange
+  fi
+}
+
+function get_ktdiff() {
+  ktdiff=`diff ${1} ${2} | head -2 | grep it | awk '{ print $4 }'`
+}
+
+function resttest() { 
+#
+# Restartability checks. Expects LONG and SHORT run directories
+# Compares end of LONG stat files with equivalent entries from the SHORT stat files.
 #
   vdir=$1
   nam=$2
   pass=$3
-
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -2l | head -1 `
-    rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | tail -1l`
-    cd ${SAS_RESTART_DIR}/LONG
-    #SF add here compilation of rebuild_tools to rebuild restart files, and add comparison of restart files
-    cd ${TOOLS_DIR}
-    ./maketools -n REBUILD_NEMO -m ${mach} > /dev/null 2>&1
-    cd ${TOOLS_DIR}/REBUILD_NEMO
-    #SF echo "REBUILD LONG restart SAS files, without standard output"
-    ./rebuild_nemo -t 4 ../../cfgs/ORCA2_SAS_ICE_ST/LONG/SAS_00000240_restart_ice  $NPROC > /dev/null 2>&1
-    #SF echo "REBUILD SHORT restart SAS files, without standard output"
-    ./rebuild_nemo -t 4 ../../cfgs/ORCA2_SAS_ICE_ST/SHORT/SAS_00000240_restart_ice $NPROC >&-
-    cd ${SAS_RESTART_DIR}/LONG
-    #SF echo "COPY rebuild restart files"
-    cp SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/LONG/.
-    cp ../SHORT/SAS_00000240_restart_ice.nc $vdir/$nam/$mach/$dorv/SHORT/.
-
-    f1o=$vdir/$nam/$mach/$dorv/LONG/SAS_00000240_restart_ice.nc
-    f2o=$vdir/$nam/$mach/$dorv/SHORT/SAS_00000240_restart_ice.nc
-    if  [ ! -f $f1o ] &&  [ ! -f $f2o ] ; then
-      printf "%-27s %s\n" $nam " REBUILD SAS restart ice DOES NOT exists; incomplete test";
-      return;
-    fi
+#
+# get $dorv
+  get_dorv
+#
+# check if directory is here
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-27s %s %s\n" $nam  " directory                  MISSING : " $dorv
+    return
+  fi
+
+  if [ -d $vdir/$nam/$mach/$dorv ]; then
+    # check ocean output
+    runtest $vdir $nam $pass RST
     #
-    done_oce=0
-    #
-  if  [  -f $f1o ] && [  -f $f2o ]; then
-## Compare the two netcdf files
-    cdo diffn $f1o $f2o > cdo_diff.out 2> /dev/null
-## Identical if cdo_diff.out exists but has zero size
-    if [ ! -s cdo_diff.out ]; then
-       difi=0
-    else
-## Identical if first character of $dif ==0
-       dif=$( grep -om1 '[0-9]* of [0-9]* records differ' cdo_diff.out )
-# difi contains the first character of summary of cdo dif. if = 0, then 0 record differ between the 2 files    
-       if [ -n "$dif" ]; then
-           difi=`echo $dif | cut -c -1`
-       fi
-    fi
-    \rm cdo_diff.out 
-
-    if [ $difi == 0 ]; then	
-       if [ $pass == 0 ]; then
-         printf "%-27s %s %s\n" $nam  " ice restarts are IDENTICAL  passed : " $dorv
-       fi
-    else
-       printf "%-27s %s %s\n" $nam  " ice restarts are DIFFERENT  FAILED : " $dorv 
-        #
-	# Offer view of differences on the second pass
-	#
-        if [ $pass == 1 ]; then
-          echo "<return> to view restart_ice.nc differences"
-          read y
-          cdo -diffv $f1o $f2o
-          done_oce=1
-          #echo "<return> to continue"
-          #read y
-        fi
-    fi
-  else
-      printf "%-27s %s\n" $nam " incomplete test";
-      return;
-  fi
-#
-fi
-}
-
-function resttest() { 
-#
-# Restartability checks. Expects LONG and SHORT run directories
-# Compares end of LONG stat files with equivalent entries from the SHORT stat files.
-#
-  vdir=$1
-  nam=$2
-  pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+    # run restartibility test
     f1o=$vdir/$nam/$mach/$dorv/LONG/ocean.output
     f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
@@ -133,5 +74,6 @@
         fi
       else
-        printf "%-27s %s %s\n" $nam  " run.stat    restartability  FAILED : " $dorv 
+        get_ktdiff f1.tmp$$ $f2s
+        printf "\e[38;5;196m%-27s %s %s %s %-5s %s\e[0m\n" $nam  " run.stat    restartability  FAILED : " $dorv " (results are different after " $ktdiff " time steps)"
 #
 # Offer view of differences on the second pass
@@ -162,5 +104,6 @@
         fi
       else
-        printf "%-27s %s %s\n" $nam  " tracer.stat restartability  FAILED : " $dorv 
+        get_ktdiff 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)"
 #
 # Offer view of differences on the second pass
@@ -196,7 +139,18 @@
   pass=$3
 #
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+# get $dorv
+  get_dorv
+#
+# check if directory is here
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-27s %s %s\n" $nam  " directory                  MISSING : " $dorv
+    return
+  fi
+#
+  if [ -d $vdir/$nam/$mach/$dorv ]; then
+    # check ocean output
+    runtest $vdir $nam $pass REPRO
+    #
+    # check reproducibility
     rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -2l | head -1 `
     rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -1l`
@@ -226,5 +180,6 @@
         fi
       else
-        printf "%-27s %s %s\n" $nam  " run.stat    reproducibility FAILED : " $dorv 
+        get_ktdiff $f1s $f2s
+        printf "\e[38;5;196m%-27s %s %s %s %-5s %s\e[0m\n" $nam  " run.stat    reproducibility FAILED : " $dorv " (results are different after " $ktdiff " time steps)"
 #
 # Offer view of differences on the second pass
@@ -252,5 +207,6 @@
         fi
       else
-        printf "%-27s %s %s\n" $nam  " tracer.stat reproducibility  FAILED : " $dorv
+        get_ktdiff $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)"
 #
 # Offer view of differences on the second pass
@@ -275,4 +231,89 @@
   fi
 }
+function runcmpres(){
+#
+# compare *.stat file with reference file from a previous sette test or previous version
+# store in NEMO_VALID_REF at revision NEMO_REV_REF
+# Compares end of stat files from each
+#
+  vdir=$1
+  nam=$2
+  vdirref=$3
+  dorvref=$4
+  pass=$5
+#
+# get $dorv
+  get_dorv
+#
+# check if reference directory is present
+  if [ ! -d $vdirref/$nam/$mach/$dorvref ]; then
+    printf "%-27s %s\n" $nam " REFERENCE directory at $dorvref is MISSING"
+    return
+  fi
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-27s %s\n" $nam " VALID     directory at $dorv is MISSING"
+    return
+  fi
+
+#
+  if [ -d $vdir/$nam/$mach/$dorv ]; then
+    f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
+    f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
+    f2s=$vdirref/$nam/$mach/$dorvref/LONG/run.stat
+    f2t=$vdirref/$nam/$mach/$dorvref/LONG/tracer.stat
+    if  [ ! -f $f1s ] && [ ! -f $f1t ] ; then
+      printf "%-20s %s\n" $nam " incomplete test";
+      return;
+    fi
+    if  [ ! -f $f2s ] && [ ! -f $f2t ] ; then
+      printf "%-20s %s\n" $nam " incomplete test";
+      return;
+    fi
+#
+    done_oce=0
+
+    if  [ -f $f1s ] && [ -f $f2s ] ; then
+      cmp -s $f1s $f2s
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then
+          printf "%-20s %s %s\n" $nam  " run.stat    files are identical "
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " run.stat    files are DIFFERENT "
+#
+# Offer view of differences on the second pass
+#
+        if [ $pass == 1 ]; then
+          echo "<return> to view run.stat differences"
+          read y
+          sdiff $f1s $f2s
+          done_oce=1
+          echo "<return> to continue"
+          read y
+        fi
+      fi
+    fi
+    # Check tracer.stat files (if they exist)
+#
+    if  [ -f $f1t ] && [ -f $f2t ] ; then
+      cmp -s $f1t $f2t
+      if [ $? == 0 ]; then
+        if [ $pass == 0 ]; then          
+          printf "%-20s %s %s\n" $nam  " tracer.stat files are identical "
+        fi
+      else
+        printf "%-20s %s %s\n" $nam  " tracer.stat files are DIFFERENT "
+#
+# Offer view of differences on the second pass
+#
+        if [ $pass == 1 ]; then
+          echo "<return> to view tracer.stat differences"
+          read y
+          sdiff $f1t $f2t
+        fi
+      fi
+    fi
+  fi
+}
 
 function runtest(){
@@ -284,33 +325,38 @@
   nam=$2
   pass=$3
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
-    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep LONG | head -1 `
-    if  [  -z $rep1 ] ; then
-      # Not all configurations test restartability (LONG/SHORT); 
-      # check for a reproducibility directory instead (REPRO)
-      rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | head -1 `
-    fi
-    f1o=$vdir/$nam/$mach/$dorv/$rep1/ocean.output
-    if  [ ! -f $f1o ] ; then
-      printf "%-27s %s %s\n" $nam " ocean.output is MISSING            : " $dorv
-      return;
-    else 
-      nerr=`grep 'E R R O R' $f1o | wc -l`
-      if [[ $nerr > 0 ]]; then
-        printf "%-27s %s %s\n" $nam " run FAILED : " $dorv
-        if [ $pass == 1 ]; then
-          echo "<return> to view end of ocean.output"
-          read y
-          tail -100 $f1o
-          echo ''
-          echo "full ocean.output available here: $f1o"
-        fi
-      fi
-    fi
+  ttype=$4
+  [[ $ttype == 'RST' ]] && ttype="LONG|SHORT"
+#
+# get $dorv
+  get_dorv
+#
+# no print needed if the repository is not here (already catch before)
+#
+  if [ -d $vdir/$nam/$mach/$dorv/ ]; then
+    #
+    # apply check for all ttype directory
+    rep1=$(ls -rt $vdir/$nam/$mach/$dorv/ | grep -E $ttype)
+    for tdir in $rep1 ; do
+       f1o=$vdir/$nam/$mach/$dorv/$tdir/ocean.output
+       if  [ ! -f $f1o ] ; then
+          if [ $pass == 0 ]; then printf "%-27s %s %s\n" $nam " ocean.output               MISSING : " $dorv ; fi
+          return;
+       else 
+          nerr=`grep 'E R R O R' $f1o | wc -l`
+          if [[ $nerr > 0 ]]; then
+             printf "\e[38;5;196m%-27s %s %s %s\e[0m\n" $nam " run                         FAILED : " $dorv " ( E R R O R in ocean.output) " 
+             if [ $pass == 1 ]; then
+                echo "<return> to view end of ocean.output"
+                read y
+                tail -100 $f1o
+                echo ''
+                echo "full ocean.output available here: $f1o"
+             fi
+             return;
+          fi
+       fi
+    done
   else
-    printf "%-27s %s %s\n" $nam  " directory is MISSING               : " $dorv
+    if [ $pass == 0 ]; then printf "%-27s %s %s\n" $nam  " directory                  MISSING : " $dorv ; fi
   fi
 }
@@ -352,5 +398,6 @@
         fi
       else
-        printf "%-5s %s %-5s %s %s %s\n" $rep1 "AGRIF vs" $rep2 "NOAGRIF run.stat    changed  -     FAILED : " $dorv1 $dorv2
+        get_ktdiff $f1s $f2s
+        printf "\e[38;5;196m%-5s %s %-5s %s %s %s %s %-5s %s\e[0m\n" $rep1 "AGRIF vs" $rep2 "NOAGRIF run.stat    changed  -     FAILED : " $dorv1 $dorv2 " (results are different after " $ktdiff " time steps)"
 #
 # Offer view of differences on the second pass
@@ -376,7 +423,13 @@
 #########################################################################################
 #
-  mach=`grep "COMPILER=" ./sette.sh | sed -e 's/COMPILER=//'`
-  NEMO_VALID=`grep "NEMO_VALIDATION_DIR=" ./param.cfg | sed -e 's/NEMO_VALIDATION_DIR=//'`
-  NEMO_VALID=`eval "echo $NEMO_VALID"`
+# LOAD param variable (COMPILER, NEMO_VALIDATION_DIR, SVN_CMD)
+  SETTE_DIR=$(cd $(dirname "$0"); pwd)
+  MAIN_DIR=$(dirname $SETTE_DIR)
+  . ./param.cfg
+
+  mach=${COMPILER}
+  NEMO_VALID=${NEMO_VALIDATION_DIR}
+  NEMO_VALID_REF=${NEMO_VALIDATION_REF}
+  LANG=en_US
 #
   if [ ! -d $NEMO_VALID ]; then
@@ -386,6 +439,4 @@
 #
 # Directory to run the tests
-  SETTE_DIR=$(cd $(dirname "$0"); pwd)
-  MAIN_DIR=${SETTE_DIR}/..
   CONFIG_DIR0=${MAIN_DIR}/cfgs
   TOOLS_DIR=${MAIN_DIR}/tools
@@ -395,12 +446,22 @@
 # Show current revision tag and branch name
 #
-cmd="svn"
-[ ! -d "$MAIN_DIR/.svn" ] && cmd="git $cmd"
-echo $cmd 
-echo "$MAIN_DIR/.svn"
-lastchange=`$cmd info ${MAIN_DIR} | grep -i "Last Changed Rev:" | sed -e "s/ //g" | cut -d ":" -f 2`
-revision=`$cmd info | grep Revision | cut -d ":" -f 2 | tr -d ' '`
-branchname=`$cmd info | grep URL | rev | cut -d "/" -f 3 | rev`
-echo "SETTE validation report : $branchname @ r$revision  ( last change @ r$lastchange )"
+echo ""
+lastchange=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep 'Last Changed Rev' | awk '{print $NF}'`
+revision=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep 'Revision' | awk '{print $NF}'`
+branchname=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep ^URL | awk -F ipsl/forge/projets/nemo/svn/ '{print $NF}'`
+echo "Current code is : $branchname @ r$revision  ( last change @ r$lastchange )"
+[ `${SVN_CMD} status -q ${MAIN_DIR}/{cfg,tests,src} | wc -l` -ge 1 ] && lastchange=${lastchange}+
+
+# overwrite revision is argument 1 present
+[[ $# -eq 1 ]] && lastchange=$1
+
+echo ""
+echo "SETTE validation report generated for : "
+echo ""
+echo "       $branchname @ r$lastchange (last changed revision)"
+echo ""
+echo "       on $COMPILER arch file"
+echo ""
+
 #
 # The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory
@@ -419,11 +480,4 @@
 #
 
-# Rebuild and restartability test for SAS
-# clem: not needed anymore
-# for restart_file in WORCA2_SAS_ICE_ST
-# do
-#   restfile $NEMO_VALID $restart_file $pass
-# done
-#
 # Restartability test
  echo ""
@@ -432,5 +486,4 @@
  do
    resttest $NEMO_VALID $restart_test $pass
-   runtest $NEMO_VALID $restart_test $pass
  done
 #
@@ -441,5 +494,4 @@
  do
    reprotest $NEMO_VALID $repro_test $pass
-   runtest $NEMO_VALID $repro_test $pass
  done
 
@@ -450,7 +502,32 @@
  dir2=WAGRIF_DEMO_ST
  identictest $NEMO_VALID $dir1 $dir2 $pass 
-
+#
+# before/after tests
+ if [ $lastchange == 'old' ] ; then
+    echo ""
+    echo "   !---- 'old' specified as revision => no comparison with reference results ----!   "
+    echo ""
+ else
+   echo ""
+   echo "   !----result comparison check----!   "
+   if [ $NEMO_VALID_REF != "/path/to/reference/sette/results" ]; then
+     echo ''
+     echo 'check result differences between :'
+     echo "VALID directory : $NEMO_VALID at rev $lastchange"
+     echo 'and'
+     echo "REFERENCE directory : $NEMO_VALID_REF at rev $NEMO_REV_REF"
+     echo ''
+     for repro_test in WGYRE_PISCES_ST WORCA2_ICE_PISCES_ST WORCA2_OFF_PISCES_ST WAMM12_ST WISOMIP_ST WORCA2_SAS_ICE_ST WAGRIF_DEMO_ST WSPITZ12_ST WISOMIP_ST WVORTEX_ST WICE_AGRIF_ST
+     do
+       runcmpres $NEMO_VALID $repro_test $NEMO_VALID_REF $NEMO_REV_REF $pass
+     done
+   else
+     echo ''
+     echo ' No path for comparison specified. Result are not compare with any other revision. '
+     echo ' To do it please fill NEMO_VALID_REF and NEMO_REV_REF in param.cfg. '
+     echo ''
+   fi
+ fi
 done
 #
-
 exit
Index: /utils/CI/sette/sette_test-cases.sh
===================================================================
--- /utils/CI/sette/sette_test-cases.sh	(revision 11160)
+++ /utils/CI/sette/sette_test-cases.sh	(revision 11161)
@@ -12,5 +12,4 @@
 # Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
 # ----------------------------------------------------------------------
-#
 #
 #############################################################
@@ -69,4 +68,9 @@
 #                       in sette_test-cases.sh. (each test in executed in its own directory)
 #
+#  set_valid_dir       : rename ocean.output/run.stat and tracer.stat to avoid checking them in the report 
+#
+#  clean_valid_dir    : rename ocean.output/run.stat and tracer.stat to avoid checking them in the report 
+#                       ( not doing it could lead to false positive )
+#
 #  prepare_job.sh     : to generate the script run_job.sh
 #
@@ -90,12 +94,13 @@
 #########################################################################################
 #
-# Compiler among those in NEMOGCM/ARCH
-COMPILER=X64_ADA
-
-export BATCH_COMMAND_PAR="llsubmit"
-export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
+# LOAD param value
+SETTE_DIR=$(cd $(dirname "$0"); pwd)
+MAIN_DIR=$(dirname $SETTE_DIR)
+. ./param.cfg
+
+export BATCH_COMMAND_PAR=${BATCH_CMD}
+export BATCH_COMMAND_SEQ=${BATCH_CMD}
 export INTERACT_FLAG="no"
 export MPIRUN_FLAG="yes"
-export USING_XIOS="yes"
 #
 export DEL_KEYS="key_iomput"
@@ -105,18 +110,23 @@
 fi
 #
+export ADD_KEYS=""
+if [ ${ADD_NOSIGNEDZERO} == "yes" ]
+ then
+   export ADD_KEYS="key_nosignedzero"
+fi
+#
 # Settings which control the use of stand alone servers (only relevant if using xios)
 #
-export USING_MPMD="no"
 export NUM_XIOSERVERS=4
-export JOB_PREFIX=batch-mpmd
+export JOB_PREFIX=${JOB_PREFIX_MPMD}
 #
 if [ ${USING_MPMD} == "no" ] 
  then
    export NUM_XIOSERVERS=0
-   export JOB_PREFIX=batch
+   export JOB_PREFIX=${JOB_PREFIX_NOMPMD}
 fi
 #
 #
-if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no"]
+if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no" ]
  then
    echo "Incompatible choices. MPMD mode requires the XIOS server"
@@ -125,6 +135,4 @@
 
 # Directory to run the tests
-SETTE_DIR=$(cd $(dirname "$0"); pwd)
-MAIN_DIR=$(dirname $SETTE_DIR)
 CONFIG_DIR0=${MAIN_DIR}/cfgs
 TOOLS_DIR=${MAIN_DIR}/tools
@@ -135,16 +143,16 @@
 cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit
 # Description of configuration tested:
-# OVERFLOW       : 1  TEST s-coordinates : (tracers) Advection schemes: FCT2, FCT4, ubs 
-#                                        & (dynamics) advection schemes: flux form (ubs, centered), vector form (een)
-#                          zps-coordinates : (tracers) Advection schemes: FCT2, FCT4, ubs
-#                                        & (dynamics) advection schemes: flux form (ubs, centered), vector form (een, and een + Hollingsworth correction)
-# LOCK_EXCHANGE  : 2
-# VORTEX         : 3
-# ICE_AGRIF      : 4
-# ISOMIP         : 5
+# OVERFLOW       : TEST s-coordinates : (tracers) Advection schemes: FCT2, FCT4, ubs 
+#                                     & (dynamics) advection schemes: flux form (ubs, centered), vector form (een)
+#                       zps-coordinates : (tracers) Advection schemes: FCT2, FCT4, ubs
+#                                     & (dynamics) advection schemes: flux form (ubs, centered), vector form (een, and een + Hollingsworth correction)
+# LOCK_EXCHANGE  : 
+# VORTEX         : 
+# ICE_AGRIF      : 
+# ISOMIP         : 
 # WAD
 
 
-for config in 1 2 3 4 5 
+for config in ${TEST_CONFIGS}
 do
 
@@ -152,13 +160,15 @@
 #  OVERFLOW
 # ---------
-if [ ${config} -eq 1 ] ;  then
+if [ ${config} == "OVERFLOW" ] ;  then
     ## Restartability tests for OVERFLOW
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n OVERFLOW_ST -a OVERFLOW -j 8 del_key ${DEL_KEYS}
+    . ./makenemo -m ${CMP_NAM} -n OVERFLOW_ST -a OVERFLOW -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
     cd ${SETTE_DIR}
     . ./param.cfg
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=1
@@ -178,9 +188,11 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
 
     cd ${SETTE_DIR}
     export TEST_NAME="SHORT"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     cd ${EXE_DIR}
     set_namelist namelist_cfg cn_exp \"OVF_SHORT\"
@@ -202,5 +214,5 @@
 
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -221,4 +233,6 @@
         . ./all_functions.sh
         . ./prepare_exe_dir.sh
+        set_valid_dir
+        clean_valid_dir
         JOB_FILE=${EXE_DIR}/run_job.sh
         NPROC=1
@@ -233,5 +247,5 @@
         fi
         cd ${SETTE_DIR}
-        . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+        . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
         cd ${SETTE_DIR}
         . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -243,13 +257,15 @@
 #  LOCK_EXCHANGE
 # --------------
-if [ ${config} -eq 2 ] ;  then
+if [ ${config} == "LOCK_EXCHANGE" ] ;  then
     ## Restartability tests for LOCK_EXCHANGE
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n LOCK_EXCHANGE_ST -a LOCK_EXCHANGE -j 8 del_key ${DEL_KEYS}
+    . ./makenemo -m ${CMP_NAM} -n LOCK_EXCHANGE_ST -a LOCK_EXCHANGE -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
     cd ${SETTE_DIR}
     . ./param.cfg
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=1
@@ -269,9 +285,11 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
 
     cd ${SETTE_DIR}
     export TEST_NAME="SHORT"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     cd ${EXE_DIR}
     set_namelist namelist_cfg cn_exp \"LOCK_SHORT\"
@@ -293,5 +311,5 @@
 
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -312,4 +330,6 @@
         . ./all_functions.sh
         . ./prepare_exe_dir.sh
+        set_valid_dir
+        clean_valid_dir
         JOB_FILE=${EXE_DIR}/run_job.sh
         NPROC=1
@@ -324,5 +344,5 @@
         fi
         cd ${SETTE_DIR}
-        . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+        . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
         cd ${SETTE_DIR}
         . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -335,13 +355,15 @@
 # VORTEX
 # ---------
-if [ ${config} -eq 3 ] ;  then 
+if [ ${config} == "VORTEX" ] ;  then 
 ## Restartability tests for VORTEX
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n VORTEX_ST -a VORTEX -j 8  del_key ${DEL_KEYS}
+    . ./makenemo -m ${CMP_NAM} -n VORTEX_ST -a VORTEX -j 8  add_key ${ADD_KEYS} del_key ${DEL_KEYS}
     cd ${SETTE_DIR}
     . ./param.cfg
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=6
@@ -370,9 +392,11 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     
     cd ${SETTE_DIR}
     export TEST_NAME="SHORT"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     cd ${EXE_DIR}
     set_namelist namelist_cfg cn_exp \"VORTEX_SHORT\"
@@ -415,5 +439,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -426,4 +450,6 @@
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=6
@@ -456,5 +482,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -463,4 +489,6 @@
     export TEST_NAME="REPRO_3_2"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=6
@@ -494,5 +522,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -504,13 +532,15 @@
 # ICE_AGRIF
 # ---------
-if [ ${config} -eq 4 ] ;  then 
+if [ ${config} == "ICE_AGRIF" ] ;  then 
 ## Restartability tests for ICE_AGRIF
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n ICE_AGRIF_ST -a ICE_AGRIF -j 8  del_key ${DEL_KEYS}
+    . ./makenemo -m ${CMP_NAM} -n ICE_AGRIF_ST -a ICE_AGRIF -j 8  add_key ${ADD_KEYS} del_key ${DEL_KEYS}
     cd ${SETTE_DIR}
     . ./param.cfg
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=6
@@ -539,9 +569,11 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     
     cd ${SETTE_DIR}
     export TEST_NAME="SHORT"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     cd ${EXE_DIR}
     set_namelist namelist_cfg cn_exp \"ICE_AGRIF_SHORT\"
@@ -592,5 +624,5 @@
 
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -604,4 +636,6 @@
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=6
@@ -634,5 +668,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -641,4 +675,6 @@
     export TEST_NAME="REPRO_3_2"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=6
@@ -672,5 +708,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -681,13 +717,15 @@
 # ISOMIP
 # ------
-if [ ${config} -eq 5 ] ;  then
+if [ ${config} == "ISOMIP" ] ;  then
 ## Restartability tests
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
-    . ./makenemo -m ${CMP_NAM} -n ISOMIP_ST -a ISOMIP -j 8 del_key ${DEL_KEYS}
+    . ./makenemo -m ${CMP_NAM} -n ISOMIP_ST -a ISOMIP -j 8 add_key ${ADD_KEYS} del_key ${DEL_KEYS}
     cd ${SETTE_DIR}
     . ./param.cfg
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=15
@@ -709,9 +747,11 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
 
     cd ${SETTE_DIR}
     export TEST_NAME="SHORT"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     cd ${EXE_DIR}
     set_namelist namelist_cfg cn_exp \"ISOMIP_SHORT\"
@@ -739,5 +779,5 @@
 
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -750,4 +790,6 @@
     . ./all_functions.sh
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=21
@@ -768,5 +810,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
@@ -775,4 +817,6 @@
     export TEST_NAME="REPRO_8_4"
     . ./prepare_exe_dir.sh
+    set_valid_dir
+    clean_valid_dir
     JOB_FILE=${EXE_DIR}/run_job.sh
     NPROC=32
@@ -793,5 +837,5 @@
     fi
     cd ${SETTE_DIR}
-    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
+    . ./prepare_job.sh input_ISOMIP.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
     cd ${SETTE_DIR}
     . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
Index: ils/CI/sette/sette_xios.sh
===================================================================
--- /utils/CI/sette/sette_xios.sh	(revision 11160)
+++ 	(revision )
@@ -1,439 +1,0 @@
-#!/bin/bash
-############################################################
-# Author : Italo Epicoco - CMCC
-# Contact: italo.epicoco@unisalento.it
-# 2014   : A.C. Coward added new namelist settings for GYRE configuration
-#
-# sette_xios.sh   : additional script of SET TEsts for XIOS within NEMO
-# ----------------------------------------------------------------------
-# NEMO/SETTE , NEMO Consortium (2014)
-# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-# ----------------------------------------------------------------------
-#
-#############################################################
-#set -x
-set -o posix
-#set -u
-#set -e
-# ===========
-# DESCRIPTION
-# ===========
-#
-# Variables to be checked by user:
-#
-# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory 
-# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
-# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs  
-# INTERACT_FLAG     : flag to run in interactive mode "yes"
-#                           to run in batch mode "no"
-# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
-#                           to run in sequential mode (NB_PROC = 1) "no"
-# USING_MPMD        : flag to control the use of stand-alone IO servers
-#                      "true" to run in MPMD (detached) mode with stand-alone IO servers
-#                      "false"  to run in SPMD (attached) mode without separate IO servers 
-# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
-#                     set to zero if USING_MPMD="false"
-#
-# Principal script is sette_xios.sh, that calls 
-#
-#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe 
-#              and links to nemo in ${CONFIG_NAME}/EXP00)
-#
-#  param.cfg : sets and loads following directories:
-#
-#   FORCING_DIR         : is the directory for forcing files (tarfile)
-#   INPUT_DIR           : is the directory for input files storing 
-#   TMPDIR              : is the temporary directory (if needed)
-#   NEMO_VALIDATION_DIR : is the validation directory
-#
-#   (NOTE: this file is the same for all configrations to be tested with sette)
-#
-#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
-#   set_namelist     : function declared in all_functions that sets namelist parameters 
-#   post_test_tidyup : creates validation storage directory and copies required output files 
-#                      (run.stat and ocean.output) in it after execution of test.
-#
-#  VALIDATION tree is:
-#
-#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
-#
-#  prepare_exe_dir.sh : defines and creates directory where the test is executed
-#                       execution directory takes name of TEST_NAME defined for every test 
-#                       in sette.sh. (each test in executed in its own directory)
-#
-#  prepare_job.sh     : to generate the script run_job.sh
-#
-#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
-#                        see sette.sh and BATCH_TEMPLATE directory
-#
-#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which 
-#        can be found paths to the input tar file)
-#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR} 
-#        directory
-#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists 
-#        remain in ${NEW_CONF}/EXP00
-# 
-#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of 
-#        executed commands
-#
-#  NOTE: if sette_xios.sh is stopped in output.sette there is written the last command 
-#        executed by sette_xios.sh
-#
-# example use: ./sette_xios.sh 
-#########################################################################################
-#
-# Compiler among those in NEMOGCM/ARCH
-COMPILER=
-export BATCH_COMMAND_PAR="llsubmit"
-export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR
-export INTERACT_FLAG="no"
-export MPIRUN_FLAG="yes"
-#
-
-# Directory to run the tests
-SETTE_DIR=$(cd $(dirname "$0"); pwd)
-MAIN_DIR=${SETTE_DIR%/SETTE}
-CONFIG_DIR=${MAIN_DIR}/cfgs
-TOOLS_DIR=${MAIN_DIR}/tools
-
-CMP_NAM=${1:-$COMPILER}
-#
-#=================================================================================
-# Copy job_batch_COMPILER file for specific compiler into job_batch_template
-# Note this batch template needs to be capable of launching both SPMD and MPMD
-# tasks with internal selection depending on the value of NUM_XIOSERVERS
-# (0=SPMD; >0 = MPMD)
-#=================================================================================
-#
-cd ${SETTE_DIR}
-cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit
-
-for config in 1 2  
-
-do
-
-#==========================================================
-# TESTS FOR XIOS USING GYRE CONFIGURATION AT LOW RESOLUTION
-#==========================================================
-
-if [ ${config} -eq 1 ] ;  then
-    ## Test of XIOS configured in attached mode with multiple output files (one for each process). 
-    ## $NPROC processes are used 
-
-    NPROC=4
-    jp_cfg=1
-    jpni=2
-    jpnj=2
-    export NUM_XIOSERVERS=0
-    export USING_MPMD="false"
-
-    export TEST_NAME="ATTACHED_MULTIPLE"
-
-    cd ${SETTE_DIR}
-    . ../cfgs/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
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}  
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml multiple_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-
-    ## Test of XIOS configured in attached mode with a single output file. 
-
-    export TEST_NAME="ATTACHED_ONE"
-    export NUM_XIOSERVERS=0
-    export USING_MPMD="false"
-    cd ${SETTE_DIR} 
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml one_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-
-    ## Test of XIOS configured in detached mode with a single output file. 
-    ## $NUM_XIOSERVERS IO server are used.
-    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
-
-    export TEST_NAME="DETACHED_ONE"
-    export NUM_XIOSERVERS=2
-    export USING_MPMD="true"
-    cd ${SETTE_DIR}
-#
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml one_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server). 
-    ## $NUM_XIOSERVERS IO server are used.
-    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
-
-
-    export TEST_NAME="DETACHED_MULTIPLE"
-    export NUM_XIOSERVERS=2
-    export USING_MPMD="true"
-    cd ${SETTE_DIR}
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_LR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml multiple_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-fi
-
-#==========================================================
-# TESTS FOR XIOS USING GYRE CONFIGURATION AT HIGH RESOLUTION
-#==========================================================
-
-if [ ${config} -eq 2 ] ;  then
-    ## Test of XIOS configured in attached mode with multiple output files (one for each process). 
-    ## $NPROC processes are used 
-
-    NPROC=64
-    jp_cfg=30
-    jpni=8
-    jpnj=8
-    export NUM_XIOSERVERS=0
-    export USING_MPMD="false"
-
-    export TEST_NAME="ATTACHED_MULTIPLE"
-
-    cd ${SETTE_DIR}
-    . ../cfgs/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
-#
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg nn_bench 1
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml multiple_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-
-    ## Test of XIOS configured in attached mode with a single output file. 
-
-    export TEST_NAME="ATTACHED_ONE"
-    export NUM_XIOSERVERS=0
-    export USING_MPMD="false"
-    cd ${SETTE_DIR}
-#
-    . ./prepare_exe_dir.sh
-#
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg nn_bench 1
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml one_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-
-    ## Test of XIOS configured in detached mode with a single output file. 
-    ## $NUM_XIOSERVERS IO server are used.
-    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
-
-    export TEST_NAME="DETACHED_ONE"
-    export NUM_XIOSERVERS=8
-    export USING_MPMD="true"
-    cd ${SETTE_DIR}
-#
-    . ./prepare_exe_dir.sh
-#
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg nn_bench 1
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml one_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-    ## Test of XIOS configured in detached mode with multiple output files (one for each IO server). 
-    ## $NUM_XIOSERVERS IO server are used.
-    ## the total number of allocated cores is $NUM_XIOSERVERS + $NPROC 
-
-    export TEST_NAME="DETACHED_MULTIPLE"
-    export NUM_XIOSERVERS=8
-    export USING_MPMD="true"
-    cd ${SETTE_DIR}
-    . ./prepare_exe_dir.sh
-    JOB_FILE=${EXE_DIR}/run_job.sh
-    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
-    cd ${EXE_DIR}
-    set_namelist namelist_cfg cn_exp \"GYRE_XIOS_HR\"
-    set_namelist namelist_cfg nn_it000 1
-    set_namelist namelist_cfg nn_itend 120
-    set_namelist namelist_cfg nn_stock 120
-    set_namelist namelist_cfg nn_bench 1
-    set_namelist namelist_cfg ln_clobber .true.
-    set_namelist namelist_cfg jp_cfg $jp_cfg
-    set_namelist namelist_cfg jpidta $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjdta $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpiglo $(( $jp_cfg * 30 + 2 ))
-    set_namelist namelist_cfg jpjglo $(( $jp_cfg * 20 + 2 ))
-    set_namelist namelist_cfg jpni $jpni
-    set_namelist namelist_cfg jpnj $jpnj
-    set_namelist namelist_cfg jpnij $NPROC
-
-    set_xio_using_server iodef.xml $USING_MPMD
-    set_xio_file_type    iodef.xml multiple_file
-
-    cd ${SETTE_DIR}
-    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS}
-
-    cd ${SETTE_DIR}
-    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
-
-fi
-
-done
