Index: /NEMO/branches/2019/fix_sette_ticket2239/README
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/README	(revision 10707)
+++ /NEMO/branches/2019/fix_sette_ticket2239/README	(revision 10708)
@@ -67,4 +67,7 @@
 	       NOTE: if INTERACT_FLAG="no" it is needed a batch_file (see below to create a new one)
 
+ in sette_rpt.sh : if no argument are 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
+
 NOTE:
 in case of error you can remove you NEW_CONF directory and all files doing :
Index: /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.sh
===================================================================
--- /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.sh	(revision 10707)
+++ /NEMO/branches/2019/fix_sette_ticket2239/sette_rpt.sh	(revision 10708)
@@ -24,7 +24,12 @@
 
 #
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+#
+# check if directory is here
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-27s %s %s %s\n" $nam  " directory                  MISSING : " $dorv " ( run did not start / finish correctly ) "
+    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`
@@ -103,7 +108,12 @@
   pass=$3
 #
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+#
+# check if directory is here
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-27s %s %s %s\n" $nam  " directory                  MISSING : " $dorv " ( run did not start / finish correctly ) "
+    return
+  fi
+
+  if [ -d $vdir/$nam/$mach/$dorv ]; then
     f1o=$vdir/$nam/$mach/$dorv/LONG/ocean.output
     f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
@@ -196,7 +206,11 @@
   pass=$3
 #
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+# check if directory is here
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-27s %s %s %s\n" $nam  " directory                  MISSING : " $dorv " ( run did not start / finish correctly ) "
+    return
+  fi
+#
+  if [ -d $vdir/$nam/$mach/$dorv ]; then
     rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -2l | head -1 `
     rep2=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -1l`
@@ -252,5 +266,5 @@
         fi
       else
-        printf "%-27s %s %s\n" $nam  " tracer.stat reproducibility  FAILED : " $dorv
+        printf "%-27s %s %s\n" $nam  " tracer.stat reproducibility FAILED : " $dorv
 #
 # Offer view of differences on the second pass
@@ -289,11 +303,14 @@
 # check if reference directory is present
   if [ ! -d $vdirref/$nam/$mach/$dorvref ]; then
-    printf "%s\n" " REFERENCE directory $vdirref/$nam/$mach/$dorvref is MISSING"
+    printf "%-25s %-27s %s\n" " REFERENCE directory for " $nam " at $dorvref is MISSING"
     return
   fi
-#
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+  if [ ! -d $vdir/$nam/$mach/$dorv ]; then
+    printf "%-25s %-27s %s\n" " VALID directory for " $nam " at $dorv is MISSING"
+    return
+  fi
+
+#
+  if [ -d $vdir/$nam/$mach/$dorv ]; then
     f1s=$vdir/$nam/$mach/$dorv/LONG/run.stat
     f1t=$vdir/$nam/$mach/$dorv/LONG/tracer.stat
@@ -364,7 +381,7 @@
   pass=$3
 #
-  if [ -d $vdir/$nam ]; then
-    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l `
-    dorv=`echo $dorv | sed -e 's:.*/::'`
+# no print needed if the repository is not here (already catch before)
+#
+  if [ -d $vdir/$nam/$mach/$dorv/ ]; then
     rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep LONG | head -1 `
     if  [  -z $rep1 ] ; then
@@ -482,5 +499,15 @@
 revision=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep 'Revision' | awk '{print $NF}'`
 branchname=`LC_MESSAGES=${LANG} ${SVN_CMD} info ${MAIN_DIR} | grep ^URL | awk -F ipsl/forge/projets/nemo/svn/ '{print $NF}'`
-echo "SETTE validation report : $branchname @ r$revision  ( last change @ r$lastchange )"
+echo "Current code is : $branchname @ r$revision  ( last change @ r$lastchange )"
+
+# overwrite revision is argument 1 present
+[[ $# -eq 1 ]] && revision=$1
+
+echo ""
+echo "SETTE validation report generated for : $branchname @ r$revision"
+echo ""
+
+dorv=$revision
+
 #
 # The script also needs the date or revision tag. Currently this is taken from the latest sub-directory found in each directory
@@ -537,7 +564,8 @@
    echo ''
    echo 'check result differences between :'
-   echo "$NEMO_VALID at rev $revision"
+   echo "VALID directory : $NEMO_VALID at rev $revision"
    echo 'and'
-   echo "$NEMO_VALID_REF at rev $NEMO_REV_REF"
+   echo "REFERENCE directory : $NEMO_VALID_REF at rev $NEMO_REV_REF"
+   echo ''
    for repro_test in WGYRE_PISCES_ST WORCA2_ICE_PISCES_ST WORCA2_OFF_PISCES_ST WAMM12_ST WISOMIP_ST WORCA2_SAS_ICE_ST WAGRIF_DEMO_ST WSPITZ12_ST WISOMIP_ST WVORTEX_ST WICE_AGRIF_ST
    do
