Index: /utils/CI/sette/README.rst
===================================================================
--- /utils/CI/sette/README.rst	(revision 12568)
+++ /utils/CI/sette/README.rst	(revision 12569)
@@ -81,4 +81,6 @@
              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.
+          - user can enforce synchronisation (-s option) of the existing CFG_ST with the REF configuration (EXPREF and MY_SRC). 
+          - user can enforce cleaning of the CFG_ST configuration (use of makenemo -n CFG_ST clean) (-c option)
 * ``sette_rpt.sh``            : it generates the sette report.
           - if no argument is given, the report will be generated on the last changed revision.
Index: /utils/CI/sette/all_functions.sh
===================================================================
--- /utils/CI/sette/all_functions.sh	(revision 12568)
+++ /utils/CI/sette/all_functions.sh	(revision 12569)
@@ -91,8 +91,86 @@
 usage=" if value is a string ths is neede syntax : ./set_namelist namelist_name var_name \"new_value\" "
 
+# sync MYSRC files (input CFG and CFG_ST)
+sync_config() {
+   if [ ${SYNC_CONFIGS} == "yes" ]; then
+
+      lREF=$3/$1    # reference 
+      lCFG=$3/$2    # target
+
+      echo '-------------------------------------------------------------------------------'
+      echo '                    SOURCE AND CONFIG FILES SYNCHRONISATION                    '
+      echo ''
+      echo "configuration $lCFG/MY_SRC will be synchronised with $lREF/MY_SRC"
+      echo ''
+      # synchronise MY_SRC if $lCFG directory exist
+      if [ -d $lREF/MY_SRC ] && [ -d $lCFG ] ; then
+
+         if [ -d $lCFG/MY_SRC ] ; then
+
+            # Manage case number of file in MY_SRC changes
+            # find number of file only in $lCFG/MY_SRC
+            FCFG=`diff -r $lREF/MY_SRC $lCFG/MY_SRC | grep "Only in $lCFG/MY_SRC" | awk '{print $4}'`
+
+            # if more than 0, trigger a cleaning as Makenemo do not properly manage this case.
+            if [ ! -z "$FCFG" ]; then 
+               echo ''
+               echo "$lCFG contains a different file list than $lREF :"
+               diff -r $lREF/MY_SRC $lCFG/MY_SRC | grep "Only in $lCFG/MY_SRC" | awk '{print $4}'
+               echo "Synchronisation is not enough because Makenemo does not handle well case where a file in MY_SRC is removed"
+               echo "Therefore, we need to clean $lCFG before starting runing it"
+               echo ''
+               CLEAN_CONFIGS="yes"
+            fi
+         fi
+
+         # synchronisation $lREF/MY_SRC directory (and delete file in target location if needed)
+         rsync -a --delete $lREF/MY_SRC/ $lCFG/MY_SRC
+
+         # rsync keep preserve the modification time stamp.
+         # To avoid case where a file in MY_SRC is replace by an older file, we touch the file
+         touch $lCFG/MY_SRC/*
+      fi
+
+      echo ''
+      echo "configuration $lCFG/EXP00 will be synchronised with $lREF/EXPREF"
+      echo "(links are skipped)"
+      echo ''
+      # synchronize EXPREF
+      if [ -d $lREF/EXPREF ] && [ -d $lCFG/EXP00 ] ; then
+         rsync -a --no-links $lREF/EXPREF/ $lCFG/EXP00/.
+      fi
+      echo '-------------------------------------------------------------------------------'
+   fi
+}
+
+# clean _ST config (input CFG CFG_ST TYPE (test or ref))
+clean_config() {
+   if [ ${CLEAN_CONFIGS} == "yes" ]; then
+      lREF=$1
+      lCFG=$2
+      lTYP=$3
+      echo ''
+      echo '-------------------------------------------------------------------------------'
+      echo '                         CLEANING CONFIGURATION                                '
+      echo ''
+      echo "./makenemo -n $lCFG -a/-r $lREF clean"
+      echo ''
+      if [ ${lTYP} == 'tests' ]; then
+         ./makenemo -n $lCFG -a $lREF clean
+      elif [ ${lTYP} == 'cfgs' ]; then
+         ./makenemo -n $lCFG -r $lREF clean
+      else
+         echo 'ERROR in the cleaning process'; exit 42
+      fi
+      echo ''
+      echo "$lCFG configuration has been cleaned"
+      echo ''
+      echo '-------------------------------------------------------------------------------'
+   fi
+}
+
 # define validation dir
 set_valid_dir () {
-    LANG=en_US
-    REVISION_NB=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${SETTE_DIR}/.. | grep "Last Changed Rev" | awk '{print $NF}'`
+    REVISION_NB=`${SVN_CMD} info ${SETTE_DIR}/.. | grep "Last Changed Rev" | awk '{print $NF}'`
     if [ ${#REVISION_NB} -eq 0 ]
     then
@@ -156,12 +234,27 @@
                 LINEVAR=$( grep -s -n "$VAR_NAME" ${EXE_DIR}/$NAMREF | awk -F: '{ { print $1} }' )
                 echo " $VAR_NAME found in ${EXE_DIR}/$NAMREF at line $LINEVAR " >> ${SETTE_DIR}/output.sette
+
 #   search for namelist group name
                 NAMGRP=$( head -n$LINEVAR ${EXE_DIR}/$NAMREF | grep --line-buffered "^&nam" | tail -1 | awk -F" " '{ { print $1} }' ) 
                 echo " variable $VAR_NAME will be added in $NAMGRP namelist-group of namelist file ${EXE_DIR}/$1 " >> ${SETTE_DIR}/output.sette
+
+# check if namelist group present in namelist_cfg
+# if missing group is added at the end of namelist_cfg
+                NGRP=$(grep ${NAMGRP} ${EXE_DIR}/$1 | wc -l )
+                if [ ${NGRP} -eq 0 ]; then
+                   echo ''                                                                          >> ${SETTE_DIR}/output.sette
+                   echo "+++++ Group ${NAMGRP} containing ${2} is missing in ${EXE_DIR}/$1 +++++ "  >> ${SETTE_DIR}/output.sette
+                   echo "+++++ Group ${NAMGRP}                 is added   in ${EXE_DIR}/$1 +++++ "  >> ${SETTE_DIR}/output.sette
+                   echo ''                                                                          >> ${SETTE_DIR}/output.sette
+                   echo "&${NAMGRP}" >> ${EXE_DIR}/$1
+                   echo "/"          >> ${EXE_DIR}/$1
+                fi
+
 # Add $VARNAME in namelist file ${EXE_DIR}/$1 in namelist group $NAMGRP
 # on mac osx, replace sed --posix by gsed (available with mac port)
                 sed --posix "/${NAMGRP} /a\ ${VAR_NAME} " ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp || gsed --posix "/${NAMGRP} /a\ ${VAR_NAME} " ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
+
 # if file not empty replace ${EXE_DIR}/$1
-                if [ -s ${EXE_DIR}/$1.tmp ] ; then
+               if [ -s ${EXE_DIR}/$1.tmp ] ; then
                    mv ${EXE_DIR}/$1.tmp ${EXE_DIR}/$1 
                 else
Index: /utils/CI/sette/param.cfg
===================================================================
--- /utils/CI/sette/param.cfg	(revision 12568)
+++ /utils/CI/sette/param.cfg	(revision 12569)
@@ -62,6 +62,12 @@
 # add key key_nosignedzero at the compilation step
 ADD_NOSIGNEDZERO=${SETTE_ADD_NOSIGNEDZERO:-"yes"}
-#- only for IBM
+# only for IBM
 #TMPDIR=${CONFIG_DIR}/${NEW_CONF}/EXP00
+# cleaning CFG_ST
+CLEAN_CONFIGS=${SETTE_CLEAN_CONFIGS:-"no"}
+# synchronisation MY_SRC and EXP00 of CFG_ST with MY_SRC and EXPREF form CFG
+SYNC_CONFIGS=${SETTE_SYNC_CONFIGS:-"no"}
+# langage (only en_US supported). This is used to grep information form linux/svn command.
+LC_MESSAGES=en_US
 # ------------------------------------------------------------------------------------------
 #
@@ -70,2 +76,6 @@
 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"}
 # ------------------------------------------------------------------------------------------
+#
+# reporting  
+# Set number of passes (default only 1). For a second pass, set '0 1'
+RPT_PASSES=${SETTE_RPT_NPASSES:-'0'} 
Index: /utils/CI/sette/sette.sh
===================================================================
--- /utils/CI/sette/sette.sh	(revision 12568)
+++ /utils/CI/sette/sette.sh	(revision 12569)
@@ -5,17 +5,24 @@
 
 # Parse command-line arguments
-#
-#  -t "test configurations": select active test configurations
-#                            (overrides selection made using
-#                            environment variable SETTE_TEST_CONFIGS)
-
 if [ $# -gt 0 ]; then
-  while getopts :ht: option; do 
+  while getopts t:csh option; do 
      case $option in
+        c) export SETTE_CLEAN_CONFIGS='yes'
+           export SETTE_SYNC_CONFIGS='yes'
+           echo ""
+           echo "Configuration $SETTE_TEST_CONFIGS will be cleaned; this option enforces also synchronisation"
+           echo "";;
+        s) export SETTE_SYNC_CONFIGS='yes'
+           echo ""
+           echo "MY_SRC and EXP00 in $SETTE_TEST_CONFIGS will be synchronised with the MY_SRC and EXPREF from the reference configuration"
+           echo "";;
         t) export SETTE_TEST_CONFIGS=$OPTARG
            echo ""
            echo "Configuration $SETTE_TEST_CONFIGS will be tested if they are available"
            echo "" ;;
-        h | *) echo 'sette.sh allow no arguments (all configuration will be tested or -t "CFG1_to_test CFG2_to_test ..."'; exit 42 ;;
+        h | *) echo 'sette.sh allows no arguments (in this case all configuration will be tested)'
+               echo '-t "CFG1_to_test CFG2_to_test ..." to test some specific configurations'
+               echo '-c to clean each configuration'
+               echo '-s to synchronise the sette MY_SRC and EXP00 with the reference MY_SRC and EXPREF'; exit 42 ;;
      esac
   done
@@ -57,7 +64,7 @@
 while [[ $NRUN -ne 0 && $nit -le 1080 ]]; do
    nit=$((nit+1))
-   NRUN=$( ${BATCH_STAT} | grep nemo_sette | wc -l ) 
+   NRUN=$( ${BATCH_STAT} | grep ${BATCH_NAME} | wc -l ) 
    if [[ $NRUN -ne 0 ]]; then 
-      printf "%-3d %s\r" $NRUN 'nemo_sette run still in queue or running ...';
+      printf "%-3d %s\r" $NRUN 'nemo_sette runs still in queue or running ...';
    else
       printf "%-50s\n" " "
Index: /utils/CI/sette/sette_list_avail_rev.sh
===================================================================
--- /utils/CI/sette/sette_list_avail_rev.sh	(revision 12568)
+++ /utils/CI/sette/sette_list_avail_rev.sh	(revision 12569)
@@ -1,4 +1,26 @@
 #!/bin/bash -f
 # set -vx
+
+SETTE_DIR=$(cd $(dirname "$0"); pwd)
+MAIN_DIR=$(dirname $SETTE_DIR)
+
+. ./param.cfg
+
+if [ $# -gt 0 ]; then
+  while getopts c:h option; do 
+     case $option in
+        c) COMPILER=$OPTARG;;
+        h | *) echo ''
+               echo 'sette_list_avail_rev.sh : ' 
+               echo '     list all sette directory and available revisions created with the compiler specified in param.cfg or in the startup file)'
+               echo '-c COMPILER_name :'
+               echo '     list all sette directory and available revisions created with the compiler specified'
+               echo ''
+               exit 42;;
+     esac
+  done
+  shift $((OPTIND - 1))
+fi
+
 #
 lst_rev () {
@@ -24,4 +46,5 @@
        rev=`echo $ALLLST | cut -d\  -f ${irev}`
        cfgrev=`echo $CFGLST | cut -d\  -f ${irevcfg}`
+       if [ -z $cfgrev ] ; then cfgrev=-9999 ; fi
        if [ $cfgrev == $rev ] ; then
           printf "%-6s  " $rev
@@ -34,13 +57,9 @@
 }
 
-  SETTE_DIR=$(cd $(dirname "$0"); pwd)
-  MAIN_DIR=$(dirname $SETTE_DIR)
-  . ./param.cfg
 
-  mach=${COMPILER}
-  NEMO_VALID=${NEMO_VALIDATION_DIR}
+  NEMO_VALID=${NEMO_VALIDATION_DIR}/
  
  # list of all revision available
- DIRLST=`find ${NEMO_VALID} -maxdepth 3 -mindepth 3 -type d | sed -e 's/.*\/W.*\///' | sort -u -r`
+ DIRLST=`find ${NEMO_VALID} -maxdepth 3 -mindepth 3 -type d -regex ".*\/W.*\/${COMPILER}\/.*" | sed -e "s/.*\/W.*\/${COMPILER}\///" | sort -u -r`
 
  # display header
@@ -49,5 +68,5 @@
  echo ""
  printf " List of all avail. rev. is : "
- for dir in `echo $DIRLST`; do printf "%5s  " $dir ; done
+ for dir in `echo $DIRLST`; do printf "%-6s  " $dir ; done
  printf "\n"
 
Index: /utils/CI/sette/sette_reference-configurations.sh
===================================================================
--- /utils/CI/sette/sette_reference-configurations.sh	(revision 12568)
+++ /utils/CI/sette/sette_reference-configurations.sh	(revision 12569)
@@ -162,4 +162,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  GYRE_PISCES GYRE_PISCES_ST 'cfgs'
+    clean_config GYRE_PISCES GYRE_PISCES_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n GYRE_PISCES_ST -r GYRE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -298,4 +304,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs'
+    clean_config ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_PISCES_ST -r ORCA2_ICE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -519,4 +531,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs'
+    clean_config ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n ORCA2_OFF_PISCES_ST -r ORCA2_OFF_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -689,4 +707,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  AMM12 AMM12_ST 'cfgs'
+    clean_config AMM12 AMM12_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n AMM12_ST -r AMM12 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -812,4 +836,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs'
+    clean_config ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n ORCA2_SAS_ICE_ST -r ORCA2_SAS_ICE -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -942,4 +972,10 @@
     export TEST_NAME="REPRO_4_8"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs'
+    clean_config ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_OBS_ST -r ORCA2_ICE_PISCES -d "OCE ICE"  -j 8 add_key "key_asminc ${ADD_KEYS}" del_key "key_top"
     cd ${SETTE_DIR}
@@ -1050,4 +1086,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  AGRIF_DEMO AGRIF_DEMO_ST 'cfgs'
+    clean_config AGRIF_DEMO AGRIF_DEMO_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -1302,4 +1344,10 @@
     export TEST_NAME="ORCA2"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs'
+    clean_config AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_NOAGRIF_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "key_agrif"
     cd ${SETTE_DIR}
@@ -1338,4 +1386,10 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    sync_config  SPITZ12 SPITZ12_ST 'cfgs'
+    clean_config SPITZ12 SPITZ12_ST 'cfgs'
+    #
     . ./makenemo -m ${CMP_NAM} -n SPITZ12_ST -r SPITZ12 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
Index: /utils/CI/sette/sette_rpt.sh
===================================================================
--- /utils/CI/sette/sette_rpt.sh	(revision 12568)
+++ /utils/CI/sette/sette_rpt.sh	(revision 12569)
@@ -15,5 +15,5 @@
     dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
     dorv=`echo $dorv | sed -e 's:.*/::'`
-    dorv2=`ls -1rt $vdir/$nam2/$mach/ | tail -1l `
+    dorv2=`ls -1rt $vdir/$nam2/$mach/ 2>/dev/null | tail -1l `
     dorv2=`echo $dorv2 | sed -e 's:.*/::'`
   else
@@ -211,5 +211,5 @@
       else
         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)"
+        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
@@ -283,5 +283,6 @@
         fi
       else
-        printf "%-20s %s %s\n" $nam  " run.stat    files are DIFFERENT "
+        get_ktdiff $f1s $f2s
+        printf "%-20s %s %s %-5s %s\n" $nam  " run.stat    files are DIFFERENT (results are different after " $ktdiff " time steps)"
 #
 # Offer view of differences on the second pass
@@ -306,5 +307,6 @@
         fi
       else
-        printf "%-20s %s %s\n" $nam  " tracer.stat files are DIFFERENT "
+        get_ktdiff $f1t $f2t
+        printf "%-20s %s %s %-5s %s\n" $nam  " tracer.stat files are DIFFERENT (results are different after " $ktdiff " time steps) "
 #
 # Offer view of differences on the second pass
@@ -418,5 +420,4 @@
   NEMO_VALID=${NEMO_VALIDATION_DIR}
   NEMO_VALID_REF=${NEMO_VALIDATION_REF}
-  LANG=en_US
 #
   if [ ! -d $NEMO_VALID ]; then
@@ -425,21 +426,39 @@
   fi
 #
-# Directory to run the tests
-  CONFIG_DIR0=${MAIN_DIR}/cfgs
-  TOOLS_DIR=${MAIN_DIR}/tools
-  NPROC=32
-  SAS_RESTART_DIR=${CONFIG_DIR0}/ORCA2_SAS_ICE_ST
 #
 # Show current revision tag and branch name
 #
 echo ""
-lastchange=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep 'Last Changed Rev' | awk '{print $NF}'`
-revision=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep 'Revision' | awk '{print $NF}'`
-branchname=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep ^URL | awk -F ipsl/forge/projets/nemo/svn/ '{print $NF}'`
+lastchange=`${SVN_CMD} info ${MAIN_DIR} | grep 'Last Changed Rev' | awk '{print $NF}'`
+revision=`${SVN_CMD} info ${MAIN_DIR} | grep 'Revision' | awk '{print $NF}'`
+branchname=`${SVN_CMD} info ${MAIN_DIR} | grep ^URL | awk -F ipsl/forge/projets/nemo/svn/ '{print $NF}'`
 echo "Current code is : $branchname @ r$revision  ( last change @ r$lastchange )"
 [ `${SVN_CMD} status -q ${MAIN_DIR}/{cfg,tests,src} | wc -l` -ge 1 ] && lastchange=${lastchange}+
 
-# overwrite revision is argument 1 present
-[[ $# -eq 1 ]] && lastchange=$1
+# overwrite revision or compiler
+  if [ $# -gt 0 ]; then
+    while getopts r:c:h option; do 
+       case $option in
+          c) mach=$OPTARG;;
+          r) rev=$OPTARG;;
+          h | *) echo ''
+                 echo 'sette_rpt.sh : ' 
+                 echo '     display result for the latest change'
+                 echo ' -c COMPILER_name :'
+                 echo '     display result for the specified compiler'
+                 echo ' -r REVISION_number :'
+                 echo '     display sette results for the specified revision (set old for the latest revision available for each config)'
+                 echo ''
+                 exit 42;;
+       esac
+    done
+    shift $((OPTIND - 1))
+fi
+
+# if $1 (remaining arguments)
+if [[ ! -z $1 ]] ; then rev=$1 ; fi
+
+# by default use the current lastchanged revision
+lastchange=${rev:-$lastchange}
 
 echo ""
@@ -454,5 +473,5 @@
 # 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 
+for pass in  $RPT_PASSES 
 do
 #
Index: /utils/CI/sette/sette_test-cases.sh
===================================================================
--- /utils/CI/sette/sette_test-cases.sh	(revision 12568)
+++ /utils/CI/sette/sette_test-cases.sh	(revision 12569)
@@ -164,4 +164,11 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    . ${SETTE_DIR}/all_functions.sh
+    #
+    clean_config OVERFLOW OVERFLOW_ST 'tests'
+    #
+    sync_config  OVERFLOW OVERFLOW_ST 'tests'
+    #
     . ./makenemo -m ${CMP_NAM} -n OVERFLOW_ST -a OVERFLOW -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -259,4 +266,12 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    #
+    clean_config LOCK_EXCHANGE LOCK_EXCHANGE_ST 'tests'
+    #
+    sync_config  LOCK_EXCHANGE LOCK_EXCHANGE_ST 'tests'
+    #
     . ./makenemo -m ${CMP_NAM} -n LOCK_EXCHANGE_ST -a LOCK_EXCHANGE -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -355,4 +370,12 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    #
+    clean_config VORTEX VORTEX_ST 'tests'
+    #
+    sync_config  VORTEX VORTEX_ST 'tests'
+    #
     . ./makenemo -m ${CMP_NAM} -n VORTEX_ST -a VORTEX -j 8  add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -524,4 +547,12 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    #
+    clean_config ICE_AGRIF ICE_AGRIF_ST 'tests'
+    #
+    sync_config  ICE_AGRIF ICE_AGRIF_ST 'tests'
+    #
     . ./makenemo -m ${CMP_NAM} -n ICE_AGRIF_ST -a ICE_AGRIF -j 8  add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
@@ -701,4 +732,12 @@
     export TEST_NAME="LONG"
     cd ${MAIN_DIR}
+    #
+    # syncronisation if target directory/file exist (not done by makenemo)
+    . ${SETTE_DIR}/all_functions.sh
+    #
+    clean_config ISOMIP ISOMIP_ST 'tests'
+    #
+    sync_config  ISOMIP ISOMIP_ST 'tests'
+    #
     . ./makenemo -m ${CMP_NAM} -n ISOMIP_ST -a ISOMIP -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
     cd ${SETTE_DIR}
