Index: /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_beginner.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_beginner.sh	(revision 11140)
+++ /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_beginner.sh	(revision 11140)
@@ -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: /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_rpt.SAS.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_rpt.SAS.sh	(revision 11140)
+++ /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_rpt.SAS.sh	(revision 11140)
@@ -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: /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_xios.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_xios.sh	(revision 11140)
+++ /NEMO/branches/2019/fix_sette_ticket2239/OLD_SCRIPT/sette_xios.sh	(revision 11140)
@@ -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: MO/branches/2019/fix_sette_ticket2239/README
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/README	(revision 11139)
+++ 	(revision )
@@ -1,133 +1,0 @@
-usage of SETTE package:
-
-INSTALLATION:
-The sette directory have to be located in the main directory (at the same level as src/ or cfg/).
-
-PRINCIPAL 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 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 (COMPILER, NEMO_VALIDATION_REF, NEMO_REV_REF) have to be specified in param.cfg
-      - variables (BATCH_CMD, BATCH_STAT, BATCH_NAME, FORCING_DIR, SVN_CMD, 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:
-               COMPILER            : compiler among those available in NEMOGCM/ARCH
-               #
-               # reference version for bit reproducibility results
-               NEMO_VALIDATION_REF : reference directory
-               NEMO_REV_REF        : reference revision
-               #
-               # 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
-          - 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
- * 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 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
-   - 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. 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)
-4. add a bloc in one of the sette_reference-configuration.sh or sette_test-cases.sh script 
-5. 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}
-   (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")
-
-
-
-
-
-USER MODIFICATIONS (sequential/parrallel (default), interacive or not (default) and mpi (default) or not )
- * in sette_cfg-ref.sh and sette_test-cases.sh script :
-	  - BATCH_COMMAND_PAR is the command for job submission in batch mode parallel (MMIÂ) 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)
-
-USAGE of internal function/script
- * 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
-                          - 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 arguments are INPUT_FILE_CONFIG_NAME NUMBER_PROC TEST_NAME MPIRUN_FLAG JOB_FILE
- * fcm_job.sh         : input arguments are 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   )
-                          - 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)
-                          - if INTERACT_FLAG="no" it is needed a batch_file (see below to create a new one)
Index: /NEMO/branches/2019/fix_sette_ticket2239/README.rst
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/README.rst	(revision 11140)
+++ /NEMO/branches/2019/fix_sette_ticket2239/README.rst	(revision 11140)
@@ -0,0 +1,143 @@
+======================
+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 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
+          - 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
+* ``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: /NEMO/branches/2019/fix_sette_ticket2239/param.cfg
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/param.cfg	(revision 11139)
+++ /NEMO/branches/2019/fix_sette_ticket2239/param.cfg	(revision 11140)
@@ -1,6 +1,3 @@
 # Computer/user dependant variable needed to run sette
-#
-# Compiler among those in NEMOGCM/ARCH
-COMPILER=X64_ADA
 #
 # REFERENCE run.stat tracer.stat you want to compare with
@@ -11,10 +8,17 @@
 # ------------------------------------------------------------------------------------------
 # IMPORTANT:
-# variables (BATCH_CMD, BATCH_STAT, BATCH_NAME, FORCING_DIR, SVN_CMD, ADD_NOSIGNEDZERO)
+# 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.
+# 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
@@ -25,14 +29,30 @@
 # generic sette job name (as it appears with $BATCH_STAT command)
 BATCH_NAME=${SETTE_BATCH_NAME:-sette}
+# ------------------------------------------------------------------------------------------
 #
-#
-# FILES STORING
+# FILES STORING paths
 # forcing files storing
 FORCING_DIR=${SETTE_FORCING_DIR:-$WORKDIR/FORCING}
 # validation files storing
-NEMO_VALIDATION_DIR=${WORKDIR:-$MAIN_DIR}/NEMO_VALIDATION
+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
@@ -44,7 +64,8 @@
 #- only for IBM
 #TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00
-#
+# ------------------------------------------------------------------------------------------
 #
 # 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: MO/branches/2019/fix_sette_ticket2239/sette_beginner.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_beginner.sh	(revision 11139)
+++ 	(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: /NEMO/branches/2019/fix_sette_ticket2239/sette_reference-configurations.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_reference-configurations.sh	(revision 11139)
+++ /NEMO/branches/2019/fix_sette_ticket2239/sette_reference-configurations.sh	(revision 11140)
@@ -101,5 +101,4 @@
 export INTERACT_FLAG="no"
 export MPIRUN_FLAG="yes"
-export USING_XIOS="yes"
 export USING_ICEBERGS="yes"
 #
@@ -118,12 +117,11 @@
 # 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
 #
Index: MO/branches/2019/fix_sette_ticket2239/sette_rpt.SAS.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.SAS.sh	(revision 11139)
+++ 	(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: /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.sh	(revision 11139)
+++ /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.sh	(revision 11140)
@@ -20,91 +20,6 @@
 }
 
-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
-
-# 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
-    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
-    #
-    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 get_ktdiff() {
+  ktdiff=`diff ${1} ${2} | head -2 | grep it | awk '{ print $4 }'`
 }
 
@@ -159,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
@@ -188,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
@@ -263,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
@@ -289,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
@@ -426,5 +345,5 @@
           nerr=`grep 'E R R O R' $f1o | wc -l`
           if [[ $nerr > 0 ]]; then
-             printf "%-27s %s %s %s\n" $nam " run                         FAILED : " $dorv " ( E R R O R in ocean.output) " 
+             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"
@@ -479,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
@@ -559,11 +479,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 ""
Index: /NEMO/branches/2019/fix_sette_ticket2239/sette_test-cases.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_test-cases.sh	(revision 11139)
+++ /NEMO/branches/2019/fix_sette_ticket2239/sette_test-cases.sh	(revision 11140)
@@ -60,7 +60,4 @@
 #                      (run.stat and ocean.output) in it after execution of test.
 #
-#  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 )
-#
 #  VALIDATION tree is:
 #
@@ -70,4 +67,9 @@
 #                       execution directory takes name of TEST_NAME defined for every test 
 #                       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
@@ -101,5 +103,4 @@
 export INTERACT_FLAG="no"
 export MPIRUN_FLAG="yes"
-export USING_XIOS="yes"
 #
 export DEL_KEYS="key_iomput"
@@ -117,12 +118,11 @@
 # 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
 #
Index: MO/branches/2019/fix_sette_ticket2239/sette_xios.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_xios.sh	(revision 11139)
+++ 	(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
