Index: TOOLS/PACK_IPSL/DEM_utilities.sh
===================================================================
--- TOOLS/PACK_IPSL/DEM_utilities.sh	(revision 1848)
+++ TOOLS/PACK_IPSL/DEM_utilities.sh	(revision 1849)
@@ -305,5 +305,5 @@
    # On verifie que xyz est un nombre a 3 chiffres
    verNCOnumberOK=`echo $verNCOnumber | grep -e '^[0-9]\{3\}$' | wc -l `
-   #  if ! [[ "$verNCOnumber" =~ ^[0-9]\{3\}$ ]]
+   #  if ! [[ "$verNCOnumber" =~ ^[0-9]\{3\}$ ]] # gpdebug : ne marche pas sous curie si ksh. 
    if [ "x${verNCOnumberOK}" == "x0" ]
    then
@@ -509,4 +509,25 @@
 }
 
+
+function getDateMilliSeconds
+{
+   test=`date +%s%N`
+   testnum=${#test}
+   millisec=${test:0:$testnum-6}
+   echo "$millisec"
+}
+
+function getTimeDiffSeconds
+{
+   startTimeMilliSec=$1
+   endTimeMilliSec=$( getDateMilliSeconds )
+   
+   diffMilliSec=$(( $endTimeMilliSec - $startTimeMilliSec ))
+   
+   diffSeconds=$(awk 'BEGIN { print '$diffMilliSec'/'1000' }')
+   echo "$diffSeconds"  
+
+}
+
 # gpdebug : fin #####################################################################################
 
Index: TOOLS/PACK_IPSL/Makefile
===================================================================
--- TOOLS/PACK_IPSL/Makefile	(revision 1849)
+++ TOOLS/PACK_IPSL/Makefile	(revision 1849)
@@ -0,0 +1,14 @@
+MPICC=mpicc
+
+.PHONY: all
+all : cmd_launch.exe 
+
+%.exe:%.c
+	$(MPICC) -o $@ $<
+
+
+
+
+
+
+
Index: TOOLS/PACK_IPSL/check_ncrcat_list.sh
===================================================================
--- TOOLS/PACK_IPSL/check_ncrcat_list.sh	(revision 1849)
+++ TOOLS/PACK_IPSL/check_ncrcat_list.sh	(revision 1849)
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+listToProcessFile="${1}"
+# exemple de fichier liste :
+# /ccc/scratch/cont003/incka/pierreg/IGCM_DEM/dataDMNFS_FromTitane/IGCM_OUT/IPSLCM5A/REDO/historicalGHG/v3.historicalGHG1R/output_tar/v3.historicalGHG1R_20101201_20121231_1M_histmthNMC.nc.list
+
+
+# export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1
+export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane
+
+# export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE
+export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE
+
+# export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK
+export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK
+
+# export OUTPUT_CHECK=${SCRATCHDIR}/PSEUDO_DMNFS_CHECK
+export OUTPUT_CHECK=${SCRATCHDIR}/dataDMNFS_FromTitane_CHECK
+
+
+dirin=$INPUT_DMF_DATA
+dirout=$OUTPUT_STORE
+dirout_work=$OUTPUT_WORK
+dirout_check=$OUTPUT_CHECK
+
+export JOB_DIR=${LS_SUBCWD:-${PWD}}
+export EXE_DIR=${JOB_DIR}
+source ${EXE_DIR}/DEM_utilities.sh
+
+dirPathOfListFile=$( dirname  $listToProcessFile )
+dirnameOfListFile=$( basename $dirPathOfListFile )
+
+# rep de simu : celui contenant le rep qui contient la liste
+PATH_SIMU=$( dirname  $dirPathOfListFile )
+set=$listToProcessFile
+
+
+#-----------------------------------
+# Set output file name from list name
+
+fileout1=$( basename $set )
+fileout=${fileout1%.list}
+
+filefirst=`head -n 1 $set`
+diroutputfile=`dirname $filefirst | sed -e "s%$dirin%$dirout%"`
+
+output_ncrcat_file=$diroutputfile/${fileout}
+
+#----------------------------------
+fileout_cdocat=${fileout1%.list}.cdocat
+
+dirOutput_cdocat_file=`dirname $filefirst | sed -e "s%$dirin%$dirout_check%"`
+
+output_cdocat_file=${dirOutput_cdocat_file}/${fileout_cdocat}
+
+
+#----------------------------------
+# log file 
+datestr=`LC_ALL=C date +"%Y%m%dTT%H%M%S"`
+logfile=${fileout_cdocat%%.cdocat}_${datestr}.log
+output_cdocat_logFile=${dirOutput_cdocat_file}/${logfile}
+
+
+echo
+echo "Output file to write:"
+echo "$output_ncrcat_file"
+echo
+echo "Output cdo cat file to write:"
+echo "$output_cdocat_file"
+echo
+echo "Output cdo cat log file to write:"
+echo "$output_cdocat_logFile"
+
+
+if [ ! -e $outputfile ]
+then
+   echo "Le fichier liste suivant n'existe pas :"
+   echo "$outputfile"
+fi
+
+mkdir -p $dirOutput_cdocat_file
+
+listOfFilesToCdocat=`cat $listToProcessFile `
+
+cdo cat $listOfFilesToCdocat $output_cdocat_file > $output_cdocat_logFile 2>&1
+
+echo >> $output_cdocat_logFile
+
+vartoexclude="'t_inst*,contfracATM,sobowlin'"
+./diff.bash $output_ncrcat_file $output_cdocat_file $vartoexclude >> $output_cdocat_logFile
+
+code_sortie=$?
+
+exit $code_sortie
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: TOOLS/PACK_IPSL/cmd_launch.c
===================================================================
--- TOOLS/PACK_IPSL/cmd_launch.c	(revision 1849)
+++ TOOLS/PACK_IPSL/cmd_launch.c	(revision 1849)
@@ -0,0 +1,107 @@
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define CMD_MAXLEN 4096
+#define CMD_MASTER 0
+#define TAG_AVAIL 1
+#define TAG_CMD   2
+
+void read_and_exec(char *filename);
+void read_and_send(int slaves, char *filename);
+void recv_and_exec(int rank);
+void read_next_command(FILE *fl, char *cmd);
+void exec_command(char *cmd, int rank);
+
+int main(int argc,char **argv)
+{
+	FILE *fl;
+	int rank,size;
+
+	MPI_Init(&argc,&argv);
+	MPI_Comm_rank(MPI_COMM_WORLD,&rank);
+	MPI_Comm_size(MPI_COMM_WORLD,&size);  
+	if (rank == CMD_MASTER)
+		printf("master is %d , nb slaves: %d\n",
+		       CMD_MASTER,size-1);	
+
+	if (size == 1)
+		read_and_exec(argv[1]);
+	else if(size != 1 && rank == CMD_MASTER)
+		read_and_send(size-1,argv[1]);
+	else
+		recv_and_exec(rank);
+	MPI_Finalize();
+}
+
+void read_and_exec(char *filename)
+{
+	FILE *fl;
+	char cmd[CMD_MAXLEN];
+	double t;
+
+	fl = fopen(filename,"r");
+	do {
+	  read_next_command(fl,cmd);
+		if(!strlen(cmd))
+			break;
+		exec_command(cmd,CMD_MASTER);
+	} while (strlen(cmd));
+	fclose(fl);
+}
+
+void read_and_send(int slaves,char *filename)
+{
+	int i, num;
+	MPI_Status status;
+	FILE *fl;
+	char cmd[CMD_MAXLEN];
+
+	fl = fopen(filename,"r");
+	i=0;
+	do {
+	        read_next_command(fl,cmd);
+		MPI_Recv(&num,1,MPI_INT,MPI_ANY_SOURCE,
+			 TAG_AVAIL,MPI_COMM_WORLD,&status);
+		MPI_Send(cmd,CMD_MAXLEN,MPI_CHAR,num,
+			 TAG_CMD,MPI_COMM_WORLD);
+		if (!strlen(cmd)) /* terminate command sent */
+			i++;
+	} while (i < slaves);
+	fclose(fl);
+}
+
+void recv_and_exec(int rank)
+{
+	char cmd[CMD_MAXLEN];  
+	MPI_Status status;  
+
+	do {
+		MPI_Send(&rank,1,MPI_INT,CMD_MASTER,
+			 TAG_AVAIL,MPI_COMM_WORLD); 
+		MPI_Recv(cmd,CMD_MAXLEN,MPI_CHAR,CMD_MASTER,
+			 TAG_CMD,MPI_COMM_WORLD,&status); 
+		if(!strlen(cmd)) /* terminate command */
+			break;
+		exec_command(cmd,rank);
+	} while (strlen(cmd));
+}
+
+void read_next_command(FILE *fl,char *cmd)
+{
+	if(!fgets(cmd,CMD_MAXLEN,fl)) cmd[0]='\0';
+	if(cmd[strlen(cmd)-1]=='\n') cmd[strlen(cmd)-1]='\0';
+}
+
+void exec_command(char *cmd, int rank)
+{
+	double t;
+	int r;
+
+	t = MPI_Wtime();  
+	r=system(cmd);
+	t = MPI_Wtime() - t;  
+	fprintf(stderr,"#executed by process\t%d in %gs\twith status\t%d : %s\n",
+		rank,t,r,cmd);
+}
Index: TOOLS/PACK_IPSL/create_config_card.sh
===================================================================
--- TOOLS/PACK_IPSL/create_config_card.sh	(revision 1848)
+++ TOOLS/PACK_IPSL/create_config_card.sh	(revision 1849)
@@ -53,6 +53,10 @@
     #PATH_SIMUL_SHORT=${PATH_SIMUL_FULL##${ROOT_DIR}} # Enleve le debut du path
 #    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/[^/]*/[^/]*/[^/]*/%%' )
-    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/%%' )
-
+#    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed 's%/ccc/dmfbuf/import_data.2/ccrt/dmnfs12/cont003/bacasable/%%' )
+    echo "gpdebug : PATH_SIMUL_FULL :" # gpdebug : a virer
+    echo "$PATH_SIMUL_FULL :" # gpdebug : a virer
+    PATH_SIMUL_SHORT=$(echo ${PATH_SIMUL_FULL} | sed "s%${SCRATCHDIR}/%%" ) # gpdebug : added
+    echo "gpdebug : PATH_SIMUL_SHORT :" # gpdebug : a virer
+    echo "$PATH_SIMUL_SHORT :" # gpdebug : a virer  
     DEM_log -3 PATH_SIMUL_SHORT : ${PATH_SIMUL_SHORT}
     
Index: TOOLS/PACK_IPSL/diff.bash
===================================================================
--- TOOLS/PACK_IPSL/diff.bash	(revision 1849)
+++ TOOLS/PACK_IPSL/diff.bash	(revision 1849)
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+#==============================================
+#
+# Usage:
+# ./diff.bash f1.nc f1.nc
+# ./diff.bash f1.nc f1_witherror.nc
+#
+# ./diff.bash fileA.nc fileB.nc 'var1,var2'
+#
+# ex: ./diff.bash file_ncrcat.nc file_cdocat.nc 'contfracATM'
+#
+#==============================================
+
+if [ $# -eq 3 ] ; then
+	delname="-delname,$3"
+fi
+
+cdo -s diff $1 $delname $2 > diff_$$.tmp 2>&1
+result2=`cat diff_$$.tmp | grep -i "records differ" | tr -s " " | cut -f2 -d" "`
+
+if [ "$result2" = "0" ] ; then
+	# EXIT_SUCCESS
+	echo "Variables from netcdf files : "
+	echo "$1"
+	echo "$2" 
+	echo "are the same"
+	rm -f diff_$$.tmp
+	exit 0
+else
+	# EXIT_FAILURE
+	echo "Variables from netcdf files : "
+	echo "$1"
+	echo "$2" 
+	echo "differ"	
+	cat diff_$$.tmp | grep -i "records differ"
+	rm -f diff_$$.tmp
+	echo "==============> ERROR"
+	exit 1 
+fi
+
Index: TOOLS/PACK_IPSL/enlarge_my_files.sh
===================================================================
--- TOOLS/PACK_IPSL/enlarge_my_files.sh	(revision 1848)
+++ TOOLS/PACK_IPSL/enlarge_my_files.sh	(revision 1849)
@@ -103,26 +103,6 @@
 # gpdebug : ****************************** fin ********************
 
-
-#********** gpdebug : mesure d'intervalles de temps ***************
-function getDateMilliSeconds
-{
-   test=`date +%s%N`
-   testnum=${#test}
-   millisec=${test:0:$testnum-6}
-   echo "$millisec"
-}
-
-function getTimeDiffSeconds
-{
-   startTimeMilliSec=$1
-   endTimeMilliSec=$( getDateMilliSeconds )
-   
-   diffMilliSec=$(( $endTimeMilliSec - $startTimeMilliSec ))
-   
-   diffSeconds=$(awk 'BEGIN { print '$diffMilliSec'/'1000' }')
-   echo "$diffSeconds"  
-
-}
-# gpdebug : ****************************** fin ********************
+source ${EXE_DIR}/DEM_utilities.sh # gpdebug : pour trouver les fonctions de mesure de temps
+
 #------------------------------------------------------
 for set in $( ls $PATH_SIMU/output_ncrcat/*list ) ; do
Index: TOOLS/PACK_IPSL/launch_and_measureTime.sh
===================================================================
--- TOOLS/PACK_IPSL/launch_and_measureTime.sh	(revision 1849)
+++ TOOLS/PACK_IPSL/launch_and_measureTime.sh	(revision 1849)
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+#MSUB -r pack_ipsl          # Nom du job                
+#MSUB -e IO_parallel/launchMeasureTimeOutput/pack_ipsl_%I.e
+#MSUB -o IO_parallel/launchMeasureTimeOutput/pack_ipsl_%I.o
+#MSUB -n 7            # Reservation du processus
+#MSUB -T 2500            # Limite de temps elapsed du job (en secondes)
+#MSUB -A tgcc0013
+#MSUB -q standard
+# #MSUB -q large
+#MSUB -Qos test
+
+
+
+export JOB_DIR=${LS_SUBCWD:-${PWD}}
+export EXE_DIR=${JOB_DIR}
+source ${EXE_DIR}/DEM_utilities.sh
+
+
+export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM
+
+
+# inputCmd="myIO/inputCmd.list"
+inputCmd="inputCmd_Realistic.list"
+output="IO_parallel/output.log"
+
+> ${inputCmd}
+
+listOfDir="output_ncrcat output_tar restart_tar debug_tar store_cp work_cp"
+
+for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 
+
+   PATH_SIMU=$( dirname $CONFIG )
+   echo "PATH_SIMU=$PATH_SIMU"
+   echo "------------------------------------------"
+   for typeDir in $listOfDir
+   do
+       typeDirList=`find $PATH_SIMU -type d -name "$typeDir" `
+       for dir in $typeDirList
+       do
+           # echo "dir=$dir"
+	   listFilesInDir=`find $dir -name "*.list" `
+	   for file in $listFilesInDir
+	   do
+	       echo "./process_list.sh $file" >> ${inputCmd}
+	   done
+       done
+   done
+   
+
+done
+
+
+
+startTime=$( getDateMilliSeconds )
+echo "start time:$startTime" >> $timeHandlingFile
+
+ccc_mprun  ./cmd_launch.exe ${inputCmd} 2>${output}
+# ./cmd_launch.exe ${inputCmd} 2>${output}
+# ccc_mprun -p standard -n ${BRIDGE_MSUB_NPROC} ./cmd_launch.exe ${inputCmd} 2>myIO/output.log
+# mpirun -n 4 ./cmd_launch.exe myIO/inputCmd10.list 2>myIO/output.log
+
+meantime=$( getTimeDiffSeconds $startTime )
+
+endExecutionTime=$( getDateMilliSeconds )
+echo "end time:$endExecutionTime" >> $timeHandlingFile
+
+
+echo "meantime ncrcat = $meantime"
Index: TOOLS/PACK_IPSL/launch_ipsl_pack.sh
===================================================================
--- TOOLS/PACK_IPSL/launch_ipsl_pack.sh	(revision 1848)
+++ TOOLS/PACK_IPSL/launch_ipsl_pack.sh	(revision 1849)
@@ -41,5 +41,6 @@
 
 # fichier de progression d'execution
-extSuiviListes=`echo ${LISTE_SIMUL} | sed 's;\.[[:alnum:]]*$;;' `
+ficParam=$( basename ${LISTE_SIMUL} ) # gpdebug : modif ici et ligne d'apres
+extSuiviListes=`echo ${ficParam} | sed 's;\.[[:alnum:]]*$;;' `
 # echo "extSuiviListes=$extSuiviListes" # gpdebug : a virer
 export MonitoringDir="${PWD}/SuiviListes_${extSuiviListes}"
Index: TOOLS/PACK_IPSL/parallelPack.sh
===================================================================
--- TOOLS/PACK_IPSL/parallelPack.sh	(revision 1849)
+++ TOOLS/PACK_IPSL/parallelPack.sh	(revision 1849)
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+########  pour option -f #############
+restartExecFromZero=0
+while [ $# -gt 0 ]
+do
+   echo "boucle sur les arguments du script ..."
+   echo "@=$@"
+   case $1 in
+   -f)  restartExecFromZero=1 
+        echo "force restart from the beginning ..."
+	;;
+   esac
+   shift
+done
+export restartExecFromZero=${restartExecFromZero}
+######################################
+
+export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM
+
+######### Si l'option -f est activee, on detruit tous les fichiers status  ##########
+if [ "x$restartExecFromZero" == "x1" ]
+then
+    echo "Deleting  all status files ..."
+    for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste )
+    do
+       PATH_SIMU=$( dirname $CONFIG )
+       ListStatFileInSimu=`find $PATH_SIMU -type f -name "*status" `
+       if [ "x$ListStatFileInSimu" != "x" ]
+       then
+           for file in $ListStatFileInSimu
+           do
+              if [ -e $file ]
+	      then
+	         rm -f $file
+	      fi
+       
+           done      
+       fi   
+    done
+    echo "Deletion done."
+fi
+#####################################################################################
+
+export JOB_DIR=${LS_SUBCWD:-${PWD}}
+export EXE_DIR=${JOB_DIR}
+source ${EXE_DIR}/DEM_utilities.sh
+
+############## gpdebug : Pour gestion des erreurs ######################################### 
+# Execute la function errorReceive() si reception d'un signal TERM
+trap 'DEM_errorReceive' TERM
+# liste des processus à détruire en cas d'erreur bloquante
+export listPID=$$
+# fichier pour la transmission des messages d'erreur d'un fils au prog principal
+export errorMsgFile="${PWD}/errorMsg.txt"
+############## gpdebug : fin ############################################################## 
+
+export timeHandlingFile="timeHandlingFile.txt"
+> $timeHandlingFile
+startTime=$( getDateMilliSeconds )
+echo "launch time:$startTime" >> $timeHandlingFile
+
+SCRIPT_NAME=$(basename ${0} )
+
+DEM_log -0 "Demarrage de ${SCRIPT_NAME}"
+
+check_nco_version # gpdebug : verification de la version de nco #######################
+
+ccc_msub -A tgcc0013 launch_and_measureTime.sh
+
+
+
+DEM_log -0 "Fin de ${SCRIPT_NAME}"
Index: TOOLS/PACK_IPSL/process_list.sh
===================================================================
--- TOOLS/PACK_IPSL/process_list.sh	(revision 1849)
+++ TOOLS/PACK_IPSL/process_list.sh	(revision 1849)
@@ -0,0 +1,645 @@
+#!/bin/bash
+
+
+listToProcessFile="${1}"
+
+
+
+switchtotar=0 # gpdebug : a modifier --> s'occuper des options du script orig enlarge.sh
+maxtries=3
+
+#------------------------------------------------------
+# export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1
+export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane
+
+# export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE
+export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE
+
+# export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK
+export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK
+
+export IGCM_DEM=${SCRATCHDIR}/IGCM_DEM
+
+dirin=$INPUT_DMF_DATA
+dirout=$OUTPUT_STORE
+dirout_work=$OUTPUT_WORK
+
+export JOB_DIR=${LS_SUBCWD:-${PWD}}
+export EXE_DIR=${JOB_DIR}
+source ${EXE_DIR}/DEM_utilities.sh
+#------------------------------------------------------
+
+dirPathOfListFile=$( dirname  $listToProcessFile )
+dirnameOfListFile=$( basename $dirPathOfListFile )
+
+echo "dirnameOfListFile=${dirnameOfListFile}|"
+
+dirOK=0
+
+if [ "$dirnameOfListFile" != "output_ncrcat" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+if [ "$dirnameOfListFile" != "output_tar" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+if [ "$dirnameOfListFile" != "restart_tar" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+if [ "$dirnameOfListFile" != "store_cp" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+if [ "$dirnameOfListFile" != "work_cp" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+if [ "$dirnameOfListFile" != "debug_tar" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+if [ "$dirnameOfListFile" != "other_tar" ] 
+then
+    dirOK=$(( $dirOK || 0 ))
+else
+    dirOK=$(( $dirOK || 1 )) 
+fi
+
+# echo "dirOK=$dirOK"
+
+if [ "$dirOK" == "0" ]
+then
+        echo "probleme : le rep du fichier liste est mauvais 2." # gpdebug : a modifier
+        exit 1
+fi
+
+
+function find_varstoexclude {
+nbfile=0
+for file in `cat $1` ; do
+ #   ncdump -h ${file} | gawk '{if (match($0, /(byte|char|short|int|float|double) (.*)\(/, arr)) print arr[2] }' >> tmp_$$.txt
+    ncdump -h ${file} | grep -Ew "byte|char|short|int|float|double"  | awk -F\( '{split($1,a," ") ; split($2,b,")") ; if (a[2] != b[1]) print a[2]}'  >> tmp_$$.txt
+    let nbfile=nbfile+1
+done
+
+varstoexclude=`cat tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 != nbfile) {print $2}}' | paste -s -d','`
+varstoexcludefiltered=`cat tmp_$$.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if (($1 != nbfile) && !(match($2, /t_inst_(.*)/))) {print $2}}' | paste -s -d','`
+nbvars=`echo $varstoexcludefiltered | gawk -F',' '{print NF}'`
+
+rm -f tmp_$$.txt
+
+return 0 
+}
+
+# gpdebug : pour test showPackProgress.sh *************************
+export RANDOM=$$
+
+function gives_0_or_1
+{
+   bit=-1
+   let "bit = RANDOM % 2"
+   echo $bit
+}
+
+resultCmd=
+# gpdebug : ****************************** fin ********************
+
+
+
+
+# rep de simu : celui contenant le rep qui contient la liste
+PATH_SIMU=$( dirname  $dirPathOfListFile )
+set=$listToProcessFile
+
+
+if [ "$dirnameOfListFile" == "output_ncrcat" ]
+then
+	#-----------------------------------
+	echo "#-------------------"
+	echo "Set: $set"
+        datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"`
+	datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	statusfile=${set%%.list}.status
+	logfile=${set%%.list}_${datestr}.log
+
+	#-----------------------------------
+	# Create status file if not exists
+	if [ ! -e $statusfile ] ; then
+		echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile
+	fi
+
+	#-----------------------------------
+	# Switch to tar command
+	if [ $switchtotar -eq 1 ] ; then
+		echo "====> DELEGATE to tar command with option --switchtotar"
+		echo "DELEGATE to tar command with option --switchtotar" >> $statusfile
+		mv $set $PATH_SIMU/output_tar
+		exit 0
+	fi
+
+	#-----------------------------------
+	# Skip the set if last line of the status file is "COMPLETED" or "DELEGATE"
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
+		printf "====> "
+		tail -1 $statusfile
+		exit 0 # gpdebug : modif
+	fi
+
+	#-----------------------------------
+	# nbtries = number of lines from status file (first comment line gives 1 for the first try)
+	nbtries=`wc -l $statusfile | cut -d' ' -f1`		
+	echo "Nb of tries: $nbtries"
+
+	#-----------------------------------
+	# Set output file name from list name
+
+ 	fileout1=$( basename $set )
+ 	fileout=${fileout1%.list}
+
+	filefirst=`head -n 1 $set`
+	diroutputfile=`dirname $filefirst | sed -e "s%$dirin%$dirout%"`
+
+	outputfile=$diroutputfile/${fileout}
+	mkdir -p $diroutputfile
+	echo "Output file to write: $outputfile"
+
+	#-----------------------------------
+	# Find variables to exclude to have homogeneous files (always exclude 't_inst_.*')
+	extratar=0
+	find_varstoexclude $set
+	if [ $nbvars -eq 0 ] ; then
+		varstoexclude="t_inst_.*"
+	else
+		# There are others variables than 't_inst_.*' so an extra tar file will be created
+		varstoexclude="t_inst_.*,$varstoexcludefiltered"
+		extratar=1
+		# 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
+		cp $set $PATH_SIMU/output_tar
+	fi
+
+	#-----------------------------------
+	# Try 2 times before fire "FAILED"
+	ncrcatcmd=ncrcat
+	ncrcatoptions="--md5_digest"
+#	ncrcatoptions=""
+
+	startTime=$( getDateMilliSeconds ) # gpdebug : time
+	resCmd=0
+	cat $set | $ncrcatcmd $ncrcatoptions -O -x -v $varstoexclude -o $outputfile > $logfile 2>&1 # gpdebug : a retablir
+	resCmd=$?
+	meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time
+	
+	# resultCmd=$( gives_0_or_1 )
+	# resultCmd=1
+	# if [ $resultCmd -eq 0 ] ; then
+	if [ $resCmd -eq 0 ] ; then
+	        sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+		datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+		echo "DONE ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile
+		echo "====> COMPLETED at try #$nbtries (at 1st shot on 2)"
+		echo "COMPLETED at try #$nbtries (at 1st shot on 2)" >> $statusfile
+	else
+		# Add --md5_digest
+		rm -f $outputfile*ncrcat.tmp
+		startTime=$( getDateMilliSeconds ) # gpdebug : time
+		resCmd=0
+		cat $set | $ncrcatcmd $ncrcatoptions -O -x -v $varstoexclude -o $outputfile > $logfile 2>&1 # gpdebug : a retablir
+		resCmd=$?
+		meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time
+	        # resultCmd=$( gives_0_or_1 )
+		# resultCmd=1
+	        # if [ $resultCmd -eq 0 ] ; then
+		if [ $resCmd -eq 0 ] ; then
+		        sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+			datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+			echo "DONE ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile
+			echo "====> COMPLETED at try #$nbtries (at 2nd shot on 2)"
+			echo "COMPLETED at try #$nbtries (at 2nd shot on 2)" >> $statusfile
+		else
+			datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+			rm -f $outputfile*ncrcat.tmp
+			echo "====> FAILED at try #$nbtries" 
+			echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; cat $set | $ncrcatcmd $ncrcatoptions -O -x -v '$varstoexclude' -o $outputfile ; $logfile ; $extratar" >> $statusfile
+			if [ $nbtries -ge $maxtries ] ; then
+				echo "====> DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)"
+				echo "DELEGATE to tar command after $nbtries tries (maxtries=$maxtries)" >> $statusfile
+				cp $set $PATH_SIMU/output_tar # gpdebug : a retablir
+			fi
+		fi
+	fi
+
+
+
+fi
+
+
+#------------------------------------------------------
+if [ "$dirnameOfListFile" == "output_tar" ]
+then
+
+	#-----------------------------------
+	echo "#-------------------"
+	echo "Set: $set"
+        datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"`
+	datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	statusfile=${set%%.list}.status
+	logfile=${set%%.list}_${datestr}.log
+
+	#-----------------------------------
+	# Create status file if not exists
+	if [ ! -e $statusfile ] ; then
+		echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile
+	fi
+
+	#-----------------------------------
+	# Skip the set if last line of the status file is "COMPLETED" or "DELEGATE"
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
+		printf "====> "
+		tail -1 $statusfile
+		exit 0
+	fi
+
+	#-----------------------------------
+	# nbtries = number of lines from status file (first comment line gives 1 for the first try)
+	nbtries=`wc -l $statusfile | cut -d' ' -f1`		
+	# echo "Nb of tries: $nbtries"
+
+	#-----------------------------------
+	# Set output file name from list name
+
+ 	fileout1=$( basename $set )
+ 	fileout=${fileout1%.list}.tar
+	
+	filefirst=`head -n 1 $set`
+	dirinputfile=`dirname $filefirst`
+	diroutputfile=`dirname $filefirst | sed -e "s%$dirin%$dirout%"`	
+
+	outputfile=$diroutputfile/${fileout}
+	mkdir -p $diroutputfile
+	echo "Output file to write: $outputfile"
+
+	#-----------------------------------
+	# Try 1 time before fire "FAILED"
+	# Waiting for CCRT command
+	tarcmd=tar
+	taroptions="--format=posix -W -cf"
+	
+	cd $dirinputfile
+
+	set_local=$set".local"
+	for file in $( cat $set) ; do
+	    basename $file >> $set".local" 
+	done
+	    
+# 	#-----------------------------------
+        startTime=$( getDateMilliSeconds ) # gpdebug : time
+	resCmd=0
+	$tarcmd $taroptions $outputfile --dereference --files-from $set.local > $logfile 2>&1 # gpdebug : a retablir
+	resCmd=$?
+	meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time
+	
+	# resultCmd=$( gives_0_or_1 )
+	# if [ $resultCmd -eq 0 ] ; then
+	if [ $resCmd -eq 0 ] ; then
+	    sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile
+	    echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)"
+	    echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile
+	else
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "====> FAILED at try #$nbtries" 
+	    echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile
+
+	fi
+	rm -f $set".local" 
+	#-----------------------------------
+	
+fi
+
+
+#------------------------------------------------------
+if [ "$dirnameOfListFile" == "restart_tar" ]
+then
+	#-----------------------------------
+	echo "#-------------------"
+	echo "Set: $set"
+        datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"`
+	datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	statusfile=${set%%.list}.status
+	logfile=${set%%.list}_${datestr}.log
+
+	#-----------------------------------
+	# Create status file if not exists
+	if [ ! -e $statusfile ] ; then
+		echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile
+	fi
+
+	#-----------------------------------
+	# Skip the set if last line of the status file is "COMPLETED" or "DELEGATE"
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
+		printf "====> "
+		tail -1 $statusfile
+		exit 0
+	fi
+
+	#-----------------------------------
+	# nbtries = number of lines from status file (first comment line gives 1 for the first try)
+	nbtries=`wc -l $statusfile | cut -d' ' -f1`		
+	# echo "Nb of tries: $nbtries"
+
+	#-----------------------------------
+	# Set output file name from list name
+	dirin1=$PATH_SIMU/RESTART
+	dirin2=${dirin1##${IGCM_DEM}}
+	dirin3=${dirin2##/$( basename ${INPUT_DMF_DATA} )}
+	diroutputfile=${OUTPUT_STORE}${dirin3}
+ 	fileout1=$( basename $set )
+ 	fileout=${fileout1%.list}.tar
+	outputfile=$diroutputfile/${fileout}
+	mkdir -p $diroutputfile
+	echo "Output file to write: $outputfile"
+
+	#-----------------------------------
+	# Try 1 time before fire "FAILED"
+	# Waiting for CCRT command
+	tarcmd=tar
+	taroptions="--format=posix -W -cf"
+	
+	cd $dirin1
+#	ls
+	
+	startTime=$( getDateMilliSeconds ) # gpdebug : time
+	resCmd=0
+	$tarcmd $taroptions $outputfile --dereference --files-from $set > $logfile 2>&1 # gpdebug : a retablir
+	resCmd=$?
+	meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time
+	
+	# resultCmd=$( gives_0_or_1 )
+	# if [ $resultCmd -eq 0 ] ; then
+	if [ $resCmd -eq 0 ] ; then
+	    sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile
+	    echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)"
+	    echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile
+	else
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "====> FAILED at try #$nbtries" 
+	    echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile
+
+	fi
+	
+	#-----------------------------------
+	
+fi	
+
+#------------------------------------------------------
+if [ "$dirnameOfListFile" == "debug_tar" ]
+then
+
+	#-----------------------------------
+	echo "#-------------------"
+	echo "Set: $set"
+        datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"`
+	datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	statusfile=${set%%.list}.status
+	logfile=${set%%.list}_${datestr}.log
+
+	#-----------------------------------
+	# Create status file if not exists
+	if [ ! -e $statusfile ] ; then
+		echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile
+	fi
+
+	#-----------------------------------
+	# Skip the set if last line of the status file is "COMPLETED" or "DELEGATE"
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
+		printf "====> "
+		tail -1 $statusfile
+		exit 0
+	fi
+
+	#-----------------------------------
+	# nbtries = number of lines from status file (first comment line gives 1 for the first try)
+	nbtries=`wc -l $statusfile | cut -d' ' -f1`		
+	# echo "Nb of tries: $nbtries"
+
+	#-----------------------------------
+	# Set output file name from list name
+	dirin1=$PATH_SIMU/DEBUG
+	dirin2=${dirin1##${IGCM_DEM}}
+	dirin3=${dirin2##/$( basename ${INPUT_DMF_DATA} )}
+	diroutputfile=${OUTPUT_STORE}${dirin3}
+ 	fileout1=$( basename $set )
+ 	fileout=${fileout1%.list}.tar
+	outputfile=$diroutputfile/${fileout}
+	mkdir -p $diroutputfile
+	echo "Output file to write: $outputfile"
+
+	#-----------------------------------
+	# Try 1 time before fire "FAILED"
+	# Waiting for CCRT command
+	tarcmd=tar
+	taroptions="--format=posix -W -cf"
+	
+	cd $dirin1
+#	ls
+        resCmd=0
+	startTime=$( getDateMilliSeconds ) # gpdebug : time
+	$tarcmd $taroptions $outputfile --dereference --files-from $set > $logfile 2>&1 # gpdebug : a retablir
+	resCmd=$?
+	meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time
+	
+	# resultCmd=$( gives_0_or_1 )
+	# if [ $resultCmd -eq 0 ] ; then
+	if [ $resCmd -eq 0 ] ; then
+	    sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "DONE ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set); $logfile" >> $statusfile
+	    echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)"
+	    echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile
+	else
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "====> FAILED at try #$nbtries" 
+	    echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $tarcmd $taroptions $outputfile $(cat $set) ; $logfile" >> $statusfile
+
+	fi
+	
+	#-----------------------------------
+	
+fi
+
+#------------------------------------------------------
+if [ "$dirnameOfListFile" == "store_cp" ]
+then
+	#-----------------------------------
+	echo "#-------------------"
+	echo "Set: $set"
+        datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"`
+	datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	statusfile=${set%%.list}.status
+	logfile=${set%%.list}_${datestr}.log
+
+	#-----------------------------------
+	# Create status file if not exists
+	if [ ! -e $statusfile ] ; then
+		echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile
+	fi
+
+	#-----------------------------------
+	# Skip the set if last line of the status file is "COMPLETED" or "DELEGATE"
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
+		printf "====> "
+		tail -1 $statusfile
+		exit 0
+	fi
+
+	#-----------------------------------
+	# nbtries = number of lines from status file (first comment line gives 1 for the first try)
+	nbtries=`wc -l $statusfile | cut -d' ' -f1`		
+	# echo "Nb of tries: $nbtries"
+
+	meantime=0
+	resCmd=0
+	startTime=$( getDateMilliSeconds ) # gpdebug : time
+	#-----------------------------------
+	# Set output file name from first and last files from the current set
+	for file in $( cat $set) ; do
+	 
+	    diroutputfile=`dirname $file | sed -e "s%$dirin%$dirout%"`
+	    mkdir -p $diroutputfile
+	    echo "Output file to write: $diroutputfile/$( basename $file )"
+	    
+	#-----------------------------------
+	# Try 1 time before fire "FAILED"
+	# Waiting for CCRT command
+	    cpcmd="cp "
+	    cpoptions="-rf"
+	    $cpcmd $cpoptions $file $diroutputfile > $logfile 2>&1 # gpdebug : a retablir
+	    resCmd=$(( $resCmd || $? ))
+	done
+	meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : time
+	
+	# resultCmd=$( gives_0_or_1 )
+	# if [ $resultCmd -eq 0 ] ; then
+	if [ $resCmd -eq 0 ] ; then
+	    sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "DONE ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile
+	    echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)"
+	    echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile
+	else
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "====> FAILED at try #$nbtries" 
+	    echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile
+
+	fi
+	
+	#-----------------------------------
+	
+fi	
+
+#------------------------------------------------------
+if [ "$dirnameOfListFile" == "work_cp" ]
+then
+	#-----------------------------------
+	echo "#-------------------"
+	echo "Set: $set"
+        datestr=`LC_ALL=C date +"%Y%m%dT%H%M%S"`
+	datestr1=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	statusfile=${set%%.list}.status
+	logfile=${set%%.list}_${datestr}.log
+
+	#-----------------------------------
+	# Create status file if not exists
+	if [ ! -e $statusfile ] ; then
+		echo "# Status ; DateStart ; DateEnd ; Command ; TarFileExists" > $statusfile
+	fi
+
+	#-----------------------------------
+	# Skip the set if last line of the status file is "COMPLETED" or "DELEGATE"
+	if tail -1 $statusfile | grep -q -E '(COMPLETED|DELEGATE)' ; then
+		printf "====> "
+		tail -1 $statusfile
+		exit 0
+	fi
+
+	#-----------------------------------
+	# nbtries = number of lines from status file (first comment line gives 1 for the first try)
+	nbtries=`wc -l $statusfile | cut -d' ' -f1`		
+	# echo "Nb of tries: $nbtries"
+
+	meantime=0
+	resCmd=0
+	startTime=$( getDateMilliSeconds ) # gpdebug : time
+	#-----------------------------------
+	# Set output file name from first and last files from the current set
+	for file in $( cat $set) ; do
+	 
+	    diroutputfile=`dirname $file | sed -e "s%$dirin%$dirout_work%"`
+	    mkdir -p $diroutputfile
+	    echo "Output file to write: $diroutputfile/$( basename $file )"
+	    
+	#-----------------------------------
+	# Try 1 time before fire "FAILED"
+	# Waiting for CCRT command
+	    cpcmd="cp "
+	    cpoptions="-rf"
+	    $cpcmd $cpoptions $file $diroutputfile > $logfile 2>&1  # gpdebug : a retablir
+	    resCmd=$(( $resCmd || $? ))   
+	done
+	meantime=$( getTimeDiffSeconds $startTime ) # gpdebug : timeS
+	# resultCmd=$( gives_0_or_1 )
+	# if [ $resultCmd -eq 0 ] ; then
+	if [ $resCmd -eq 0 ] ; then
+	    sed -i "1i\meantime:${meantime}" $statusfile # gpdebug : time
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "DONE ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile
+	    echo "====> COMPLETED at try #$nbtries (at 1st shot on 1)"
+	    echo "COMPLETED at try #$nbtries (at 1st shot on 1)" >> $statusfile
+	else
+	    datestr2=`LC_ALL=C date +"%Y-%m-%dT%H:%M:%S"`
+	    echo "====> FAILED at try #$nbtries" 
+	    echo "FAILED at try #$nbtries ; $datestr1 ; $datestr2 ; $cpcmd $cpoptions $file $diroutputfile ; $logfile" >> $statusfile
+
+	fi
+	
+	#-----------------------------------
+	
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: TOOLS/PACK_IPSL/showListsProgress.sh
===================================================================
--- TOOLS/PACK_IPSL/showListsProgress.sh	(revision 1848)
+++ TOOLS/PACK_IPSL/showListsProgress.sh	(revision 1849)
@@ -56,11 +56,14 @@
 # fichier de progression d'execution
 # Le seul arg du script doit etre un fichier param
-paramFile=$(basename ${1})
+
+paramFile=${1}
+paramFileBasename=$(basename ${1})
+
 if [ ! -e $paramFile ] || [ "x${paramFile}" == "x" ]
 then
-    echo "Le repertoire en argument n existe pas"
+    echo "Le fichier en argument n existe pas"
     exit 0
 fi
-extSuiviListes=`echo ${paramFile} | sed 's;\.[[:alnum:]]*$;;' `
+extSuiviListes=`echo ${paramFileBasename} | sed 's;\.[[:alnum:]]*$;;' `
 export MonitoringDir="${PWD}/SuiviListes_${extSuiviListes}"
 # echo "MonitoringDir=$MonitoringDir"
Index: TOOLS/PACK_IPSL/showPackProgress.sh
===================================================================
--- TOOLS/PACK_IPSL/showPackProgress.sh	(revision 1848)
+++ TOOLS/PACK_IPSL/showPackProgress.sh	(revision 1849)
@@ -4,7 +4,16 @@
 export EXE_DIR=${JOB_DIR}
 
-export INPUT_DMF_DATA=${SCRATCHDIR}/PSEUDO_DMNFS_light
-export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE
-export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK
+# gpdebug : pour titane
+# ---------------------
+# export INPUT_DMF_DATA=${SCRATCHDIR}/datasLabo/dataDMNFS_simple1
+# export OUTPUT_STORE=${SCRATCHDIR}/PSEUDO_DMNFS_STORE
+# export OUTPUT_WORK=${SCRATCHDIR}/PSEUDO_DMNFS_WORK
+
+
+# gpdebug : pour curie
+# --------------------
+export INPUT_DMF_DATA=${SCRATCHDIR}/dataDMNFS_FromTitane
+export OUTPUT_STORE=${SCRATCHDIR}/dataDMNFS_FromTitane_STORE 
+export OUTPUT_WORK=${SCRATCHDIR}/dataDMNFS_FromTitane_WORK
 
 SCRIPT_NAME=$(basename ${0} )
@@ -16,4 +25,6 @@
 
 source ${EXE_DIR}/DEM_utilities.sh
+
+export timeHandlingFile="timeHandlingFile.txt"
 
 
@@ -115,8 +126,88 @@
 
 
+function getWaitingTime
+{
+    timeNow_=$1
+    stillWaiting_=1
+    
+    launchTimeString=`cat $timeHandlingFile | grep -e 'launch time:[[:digit:].]*$' `
+    if [ "x${launchTimeString}" == "x" ]
+    then
+        echo "no launch time"
+	return
+    fi
+    launchTime_=`echo $launchTimeString | awk -F":" '{print $2}' `
+    
+    
+    startExecTimeString=`cat $timeHandlingFile | grep -e 'start time:[[:digit:].]*$' `
+    if [ "x${startExecTimeString}" == "x" ]
+    then
+        execTime_=${timeNow_}	
+    else
+        execTime_=`echo $startExecTimeString | awk -F":" '{print $2}' `
+	stillWaiting_=0
+    fi
+    
+    waitingTime_=$( awk 'BEGIN { print '${execTime_}'-'${launchTime_}' }' )
+    waitingTime_=$( awk 'BEGIN { print '${waitingTime_}'/'1000' }' )
+    if [ "x$stillWaiting_" == "x1" ]
+    then
+       waitingTime_="${waitingTime_}, still waiting..."
+    fi
+    
+    echo $waitingTime_
+}
+    
+    
+function getTimeSinceExecutionStart
+{  
+    
+    timeNow_=$1
+    stillWaiting_=1    
+    
+    execTimeString=`cat $timeHandlingFile | grep -e 'start time:[[:digit:].]*$' `
+    if [ "x${execTimeString}" == "x" ]
+    then
+        echo "no start time"
+	return
+    fi
+    execTime_=`echo $execTimeString | awk -F":" '{print $2}' `
+    
+        
+    endTimeString=`cat $timeHandlingFile | grep -e 'end time:[[:digit:].]*$' `
+    if [ "x${endTimeString}" == "x" ]
+    then
+	endTime_=${timeNow_}
+    else
+	endTime_=`echo $endTimeString | awk -F":" '{print $2}' `
+	stillWaiting_=0
+    fi
+    
+    timeSinceExec_=$( awk 'BEGIN { print '${endTime_}'-'${execTime_}' }' )
+    timeSinceExec_=$( awk 'BEGIN { print '${timeSinceExec_}'/'1000' }' )
+    if [ "x$stillWaiting_" == "x1" ]
+    then
+       timeSinceExec_="${timeSinceExec_}, still executing..."
+    fi
+    
+    echo $timeSinceExec_
+}
+
 #################################
 ####### Main script #############
 #################################
 > showPackProgress.log # vider le fichier de log
+
+# Recuperation des temps d'attente et ecoule depuis de demarrage des traitements en batch
+if [ -e $timeHandlingFile ]
+then
+    timeNow=$( getDateMilliSeconds )
+    waitingTime=$( getWaitingTime $timeNow )
+    timeSinceExecutionStart=$( getTimeSinceExecutionStart $timeNow )
+else
+    waitingTime="no handling time file available."
+    timeFromExecutionStart="no handling time file available."
+fi
+
 
 totalNbOfList=0
@@ -135,4 +226,5 @@
 TotalNbInodes=0
 TotalSimuTar=0
+totalTime=0
 
 for CONFIG in $( awk '{print $1}' ${IGCM_DEM}/config_card.liste ) ; do 
@@ -193,4 +285,10 @@
 		  
 		  echo "       $listName : $status | time : $timeTaken"
+		  
+		  timeInSecondsOK=`echo $timeTaken | grep -e '^[[:digit:].]*$' | wc -l `
+		  if [ "x${timeInSecondsOK}" != "x0" ]
+		  then
+		      totalTime=$(awk 'BEGIN { print '$totalTime'+'$timeTaken' }')
+		  fi
 	     done
          done
@@ -219,6 +317,9 @@
 echo "nb inode before : $NbInodeBefore"
 echo "nb inode after : $NbInodeAfter"
-
-
-
-
+echo "Total time for elementary operations : $totalTime  (sum of times on several proc)" 
+echo "waiting time : $waitingTime"
+echo "Time since execution start : $timeSinceExecutionStart" 
+
+
+
+
