Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 712)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 713)
@@ -860,5 +860,5 @@
 
   if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_Cp : error."
+    echo "IGCM_sys_Cp : error code ${RET}"
     cat out_rsync
     IGCM_debug_Exit "IGCM_sys_Cp"
@@ -887,5 +887,5 @@
 
   if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_Rm : error."
+    echo "IGCM_sys_Rm : error code ${RET}"
     cat out_rsync
     IGCM_debug_Exit "IGCM_sys_Rm"
@@ -915,5 +915,5 @@
 
   if [ ${RET} -gt 0 ] ; then
-    echo "IGCM_sys_RmRunDir : error."
+    echo "IGCM_sys_RmRunDir : error code ${RET}"
     cat out_rsync
     IGCM_debug_Exit "IGCM_sys_RmRunDir"
@@ -944,5 +944,5 @@
 
     if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Mv : error in mv."
+      echo "IGCM_sys_Mv : error code ${RET}"
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_Mv"
@@ -984,5 +984,5 @@
 
     if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Dir : error."
+      echo "IGCM_sys_Put_Dir : error code ${RET}"
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_Put_Dir"
@@ -1024,5 +1024,5 @@
     # USUAL WAY
     # add 'ccc_hsm get' (to demigrate all offline files) to reduce time of this command :
-    ccc_hsm get $1/*
+    ccc_hsm get -r $1
 
     i=0
@@ -1031,5 +1031,5 @@
       status=$?
       if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed ${i}/${NB_ESSAI}"
+        IGCM_debug_Print 2 "IGCM_sys_Get_Dir : cp failed error code ${status} ${i}/${NB_ESSAI}"
         IGCM_debug_Print 2 "IGCM_sys_Get_Dir : sleep ${DELAI} seconds and try again."
         sleep $DELAI
@@ -1081,5 +1081,5 @@
       status=$?
       if [ ${status} -gt 0 ]; then
-        IGCM_debug_Print 2 "IGCM_sys_Get_Master : cp failed ${i}/${NB_ESSAI}"
+        IGCM_debug_Print 2 "IGCM_sys_Get_Master : cp failed error code ${status} ${i}/${NB_ESSAI}"
         IGCM_debug_Print 2 "IGCM_sys_Get_Master : sleep ${DELAI} seconds and try again."
         sleep $DELAI
@@ -1152,5 +1152,5 @@
 
     if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Put_Rest : error."
+      echo "IGCM_sys_Put_Rest : cp failed error code ${RET}"
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_Put_Rest"
@@ -1193,5 +1193,5 @@
 
     if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_PutBuffer_Rest : error."
+      echo "IGCM_sys_PutBuffer_Rest : error code ${RET}"
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_PutBuffer_Rest"
@@ -1281,5 +1281,5 @@
         status=$?
         if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_Put_Out : cp failed ${i}/${NB_ESSAI}"
+          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."
           sleep $DELAI
@@ -1378,5 +1378,5 @@
         status=$?
         if [ ${status} -gt 0 ]; then
-          IGCM_debug_Print 2 "IGCM_sys_PutBuffer_Out : cp failed ${i}/${NB_ESSAI}"
+          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."
           sleep $DELAI
@@ -1450,5 +1450,5 @@
     RET=$?
     if [ ${RET} -gt 0 ] ; then
-      echo "WARNING IGCM_sys_Get : demigration error."
+      echo "WARNING IGCM_sys_Get : error code ${RET}"
       cat out_rsync
       echo "WARNING IGCM_sys_Get : will stop later if the cp fails."
@@ -1493,5 +1493,5 @@
             status=$?
             if [ ${status} -gt 0 ]; then
-              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed ${i}/${NB_ESSAI}"
+              IGCM_debug_Print 2 "IGCM_sys_Get : cp failed error code ${status} ${i}/${NB_ESSAI}"
               IGCM_debug_Print 2 "IGCM_sys_Get : sleep ${DELAI} seconds and try again."
               sleep $DELAI
@@ -1524,5 +1524,5 @@
 
     if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_Get : copy error."
+      echo "IGCM_sys_Get : error code ${RET}"
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_Get"
@@ -1572,5 +1572,5 @@
 
     if [ ${RET} -gt 0 ] ; then
-      echo "IGCM_sys_GetBuffer : copy error."
+      echo "IGCM_sys_GetBuffer : error code ${RET}"
       cat out_rsync
       IGCM_debug_Exit "IGCM_sys_GetBuffer"
@@ -2004,8 +2004,30 @@
     echo "IGCM_sys_ncap2 :" $@
   fi
-  ncap2 "$@"
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncap2 : erreur ${@}."
-    IGCM_debug_Exit "ncap2"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncap2 "$@" > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncap2 : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncap2 : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncap2 : ncap2 error"
+      IGCM_debug_Exit "ncap2"
   fi
 
@@ -2018,8 +2040,30 @@
     echo "IGCM_sys_ncatted :" $@
   fi
-  ncatted "$@"
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncatted : erreur ${@}."
-    IGCM_debug_Exit "ncatted"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncatted "$@" > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncatted : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncatted : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncatted : ncatted error"
+      IGCM_debug_Exit "ncatted"
   fi
 
@@ -2032,8 +2076,30 @@
     echo "IGCM_sys_ncbo :" $@
   fi
-  ncbo $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncbo : erreur ${@}."
-    IGCM_debug_Exit "ncbo"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncbo $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncbo : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncbo : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncbo : ncbo error"
+      IGCM_debug_Exit "ncbo"
   fi
 
@@ -2046,8 +2112,30 @@
     echo "IGCM_sys_ncdiff :" $@
   fi
-  ncdiff $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncdiff : erreur ${@}."
-    IGCM_debug_Exit "ncdiff"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncdiff $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncdiff : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncdiff : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncdiff : ncdiff error"
+      IGCM_debug_Exit "ncdiff"
   fi
 
@@ -2060,8 +2148,30 @@
     echo "IGCM_sys_ncea :" $@
   fi
-  ncea $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncea : erreur ${@}."
-    IGCM_debug_Exit "ncea"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncea $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncea : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncea : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncea : ncea error"
+      IGCM_debug_Exit "ncea"
   fi
 
@@ -2074,8 +2184,30 @@
     echo "IGCM_sys_ncecat :" $@
   fi
-  ncecat $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncecat : erreur ${@}."
-    IGCM_debug_Exit "ncecat"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncecat $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncecat : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncecat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncecat : ncecat error"
+      IGCM_debug_Exit "ncecat"
   fi
 
@@ -2088,8 +2220,30 @@
     echo "IGCM_sys_ncflint :" $@
   fi
-  ncflint $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncflint : erreur ${@}."
-    IGCM_debug_Exit "ncflint"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncflint $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncflint : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncflint : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncflint : ncflint error"
+      IGCM_debug_Exit "ncflint"
   fi
 
@@ -2102,8 +2256,30 @@
     echo "IGCM_sys_ncks :" $@
   fi
-  ncks $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncks : erreur ${@}."
-    IGCM_debug_Exit "ncks"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncks $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncks : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncks : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncks : ncks error"
+      IGCM_debug_Exit "ncks"
   fi
 
@@ -2116,8 +2292,30 @@
     echo "IGCM_sys_ncpdq :" $@
   fi
-  ncpdq $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncpdq : erreur ${@}."
-    IGCM_debug_Exit "ncpdq"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncpdq $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncpdq : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncpdq : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncpdq : ncpdq error"
+      IGCM_debug_Exit "ncpdq"
   fi
 
@@ -2130,8 +2328,30 @@
     echo "IGCM_sys_ncra :" $@
   fi
-  ncra $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncra : erreur ${@}."
-    IGCM_debug_Exit "ncra"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncra $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncra : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncra : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncra : ncra error"
+      IGCM_debug_Exit "ncra"
   fi
 
@@ -2144,8 +2364,30 @@
     echo "IGCM_sys_ncrcat :" $@
   fi
-  ncrcat $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncrcat : erreur ${@}."
-#       IGCM_debug_Exit "ncrcat"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncrcat $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncrcat : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncrcat : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncrcat : ncrcat error"
+      #IGCM_debug_Exit "ncrcat"
   fi
 
@@ -2158,8 +2400,30 @@
     echo "IGCM_sys_ncrename :" $@
   fi
-  ncrename $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncrename : erreur ${@}."
-    IGCM_debug_Exit "ncrename"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncrename $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncrename : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncrename : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncrename : ncrename error"
+      IGCM_debug_Exit "ncrename"
   fi
 
@@ -2172,8 +2436,30 @@
     echo "IGCM_sys_ncwa :" $@
   fi
-  ncwa $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_ncwa : erreur ${@}."
-    IGCM_debug_Exit "ncwa"
+
+  typeset NB_ESSAI DELAI status i
+  # number of tentative
+  NB_ESSAI=3
+  # time delay between tentative
+  DELAI=2
+
+  i=0
+  while [ $i -lt $NB_ESSAI ] ; do
+    ncwa $@ > out_rsync 2>&1
+    status=$?
+    if [ ${status} -gt 0 ] ; then
+      IGCM_debug_Print 2 "IGCM_sys_ncwa : error code ${status}"
+      cat out_rsync
+      \rm out_rsync
+      IGCM_debug_Print 2 "IGCM_sys_ncwa : ${i}/${NB_ESSAI} sleep ${DELAI} seconds and try again."
+    else
+      \rm out_rsync
+      break
+    fi
+    (( i = i + 1 ))
+  done
+
+  if [ ${status} -gt 0 ] ; then
+      echo "IGCM_sys_ncwa : ncwa error"
+      IGCM_debug_Exit "ncwa"
   fi
 
@@ -2189,7 +2475,13 @@
     echo "IGCM_sys_cdo :" $@
   fi
-  \cdo $@
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_cdo : erreur ${@}."
+
+  typeset status
+
+  \cdo $@ > out_rsync 2>&1
+  status=$?
+  if [ ${status} -gt 0 ] ; then
+    echo "IGCM_sys_cdo : error code ${status}"
+    cat out_rsync
+    \rm out_rsync
     IGCM_debug_PopStack "IGCM_sys_cdo"
     return 1
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 712)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 713)
@@ -830,5 +830,5 @@
     # add dmget (to demigrate all offline files) to reduce time of this command :
     #dmget $1/*
-    ccc_hsm get $1/*
+    ccc_hsm get -r $1
     \cp -r $1 $2 > out_rsync 2>&1
     RET=$?
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 712)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 713)
@@ -1047,4 +1047,5 @@
     # add dmfind/dmget (to demigrate all offline files) :
     #dmfind $1 -state MIG -o -state OFL -o -state PAR | dmget
+    ccc_hsm get -r $1
     \cp -r $1 $2 > out_rsync 2>&1
     RET=$?
