Index: /TOOLS/PACK_IPSL/archive_debug.sh
===================================================================
--- /TOOLS/PACK_IPSL/archive_debug.sh	(revision 1921)
+++ /TOOLS/PACK_IPSL/archive_debug.sh	(revision 1922)
@@ -147,8 +147,13 @@
 #la date du dernier fichier donnera la date de fin du pack
    sort ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt > ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt.tmp
+
+   first_file=$(head -n 1 ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt.tmp )
+   extract_date_file=$( echo ${first_file}  | sed -e "s/.*${JobName}_//" )
+   DateBegin_Debug=$(echo ${extract_date_file}| sed 's%\([0-9]\{8\}\)_.*$%\1%g' )
+
    last_file=$(tail -n 1 ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt.tmp )
    extract_date_file=$( echo ${last_file}  | sed -e "s/.*${JobName}_//" )
    DateEnd_Debug=$(   echo ${extract_date_file}| sed 's/\([0-9]\{8\}\)_.*$/\1/g' )
-   mv ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt.tmp ${DEBUG_TAR}/${JobName}_debug_${date_begin_pack}_${DateEnd_Debug}.list
+   mv ${IGCM_TMP}/${$}.liste_pack_debug_${number_pack}.txt.tmp ${DEBUG_TAR}/${JobName}_debug_${DateBegin_Debug}_${DateEnd_Debug}.list
 
 
Index: /TOOLS/PACK_IPSL/archive_restart.sh
===================================================================
--- /TOOLS/PACK_IPSL/archive_restart.sh	(revision 1921)
+++ /TOOLS/PACK_IPSL/archive_restart.sh	(revision 1922)
@@ -159,8 +159,13 @@
 #la date du dernier fichier donnera la date de fin du pack
    sort ${IGCM_TMP}/${$}.liste_pack_restart_${number_pack}.txt > ${IGCM_TMP}/${$}.liste_pack_restart_${number_pack}.txt.tmp
+
+   first_file=$(head -n 1 ${IGCM_TMP}/${$}.liste_pack_restart_${number_pack}.txt.tmp )
+   extract_date_file=$( echo ${first_file}  | sed -e "s/.*${JobName}_//" )
+   DateBegin_Restart=$(echo ${extract_date_file}| sed 's%\([0-9]\{8\}\)_.*$%\1%g' )
+
    last_file=$(tail -n 1 ${IGCM_TMP}/${$}.liste_pack_restart_${number_pack}.txt.tmp )
    extract_date_file=$( echo ${last_file}  | sed -e "s/.*${JobName}_//" )
    DateEnd_Restart=$(   echo ${extract_date_file}| sed 's/\([0-9]\{8\}\)_.*$/\1/g' )
-   mv ${IGCM_TMP}/${$}.liste_pack_restart_${number_pack}.txt.tmp ${RESTART_TAR}/${JobName}_restart_${date_begin_pack}_${DateEnd_Restart}.list
+   mv ${IGCM_TMP}/${$}.liste_pack_restart_${number_pack}.txt.tmp ${RESTART_TAR}/${JobName}_restart_${DateBegin_Restart}_${DateEnd_Restart}.list
 
 
Index: /TOOLS/PACK_IPSL/write_liste_pack.sh
===================================================================
--- /TOOLS/PACK_IPSL/write_liste_pack.sh	(revision 1921)
+++ /TOOLS/PACK_IPSL/write_liste_pack.sh	(revision 1922)
@@ -88,5 +88,4 @@
     [[ "${clean_tmp}" = "yes" ]] && rm -f ${IGCM_TMP}/${$}.tmp_info_${type_file}.txt.tmp
 done
-
 
 # 3- Maintenant pour chaque type de fichier de sortie nous allons creer la liste
@@ -151,12 +150,19 @@
 
 #On renomme le fichier ncrcat avec la date reelle de fin et non pas la premiere date suivant la fin 
-       sort ${OUTPUT_NCRCAT}/ncrcat_${type_file}_${date_begin_pack}_${date_end_pack}.list > ${IGCM_TMP}/${$}.ncrcat.tmp
-       last_file=$(tail -n 1 ${IGCM_TMP}/${$}.ncrcat.tmp )
-       extract_date_file=$( echo ${last_file}  | sed -e "s/.*${JobName}_//" )
-       date_fin=$(echo ${extract_date_file}| sed 's%.*_\([0-9]\{8\}\)_.*$%\1%g' )
-       mv ${OUTPUT_NCRCAT}/ncrcat_${type_file}_${date_begin_pack}_${date_end_pack}.list ${OUTPUT_NCRCAT}/${JobName}_${date_begin_pack}_${date_fin}_${type_file}.list
+#on renomme egalement en fonction de la date reelle de debut pour le cas des annees < 1000 qui perdent leurs zeros en cour de route
+       if [[ -f ${OUTPUT_NCRCAT}/ncrcat_${type_file}_${date_begin_pack}_${date_end_pack}.list ]]; then 
+	   sort ${OUTPUT_NCRCAT}/ncrcat_${type_file}_${date_begin_pack}_${date_end_pack}.list > ${IGCM_TMP}/${$}.ncrcat.tmp
+
+	   first_file=$(head -n 1 ${IGCM_TMP}/${$}.ncrcat.tmp )
+	   extract_date_file=$( echo ${first_file}  | sed -e "s/.*${JobName}_//" )
+	   date_debut=$(echo ${extract_date_file}| sed 's%\([0-9]\{8\}\)_.*$%\1%g' )
+
+	   last_file=$(tail -n 1 ${IGCM_TMP}/${$}.ncrcat.tmp )
+	   extract_date_file=$( echo ${last_file}  | sed -e "s/.*${JobName}_//" )
+	   date_fin=$(echo ${extract_date_file}| sed 's%.*_\([0-9]\{8\}\)_.*$%\1%g' )
+	   mv ${OUTPUT_NCRCAT}/ncrcat_${type_file}_${date_begin_pack}_${date_end_pack}.list ${OUTPUT_NCRCAT}/${JobName}_${date_debut}_${date_fin}_${type_file}.list
+       fi
    done
-   
-   
+
    month_begin_pack=${month_end_pack}
    year_begin_pack=${year_end_pack}
@@ -243,4 +249,8 @@
 			date_debut=$( echo ${extract_date_file} | sed 's%\([0-9]\{8\}\)_.*$%\1%g'     | cut -c 1-6  )
 			date_fin=$(   echo ${extract_date_file} | sed 's%.*_\([0-9]\{8\}\)_.*$%\1%g' | cut -c 1-6  )
+			#on retire les eventuels zero pour eviter de tomber sur des dates de type 08 ou 09 
+			date=`echo $date|sed 's/^0*//'`
+			date_debut=`echo $date_debut|sed 's/^0*//'`
+			date_fin=`echo $date_fin|sed 's/^0*//'`
 			if [[ ${date} -ge ${date_debut} && ${date} -lt ${date_fin} ]]; then
 			    mv ${pack} ${OUTPUT_TAR}/.
