Index: branches/libIGCM_pack/AA_SE_Checker
===================================================================
--- branches/libIGCM_pack/AA_SE_Checker	(revision 1587)
+++ branches/libIGCM_pack/AA_SE_Checker	(revision 1588)
@@ -212,5 +212,12 @@
           #
           if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
-            (( i=i+3 ))
+              (( i_ = i+1 ))
+	      eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	      eval Testvar=${Testvar_}
+	      if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+		  (( i = i+4 ))
+	      else
+		  (( i = i+3 ))
+	      fi
             continue
           fi
@@ -234,5 +241,12 @@
           fi
         fi
-        (( i=i+3 )) # to explore file list
+      (( i_ = i+1 )) # to explore file list
+      eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+      eval Testvar=${Testvar_}
+      if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	  (( i = i+4 ))
+      else
+	  (( i=i+3 ))
+      fi
       done            # until [ $i -eq $NbFiles ]
     fi                  # [ X${FileName0} != X${NULL_STR} ]
Index: branches/libIGCM_pack/AA_TimeSeries_Checker
===================================================================
--- branches/libIGCM_pack/AA_TimeSeries_Checker	(revision 1587)
+++ branches/libIGCM_pack/AA_TimeSeries_Checker	(revision 1588)
@@ -218,4 +218,12 @@
               #IGCM_debug_Print 2 "Empty TS : ${compname}_Post_${FILE}_TimeSeriesVars${Dimension}"
               #(( i=i+3 ))
+		(( i_ = i+1 ))
+		eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+		eval Testvar=${Testvar_}
+		if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+		    (( i = i+4 ))
+		else
+		    (( i = i+3 ))
+		fi          
               continue
             fi
@@ -447,5 +455,12 @@
         fi
       fi
+      (( i_ = i+1 ))
+      eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+      eval Testvar=${Testvar_}
+      if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	  (( i = i+4 ))
+      else
       (( i=i+3 ))
+      fi
     done
   fi
Index: branches/libIGCM_pack/AA_create_multi_se
===================================================================
--- branches/libIGCM_pack/AA_create_multi_se	(revision 1587)
+++ branches/libIGCM_pack/AA_create_multi_se	(revision 1588)
@@ -291,5 +291,12 @@
         #
         if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
-          (( i=i+3 ))
+            (( i_ = i+1 ))
+	    eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	    eval Testvar=${Testvar_}
+	    if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+		(( i = i+4 ))
+	    else
+		(( i = i+3 ))
+	    fi
           continue
         fi
@@ -310,5 +317,12 @@
         fi
       fi
-      (( i=i+3 ))
+      (( i_ = i+1 )) # to explore file list
+      eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+      eval Testvar=${Testvar_}
+      if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	  (( i = i+4 ))
+      else
+	  (( i=i+3 ))
+      fi
     done # until [ $i -eq $NbFiles ]
   fi
Index: branches/libIGCM_pack/AA_create_se
===================================================================
--- branches/libIGCM_pack/AA_create_se	(revision 1587)
+++ branches/libIGCM_pack/AA_create_se	(revision 1588)
@@ -308,5 +308,12 @@
         #
         if [ ! X$( eval echo \${${compname}_${flag_post}_Seasonal} ) = XON ] ; then
+            (( i_ = i+1 ))
+	    eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	    eval Testvar=${Testvar_}
+	    if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+		(( i = i+4 ))
+	    else
           (( i=i+3 ))
+	    fi
           continue
         fi
@@ -337,5 +344,12 @@
         fi
       fi
+      (( i_ = i+1 ))
+      eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+      eval Testvar=${Testvar_}
+      if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	  (( i = i+4 ))
+      else
       (( i=i+3 ))
+      fi
     done # until [ $i -eq $NbFiles ]
   fi
Index: branches/libIGCM_pack/AA_create_ts
===================================================================
--- branches/libIGCM_pack/AA_create_ts	(revision 1587)
+++ branches/libIGCM_pack/AA_create_ts	(revision 1588)
@@ -354,5 +354,12 @@
           IGCM_debug_Print 3 "Nothing to do for ${FILE} according to ${card}"
           IGCM_debug_Print 3 "TimeSeriesVars${Dimension} for ${FILE} is empty"
+	  (( i_ = i+1 ))
+	  eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	  eval Testvar=${Testvar_}
+	  if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	      (( i = i+4 ))
+	  else
           (( i=i+3 ))
+	  fi          
           continue
           #
@@ -364,5 +371,12 @@
           IGCM_debug_Print 3 "Nothing to do for ${FILE} according to ${card}"
           IGCM_debug_Print 3 "ChunckJob${Dimension}=OFF for ${FILE} so it has been switched off"
+	  (( i_ = i+1 ))
+	  eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	  eval Testvar=${Testvar_}
+	  if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	      (( i = i+4 ))
+	  else
           (( i=i+3 ))
+	  fi           
           continue
         fi
@@ -374,5 +388,12 @@
             IGCM_debug_Print 3 "Nothing to do for ${FILE} TimeSeriesVars${Dimension} according to ${card}"
             IGCM_debug_Print 3 "Let another chunck task do the job $( eval echo \${${compname}_Post_${FILE}_ChunckJob${Dimension}} )"
+	  (( i_ = i+1 ))
+	  eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	  eval Testvar=${Testvar_}
+	  if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	      (( i = i+4 ))
+	  else
             (( i=i+3 ))
+	  fi
             continue
           fi
@@ -391,5 +412,12 @@
           IGCM_debug_Print 1 "ERROR !! We miss coordinate axis for ${FILE} according to ${card}"
           IGCM_debug_Print 1 "So no time series will be produced for ${FILE} !!"
+	  (( i_ = i+1 ))
+	  eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	  eval Testvar=${Testvar_}
+	  if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	      (( i = i+4 ))
+	  else
           (( i=i+3 ))
+	  fi          
           continue
           #
@@ -426,4 +454,13 @@
           eval set +A LISTE_FILE_${comp} \${LISTE_FILE_${comp}[*]} ${FILE}
           eval set +A LISTE_AXIS_${FILE} \${${compname}_Post_${FILE}_GatherWithInternal[*]}
+	  (( i_ = i+1 ))
+	  eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	  eval Testvar=${Testvar_}
+	  if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	      eval PeriodPack_FileType=${Testvar}
+	  else
+	      PeriodPack_FileType=${PeriodPack}
+	  fi
+	  eval set +A LISTE_PACKFREQUENCY_${comp} \${LISTE_PACKFREQUENCY_${comp}[*]} ${PeriodPack_FileType}
           #
           if [ ! X${RebuildFrequency} = Xtrue ] ; then
@@ -441,5 +478,12 @@
         fi
       fi
+      (( i_ = i+1 ))
+      eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+      eval Testvar=${Testvar_}
+      if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	  (( i = i+4 ))
+      else
       (( i=i+3 ))
+      fi          
     done
   fi
@@ -497,6 +541,4 @@
   # First Time Series Submission
   FIRST_PASS=TRUE
-  Length=$( IGCM_date_DaysInPreviousPeriod ${DateBegin} ${config_UserChoices_PeriodLength} begin)
-  DATE_FIN_JOB_B=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( Length - 1 )) )
 else
   # Last Completed Time Series
@@ -559,9 +601,25 @@
 ########################################################################
 
-DATE_COUNT=${DATE_FIN_JOB_B}
-DATE_FIN_JOB_B_LOOP=${DATE_FIN_JOB_B}
-
 ( [ -n "${LEVEL}" ] && [ ${LEVEL} -eq 0 ] ) && NBRE_FILE_TOT=0 || NBRE_FILE_TOT=1
 
+# THEN FOR EACH FILE TYPE WE LOOP BETWEEN DATE_COURANTE AND DATE_FIN.
+for comp in ${config_ListOfComponents[*]} ; do
+    #
+    IGCM_sys_Mkdir ${RUN_DIR_PATH}/${comp}
+      #
+    IGCM_sys_Cd ${RUN_DIR_PATH}/${comp}
+    #
+    eval R_OUT_${comp}=${R_SAVE}/${comp}
+    #
+    i=0
+    #
+    for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
+	config_UserChoices_PeriodLength=$( eval echo \${LISTE_PACKFREQUENCY_${comp}[$i]} )
+	if [ ${FIRST_PASS} = TRUE ] ; then
+	    Length=$( IGCM_date_DaysInPreviousPeriod ${DateBegin} ${config_UserChoices_PeriodLength} begin) 
+	    DATE_FIN_JOB_B=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( Length - 1 )) )
+	fi
+	DATE_COUNT=${DATE_FIN_JOB_B}
+	DATE_FIN_JOB_B_LOOP=${DATE_FIN_JOB_B}
 if [ ${DoJob} = true ] ; then
   while [ ${DATE_COUNT} -lt ${PeriodDateEnd} ] ; do
@@ -658,15 +716,4 @@
 
   # THEN FOR EACH FILE TYPE WE LOOP BETWEEN DATE_COURANTE AND DATE_FIN.
-  for comp in ${config_ListOfComponents[*]} ; do
-    #
-    IGCM_sys_Mkdir ${RUN_DIR_PATH}/${comp}
-      #
-    IGCM_sys_Cd ${RUN_DIR_PATH}/${comp}
-    #
-    eval R_OUT_${comp}=${R_SAVE}/${comp}
-    #
-    i=0
-    #
-    for file in $( eval echo \${LISTE_FILE_${comp}[*]} ); do
       #
       # Determine in which output we can find file
@@ -717,5 +764,5 @@
       if [ "${MissingFile}" = "TRUE" ] ; then
         IGCM_debug_Print 1 "WARNING We skip ${file} type processing"
-        continue
+		continue 2
       fi
 
@@ -802,8 +849,8 @@
       done                              # for var in ${liste_var} ; do
       IGCM_sys_Rm ${liste_file_tmp[*]}
+	    (( CURRENT_LOOP = CURRENT_LOOP + 1 ))
     done                                # for file in ${liste_file_brut} do
   done                                  # for comp in ${config_ListOfComponents[*]} ; do
   # GO AHEAD IN DEEPEST LOOP
-  (( CURRENT_LOOP = CURRENT_LOOP + 1 ))
 done                                    # while [ ${CURRENT_LOOP} -le  ${NBRE_TOUR} ] do
 # FINISH
Index: branches/libIGCM_pack/AA_pack_output
===================================================================
--- branches/libIGCM_pack/AA_pack_output	(revision 1587)
+++ branches/libIGCM_pack/AA_pack_output	(revision 1588)
@@ -155,4 +155,8 @@
 DEBUG_debug=${DEBUG_debug:=false}
 
+#D- Surpack_mode : to pack existing packs output files 
+#D- Default : n
+surpack_mode=n
+
 ########################################################################
 
@@ -231,13 +235,4 @@
 IGCM_debug_Verif_Exit
 
-IGCM_debug_Print 1 "Check coherence between PackFrequency and PeriodLength"
-IGCM_post_CheckModuloFrequency PeriodPack config_UserChoices_PeriodLength NbPeriodPerFrequency
-# ------------------------------------------------------------------
-# Test if all was right before proceeding further
-# ------------------------------------------------------------------
-IGCM_debug_Verif_Exit
-
-IGCM_debug_Print 1 "We must process ${NbPeriodPerFrequency} files for each pack"
-
 # Init loop
 date_begin_pack=${DateBegin}
@@ -248,12 +243,17 @@
 IGCM_debug_PrintVariables 3 date_end_simulation
 
-while [ ${date_begin_pack} -le ${date_end_simulation} ] ; do
-
-  IGCM_debug_PrintVariables 3 number_pack
-  DaysTemp=$( IGCM_date_DaysInCurrentPeriod ${date_begin_pack} ${PeriodPack} )
-  date_end_pack=$( IGCM_date_AddDaysToGregorianDate ${date_begin_pack} $(( ${DaysTemp} - 1 )) )
-
-  for comp in ${config_ListOfComponents[*]} ; do
+# Loop over components
+for comp in ${config_ListOfComponents[*]} ; do
+
+    IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card ListOfComponents ${comp}
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    card=${SUBMIT_DIR}/COMP/${compname}.card
+    #	  
+    if [ X${surpack_mode} = Xy ] ; then
+	dirList=$( find ${R_SAVE}/${comp}/Output -maxdepth 1 -mindepth 1 -type d )  
+    else
     dirList=$( find ${R_BUFR}/${comp}/Output -maxdepth 1 -mindepth 1 -type d )
+    fi
+    # Loop over directories containing output files
     for dir in ${dirList} ; do
       # dirID is like ATM.Output.MO
@@ -266,10 +266,53 @@
       # Loop over the file type and pack them when in between date_begin_pack and date_end_pack
       for myType in ${fileType} ; do
+		# Read comp.card and find specific pack period for each type of file
+      		IGCM_card_DefineArrayFromOption ${card} OutputFiles List
+      		ListFilesName=${compname}_OutputFiles_List
+       		eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+
+       		if [ X${FileName0} != X${NULL_STR} ] ; then
+       		    eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+		    
+		    (( i=0 ))
+		    until [ $i -ge $NbFiles ]; do
+			(( i_ = i+1 ))
+			eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+			eval file_out=${file_out_}
+			(( i_ = i+3 ))
+			eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+			eval Testvar=${Testvar_}
+			if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+			    eval PeriodPack_FileType=${Testvar}
+			    ((i = i+4))
+			else
+			    PeriodPack_FileType=${PeriodPack}
+			    ((i = i+3))
+			fi
+			if [[ ${file_out} =~ ${myType} ]] ; then
+			    break
+			fi
+		    done
+		fi
+		IGCM_debug_Print 1 "Check coherence between PackFrequency and PeriodLength"
+		IGCM_post_CheckModuloFrequency PeriodPack_FileType config_UserChoices_PeriodLength NbPeriodPerFrequency
+		# ------------------------------------------------------------------
+                # Test if all was right before proceeding further
+                # ------------------------------------------------------------------
+                IGCM_debug_Verif_Exit
+
+		# Loop over period pack
+		while [ ${date_begin_pack} -le ${date_end_simulation} ] ; do
+		    DaysTemp=$( IGCM_date_DaysInCurrentPeriod ${date_begin_pack} ${PeriodPack_FileType} )
+		    date_end_pack=$( IGCM_date_AddDaysToGregorianDate ${date_begin_pack} $(( ${DaysTemp} - 1 )) )		    
+		    #
         grep ${myType} liste_files.${dirID}.txt > liste_files.${dirID}.${myType}.txt
         nbfile=0
+		    # If no surpack, no need to demigrate.
+		    if [ X${surpack_mode} = Xn ] ; then
         for file in $( gawk '{print $11}' liste_files.${dirID}.${myType}.txt ); do
           extract_date_file=$( echo ${file}  | sed -e "s/.*${JobName}_[0-9]*_//" )
           date_file=$( echo ${extract_date_file} | sed 's/\([0-9]\{8\}\)_.*$/\1/g' )
           # echo pack nÂ°${number_pack}  ${date_file} ${date_begin_pack} ${date_end_pack}
+			# Ajouter un test sur la date
           if [ ${date_file} -le ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then
             echo ${file} >> liste_pack_${myType}_${date_begin_pack}_${date_end_pack}.txt
@@ -278,4 +321,28 @@
           fi
         done
+		    else
+			for file in $( gawk '{print $11}' liste_files.${dirID}.${myType}.txt ); do
+			    extract_date_file=$( echo ${file}  | sed -e "s/.*${JobName}_[0-9]*_//" )
+			    date_file=$( echo ${extract_date_file} | sed 's/\([0-9]\{8\}\)_.*$/\1/g' )
+			# echo pack nÂ°${number_pack}  ${date_file} ${date_begin_pack} ${date_end_pack}
+			# Ajouter un test sur la date
+			    if [ ${date_file} -le ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then
+				echo ${file} >> liste_pack_${myType}_${date_begin_pack}_${date_end_pack}.txt
+				(( nbfile = nbfile + 1 ))
+			    fi
+			done
+			# If surpack_mode, archive demigration is needed on TGCC
+#-Q- irene-amd			ccc_hsm get $( cat liste_pack_${myType}_${date_begin_pack}_${date_end_pack}.txt )
+#-Q- irene			ccc_hsm get $( cat liste_pack_${myType}_${date_begin_pack}_${date_end_pack}.txt )
+			for file in $( gawk '{print $11}' liste_files.${dirID}.${myType}.txt ); do
+			    extract_date_file=$( echo ${file}  | sed -e "s/.*${JobName}_[0-9]*_//" )
+			    date_file=$( echo ${extract_date_file} | sed 's/\([0-9]\{8\}\)_.*$/\1/g' )
+			# echo pack nÂ°${number_pack}  ${date_file} ${date_begin_pack} ${date_end_pack}
+			# Ajouter un test sur la date
+			    if [ ${date_file} -le ${date_end_pack} ] && [ ${date_file} -ge ${date_begin_pack} ] ; then
+				ncdump -h ${file} | grep -E 'float|double' | cut -f 1 -d '(' | cut -f 2 -d ' ' >> liste_variables_${myType}_${date_begin_pack}_${date_end_pack}.txt
+			    fi
+			done
+		    fi
 
         if [ ${nbfile} = 0 ] ; then
@@ -283,7 +350,12 @@
           IGCM_debug_Print 1 "We should have found ${NbPeriodPerFrequency} files"
           IGCM_debug_Print 1 "As some files can be produced only for some selected period we consider we can move to the next file type"
+			date_begin_pack=$( IGCM_date_AddDaysToGregorianDate ${date_end_pack} 1 )
+			continue
+		    fi
+		    if [ X${surpack_mode} = Xy ] &&  [ ${nbfile} = 1 ] ; then
+			IGCM_debug_Print 1 "Only 1 file to pack in surpack mode, nothing to be done"
+			date_begin_pack=$( IGCM_date_AddDaysToGregorianDate ${date_end_pack} 1 )
           continue
         fi
-
         # Select list of variables to work with
         list_var=$( cat liste_variables_${myType}_${date_begin_pack}_${date_end_pack}.txt | sort | uniq -c | awk -v nbfile=$nbfile '{if ($1 != nbfile) {print $2}}' | paste -s -d ',' )
@@ -291,9 +363,12 @@
         # Create packed files
         IGCM_debug_Print 1 "Ncrcat ongoing for ${dir} and ${myType}"
+		    if [ X${surpack_mode} = Xn ] ; then
         if [ ! ${nbfile} = ${NbPeriodPerFrequency} ] ; then
+#			    if [ ${date_end_pack} -le ${date_end_simulation} ] ; then
           IGCM_debug_Print 1 "Number of files to process is not equal to what it should be"
           IGCM_debug_Print 1 "We found ${nbfile} files and it should have been ${NbPeriodPerFrequency} files"
           IGCM_debug_Exit "ERROR in number of files to process. STOP HERE INCLUDING THE COMPUTING JOB"
           IGCM_debug_Verif_Exit
+			fi
         fi
         output=${JobName}_${date_begin_pack}_${date_end_pack}_${myType}
@@ -309,5 +384,9 @@
         IGCM_debug_Verif_Exit
         # Save it
+		    if [ X${surpack_mode} = Xy ] ; then
+			IGCM_sys_Put_Out ${output} ${R_SAVE}/$( echo $dir | sed "s:${R_SAVE}/::" )/${output}
+		    else
         IGCM_sys_Put_Out ${output} ${R_SAVE}/$( echo $dir | sed "s:${R_BUFR}/::" )/${output}
+		    fi
         # Clean file produced by ncrcat
         IGCM_sys_Rm ${output}
@@ -322,13 +401,12 @@
         IGCM_debug_Print 1 "Ncrcat and cleaning done for ${dir} and ${myType}"
         echo
+		    # Add 1 day to date_end_pack to have the new date_begin_pack
+		    date_begin_pack=$( IGCM_date_AddDaysToGregorianDate ${date_end_pack} 1 )
       done
     done
   done
-  (( number_pack = number_pack + 1 ))
-  # Add 1 day to date_end_pack to have the new date_begin_pack
-  date_begin_pack=$( IGCM_date_AddDaysToGregorianDate ${date_end_pack} 1 )
 done
-
 # Flush post-processing submission
+if [ X${surpack_mode} = Xn ] && [ ${StandAlone} = false ] ; then
 if [ -f ${R_BUFR}/FlushPost_${DateEnd}.ksh ] ; then
   . ${R_BUFR}/FlushPost_${DateEnd}.ksh
@@ -336,5 +414,5 @@
   #IGCM_sys_Rm -f ${R_BUFR}/FlushPost_${DateEnd}.ksh
 fi
-
+fi
 # Clean RUN_DIR_PATH (necessary for cesium and titane only)
 IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Index: branches/libIGCM_pack/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- branches/libIGCM_pack/libIGCM_comp/libIGCM_comp.ksh	(revision 1587)
+++ branches/libIGCM_pack/libIGCM_comp/libIGCM_comp.ksh	(revision 1588)
@@ -245,5 +245,12 @@
           fi
         fi
+	((i_ = i +1))
+	eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	eval Testvar=${Testvar_}
+	if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	    ((i = i+4))
+	else
         (( i=i+3 ))
+	fi
       done
     fi
@@ -1919,5 +1926,12 @@
           fi
         fi
+	((i_ = i +1))
+	eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	eval Testvar=${Testvar_}
+	if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+	    ((i = i+4))
+	else
         (( i=i+3 ))
+	fi
       done
     fi
Index: branches/libIGCM_pack/libIGCM_config/libIGCM_config.ksh
===================================================================
--- branches/libIGCM_pack/libIGCM_config/libIGCM_config.ksh	(revision 1587)
+++ branches/libIGCM_pack/libIGCM_config/libIGCM_config.ksh	(revision 1588)
@@ -625,4 +625,38 @@
     Pack=false
   fi
+  # Loop over components
+  for comp in ${config_ListOfComponents[*]} ; do
+    
+    IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card ListOfComponents ${comp}
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    card=${SUBMIT_DIR}/COMP/${compname}.card
+    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
+    ListFilesName=${compname}_OutputFiles_List
+    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+    if [ X${FileName0} != X${NULL_STR} ] ; then
+       	eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+		    
+	(( i=0 ))
+	until [ $i -ge $NbFiles ]; do
+	    (( i_ = i+3 ))
+	    eval Testvar_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+	    eval Testvar=${Testvar_}
+	    if [[ ${Testvar} =~ [0-9][DMY]$ ]] ; then
+		IGCM_debug_Print 1 "Check coherence between PackFrequency and specific pack frequencies"
+		DaysTemp1=$( IGCM_date_DaysInPreviousPeriod ${DateBegin} ${Testvar} )
+		DaysTemp2=$( IGCM_date_DaysInPreviousPeriod ${DateBegin} ${config_Post_PackFrequency} )
+		if [ ${DaysTemp2} -lt ${DaysTemp1} ] ; then
+		    IGCM_debug_Print 1 "PackFrequency in config.card is smaller than the specific pack frequency"
+		    IGCM_debug_Print 1 "we found in ${compname}.card"
+		    IGCM_debug_Exit "ERROR You have to modify the PackFrequency in config.card to be always greater or equal to specific pack frequencies defined in comp.card"
+		    IGCM_debug_Verif_Exit
+		fi
+		((i = i+4))
+	    else
+		((i = i+3))
+	    fi
+	done
+    fi
+  done
 
   # modulo (TimeSeriesFrequency and all Chunck2D) must be zero
Index: branches/libIGCM_pack/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- branches/libIGCM_pack/libIGCM_debug/libIGCM_debug.ksh	(revision 1587)
+++ branches/libIGCM_pack/libIGCM_debug/libIGCM_debug.ksh	(revision 1588)
@@ -880,31 +880,37 @@
       case ${postProcessingName} in
       atlas*|monitoring*|metrics*)
-        [ ${postProcessingStopLevel} -gt 2 ] && StopAll=true ;;
+        [ ${postProcessingStopLevel} -gt 2 ] && StopAll=true
+        echo "The job is not a pack job "
+        echo "SO WE DO NOT EXIT THE JOB."
+        echo
+        date
+	;; 
       create_*)
-        [ ${postProcessingStopLevel} -gt 1 ] && StopAll=true ;;
+        [ ${postProcessingStopLevel} -gt 1 ] && StopAll=true
+	echo "The job is not a pack job "
+        echo "SO WE DO NOT EXIT THE JOB."
+        echo
+        date   
+	;;
       rebuild*|pack_*)
-        [ ${postProcessingStopLevel} -gt 0 ] && StopAll=true ;;
+          if [ ${postProcessingStopLevel} -gt 0 ] ; then
+	      # Notify the computing job that something wrong happened and stop it.
+	      IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Fatal.${Script_Post_Output}"
+	  fi
+        echo "                        EXIT THE POST-PROCESSING JOB."
+        echo
+        IGCM_debug_CallStack
+
+        # Inform the rabbitMQ queue
+        IGCM_debug_BigBro_Finalize
+
+        # And Good Bye
+        date
+        exit 1
+	;;
       esac
       # Notify the computing job that something wrong happened and stop it.
       ( ${StopAll} ) && IGCM_card_WriteOption ${SUBMIT_DIR}/run.card Configuration PeriodState "Fatal.${Script_Post_Output}"
 
-      # If SpaceName is PROD we stop when post_processing failed
-      if [ X${config_UserChoices_SpaceName} = XPROD ] ; then
-        echo "                        EXIT THE POST-PROCESSING JOB."
-        echo
-        IGCM_debug_CallStack
-
-        # Inform the rabbitMQ queue
-        IGCM_debug_BigBro_Finalize
-
-        # And Good Bye
-        date
-        exit 1
-      else
-        echo "In config.card the variable SpaceName is not in PROD"
-        echo "              SO WE DO NOT EXIT THE JOB."
-        echo
-        date
-      fi
     elif [ X${TaskType} = Xchecking ] ; then
       echo "Nothing will happen for now"
