Index: /trunk/libIGCM/libIGCM_card/libIGCM_card.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_card/libIGCM_card.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_card/libIGCM_card.ksh	(revision 926)
@@ -311,10 +311,10 @@
 
 #---------------------
-    ${libIGCM}/libIGCM_card/IGCM_card_Test.ksh > IGCM_card_Test.ref.failed 2>&1
+    ${libIGCM}/libIGCM_card/IGCM_card_Test.ksh > /tmp/IGCM_card_Test.ref.failed 2>&1
     sleep 2
 
-    if diff IGCM_card_Test.ref.failed ${libIGCM}/libIGCM_card/IGCM_card_Test.ref > /dev/null 2>&1 ; then 
+    if diff /tmp/IGCM_card_Test.ref.failed ${libIGCM}/libIGCM_card/IGCM_card_Test.ref > /dev/null 2>&1 ; then 
       echo "Check libIGCM_card ...............................................[ OK ]"
-      rm -f IGCM_card_Test.ref.failed
+      rm -f /tmp/IGCM_card_Test.ref.failed
     else 
       echo "Check libIGCM_card ...........................................[ FAILED ]"
@@ -324,4 +324,5 @@
       echo "           diff IGCM_card_Test.ref.failed ${libIGCM}/libIGCM_card/IGCM_card_Test.ref"
       echo "           Report errors to the author: Patrick.Brockmann@cea.fr"
+      cat /tmp/IGCM_card_Test.ref.failed
       IGCM_debug_Exit "IGCM_card_Check"
     fi
Index: /trunk/libIGCM/libIGCM_date/IGCM_date_Test.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_date/IGCM_date_Test.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_date/IGCM_date_Test.ksh	(revision 926)
@@ -19,4 +19,5 @@
 #=================================================
 libIGCM=`dirname $0`/..
+typeset TaskType=checking
 . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
 . ${libIGCM}/libIGCM_date/libIGCM_date.ksh
Index: /trunk/libIGCM/libIGCM_date/libIGCM_date.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_date/libIGCM_date.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_date/libIGCM_date.ksh	(revision 926)
@@ -1036,9 +1036,9 @@
 
 #---------------------
-  ${libIGCM}/libIGCM_date/IGCM_date_Test.ksh > IGCM_date_Test.ref.failed 2>&1
-
-  if diff IGCM_date_Test.ref.failed ${libIGCM}/libIGCM_date/IGCM_date_Test${dY}.ref > /dev/null 2>&1 ; then
+  ${libIGCM}/libIGCM_date/IGCM_date_Test.ksh > /tmp/IGCM_date_Test.ref.failed 2>&1
+
+  if diff /tmp/IGCM_date_Test.ref.failed ${libIGCM}/libIGCM_date/IGCM_date_Test${dY}.ref > /dev/null 2>&1 ; then
     echo "Check libIGCM_date ...............................................[ OK ]"
-    rm -f IGCM_date_Test.ref.failed
+    rm -f /tmp/IGCM_date_Test.ref.failed
   else
     echo "Check libIGCM_date ...........................................[ FAILED ]"
@@ -1048,4 +1048,5 @@
     echo "           diff IGCM_date_Test.ref.failed ${libIGCM}/libIGCM_date/IGCM_date_Test${dY}.ref"
     echo "           Report errors to the author: Sebastien.Denvil@ipsl.jussieu.fr"
+    cat /tmp/IGCM_date_Test.ref.failed
     IGCM_debug_Exit "IGCM_date_Check"
   fi
Index: /trunk/libIGCM/libIGCM_debug/IGCM_debug_Test.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_debug/IGCM_debug_Test.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_debug/IGCM_debug_Test.ksh	(revision 926)
@@ -19,4 +19,5 @@
 #=================================================
 libIGCM=`dirname $0`/..
+typeset TaskType=checking
 . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
 
@@ -47,3 +48,2 @@
 
 IGCM_debug_PrintVariables 1 Option
-
Index: /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 926)
@@ -31,13 +31,21 @@
 typeset RandomError=false
 
-# Where the stack file containing call tree will be stored.
-typeset StackFileLocation=${StackFileLocation:=${PWD}}
-
+# Stack file containing call tree will be stored there.
 if ( $DEBUG_debug ) ; then
-  if [ -f ${StackFileLocation}/stack ] ;
+  if [ X${TaskType} = Xcomputing ]; then
+    typeset StackFileLocation=${StackFileLocation:=${PWD}}
+    typeset StackFileName=computing.stack.$$
+  elif [ X${TaskType} = Xpost-processing ]; then
+    typeset StackFileLocation=${POST_DIR:=${StackFileLocation}}
+    typeset StackFileName=post-processing.stack.$$
+  elif [ X${TaskType} = Xchecking ]; then
+    typeset StackFileLocation=${POST_DIR:=${PWD}}
+    typeset StackFileName=checking.stack.$$
+  fi
+  if [ -f ${StackFileLocation}/${StackFileName} ] ;
   then
-    echo "Stack of an libIGCM job :" >> ${StackFileLocation}/stack
+    echo "Stack of an libIGCM job :" >> ${StackFileLocation}/${StackFileName}
   else
-    echo "Stack of an libIGCM job :" >  ${StackFileLocation}/stack
+    echo "Stack of an libIGCM job :" >  ${StackFileLocation}/${StackFileName}
   fi
 fi
@@ -73,5 +81,5 @@
 function IGCM_debug_getDate_ms
 {
-  typeset nanosecs testnum
+  typeset nanosecs ms
   # nano secondes since 01-jan-1970
   nanosecs=$( date +%s%N )
@@ -119,9 +127,10 @@
       iEntity=${destination}
     fi
-    sizeKo=$( du --apparent-size -k ${iEntity} | awk {'print $1'} )
+    sizeKo=$( du --apparent-size -sk ${iEntity} | awk {'print $1'} )
     sumSizeKo=$(( $sumSizeKo + $sizeKo ))
   done
   sumSizeMo=$( echo "scale=6;${sumSizeKo}/1024" | bc )
   echo "${sumSizeKo}|${sumSizeMo}"
+
 }
 
@@ -149,9 +158,9 @@
   decal=0
   while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do
-    printf ' ' >> ${StackFileLocation}/stack
+    printf ' ' >> ${StackFileLocation}/${StackFileName}
     (( decal = decal + 1 ))
   done
   # Log to stack file
-  echo sendAMQPMsg -h localhost -p 5672 ${additionnalOption} -b "${Body}"      >> ${StackFileLocation}/stack
+  echo sendAMQPMsg -h localhost -p 5672 ${additionnalOption} -b "${Body}"      >> ${StackFileLocation}/${StackFileName}
 
   # Log separately AMQP send message command
@@ -196,12 +205,15 @@
   if ( $DEBUG_debug ) ; then
     typeset decal inputs startTime_ms
-    echo >> ${StackFileLocation}/stack
 
     # Only cosmetics : stack file
+    echo >> ${StackFileLocation}/${StackFileName}
     decal=0
     while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do
-      printf ' ' >> ${StackFileLocation}/stack
+      printf ' ' >> ${StackFileLocation}/${StackFileName}
       (( decal = decal + 1 ))
     done
+
+    # Fill the stack file
+    echo "> ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName}
 
     # Save input list in an indexed array
@@ -224,7 +236,4 @@
       IGCM_debug_StackArgs[0]=$(echo ${INPUTS[*]:1} | sed -e "s/\ /,/g" )
     fi
-
-    # Fill the stack file
-    echo "> ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/stack
 
     if [ X${ActivateBigBro} = Xtrue ] ; then
@@ -250,6 +259,9 @@
 function IGCM_debug_PopStack {
   if ( $DEBUG_debug ) ; then
-    typeset decal command arguments startTime_ms endTime_ms
-    typeset instrumentation source dest
+    typeset i decal command arguments startTime_ms endTime_ms
+    typeset instrumentation dest
+    # they are not typeset because they are send "by adress" to son functions
+    # we unset them to avoid "memory effect"
+    unset fileList source
 
     # INTRODUCE SIMPLE ERROR GENERATOR TO TEST SUPERVISOR
@@ -259,5 +271,5 @@
       if [ $((RANDOM%10000)) -le 10 ] ; then
         IGCM_debug_Print 1 "Random error has been triggered"
-        echo "RANDOM ERROR" >> ${StackFileLocation}/stack
+        echo "RANDOM ERROR" >> ${StackFileLocation}/${StackFileName}
         ExitFlag=true
       fi
@@ -362,4 +374,34 @@
       entitySize=$( IGCM_debug_sizeOfTabContent fileList ${dest} )
       ;;
+    
+    # NCO commands
+    IGCM_sys_ncrcat|IGCM_sys_ncecat|IGCM_sys_ncra|IGCM_sys_ncks|IGCM_sys_cdo)
+      # Example of what we want to catch : only filenames in those command lines
+      # IGCM_sys_ncrcat -O -v ${list_var_final_ncrcat} ${OUT_SE[*]} ${RESULT_SE}
+      # IGCM_sys_ncrcat --hst -v ${liste_coord}${var} ${file1} ${liste_file_tmp[*]} ${file_out}
+      # IGCM_sys_ncrcat -p ${dir} ${liste_file_tmp} --output ${output}
+      # IGCM_sys_ncrcat -x -v ${list_var} -p ${dir} ${liste_file_tmp} --output ${output}
+      instrumentation=true
+      # All files that are not the latest argument (only input files)
+      i=0
+      keepGoing=true
+      while ( ${keepGoing} ) ; do
+        if [ -f ${arguments[${#arguments[*]}-2-${i}]} ] ; then
+          fileList="${fileList} ${arguments[${#arguments[*]}-2-${i}]}"
+          ((i = i + 1))
+        elif [ ${i} -ge 1 ] ; then
+          keepGoing=false
+        else
+          ((i = i + 1))
+        fi
+      done
+      # i value is at least 1
+      # just need one file to get the directory
+      source=${arguments[${#arguments[*]}-1-${i}]}
+      # Nothing but the latest
+      dest=${arguments[${#arguments[*]}-1]}
+      # Size of file whose name are stored in a list
+      entitySize=$( IGCM_debug_sizeOfTabContent fileList ${dest} )
+      ;;
     esac
 
@@ -370,5 +412,5 @@
     decal=0
     while [ ${decal} -lt ${IGCM_debug_LenStack} ]; do
-      printf ' ' >> ${StackFileLocation}/stack
+      printf ' ' >> ${StackFileLocation}/${StackFileName}
       (( decal = decal + 1 ))
     done
@@ -376,5 +418,5 @@
     if ( ${ExitFlag} ) ; then
       # Inform the stack file
-      echo '!!! ExitFlag has been activated !!!' >> ${StackFileLocation}/stack
+      echo '!!! ExitFlag has been activated !!!' >> ${StackFileLocation}/${StackFileName}
 
       if [ X${ActivateBigBro} = Xtrue ] ; then
@@ -388,5 +430,5 @@
     else
       # Inform the stack file
-      echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/stack
+      echo "< ${IGCM_debug_LenStack} : ${@}" >> ${StackFileLocation}/${StackFileName}
       if [ X${ActivateBigBro} = Xtrue ] ; then
         # RabbitMQ message code
@@ -652,14 +694,14 @@
 
   #---------------------
-  ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh > IGCM_debug_Test.ref.failed 2>&1
+  ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ksh > /tmp/IGCM_debug_Test.ref.failed 2>&1
   sleep 2
 
   # Remove date stamp.
-  sed -e "s:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]\:[0-9][0-9]\:[0-9][0-9] ::g" IGCM_debug_Test.ref.failed > IGCM_debug_Test.ref.failed.nodate
-  mv IGCM_debug_Test.ref.failed.nodate IGCM_debug_Test.ref.failed
-
-  if diff IGCM_debug_Test.ref.failed ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref > /dev/null 2>&1 ; then
+  sed -e "s:[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]\:[0-9][0-9]\:[0-9][0-9] ::g" /tmp/IGCM_debug_Test.ref.failed > /tmp/IGCM_debug_Test.ref.failed.nodate
+  mv /tmp/IGCM_debug_Test.ref.failed.nodate /tmp/IGCM_debug_Test.ref.failed
+
+  if diff /tmp/IGCM_debug_Test.ref.failed ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref > /dev/null 2>&1 ; then
     echo "Check libIGCM_debug ..............................................[ OK ]"
-    rm -f IGCM_debug_Test.ref.failed
+    rm -f /tmp/IGCM_debug_Test.ref.failed
   else
     echo "Check libIGCM_debug ..........................................[ FAILED ]"
@@ -669,4 +711,5 @@
     echo "           diff IGCM_debug_Test.ref.failed ${libIGCM}/libIGCM_debug/IGCM_debug_Test.ref"
     echo "           Report errors to the author: Patrick.Brockmann@cea.fr"
+    cat /tmp/IGCM_debug_Test.ref.failed
     exit 4
   fi
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys.ksh	(revision 926)
@@ -52,21 +52,7 @@
         [ ! X${TaskType} = Xchecking ] && echo "sys source ada Intel X-64 lib."
         . ${libIGCM}/libIGCM_sys/libIGCM_sys_ada.ksh;;
-
-    mercure0?)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source mercure frontend X-64 lib."
-        . ${libIGCM}/libIGCM_sys/libIGCM_sys_mercure.ksh;;
-
-    mercure2?)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source mercure Nec SX9 lib."
-        . ${libIGCM}/libIGCM_sys/libIGCM_sys_mercurex9.ksh;;
-
     curie*)
-       [ ! X${TaskType} = Xchecking ] && echo "sys source curie Intel X-64 lib."
-       . ${libIGCM}/libIGCM_sys/libIGCM_sys_curie.ksh;;
-
-    titane*)
-        [ ! X${TaskType} = Xchecking ] && echo "sys source titane Intel X-64 lib."
-        . ${libIGCM}/libIGCM_sys/libIGCM_sys_titane.ksh;;
-
+        [ ! X${TaskType} = Xchecking ] && echo "sys source curie Intel X-64 lib."
+        . ${libIGCM}/libIGCM_sys/libIGCM_sys_curie.ksh;;
     asterix*|obelix*)
         [ ! X${TaskType} = Xchecking ] && echo "sys source obelix or asterix lib."
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 926)
@@ -1561,5 +1561,4 @@
 #D-
 function IGCM_sys_GetDate_Monitoring {
-#set -vx
   IGCM_debug_PushStack "IGCM_sys_GetDate_Monitoring" $@
   if ( $DEBUG_sys ) ; then
@@ -1572,5 +1571,4 @@
   IGCM_sys_Cd -
 
-#set +vx
   IGCM_debug_PopStack "IGCM_sys_GetDate_Monitoring"
 }
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 925)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 926)
@@ -358,6 +358,4 @@
   IGCM_debug_PushStack "IGCM_sys_SendMail" $@
 
-set -vx
-
   if ( $DEBUG_sys ) ; then
     echo "IGCM_sys_SendMail :" $@
@@ -388,6 +386,4 @@
   sleep 10
   rm -f mail.txt
-
-set +vx
 
   IGCM_debug_PopStack "IGCM_sys_SendMail"
