Index: trunk/libIGCM/AA_RunChecker
===================================================================
--- trunk/libIGCM/AA_RunChecker	(revision 832)
+++ trunk/libIGCM/AA_RunChecker	(revision 834)
@@ -163,5 +163,5 @@
 
 
-  
+
   #Â Print header
   # ============
@@ -315,7 +315,4 @@
       echo "       the config.card instead of the job name."
       exit ;;
-#    -b|-nocolor)
-#      fg_color=false
-#      shift 1 ;;
     -j|-job-number)
       NbHisto="$2"
@@ -358,4 +355,6 @@
 libIGCM=${libIGCM:=::modipsl::/libIGCM}
 
+DEBUG_debug=false
+
 . ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
 . ${libIGCM}/libIGCM_card/libIGCM_card.ksh
@@ -462,4 +461,14 @@
   echo "Work:    >${CWORK_DIR}<"
 
+  # Are packs activated or not ?
+  # ============================
+  if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && \
+       [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
+    Pack=true
+  else
+    Pack=false
+  fi
+
+
   if [ $PeriodState != "Waiting" ] ; then
 
@@ -498,10 +507,21 @@
       typeset    name1="${JobType}_String"
       typeset    name2="${JobType}_Field"
+      typeset    name3="${JobType}_Activ"
       if [ X${JobType} == X${RebuildJob} ] ; then
-        eval ${name1}=IGCM_sys_PutBuffer_Out
+        if ( ${Pack} ) ; then
+          eval ${name1}=IGCM_sys_PutBuffer_Out
+        else
+          eval ${name1}=IGCM_sys_Put_Out
+        fi
         eval ${name2}=4
+        eval ${name3}=true
       else
         eval ${name1}=IGCM_sys_Put_Out
         eval ${name2}=3
+        if ( ${Pack} ) ; then
+          eval ${name3}=true
+        else
+          eval ${name3}=false
+        fi
       fi
     done
@@ -513,36 +533,55 @@
       eval String=\${${JobType}_String}
       eval Field=\${${JobType}_Field}
-
-      set -A FileList $( ls ${POST_DIR}/${JobType}.*.out | tail -n ${NbHisto} )
-
-      if [ ${#FileList[*]} -gt ${NbLines} ] ; then
-        NbLines=${#FileList[*]}
+      eval Activ=\${${JobType}_Activ}
+
+      if ( ${Activ} ) ; then
+
+        set -A FileList $( ls ${POST_DIR}/${JobType}.*.out | tail -n ${NbHisto} )
+
+        if [ ${#FileList[*]} -gt ${NbLines} ] ; then
+          NbLines=${#FileList[*]}
+        fi
+
+        (( ind = 0 ))
+        for FileName in ${FileList[*]} ; do
+          LastDate=$( basename ${FileName} | gawk -F"." '{ print $(NF-1) }' )
+
+          set -- $( gawk -v String=${String} \
+                         'BEGIN { nb_ok = 0 ; nb_ko = 0 } \
+                         ($1 ~ String) { \
+                           if ($3 !~ /error./) { \
+                             nb_ok = nb_ok + 1 \
+                           } else { \
+                             nb_ko = nb_ko + 1 \
+                           } \
+                         } \
+                         END { print nb_ok " " nb_ko }' \
+                         ${POST_DIR}/${JobType}.${LastDate}.out )
+          Match=$1
+          Error=$2
+
+          (( Nb = ${Match} - ${Error} ))
+
+          if ( [ ${Error} -eq 0 ] && [ ${Nb} -gt 0 ] ) ; then
+            Status=OK
+          else
+            Status=KO
+          fi
+
+          eval ${JobType}_Date[$ind]=${LastDate}
+          eval ${JobType}_Status[$ind]=${Status}
+          eval ${JobType}_Nb[$ind]=${Nb}
+
+          (( ind = ind + 1 ))
+        done
+
+      else
+
+          eval ${JobType}_Date[0]=""
+          eval ${JobType}_Status[0]=""
+          eval ${JobType}_Nb[0]=""
+
       fi
 
-      (( ind = 0 ))
-      for FileName in ${FileList[*]} ; do
-        LastDate=$( basename ${FileName} | gawk -F"." '{ print $(NF-1) }' )
-
-        Error=$( gawk -v String=${String} \
-                     'BEGIN { x=0 } ($1~String) && ($3~"error.") { x=x+1 } END { print x }' \
-                     ${POST_DIR}/${JobType}.${LastDate}.out )
-
-        Match=$( gawk -v String=${String} \
-                     'BEGIN { x=0 } ($1~String) && ($3!~"error.") { x=x+1 } END { print x }' \
-                     ${POST_DIR}/${JobType}.${LastDate}.out )
-        (( Nb = ${Match} - ${Error} ))
-
-        if ( [ ${Error} -eq 0 ] && [ ${Nb} -gt 0 ] ) ; then
-          Status=OK
-        else
-          Status=KO
-        fi
-
-        eval ${JobType}_Date[$ind]=${LastDate}
-        eval ${JobType}_Status[$ind]=${Status}
-        eval ${JobType}_Nb[$ind]=${Nb}
-        
-        (( ind = ind + 1 ))
-      done
     done
 
@@ -583,5 +622,5 @@
 
   fi
-    
+
 
   # Print results
