Index: TOOLS/PACK_IPSL/launch_and_measureTime.sh
===================================================================
--- TOOLS/PACK_IPSL/launch_and_measureTime.sh	(revision 1868)
+++ TOOLS/PACK_IPSL/launch_and_measureTime.sh	(revision 1869)
@@ -35,8 +35,4 @@
 	       echo "./process_list.sh $newCmdToPrint" >> ${tasksListFile}
 	   ;;
-	   x50)
-	       # ne fait rien, la liste, au depart a concatener, a ete taree 
-	       # car echec de la concatenation  
-	   ;;
 	   *)
 	       echo "./process_list.sh $cmdToPrint" >> ${tasksListFile}
@@ -127,24 +123,28 @@
    local file1=$1
    local file2=$2
-   if [ "x${file1}" == "x" ] || [ "x${file2}" == "x" ]
+   local file_to_get_retCode=$3
+   if [ "x${file1}" == "x" ] || [ "x${file2}" == "x" ] || [ "x${file_to_get_retCode}" == "x" ]
    then
-       echo "check_progress : Le nom d'au moins 1 des 2 fichiers d'entree est vide" >> $badFailureFile
+       echo "check_progress : Le nom d'au moins 1 des 3 fichiers d'entree est vide" >> $badFailureFile
        exit 1
    fi
       
-   if [ ! -e $file1 ] || [ ! -e $file2 ]
+   if [ ! -e $file1 ] || [ ! -e $file2 ] || [ ! -e ${file_to_get_retCode} ]
    then
-       echo "check_progress : au moins un des 2 fichiers suivants n'existe pas :" >> $badFailureFile
-       echo "$file1"
-       echo "$file2"
+       echo "check_progress : au moins un des 3 fichiers suivants n'existe pas :" >> $badFailureFile
+       echo "$file1" >> $badFailureFile
+       echo "$file2" >> $badFailureFile
+       echo "${file_to_get_retCode}" >> $badFailureFile
        exit 1
    fi
    local nbLineFile1=`cat $file1 | wc -l `
-   local nbLineFile1=`cat $file2 | wc -l `
-   if [ $nbLineFile1 -ne $nbLineFile1 ]
+   local nbLineFile2=`cat $file2 | wc -l `
+   if [ $nbLineFile1 -ne $nbLineFile2 ]
    then
        echo 1
        return
    fi
+   # si l'on parvient a ce stade, c'est les 2 fichiers ont le meme
+   # nombre de lignes
    
    old_IFS=$IFS     # sauvegarde du séparateur de champ  
@@ -160,5 +160,14 @@
        fi 
    done
-   IFS=$old_IFS     # rétablissement du séparateur de champ par défaut   
+   IFS=$old_IFS     # rétablissement du séparateur de champ par défaut
+   
+   # Les codes de retour sont-ils != 0 ?
+   nbNonZeroCodes=`cat ${file_to_get_retCode} | grep -e '^#executed by' | awk '{ if ($9 != 0) {print $9} }' | wc -l `
+   if [ $nbNonZeroCodes -gt 0 ]
+   then
+       echo 1
+       return
+   fi
+     
    echo 0
 }
@@ -368,53 +377,56 @@
 update_tasks_list $nextInputCmd $output $inputCmd
 
-# Verifications sur qq listes (dont le traitement semble correct) :
-# ----------------------------------------------------------------------------------------
-if [ "x${nbListsToCheck}" == "x" ]
-then
-    echo "nbre de listes a checker absent" >> $checkFile
-    echo "nbre de listes a checker absent" >> $badFailureFile
-    exit 1
-fi
-> $checkFileTmp
-# ensemble des listes concatenees correctement
-set_of_good_lists=`cat $output | grep -e '^#executed by process' | awk '{ if ($9==0){print $12} }' | grep "output_ncrcat" `
-
-# envoi des cmds de check dans fichier tmp
-for lst in $set_of_good_lists
-do
-   echo "./check_ncrcat_list.sh $lst" >> $checkFileTmp
-done
-
-# nombre de listes concatenees correctement
-nb_of_good_lists=`cat $checkFileTmp | wc -l `
-
-# le nb de listes a checker ne peut exceder le nb de listes disponibles pour le check
-if [ $nbListsToCheck -ge $nb_of_good_lists ]
-then
-    nbListsToCheck=$nb_of_good_lists
-fi
-nbLstToCheck_tmp=$nbListsToCheck
-
-while [ $nbLstToCheck_tmp -gt 0 ]
-do
-    random_number=$( gives_random_number $nbLstToCheck_tmp ) # nb aleatoire entre 1 et $nbLstToCheck_tmp
-    checkCmd=`sed -n "${random_number}p" $checkFileTmp `
-    $checkCmd # on envoie la cmd de check
-    resCmd=$?
-    if [ "x${resCmd}" != "x0" ]
+if [ "x${doYouWantCheck}" == "xyes" ]
+then
+    # Verifications sur qq listes (dont le traitement semble correct) :
+    # ----------------------------------------------------------------------------------------
+    if [ "x${nbListsToCheck}" == "x" ]
     then
-        echo "$checkCmd ==> not OK ==> stop everything." >> $checkFile
-	echo "$checkCmd ==> not OK ==> stop everything." >> $badFailureFile
-	# exit 1 # a retablir
-    else
-        echo "$checkCmd ==> OK" >> $checkFile
+	echo "nbre de listes a checker absent" >> $checkFile
+	echo "nbre de listes a checker absent" >> $badFailureFile
+	exit 1
     fi
-    sed -i "${random_number}d" $checkFileTmp # on retire la cmd qui vient d'etre effectuee du fichier tmp
-    nbLstToCheck_tmp=$(( $nbLstToCheck_tmp - 1 ))
-done
-
-
-rm $checkFileTmp
-# ----- Fin verif ------------------------------------------------------------------------
+    > $checkFileTmp
+    # ensemble des listes concatenees correctement
+    set_of_good_lists=`cat $output | grep -e '^#executed by process' | awk '{ if ($9==0){print $12} }' | grep "output_ncrcat" `
+
+    # envoi des cmds de check dans fichier tmp
+    for lst in $set_of_good_lists
+    do
+       echo "./check_ncrcat_list.sh $lst" >> $checkFileTmp
+    done
+
+    # nombre de listes concatenees correctement
+    nb_of_good_lists=`cat $checkFileTmp | wc -l `
+
+    # le nb de listes a checker ne peut exceder le nb de listes disponibles pour le check
+    if [ $nbListsToCheck -ge $nb_of_good_lists ]
+    then
+	nbListsToCheck=$nb_of_good_lists
+    fi
+    nbLstToCheck_tmp=$nbListsToCheck
+
+    while [ $nbLstToCheck_tmp -gt 0 ]
+    do
+	random_number=$( gives_random_number $nbLstToCheck_tmp ) # nb aleatoire entre 1 et $nbLstToCheck_tmp
+	checkCmd=`sed -n "${random_number}p" $checkFileTmp `
+	$checkCmd # on envoie la cmd de check
+	resCmd=$?
+	if [ "x${resCmd}" != "x0" ]
+	then
+            echo "$checkCmd ==> not OK ==> stop everything." >> $checkFile
+	    echo "$checkCmd ==> not OK ==> stop everything." >> $badFailureFile
+	    # exit 1 # a retablir
+	else
+            echo "$checkCmd ==> OK" >> $checkFile
+	fi
+	sed -i "${random_number}d" $checkFileTmp # on retire la cmd qui vient d'etre effectuee du fichier tmp
+	nbLstToCheck_tmp=$(( $nbLstToCheck_tmp - 1 ))
+    done
+
+
+    rm $checkFileTmp
+    # ----- Fin verif ------------------------------------------------------------------------
+fi
 
 echo "no interruption has occured" > ${noInterruptFile}
@@ -431,7 +443,13 @@
 fi
 
-# y a t il progression ?
-# ----------------------
-resDiff=$( check_progress $inputCmd $nextInputCmd )
+# y a t il progression avant traitements et apres ?
+# -------------------------------------------------
+# Dans la fonction 'check_progress', on a besoin de verifier le code
+# de retour du traitement des listes : en effet, si les 2 fichiers a comparer
+# contiennent les memes fichiers de liste, il faut aussi que les codes de
+# retour soient != 0. 
+file_to_get_lists_retCode=$output
+resDiff=$( check_progress $inputCmd $nextInputCmd $file_to_get_lists_retCode )
+
 # resDiff == 1 : fichiers differents
 # resDiff == 0 : fichiers identiques
Index: TOOLS/PACK_IPSL/process_list.sh
===================================================================
--- TOOLS/PACK_IPSL/process_list.sh	(revision 1868)
+++ TOOLS/PACK_IPSL/process_list.sh	(revision 1869)
@@ -105,17 +105,18 @@
 		echo "====> DELEGATE to tar command with option --switchtotar"
 		echo "DELEGATE to tar command with option --switchtotar" >> $statusfile
+		mkdir -p $PATH_SIMU/output_tar
 		mv $set $PATH_SIMU/output_tar
 		exit 5
 	fi
 	
-	# Skip the set if last line of the status file is "DELEGATE"
-	if tail -1 $statusfile | grep -q -E 'DELEGATE' ; then
-		printf "====> "
-		tail -1 $statusfile
-		exit 50
-	fi
+	# # Skip the set if last line of the status file is "DELEGATE"
+	# if tail -1 $statusfile | grep -q -E 'DELEGATE' ; then
+	# 	printf "====> "
+	# 	tail -1 $statusfile
+	# 	exit 50
+	# fi
 	
 	# Skip the set if last line of the status file is "COMPLETED"
-	if tail -1 $statusfile | grep -q -E 'COMPLETED' ; then
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
 		printf "====> "
 		tail -1 $statusfile
@@ -153,6 +154,8 @@
 		# Copy to output_tar directory
 		echo "====> COPY to tar command because find other variables ($varstoexcludefiltered) than t_inst_*"
-		echo "COPY to tar command because find other variables ($varstoexcludefiltered) than t_inst_*" >> $statusfile
+#		echo "COPY to tar command because find other variables ($varstoexcludefiltered) than t_inst_*" >> $statusfile
+		mkdir -p $PATH_SIMU/output_tar
 		cp $set $PATH_SIMU/output_tar
+		
 	fi
 
@@ -178,4 +181,10 @@
 		echo "====> COMPLETED at try #$nbtries (at 1st shot on 2)"
 		echo "COMPLETED at try #$nbtries (at 1st shot on 2)" >> $statusfile
+		# exit 10 : il faut tarer cette liste dans "output_tar" et tenter de la concatener a nouveau
+			# exit 5 : seulement la tarer dans "output_tar"
+		if [ "x${extratar}" == "x1" ]
+		then
+		    exit 10
+		fi
 	else
 		# Add --md5_digest
@@ -195,4 +204,8 @@
 			echo "====> COMPLETED at try #$nbtries (at 2nd shot on 2)"
 			echo "COMPLETED at try #$nbtries (at 2nd shot on 2)" >> $statusfile
+			if [ "x${extratar}" == "x1" ]
+			then
+			    exit 10
+			fi
 		else
 			datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
@@ -203,5 +216,7 @@
 				echo "====> DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)"
 				echo "DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)" >> $statusfile
+				mkdir -p $PATH_SIMU/output_tar
 				cp $set $PATH_SIMU/output_tar # gpdebug : a retablir
+				exit 10
 			fi
 			
@@ -212,5 +227,5 @@
 			    exit 10
 			else
-			    exit 5
+			    exit 1
 			fi
 		fi
