Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 1177)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 1178)
@@ -85,9 +85,4 @@
 # ie storage filesystem
 typeset -r STOREHOST=${MASTER}
-
-#====================================================
-# Source default environment
-#====================================================
-##. /etc/profile
 
 #====================================================
@@ -1068,10 +1063,4 @@
   fi
   if [ $DRYRUN = 0 ]; then
-#    if [ ! -d ${1} ] ; then
-#      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-#      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-#      return
-#    fi
-
     typeset NB_ESSAI DELAI status i
     # number of tentative
@@ -1102,5 +1091,5 @@
 
     if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Get_Dir : error."
+      IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}"
       cat /tmp/out_command.$$
       IGCM_debug_Exit "IGCM_sys_Get_Dir"
@@ -1267,5 +1256,5 @@
 #D-#==================================================
 #D-function IGCM_sys_PrepareTaredRestart
-#D-* Purpose: Prepare tared restart to be access by computing job. Identity here.
+#D-* Purpose: Prepare tared restart to be access by computing job.
 #D-* Examples:
 #D-
@@ -1305,19 +1294,4 @@
     IGCM_sys_MkdirArchive $( dirname $2 )
     #
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    #echo ${2} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #    typeset WORKPATH FILEPATH
-    #    WORKPATH=$( dirname $2 | sed -e "s|${R_OUT}|${R_BUF}|" )
-    #    IGCM_sys_MkdirWork ${WORKPATH}
-    #    FILEPATH=${WORKPATH}/$( basename $2 )
-    #    #
-    #    IGCM_sys_Cp ${1} ${FILEPATH}
-    #fi
-
     exist=false
     skip=false
@@ -1523,21 +1497,4 @@
     fi
     eval DEST=\${${#}}
-
-    #=====================================================
-    #         COMMENT OUT DOUBLE COPY ON SCRATCHDIR
-    #=====================================================
-
-    # Is it an R_OUT file (not R_IN) ?
-    #echo ${dm_liste[0]} | grep "${R_OUT}" > /dev/null 2>&1
-    #if [ $? -eq 0 ] ; then
-    #  # Yes  ? then we try to get it in SCRATCHDIR
-    #  set +A file_work $( echo ${dm_liste[*]} | sed -e "s|${R_OUT}|${R_BUF}|g" )
-    #  if [ -f ${file_work[0]} ] ; then
-    #    IGCM_sys_Cp ${file_work[*]} ${DEST}
-    #    IGCM_debug_PopStack "IGCM_sys_Get"
-    #    return
-    #  fi
-    #fi
-
     ccc_hsm get ${dm_liste[*]} > /tmp/out_command.$$ 2>&1
     status=$?
@@ -1869,5 +1826,5 @@
 #D-#==================================================
 #D-function IGCM_sys_Put_Dods
-#D-* Purpose: Put $(ARCHIVE) files on DODS internet protocole.
+#D-* Purpose: Put ${ARCHIVE} files on DODS internet protocole.
 #D-* Examples:
 #D-
@@ -2317,5 +2274,5 @@
             string_final=""
             for index in `seq $slot $(($slot+$comp_proc_omp_loc-1))`; do
-	      (( index_slot = index * 2 ))	
+              (( index_slot = index * 2 ))
               string=$index_slot$virg
               string_final=$string_final$string
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 1177)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 1178)
@@ -68,5 +68,5 @@
 typeset  LOGIN=${LOGIN:=$( whoami )}
 # $hostname of the MASTER job
-typeset -r MASTER=${HOST}
+typeset MASTER=${HOST}
 
 #D-
@@ -175,5 +175,5 @@
   fi
 
-  # ON OBELIX NO SPECIAL CASE WHEN X${config_UserChoices_SpaceName} = XTEST
+  # ON DEFAULT MACHINE NO SPECIAL CASE WHEN X${config_UserChoices_SpaceName} = XTEST
 
   #====================================================
@@ -236,4 +236,18 @@
 
 #D-#==================================================
+#D-function IGCM_sys_RshArchive_NoError
+#D-* Purpose: Archive rsh command, without error
+#D-*          used only in monitoring.job
+#D-* Examples:
+#D-
+function IGCM_sys_RshArchive_NoError {
+  IGCM_debug_PushStack "IGCM_sys_RshArchive_NoError" $@
+  /bin/ksh <<-EOF
+    ${@} 2> \dev\null
+EOF
+  IGCM_debug_PopStack "IGCM_sys_RshArchive_NoError"
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Post-process rsh command
@@ -245,9 +259,8 @@
     echo "IGCM_sys_RshPost :" $@
   fi
-
   # keep standard input (stdin) for the loop onto temporary file
-  cat >tmp_IGCM_sys_RshPost_$$
-
-  /bin/ksh <tmp_IGCM_sys_RshPost_$$
+  cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
+
+  /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
   if [ $? -gt 0 ] ; then
     echo "IGCM_sys_RshPost : erreur."
@@ -255,5 +268,5 @@
   fi
   # delete temporary file
-  \rm tmp_IGCM_sys_RshPost_$$
+  \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
   IGCM_debug_PopStack "IGCM_sys_RshPost"
 }
@@ -334,10 +347,12 @@
   fi
   #- creation de repertoire sur le serveur fichier
-  mkdir -p $1
-  status=$?
-
-  if [ ${status} -gt 0 ] ; then
-    IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}"
-    IGCM_debug_Exit "IGCM_sys_MkdirArchive"
+  if [ ! -d ${1} ]; then
+    \mkdir -p $1
+    status=$?
+
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_MkdirArchive : mkdir failed error code ${status}"
+      IGCM_debug_Exit "IGCM_sys_MkdirArchive"
+    fi
   fi
   IGCM_debug_PopStack "IGCM_sys_MkdirArchive"
@@ -537,5 +552,5 @@
   fi
 
-  \tree -f $@
+  \ls -lR ${@}
 
   IGCM_debug_PopStack "IGCM_sys_Tree"
@@ -746,11 +761,11 @@
   mkdir -p ${HOME}/MIRROR/${PATHlibIGCM}
 
-  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > /tmp/out_command.$$ 2>&1
-  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> /tmp/out_command.$$ 2>&1
+  echo ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} > /tmp/out_command_${LOGIN}.$$ 2>&1
+  ${RSYNC} ${RSYNC_opt} ${libIGCM} ${HOME}/MIRROR/${PATHlibIGCM} >> /tmp/out_command_${LOGIN}.$$ 2>&1
   status=$?
 
   if [ ${status} -gt 0 ] ; then
     echo "IGCM_sys_Mirror_libIGCM Warning : no libIGCM on frontend."
-    cat /tmp/out_command.$$
+    cat /tmp/out_command_${LOGIN}.$$
   fi
   IGCM_debug_PopStack "IGCM_sys_Mirror_libIGCM"
@@ -770,14 +785,14 @@
   typeset status
 
-  echo cp $@ > /tmp/out_command.$$ 2>&1
-  \cp $@ >> /tmp/out_command.$$ 2>&1
+  echo cp $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
+  \cp $@ >> /tmp/out_command_${LOGIN}.$$ 2>&1
   status=$?
 
   if [ ${status} -gt 0 ] ; then
     echo "IGCM_sys_Cp : error code ${status}"
-    cat /tmp/out_command.$$
+    cat /tmp/out_command_${LOGIN}.$$
     IGCM_debug_Exit "IGCM_sys_Cp"
   else
-    \rm /tmp/out_command.$$
+    \rm /tmp/out_command_${LOGIN}.$$
   fi
   IGCM_debug_PopStack "IGCM_sys_Cp"
@@ -797,14 +812,14 @@
   typeset status
 
-  echo rm $@ > /tmp/out_command.$$ 2>&1
-  \rm $@ >> /tmp/out_command.$$ 2>&1
+  echo rm $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
+  \rm $@ >> /tmp/out_command_${LOGIN}.$$ 2>&1
   status=$?
 
   if [ ${status} -gt 0 ] ; then
     echo "IGCM_sys_Rm : error code ${status}"
-    cat /tmp/out_command.$$
+    cat /tmp/out_command_${LOGIN}.$$
     IGCM_debug_Exit "IGCM_sys_Rm"
   else
-    \rm /tmp/out_command.$$
+    \rm /tmp/out_command_${LOGIN}.$$
   fi
   IGCM_debug_PopStack "IGCM_sys_Rm"
@@ -842,17 +857,16 @@
     typeset status
 
-    echo mv $@ > /tmp/out_command.$$ 2>&1
-    \mv $@ >> /tmp/out_command.$$ 2>&1
+    echo mv $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
+    \mv $@ >> /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
 
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_Mv : error code ${status}"
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Exit "IGCM_sys_Mv"
     else
-      \rm /tmp/out_command.$$
-    fi
-  fi
-
+      \rm /tmp/out_command_${LOGIN}.$$
+    fi
+  fi
   IGCM_debug_PopStack "IGCM_sys_Mv"
 }
@@ -881,13 +895,13 @@
     #
     #USUAL WAY
-    \cp -r $1 $2 > /tmp/out_command.$$ 2>&1
+    \cp -r $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
 
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_Put_Dir : cp failed error code ${status}"
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Exit "IGCM_sys_Put_Dir"
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
     fi
   fi
@@ -906,22 +920,16 @@
   fi
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-      return
-    fi
-
     typeset status
 
     #USUAL WAY
-    \cp -ur $1 $2 > /tmp/out_command.$$ 2>&1
+    \cp -ur $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
 
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status}"
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Exit "IGCM_sys_Get_Dir"
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
     fi
   fi
@@ -954,5 +962,5 @@
     i=0
     while [ $i -lt $NB_ESSAI ] ; do
-      \cp -urL $1 $2 > /tmp/out_command.$$ 2>&1
+      \cp -urL $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1
       status=$?
       if [ ${status} -gt 0 ]; then
@@ -968,8 +976,8 @@
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_Get_Master : error."
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Exit "IGCM_sys_Get_Master"
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
     fi
   fi
@@ -1002,34 +1010,36 @@
     typeset status
     #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-    #
-    # Only if we use rsync
-    #IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-    #USUAL WAY
+    # USUAL WAY
     \cp $1 $2 > /tmp/out_command.$$ 2>&1
     status=$?
 
 #       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > /tmp/out_command.$$ 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> /tmp/out_command.$$ 2>&1
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > /tmp/out_command_${LOGIN}.$$ 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> /tmp/out_command_${LOGIN}.$$ 2>&1
 
 #       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > /tmp/out_command.$$ 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> /tmp/out_command.$$ 2>&1
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > /tmp/out_command_${LOGIN}.$$ 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> /tmp/out_command_${LOGIN}.$$ 2>&1
 
 #       status=$?
 #       IGCM_sys_Rsync_out $status
 
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command.$$
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command_${LOGIN}.$$
 #       (( status=status+$? ))
 
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
+      [ -f ${1} ] && ls -l ${1}
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
       cat /tmp/out_command.$$
       IGCM_debug_Exit "IGCM_sys_Put_Rest"
     else
+
+      if [ X${JobType} = XRUN ] ; then
+        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+      fi
+
       \rm /tmp/out_command.$$
     fi
@@ -1056,9 +1066,4 @@
 
     typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
     #
     # USUAL WAY
@@ -1073,4 +1078,10 @@
       IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
     else
+
+      if [ X${JobType} = XRUN ] ; then
+        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+      fi
+
       \rm /tmp/out_command.$$
     fi
@@ -1119,18 +1130,18 @@
     #
 
-    echo ${RSYNC} ${RSYNC_opt} $1 $2 > /tmp/out_command.$$ 2>&1
-    ${RSYNC} ${RSYNC_opt} $1 $2 >> /tmp/out_command.$$ 2>&1
+    echo ${RSYNC} ${RSYNC_opt} $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1
+    ${RSYNC} ${RSYNC_opt} $1 $2 >> /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     IGCM_sys_Rsync_out $status
 
-    ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command.$$
+    ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk /tmp/out_command_${LOGIN}.$$
     (( status=status+$? ))
 
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_Put_Out : rsync failed error code ${status}"
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Exit "IGCM_sys_Put_Out"
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
     fi
   fi
@@ -1189,7 +1200,13 @@
       i=0
       while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > /tmp/out_command.$$ 2>&1
-        status=$?
+        if [ $( stat -c %d $1 ) -ne $( stat -c %d $( dirname $2 ) ) ] ; then
+          # USUAL WAY
+          \cp $1 $2 > /tmp/out_command.$$ 2>&1
+          status=$?
+        else
+          # NOT SO USUAL WAY
+          \mv $1 $2 > /tmp/out_command.$$ 2>&1
+          status=$?
+        fi
         if [ ${status} -gt 0 ]; then
           IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
@@ -1258,13 +1275,13 @@
 
     #USUAL WAY
-    \cp ${dm_liste[*]} ${DEST} > /tmp/out_command.$$ 2>&1
+    \cp ${dm_liste[*]} ${DEST} > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
 
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status}"
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Exit "IGCM_sys_Get"
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
     fi
   fi
@@ -1306,5 +1323,5 @@
         i=0
         while [ $i -lt $NB_ESSAI ] ; do
-          \cp ${target} ${DEST}/${local_file} >> /tmp/out_command.$$ 2>&1
+          \cp ${target} ${DEST}/${local_file} >> /tmp/out_command_${LOGIN}.$$ 2>&1
           status=$?
           if [ ${status} -gt 0 ]; then
@@ -1319,9 +1336,9 @@
         if [ ${status} -gt 0 ] ; then
           echo "IGCM_sys_Get : error"
-          cat /tmp/out_command.$$
-          \rm /tmp/out_command.$$
+          cat /tmp/out_command_${LOGIN}.$$
+          \rm /tmp/out_command_${LOGIN}.$$
           IGCM_debug_Exit "IGCM_sys_GetBuffer"
         else
-          \rm /tmp/out_command.$$
+          \rm /tmp/out_command_${LOGIN}.$$
         fi
       done
@@ -1329,5 +1346,5 @@
       i=0
       while [ $i -lt $NB_ESSAI ] ; do
-        \cp ${buf_liste} ${DEST} >> /tmp/out_command.$$ 2>&1
+        \cp ${buf_liste} ${DEST} >> /tmp/out_command_${LOGIN}.$$ 2>&1
         status=$?
         if [ ${status} -gt 0 ]; then
@@ -1342,9 +1359,9 @@
       if [ ${status} -gt 0 ] ; then
         echo "IGCM_sys_Get : error"
-        cat /tmp/out_command.$$
-        \rm /tmp/out_command.$$
+        cat /tmp/out_command_${LOGIN}.$$
+        \rm /tmp/out_command_${LOGIN}.$$
         IGCM_debug_Exit "IGCM_sys_GetBuffer"
       else
-        \rm /tmp/out_command.$$
+        \rm /tmp/out_command_${LOGIN}.$$
       fi
     fi
@@ -1362,4 +1379,40 @@
   if ( $DEBUG_sys ) ; then
     echo "IGCM_sys_GetDate_FichWork :" $@
+  fi
+
+  if [ $# -ge 3 ] ; then
+    mode=$3
+    TimeStyle=$4
+  else
+    mode="default"
+    TimeStyle="%Y%m%d%H%M%S"
+  fi
+
+  typeset dateF
+  set +A dateF -- $( ls -l --full-time --time-style=+"${TimeStyle}" ${1} )
+
+  case $mode in
+    "default")
+      eval ${2}=${dateF[5]}
+      ;;
+    "SplitFields")
+      eval ${2}="${dateF[5]}\ ${dateF[6]}"
+      ;;
+  esac
+
+
+  # donne la date filesys d'un fichier sur la machine work
+  IGCM_debug_PopStack "IGCM_sys_FichWork"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_GetDate_FichArchive
+#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
+#D-* Examples:
+#D-
+function IGCM_sys_GetDate_FichArchive {
+  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetDate_FichArchive :" $@
   fi
   typeset dateF
@@ -1367,23 +1420,21 @@
   eval ${2}=${dateF[5]}
 
-  # donne la date filesys d'un fichier sur la machine work
-  IGCM_debug_PopStack "IGCM_sys_FichWork"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_GetDate_FichArchive
-#D-* Purpose: donne la date filesys d'un fichier sur le filesystem ARCHIVE
-#D-* Examples:
-#D-
-function IGCM_sys_GetDate_FichArchive {
-  IGCM_debug_PushStack "IGCM_sys_FichArchive" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_GetDate_FichArchive :" $@
-  fi
-  typeset dateF
-  set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
-  eval ${2}=${dateF[5]}
-
   IGCM_debug_PopStack "IGCM_sys_FichArchive"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_GetDate_Monitoring
+#D-* Purpose: get the last year for which the monitoring has been computed
+#D-* Examples:
+#D-
+function IGCM_sys_GetDate_Monitoring {
+  IGCM_debug_PushStack "IGCM_sys_GetDate_Monitoring" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_GetDate_Monitoring :" $@
+  fi
+
+  eval ${2}=$( cdo showyear ${1} 2> /dev/null | gawk '{ print $NF }' )
+
+  IGCM_debug_PopStack "IGCM_sys_GetDate_Monitoring"
 }
 
@@ -1537,4 +1588,5 @@
   #  0  118 110.0000000000000   87.46478873239437
   #  1  40  4.999999999999995   51.97183098591550
+
 #  typeset iStation iProc list_opt file_in file_out prefix_invert
 #  typeset -Z4 j4
@@ -1904,4 +1956,8 @@
           EXECUTION="time ./script_${ExeNameOut}.ksh"
         fi
+
+        IGCM_debug_Print 1 "sys $( hostname ) : script_${ExeNameOut}.ksh contains"
+        cat script_${ExeNameOut}.ksh
+
       fi
     done
@@ -1984,14 +2040,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncap2 -C "$@" > /tmp/out_command.$$ 2>&1
+    ncap2 -C "$@" > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2026,14 +2082,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncatted "$@" > /tmp/out_command.$$ 2>&1
+    ncatted "$@" > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2068,14 +2124,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncbo -C $@ > /tmp/out_command.$$ 2>&1
+    ncbo -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2110,14 +2166,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncdiff -C $@ > /tmp/out_command.$$ 2>&1
+    ncdiff -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2152,14 +2208,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncea -C $@ > /tmp/out_command.$$ 2>&1
+    ncea -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2194,14 +2250,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncecat -C $@ > /tmp/out_command.$$ 2>&1
+    ncecat -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2236,14 +2292,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncflint -C $@ > /tmp/out_command.$$ 2>&1
+    ncflint -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2278,14 +2334,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncks -C $@ > /tmp/out_command.$$ 2>&1
+    ncks -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2320,14 +2376,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncpdq -C $@ > /tmp/out_command.$$ 2>&1
+    ncpdq -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2362,14 +2418,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncra -C $@ > /tmp/out_command.$$ 2>&1
+    ncra -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2404,24 +2460,24 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncrcat -C $@ > /tmp/out_command.$$ 2>&1
+    ncrcat -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
-    elif [ ! "X$( grep "WARNING Intra-file non-monotonicity" /tmp/out_command.$$ )" = "X" ] ; then
+    elif [ ! "X$( grep "WARNING Intra-file non-monotonicity" /tmp/out_command_${LOGIN}.$$ )" = "X" ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncrcat : WARNING Intra-file non-monotonicity"
-      cat /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
       # remove files having corrupted time axis
       eval lastArg=\${$#}
       IGCM_debug_Print 2 "IGCM_sys_ncrcat : Delete ${lastArg}"
       \rm ${lastArg}
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2456,14 +2512,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncrename $@ > /tmp/out_command.$$ 2>&1
+    ncrename $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2498,14 +2554,14 @@
   i=0
   while [ $i -lt $NB_ESSAI ] ; do
-    ncwa -C $@ > /tmp/out_command.$$ 2>&1
+    ncwa -C $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
     status=$?
     if [ ${status} -gt 0 ] ; then
       IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}"
-      cat /tmp/out_command.$$
-      \rm /tmp/out_command.$$
+      cat /tmp/out_command_${LOGIN}.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
       sleep $DELAI
     else
-      \rm /tmp/out_command.$$
+      \rm /tmp/out_command_${LOGIN}.$$
       break
     fi
@@ -2537,10 +2593,10 @@
   typeset status
 
-  \cdo $@ > /tmp/out_command.$$ 2>&1
+  \cdo $@ > /tmp/out_command_${LOGIN}.$$ 2>&1
   status=$?
   if [ ${status} -gt 0 ] ; then
     echo "IGCM_sys_cdo : error code ${status}"
-    cat /tmp/out_command.$$
-    \rm /tmp/out_command.$$
+    cat /tmp/out_command_${LOGIN}.$$
+    \rm /tmp/out_command_${LOGIN}.$$
     IGCM_debug_PopStack "IGCM_sys_cdo"
     return 1
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1177)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1178)
@@ -213,5 +213,5 @@
 function IGCM_sys_RshMaster {
   IGCM_debug_PushStack "IGCM_sys_RshMaster" $@
-  /bin/ksh  <<-EOF
+  /bin/ksh <<-EOF
     export libIGCM=${libIGCM}
     export DEBUG_debug=${DEBUG_debug}
@@ -246,4 +246,18 @@
 
 #D-#==================================================
+#D-function IGCM_sys_RshArchive_NoError
+#D-* Purpose: Archive rsh command, without error
+#D-*          used only in monitoring.job
+#D-* Examples:
+#D-
+function IGCM_sys_RshArchive_NoError {
+  IGCM_debug_PushStack "IGCM_sys_RshArchive_NoError" $@
+  /bin/ksh <<-EOF
+    ${@} 2> \dev\null
+EOF
+  IGCM_debug_PopStack "IGCM_sys_RshArchive_NoError"
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Post-process rsh command
@@ -255,11 +269,8 @@
     echo "IGCM_sys_RshPost :" $@
   fi
-
   # keep standard input (stdin) for the loop onto temporary file
-  cat >tmp_IGCM_sys_RshPost_$$
-
-# ============ FRONTEND START ============ #
-
-  /bin/ksh <tmp_IGCM_sys_RshPost_$$
+  cat >/tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
+
+  /bin/ksh </tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
   if [ $? -gt 0 ] ; then
     echo "IGCM_sys_RshPost : erreur."
@@ -267,5 +278,5 @@
   fi
   # delete temporary file
-  \rm tmp_IGCM_sys_RshPost_$$
+  \rm /tmp/tmp_IGCM_sys_RshPost_$$_${LOGNAME}
   IGCM_debug_PopStack "IGCM_sys_RshPost"
 }
@@ -299,5 +310,5 @@
 
   if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt
+    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  mail.txt
   elif [ -f ~/.forward ] ; then
     mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt
@@ -347,5 +358,5 @@
   #- creation de repertoire sur le serveur fichier
   if [ ! -d ${1} ]; then
-    mkdir -p $1
+    \mkdir -p $1
     status=$?
 
@@ -930,10 +941,4 @@
   fi
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${1} ] ; then
-      echo "WARNING : IGCM_sys_Get_Dir ${1} DOES NOT EXIST ."
-      IGCM_debug_PopStack "IGCM_sys_Get_Dir"
-      return
-    fi
-
     typeset status
 
@@ -1026,13 +1031,6 @@
     typeset status
     #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-    #
-    # Only if we use rsync
-    #IGCM_sys_MkdirArchive $( dirname $2 )
-    #
-    #USUAL WAY
-    \cp $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1
+    # USUAL WAY
+    \cp $1 $2 > /tmp/out_command.$$ 2>&1
     status=$?
 
@@ -1053,8 +1051,17 @@
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
-      cat /tmp/out_command_${LOGIN}.$$
+      [ -f ${1} ] && ls -l ${1}
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
+      cat /tmp/out_command.$$
       IGCM_debug_Exit "IGCM_sys_Put_Rest"
     else
-      \rm /tmp/out_command_${LOGIN}.$$
+
+      if [ X${JobType} = XRUN ] ; then
+        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+      fi
+
+      \rm /tmp/out_command.$$
     fi
   fi
@@ -1080,9 +1087,4 @@
 
     typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
     #
     # USUAL WAY
@@ -1097,5 +1099,11 @@
       IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
     else
-      \rm /tmp/out_command_${LOGIN}.$$
+
+      if [ X${JobType} = XRUN ] ; then
+        [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+        [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+      fi
+
+      \rm /tmp/out_command.$$
     fi
   fi
@@ -1213,7 +1221,13 @@
       i=0
       while [ $i -lt $NB_ESSAI ] ; do
-        # USUAL WAY
-        \cp $1 $2 > /tmp/out_command_${LOGIN}.$$ 2>&1
-        status=$?
+        if [ $( stat -c %d $1 ) -ne $( stat -c %d $( dirname $2 ) ) ] ; then
+          # USUAL WAY
+          \cp $1 $2 > /tmp/out_command.$$ 2>&1
+          status=$?
+        else
+          # NOT SO USUAL WAY
+          \mv $1 $2 > /tmp/out_command.$$ 2>&1
+          status=$?
+        fi
         if [ ${status} -gt 0 ]; then
           IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
@@ -1233,5 +1247,5 @@
       [ -f ${2} ] && ls -l ${2}
       [ -f ${2}/${1} ] && ls -l ${2}/${1}
-      cat /tmp/out_command_${LOGIN}.$$
+      cat /tmp/out_command.$$
       IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
     else
@@ -1387,7 +1401,25 @@
     echo "IGCM_sys_GetDate_FichWork :" $@
   fi
+
+  if [ $# -ge 3 ] ; then
+    mode=$3
+    TimeStyle=$4
+  else
+    mode="default"
+    TimeStyle="%Y%m%d%H%M%S"
+  fi
+
   typeset dateF
-  set +A dateF -- $( ls -l --full-time --time-style='+%Y%m%d%H%M%S' ${1} )
-  eval ${2}=${dateF[5]}
+  set +A dateF -- $( ls -l --full-time --time-style=+"${TimeStyle}" ${1} )
+
+  case $mode in
+    "default")
+      eval ${2}=${dateF[5]}
+      ;;
+    "SplitFields")
+      eval ${2}="${dateF[5]}\ ${dateF[6]}"
+      ;;
+  esac
+
 
   # donne la date filesys d'un fichier sur la machine work
@@ -1577,4 +1609,5 @@
   #  0  118 110.0000000000000   87.46478873239437
   #  1  40  4.999999999999995   51.97183098591550
+
 #  typeset iStation iProc list_opt file_in file_out prefix_invert
 #  typeset -Z4 j4
