Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 713)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 714)
@@ -2270,8 +2270,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
 
@@ -2284,8 +2306,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
 
@@ -2298,8 +2342,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
 
@@ -2312,8 +2378,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
 
@@ -2326,8 +2414,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
 
@@ -2340,8 +2450,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
 
@@ -2354,8 +2486,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
 
@@ -2368,8 +2522,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
 
@@ -2382,8 +2558,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
 
@@ -2396,8 +2594,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
 
@@ -2410,8 +2630,30 @@
     echo "IGCM_sys_ncrcat :" $@
   fi
-  ncrcat --omp_num_threads 2 $@
-  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
 
@@ -2424,8 +2666,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
 
@@ -2438,8 +2702,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
 
@@ -2455,7 +2741,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
