Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 747)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 759)
@@ -1148,8 +1148,61 @@
     typeset status
     #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
+    # USUAL WAY
+    \cp $1 $2 > out_rsync 2>&1
+    status=$?
+
+#       #RSYNC WITH NETWORK SSH CALL
+#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
+
+#       #RSYNC WITH NFS USE
+#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
+#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
+
+#       status=$?
+#       IGCM_sys_Rsync_out $status
+
+#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#       (( status=status+$? ))
+
+    if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
+      cat out_rsync
+      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 out_rsync
+    fi
+  else
+    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+  fi
+  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
+}
+
+#D-#==================================================
+#D-function IGCM_sys_PutBuffer_Rest
+#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
+#D-           File and target directory must exist.
+#D-* Examples:
+#D-
+function IGCM_sys_PutBuffer_Rest {
+  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_PutBuffer_Rest :" $@
+  fi
+  if [ $DRYRUN = 0 ]; then
+    if [ ! -f ${1} ] ; then
+      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
+      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
+    fi
+
+    typeset status
     #
     # USUAL WAY
@@ -1157,64 +1210,17 @@
     status=$?
 
-#       #RSYNC WITH NETWORK SSH CALL
-#       echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${STOREHOST}:${2} >> out_rsync 2>&1
-
-#       #RSYNC WITH NFS USE
-#       echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
-#       ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
-
-#       status=$?
-#       IGCM_sys_Rsync_out $status
-
-#       ${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
-#       (( status=status+$? ))
-
-    if [ ${status} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : cp failed error code ${status}"
-      cat out_rsync
-      IGCM_debug_Exit "IGCM_sys_Put_Rest"
-    else
-      \rm out_rsync
-    fi
-  else
-    ( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
-  fi
-  IGCM_debug_PopStack "IGCM_sys_Put_Rest"
-}
-
-#D-#==================================================
-#D-function IGCM_sys_PutBuffer_Rest
-#D-* Purpose: Put computied restarts on ${SCRATCHDIR}.
-#D-           File and target directory must exist.
-#D-* Examples:
-#D-
-function IGCM_sys_PutBuffer_Rest {
-  IGCM_debug_PushStack "IGCM_sys_PutBuffer_Rest" $@
-  if ( $DEBUG_sys ) ; then
-    echo "IGCM_sys_PutBuffer_Rest :" $@
-  fi
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -f ${1} ] ; then
-      echo "ERROR : IGCM_sys_PutBuffer_Rest ${1} DOES NOT EXIST ."
-      IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
-    fi
-
-    typeset status
-    #
-    if [ X${JobType} = XRUN ] ; then
-      IGCM_sys_Chmod 444 ${1}
-    fi
-
-    #
-    # USUAL WAY
-    \cp $1 $2 > out_rsync 2>&1
-    status=$?
-
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_PutBuffer_Rest : error code ${status}"
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
       cat out_rsync
       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 out_rsync
     fi
@@ -1266,11 +1272,4 @@
     #    IGCM_sys_Cp ${1} ${FILEPATH}
     #fi
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
-    #
 
     exist=false
@@ -1303,4 +1302,6 @@
           IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
           IGCM_debug_Print 2 "IGCM_sys_Put_Out : sleep ${DELAI} seconds and try again."
+          [ -f ${2} ] && ls -l ${2}
+          [ -f ${2}/${1} ] && ls -l ${2}/${1}
           sleep $DELAI
         else
@@ -1327,7 +1328,17 @@
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_Put_Out : error."
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_Put_Out"
     else
+
+      if [ X${JobType} = XRUN ] ; then
+        if [ X${3} = X ] ; then
+          [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+          [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+        fi
+      fi
+
       \rm out_rsync
     fi
@@ -1366,10 +1377,4 @@
     IGCM_sys_Mkdir $( dirname $2 )
     #
-
-    if [ X${JobType} = XRUN ] ; then
-      if [ X${3} = X ] ; then
-        IGCM_sys_Chmod 444 ${1}
-      fi
-    fi
 
     exist=false
@@ -1400,4 +1405,6 @@
           IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed error code ${status} ${i}/${NB_ESSAI}"
           IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : sleep ${DELAI} seconds and try again."
+          [ -f ${2} ] && ls -l ${2}
+          [ -f ${2}/${1} ] && ls -l ${2}/${1}
           sleep $DELAI
         else
@@ -1410,7 +1417,17 @@
     if [ ${status} -gt 0 ] ; then
       echo "IGCM_sys_PutBuffer_Out : error."
+      [ -f ${2} ] && ls -l ${2}
+      [ -f ${2}/${1} ] && ls -l ${2}/${1}
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_PutBuffer_Out"
     else
+
+      if [ X${JobType} = XRUN ] ; then
+        if [ X${3} = X ] ; then
+          [ -f ${2} ] && IGCM_sys_Chmod 444 ${2}
+          [ -f ${2}/${1} ] && IGCM_sys_Chmod 444 ${2}/${1}
+        fi
+      fi
+
       \rm out_rsync
     fi
