Index: /trunk/libIGCM/AA_TimeSeries_Checker
===================================================================
--- /trunk/libIGCM/AA_TimeSeries_Checker	(revision 590)
+++ /trunk/libIGCM/AA_TimeSeries_Checker	(revision 591)
@@ -41,7 +41,10 @@
 POST_DIR=${POST_DIR:=${CARD_DIR}/OutScript}
 
+# project 
+export BRIDGE_MSUB_PROJECT=gen2211
+
 if [ ! -d ${CARD_DIR} ]; then
-    echo "No ${CARD_DIR}, we stop here"
-    exit
+  echo "No ${CARD_DIR}, we stop here"
+  exit
 fi
 
@@ -65,55 +68,71 @@
 read ActionAnswer
 
-case ${ActionAnswer} in    
-    oui|OUI|o|y|yes|YES)
-	echo "OK. I will submit jobs but ask permissions before removing files"
-	action=true
-	;;
-    non|NON|n|no|NO)
-	echo "OK. I won't submit jobs and only print out files I could remove"
-	action=false
-	;;
-    *)
-	echo "I did not recognize your answer. I will stop here."
-	echo "Please respond: oui|OUI|o|y|yes|YES"
-	echo "Or please respond: non|NON|n|no|NO"
-	exit
-	;;
+case ${ActionAnswer} in
+oui|OUI|o|y|yes|YES)
+  echo "OK. I will submit jobs but ask permissions before removing files"
+  action=true
+  ;;
+non|NON|n|no|NO)
+  echo "OK. I won't submit jobs and only print out files I could remove"
+  action=false
+  ;;
+*)
+  echo "I did not recognize your answer. I will stop here."
+  echo "Please respond: oui|OUI|o|y|yes|YES"
+  echo "Or please respond: non|NON|n|no|NO"
+  exit
+  ;;
 esac
 
+#==================================
 # First of all
+#
+typeset option
+
+#==================================
+# Read UserChoices section: 
 IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
-typeset option
+echo
+IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
 for option in ${config_UserChoices[*]} ; do
     IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
+    eval auxprint=\${config_UserChoices_${option}}
+    IGCM_debug_Print 3 "${option} : ${auxprint}"
 done
-
-echo
-IGCM_debug_Print 1 "DefineVariableFromOption  : config_UserChoices"
-IGCM_debug_PrintVariables 3 config_UserChoices_JobName
-#IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
-#IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
-IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
-IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
-IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
+#
+echo
+
+#==================================
+# Read Post section: 
+IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card Post
+echo
+IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
+
+for option in ${config_Post[*]} ; do
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post ${option}
+  eval auxprint=\${config_Post_${option}}
+  IGCM_debug_Print 3 "${option} : ${auxprint}"
+done
+#
+echo
 
 if [ -f ${CARD_DIR}/run.card ] ; then
-    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration OldPrefix
-    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration PeriodState
-    IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card PostProcessing TimeSeriesCompleted
-    IGCM_debug_Print 1 "DefineVariableFromOption  : run_Configuration"
-    IGCM_debug_PrintVariables 3 run_Configuration_OldPrefix
-    IGCM_debug_PrintVariables 3 run_Configuration_PeriodState
-    IGCM_debug_Print 1 "DefineVariableFromOption  : run_PostProcessing"
-    IGCM_debug_PrintVariables 3 run_PostProcessing_TimeSeriesCompleted
-    if [ X${run_Configuration_PeriodState} != X"Completed" ] ; then
-	DateEnd=$( IGCM_date_ConvertFormatToGregorian $( echo ${run_Configuration_OldPrefix} | awk -F'_' '{print $2}' ) )
-    else
-	DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
-    fi
-    CompletedFlag=${run_PostProcessing_TimeSeriesCompleted}
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration OldPrefix
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card Configuration PeriodState
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/run.card PostProcessing TimeSeriesCompleted
+  IGCM_debug_Print 1 "DefineVariableFromOption  : run_Configuration"
+  IGCM_debug_PrintVariables 3 run_Configuration_OldPrefix
+  IGCM_debug_PrintVariables 3 run_Configuration_PeriodState
+  IGCM_debug_Print 1 "DefineVariableFromOption  : run_PostProcessing"
+  IGCM_debug_PrintVariables 3 run_PostProcessing_TimeSeriesCompleted
+  if [ X${run_Configuration_PeriodState} != X"Completed" ] ; then
+    DateEnd=$( IGCM_date_ConvertFormatToGregorian $( echo ${run_Configuration_OldPrefix} | awk -F'_' '{print $2}' ) )
+  else
+    DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
+  fi
+  CompletedFlag=${run_PostProcessing_TimeSeriesCompleted}
 else
-    DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
-    CompletedFlag=""
+  DateEnd=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateEnd} )
+  CompletedFlag=""
 fi
 SavedCompletedFlag=${CompletedFlag}
@@ -133,12 +152,12 @@
 #R_BUFR : Job output buffered directory
 if ( [ ! X${config_UserChoices_SpaceName} = X ] && [ ! X${config_UserChoices_ExperimentName} = X ] ) ; then
-    FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
-    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
-    R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
-    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
+  FreeName=$( echo ${config_UserChoices_JobName} | sed 's/.*_//' )
+  R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
+  R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
+  R_DODS=${config_UserChoices_TagName}/${config_UserChoices_SpaceName}/${config_UserChoices_ExperimentName}/${FreeName}
 else
-    R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
-    R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
-    R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
+  R_SAVE=${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
+  R_BUFR=${R_BUF}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
+  R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
 fi
 
@@ -146,314 +165,313 @@
 
 for comp in ${config_ListOfComponents[*]} ; do
-    # Debug Print
-    IGCM_debug_Print 1 ${comp}
-    # Define component 
-    IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
-    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
-    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
-
-    # Read libIGCM compatibility version in ${compname}.card
-    card=${CARD_DIR}/COMP/${compname}.card
-
-    # Read and Build Output File stuff
-    #IGCM_debug_Print 1 "DefineArrayFromOption  : ${compname}_OutputFiles ${card}"
-    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
-    ListFilesName=${compname}_OutputFiles_List
-    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+  # Debug Print
+  IGCM_debug_Print 1 ${comp}
+  # Define component
+  IGCM_card_DefineArrayFromOption ${CARD_DIR}/config.card ListOfComponents ${comp}
+  eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+  eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
+
+  # Read libIGCM compatibility version in ${compname}.card
+  card=${CARD_DIR}/COMP/${compname}.card
+
+  # Read and Build Output File stuff
+  #IGCM_debug_Print 1 "DefineArrayFromOption  : ${compname}_OutputFiles ${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
     #
-    if [ X${FileName0} != X${NULL_STR} ] ; then
+    #IGCM_debug_Print 1 "Component      : ${compname}"
+    #
+    # INITIALISATION
+    #
+    eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+    i=2
+    #
+    until [ $i -ge $NbFiles ]; do
+      #
+      eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
+      #
+      if [ X${flag_post} != XNONE ] ; then
         #
-	#IGCM_debug_Print 1 "Component      : ${compname}"
-	#
-	# INITIALISATION
-	#
-	eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-	i=2
-	#
-	until [ $i -ge $NbFiles ]; do
-	    #
-	    eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	    #
-	    if [ X${flag_post} != XNONE ] ; then
-		#
-                # First of all
+        # First of all
+        #
+        IGCM_card_DefineArrayFromSection ${card} ${flag_post}
+        #
+        IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars
+        IGCM_card_DefineArrayFromOption ${card} ${flag_post} Patches
+        if [ X"$( eval echo \${${compname}_${flag_post}_TimeSeriesVars[*]} )" = X"Option not" ] ; then
+          # New TimeSeriesVar description, with 2D, 3D and associate ChunckJob.
+          unset ListDimension
+          ListDimension[0]=2D
+          ListDimension[1]=3D
+          TimeSeries=false
+          TimeSeries2D=false
+          TimeSeries3D=false
+          chunck=false
+          iLoop=${#ListDimension[*]}
+          j=0
+          until [ $j -ge ${iLoop} ]; do
+            Dimension=${ListDimension[${j}]}
+            IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars${Dimension}
+            IGCM_card_DefineVariableFromOption ${card} ${flag_post} ChunckJob${Dimension}
+            #
+            # Time series WITHOUT chunk
+            #
+            if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
+              if [ $( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) = NONE ] ; then
+                IGCM_debug_Print 2 "${Dimension} time series activated for ${flag_post}"
+                eval TimeSeries${Dimension}=true
+                chunck=false
+              fi
+            fi
+            #
+            # Time series WITH chunk
+            #
+            if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
+              chunck_size=$( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} )
+              if [ ! ${chunck_size} = NONE ] &&  [ ! ${chunck_size} = OFF ] ; then
+                IGCM_debug_Print 2 "${Dimension} time series activated with ${chunck_size} chunck for ${flag_post}"
+                eval TimeSeriesChunck${Dimension}=true
+                chunck=true
+              fi
+            fi
+            (( j=j+1 ))
+            #
+            # If TimeSeriesVars list is empty or OFF we skip
+            #
+            if ( [ $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] || \
+              [ ${chunck_size} = OFF ] ) ; then
+              #IGCM_debug_Print 2 "Empty TS : ${compname}_Post_${FILE}_TimeSeriesVars${Dimension}"
+              #(( i=i+3 ))
+              continue
+            fi
+            #
+            #  ICI ON TESTE QUE LES FICHIERS TS SONT LA!
+            #
+            FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
+            IGCM_card_DefineArrayFromOption ${card}    Post_${FILE} TimeSeriesVars${Dimension}
+            IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension}
+            #
+            FlagDir=$( echo ${FILE} | awk -F "_" '{print $1}' )
+            case ${FlagDir} in
+            *Y)  TS_Dir=TS_YE  ;;
+            *M)  TS_Dir=TS_MO  ;;
+            *D)  TS_Dir=TS_DA  ;;
+            3H|HF)  TS_Dir=TS_HF  ;;
+            INS) TS_Dir=TS_INS ;;
+            esac
+            #
+            # We need LIST of variables not allready produced (useful for standalone mode)
+            #
+            DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
+            IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin
+
+            # Si on n'a pas de chunck, dans ce cas chunck_size=la durÃ©e de la simulation en annÃ©es
+            YearsChunckLength=$( echo ${chunck_size} | sed -e "s/[yY]//" )
+            [ ${chunck} = false ] && YearsChunckLength=$(( YearEnd - YearBegin + 1 ))
+
+            NbYearsChunckLoop=$(( ( YearEnd - YearBegin + 1 ) / YearsChunckLength ))
+            Reste=$(( ( YearEnd - YearBegin + 1 ) % YearsChunckLength ))
+
+            if [ ${Reste} -ne 0 ] ; then
+              NbYearsChunckLoop=$(( NbYearsChunckLoop + 1 ))
+            fi
+
+            if [ ${NbYearsChunckLoop} -eq 1 ] ; then
+              PeriodDateEnd=${DateEnd}
+            else
+              DaysInYear=$( IGCM_date_DaysInYear ${YearBegin} )
+              PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( YearsChunckLength * DaysInYear - 1 )) )
+            fi
+            #
+            DIRECTORY=${R_SAVE}/${comp}/Analyse/${TS_Dir}
+            YearsChunckLoop=1
+            ChunckDebut=${DateBegin}
+            ChunckFin=${PeriodDateEnd}
+            while [ ${YearsChunckLoop} -le ${NbYearsChunckLoop} ] ; do
+              countTotal=0
+              countGood=0
+              countBad=0
+              unset RemoveList
+              unset PotentialCompletedFlag
+              for var in $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}[*]} ) ; do
+                TestedFile=${config_UserChoices_JobName}_${ChunckDebut}_${ChunckFin}_${FlagDir}_${var}.nc
                 #
-		IGCM_card_DefineArrayFromSection ${card} ${flag_post}
-		#
-		IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars
-		IGCM_card_DefineArrayFromOption ${card} ${flag_post} Patches
-		if [ X"$( eval echo \${${compname}_${flag_post}_TimeSeriesVars[*]} )" = X"Option not" ] ; then
-		    # New TimeSeriesVar description, with 2D, 3D and associate ChunckJob.
-		    unset ListDimension
-		    ListDimension[0]=2D
-		    ListDimension[1]=3D
-		    TimeSeries=false
-		    TimeSeries2D=false
-		    TimeSeries3D=false
-		    chunck=false
-		    iLoop=${#ListDimension[*]}
-		    j=0
-		    until [ $j -ge ${iLoop} ]; do
-			Dimension=${ListDimension[${j}]}
-			IGCM_card_DefineArrayFromOption ${card} ${flag_post} TimeSeriesVars${Dimension}
-			IGCM_card_DefineVariableFromOption ${card} ${flag_post} ChunckJob${Dimension}
-		        #
-	                # Time series WITHOUT chunk
-	                #
-			if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
-			    if [ $( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} ) = NONE ] ; then
-				IGCM_debug_Print 2 "${Dimension} time series activated for ${flag_post}"
-				eval TimeSeries${Dimension}=true
-				chunck=false
-			    fi
-			fi
-                        #
-	                # Time series WITH chunk
-		        #
-			if [ ! $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] ; then
-			    chunck_size=$( eval echo \${${compname}_${flag_post}_ChunckJob${Dimension}} )
-			    if [ ! ${chunck_size} = NONE ] &&  [ ! ${chunck_size} = OFF ] ; then
-				IGCM_debug_Print 2 "${Dimension} time series activated with ${chunck_size} chunck for ${flag_post}"
-				eval TimeSeriesChunck${Dimension}=true
-				chunck=true
-			    fi
-			fi
-			(( j=j+1 ))
-	                #
-		        # If TimeSeriesVars list is empty or OFF we skip
-		        #
-			if ( [ $( eval echo \${${compname}_${flag_post}_TimeSeriesVars${Dimension}} ) = ${NULL_STR} ] || \
-			    [ ${chunck_size} = OFF ] ) ; then
-			    #IGCM_debug_Print 2 "Empty TS : ${compname}_Post_${FILE}_TimeSeriesVars${Dimension}"
-			    #(( i=i+3 ))
-			    continue
-			fi
-			#
-			#  ICI ON TESTE QUE LES FICHIERS TS SONT LA!
-			#
-			#
-			FILE=$( echo ${flag_post} | awk "-FPost_" '{print $2}' )
-			IGCM_card_DefineArrayFromOption ${card}    Post_${FILE} TimeSeriesVars${Dimension}
-			IGCM_card_DefineVariableFromOption ${card} Post_${FILE} ChunckJob${Dimension}
-			#
-			FlagDir=$( echo ${FILE} | awk -F "_" '{print $1}' )
-			case ${FlagDir} in
-			    *Y)  TS_Dir=TS_YE  ;;
-			    *M)  TS_Dir=TS_MO  ;;
-			    *D)  TS_Dir=TS_DA  ;;
-			 3H|HF)  TS_Dir=TS_HF  ;;
-			   INS) TS_Dir=TS_INS ;;
-			esac
-		        #
-	                # We need LIST of variables not allready produced (useful for standalone mode)
-	                #
-			DateBegin=$( IGCM_date_ConvertFormatToGregorian ${config_UserChoices_DateBegin} )
-			IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin
-
-			# Si on n'a pas de chunck, dans ce cas chunck_size=la durÃ©e de la simulation en annÃ©es
-			YearsChunckLength=$( echo ${chunck_size} | sed -e "s/[yY]//" )
-			[ ${chunck} = false ] && YearsChunckLength=$(( YearEnd - YearBegin + 1 ))
-
-			NbYearsChunckLoop=$(( ( YearEnd - YearBegin + 1 ) / YearsChunckLength ))
-			Reste=$(( ( YearEnd - YearBegin + 1 ) % YearsChunckLength ))
-
-			if [ ${Reste} -ne 0 ] ; then
-			    NbYearsChunckLoop=$(( NbYearsChunckLoop + 1 ))
-			fi
-
-			if [ ${NbYearsChunckLoop} -eq 1 ] ; then
-			    PeriodDateEnd=${DateEnd}
-			else
-			    DaysInYear=$( IGCM_date_DaysInYear ${YearBegin} )
-			    PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( YearsChunckLength * DaysInYear - 1 )) )
-			fi
-	                #
-			DIRECTORY=${R_SAVE}/${comp}/Analyse/${TS_Dir}
-			YearsChunckLoop=1
-			ChunckDebut=${DateBegin}
-			ChunckFin=${PeriodDateEnd}
-			while [ ${YearsChunckLoop} -le ${NbYearsChunckLoop} ] ; do
-			    countTotal=0
-			    countGood=0
-			    countBad=0
-			    unset RemoveList
-			    unset PotentialCompletedFlag
-			    for var in $( eval echo \${${compname}_Post_${FILE}_TimeSeriesVars${Dimension}[*]} ) ; do
-				TestedFile=${config_UserChoices_JobName}_${ChunckDebut}_${ChunckFin}_${FlagDir}_${var}.nc
-	                        #
-				if [ -d ${DIRECTORY} ] ; then
-				    Candidat=$( find ${DIRECTORY} -name "${config_UserChoices_JobName}_${ChunckDebut}_*_${FlagDir}_${var}.nc" )
-				else
-				    Candidat=""
-				fi
-				#
-				BestCandidat=${ChunckDebut}
-				#
-				FoundCandidat=false
-				if [ ! "X${Candidat}" = "X" ] ; then
-				    for candid in ${Candidat} ; do
-					#IGCM_debug_Print 1 -e "\033[1;32m[CompletedFlag CANDIDAT MATCH FOUND]\033[m $( basename ${candid} )"
-					CandidatEnd=$( echo ${candid}   | awk -F${config_UserChoices_JobName} '{print $3}' | awk -F_ '{print $3}' )
-					if [ ${CandidatEnd} -gt ${ChunckFin} ] ; then
-					    #IGCM_debug_Print 3 -e "File $( basename ${candid} ) should be suppress"
-					    set +A RemoveList ${RemoveList[*]} ${candid}
-					elif [ ${CandidatEnd} -lt ${ChunckFin} ] ; then
-					    #IGCM_debug_Print 3 -e "File $( basename ${candid} ) should be suppress or used as a CompletedFlag baseline"
-					    # We keep the best candidat and remove the others
-                                            if [ ${BestCandidat} -lt ${CandidatEnd} ] ; then
-                                                if [ ${FoundCandidat} = true ] ; then
-                                                   set +A RemoveList ${RemoveList[*]} ${DIRECTORY}/${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc
-                                                else
-                                                   FoundCandidat=true
-                                                fi
-                                                BestCandidat=${CandidatEnd}
-                                            else
-                                                set +A RemoveList ${RemoveList[*]} ${candid}
-                                            fi
-					fi
-				    done
-				else
-				    # No CompletedFlag candidat found
-				    CandidatCompletedFlag=""
-				fi
-				#
-				if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then
-				    (( countBad = countBad + 1 ))
-				    [ ${countBad} = 1 ] && IGCM_debug_Print 3 "Missing time series from ${FILE} :"
-				    IGCM_debug_Print 3 ${DIRECTORY}/${TestedFile}
-				    # Then we keep a track of the Best Candidat
-				    if [ ${FoundCandidat} = true ] ; then
-					if [ ${chunck} = true ] ; then
-					    set +A PotentialCompletedFlag ${PotentialCompletedFlag[*]} ${BestCandidat}
-					else
-					    eval set +A PotentialCompletedFlag${Dimension} \${PotentialCompletedFlag${Dimension}[*]} \${BestCandidat}
-					fi
-				    fi
-				else
-				    (( countGood = countGood + 1 ))
-				    # Then we do not need the best candidat if any
-				    [ ${FoundCandidat} = true ] && set +A RemoveList ${RemoveList[*]} ${DIRECTORY}/${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc
-				fi
-				(( countTotal = countTotal + 1 ))
-			    done
-
-			    SuccessRate=$(( countGood * 100 / countTotal ))
-			    if [ ${SuccessRate} -ne 100 ] ; then
-				IGCM_debug_Print 2 -e "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}"
-			    else
-				IGCM_debug_Print 2 -e "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}"
-			    fi
-			    echo
-
-			    # Remove what's in the RemoveList
-			    if [ ${RemoveList} ] ; then
-				IGCM_debug_Print 2 "File(s) that will be removed ${RemoveList[*]}"
-				if [ ${action} = true ] ; then
-				    echo -e "\033[1;32mDo you want to remove them?\033[m"
-				    echo -n " Your answer (y/n) : "
-				    read RemoveAnswer
-				    case ${RemoveAnswer} in    
-					oui|OUI|o|y|yes|YES)
-					    echo "OK. I will erase them"
-					    IGCM_sys_Rm -f ${RemoveList[*]}
-					    ;;
-					non|NON|n|no|NO)
-					    echo "OK. I won't erase them"
-					    ;;
-					*)
-					    echo "I did not recognize your answer."
-					    echo "Please respond: oui|OUI|o|y|yes|YES"
-					    echo "Or please respond: non|NON|n|no|NO"
-					    exit
-					    ;;
-				    esac
-				fi
-			    fi
-			    #[ ${FoundCandidat} = true ] && IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag[*]}"
-			    if ( [ ${chunck} = true ] && [ ${SuccessRate} -ne 100 ] ) ; then
-				#
-				# TO REWRITE BEGIN
-				#
-				NbCandidats=${#PotentialCompletedFlag[@]}
-				countCandid=1
-				if [ ${NbCandidats} -eq 0 ] ; then
-				    ChunckCompletedFlag=""
-				    IGCM_debug_Print 2 -e "\033[1;31mNO CompletedFlag\033[m"
-				elif [ ${NbCandidats} -eq 1 ] ; then
-				    ChunckCompletedFlag=${PotentialCompletedFlag[0]}
-				    IGCM_debug_Print 2 -e "\033[1;32mCompletedFlag=${ChunckCompletedFlag}\033[m"
-				elif [ ${NbCandidats} -gt 1 ] ; then
-				    k=1
-				    until [ $k -ge ${NbCandidats} ]; do
-					((k_m1=k-1))
-					if [ ${PotentialCompletedFlag[${k_m1}]} = ${PotentialCompletedFlag[${k}]} ] ; then
-					    ((countCandid=countCandid+1))
-					fi
-					((k=k+1))
-				    done
-				    if [ ${NbCandidats} -eq ${countCandid} ] ; then
-					ChunckCompletedFlag=${PotentialCompletedFlag[0]}
-					IGCM_debug_Print 2 -e "\033[1;32mCompletedFlag=${ChunckCompletedFlag}\033[m"
-				    else
-					ChunckCompletedFlag=${PotentialCompletedFlag[0]}
-					IGCM_debug_Print 2 -e "\033[1;31mToo Many Potential CompletedFlag\033[m Let start with first CompletedPeriod"
-					IGCM_debug_Print 2 -e "\033[1;31mYou will have to redo TimeSeries_Checker\033[m for other period."
-				    fi
-				fi
-				#
-				# TO REWRITE END
-				#
-				if [ ${action} = true ] ; then
-				    IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}"
-				    listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask,CompToRead,FlagToRead"
-				    export libIGCM=${libIGCM}
-				    export SUBMIT_DIR=${CARD_DIR}
-				    export POST_DIR=${POST_DIR}
-				    export DateBegin=${ChunckDebut}
-				    export PeriodDateEnd=${ChunckFin}
-				    export CompletedFlag=${ChunckCompletedFlag}
-				    export TsTask=Chunck${Dimension}
-				    export CompToRead=${comp}
-				    export FlagToRead=${i}
-				    export NameToRead=${flag_post}
-				    export listVarEnv=${listVarEnv}
-                                    IGCM_sys_MkdirWork ${POST_DIR}
-                                    IGCM_debug_Verif_Exit_Post
-				    Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}.${CompToRead}.${NameToRead}
-                                    IGCM_sys_QsubPost create_ts
-				    echo
-				else
-				    IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}"
-				fi
-			    fi
-
-			    if ( [ ${chunck} = false ] && [ ${SuccessRate} -ne 100 ] ) ; then
-				eval Launch${Dimension}=true
-			    fi
-
-			    # Date update
-			    ChunckDebut=$( IGCM_date_AddDaysToGregorianDate ${ChunckFin} 1 )
-
-			    (( YearsChunckLoop = YearsChunckLoop + 1 ))
-
-			    if [ ${YearsChunckLoop} -eq ${NbYearsChunckLoop} ] ; then 
-				ChunckFin=${DateEnd}
-			    else
-				ChunckFin=$( IGCM_date_AddDaysToGregorianDate ${ChunckDebut} $(( YearsChunckLength * DaysInYear - 1 )) )
-			    fi
-			done
-		    done
-		else
-		    ListDimension[0]=""
-		    TimeSeries=true
-		    TimeSeries2D=false
-		    TimeSeries3D=false
-		    TimeSeriesChunck2D=false
-		    TimeSeriesChunck3D=false
-		fi
-	    fi
-	    (( i=i+3 ))
-	done
-    fi
+                if [ -d ${DIRECTORY} ] ; then
+                  Candidat=$( find ${DIRECTORY} -name "${config_UserChoices_JobName}_${ChunckDebut}_*_${FlagDir}_${var}.nc" )
+                else
+                  Candidat=""
+                fi
+                #
+                BestCandidat=${ChunckDebut}
+                #
+                FoundCandidat=false
+                if [ ! "X${Candidat}" = "X" ] ; then
+                  for candid in ${Candidat} ; do
+                    #IGCM_debug_Print 1 -e "\033[1;32m[CompletedFlag CANDIDAT MATCH FOUND]\033[m $( basename ${candid} )"
+                    CandidatEnd=$( echo ${candid}   | awk -F${config_UserChoices_JobName} '{print $3}' | awk -F_ '{print $3}' )
+                    if [ ${CandidatEnd} -gt ${ChunckFin} ] ; then
+                      #IGCM_debug_Print 3 -e "File $( basename ${candid} ) should be suppress"
+                      set +A RemoveList ${RemoveList[*]} ${candid}
+                    elif [ ${CandidatEnd} -lt ${ChunckFin} ] ; then
+                      #IGCM_debug_Print 3 -e "File $( basename ${candid} ) should be suppress or used as a CompletedFlag baseline"
+                      # We keep the best candidat and remove the others
+                      if [ ${BestCandidat} -lt ${CandidatEnd} ] ; then
+                        if [ ${FoundCandidat} = true ] ; then
+                          set +A RemoveList ${RemoveList[*]} ${DIRECTORY}/${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc
+                        else
+                          FoundCandidat=true
+                        fi
+                        BestCandidat=${CandidatEnd}
+                      else
+                        set +A RemoveList ${RemoveList[*]} ${candid}
+                      fi
+                    fi
+                  done
+                else
+                  # No CompletedFlag candidat found
+                  CandidatCompletedFlag=""
+                fi
+                #
+                if [ ! -f ${DIRECTORY}/${TestedFile} ] ; then
+                  (( countBad = countBad + 1 ))
+                  [ ${countBad} = 1 ] && IGCM_debug_Print 3 "Missing time series from ${FILE} :"
+                  IGCM_debug_Print 3 ${DIRECTORY}/${TestedFile}
+                  # Then we keep a track of the Best Candidat
+                  if [ ${FoundCandidat} = true ] ; then
+                    if [ ${chunck} = true ] ; then
+                      set +A PotentialCompletedFlag ${PotentialCompletedFlag[*]} ${BestCandidat}
+                    else
+                      eval set +A PotentialCompletedFlag${Dimension} \${PotentialCompletedFlag${Dimension}[*]} \${BestCandidat}
+                    fi
+                  fi
+                else
+                  (( countGood = countGood + 1 ))
+                  # Then we do not need the best candidat if any
+                  [ ${FoundCandidat} = true ] && set +A RemoveList ${RemoveList[*]} ${DIRECTORY}/${config_UserChoices_JobName}_${ChunckDebut}_${BestCandidat}_${FlagDir}_${var}.nc
+                fi
+                (( countTotal = countTotal + 1 ))
+              done
+
+              SuccessRate=$(( countGood * 100 / countTotal ))
+              if [ ${SuccessRate} -ne 100 ] ; then
+                IGCM_debug_Print 2 -e "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}"
+              else
+                IGCM_debug_Print 2 -e "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}"
+              fi
+              echo
+
+              # Remove what's in the RemoveList
+              if [ ${RemoveList} ] ; then
+                IGCM_debug_Print 2 "File(s) that will be removed ${RemoveList[*]}"
+                if [ ${action} = true ] ; then
+                  echo -e "\033[1;32mDo you want to remove them?\033[m"
+                  echo -n " Your answer (y/n) : "
+                  read RemoveAnswer
+                  case ${RemoveAnswer} in
+                  oui|OUI|o|y|yes|YES)
+                    echo "OK. I will erase them"
+                    IGCM_sys_Rm -f ${RemoveList[*]}
+                    ;;
+                  non|NON|n|no|NO)
+                    echo "OK. I won't erase them"
+                    ;;
+                  *)
+                    echo "I did not recognize your answer."
+                    echo "Please respond: oui|OUI|o|y|yes|YES"
+                    echo "Or please respond: non|NON|n|no|NO"
+                    exit
+                    ;;
+                  esac
+                fi
+              fi
+              #[ ${FoundCandidat} = true ] && IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag[*]}"
+              #
+              # TO REWRITE BEGIN
+              #
+              if ( [ ${chunck} = true ] && [ ${SuccessRate} -ne 100 ] ) ; then
+                NbCandidats=${#PotentialCompletedFlag[@]}
+                countCandid=1
+                if [ ${NbCandidats} -eq 0 ] ; then
+                  ChunckCompletedFlag=""
+                  IGCM_debug_Print 2 -e "\033[1;31mNO CompletedFlag\033[m"
+                elif [ ${NbCandidats} -eq 1 ] ; then
+                  ChunckCompletedFlag=${PotentialCompletedFlag[0]}
+                  IGCM_debug_Print 2 -e "\033[1;32mCompletedFlag=${ChunckCompletedFlag}\033[m"
+                elif [ ${NbCandidats} -gt 1 ] ; then
+                  k=1
+                  until [ $k -ge ${NbCandidats} ]; do
+                    ((k_m1=k-1))
+                    if [ ${PotentialCompletedFlag[${k_m1}]} = ${PotentialCompletedFlag[${k}]} ] ; then
+                      ((countCandid=countCandid+1))
+                    fi
+                    ((k=k+1))
+                  done
+                  if [ ${NbCandidats} -eq ${countCandid} ] ; then
+                    ChunckCompletedFlag=${PotentialCompletedFlag[0]}
+                    IGCM_debug_Print 2 -e "\033[1;32mCompletedFlag=${ChunckCompletedFlag}\033[m"
+                  else
+                    ChunckCompletedFlag=${PotentialCompletedFlag[0]}
+                    IGCM_debug_Print 2 -e "\033[1;31mToo Many Potential CompletedFlag\033[m Let start with first CompletedPeriod"
+                    IGCM_debug_Print 2 -e "\033[1;31mYou will have to redo TimeSeries_Checker\033[m for other period."
+                  fi
+                fi
+                #
+                # TO REWRITE END
+                #
+                if [ ${action} = true ] ; then
+                  IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}"
+                  listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask,CompToRead,FlagToRead"
+                  export libIGCM=${libIGCM}
+                  export SUBMIT_DIR=${CARD_DIR}
+                  export POST_DIR=${POST_DIR}
+                  export DateBegin=${ChunckDebut}
+                  export PeriodDateEnd=${ChunckFin}
+                  export CompletedFlag=${ChunckCompletedFlag}
+                  export TsTask=Chunck${Dimension}
+                  export CompToRead=${comp}
+                  export FlagToRead=${i}
+                  export NameToRead=${flag_post}
+                  export listVarEnv=${listVarEnv}
+                  IGCM_sys_MkdirWork ${POST_DIR}
+                  IGCM_debug_Verif_Exit_Post
+                  Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}.${CompToRead}.${NameToRead}
+                  IGCM_sys_QsubPost create_ts
+                  echo
+                else
+                  IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}"
+                fi
+              fi
+
+              if ( [ ${chunck} = false ] && [ ${SuccessRate} -ne 100 ] ) ; then
+                eval Launch${Dimension}=true
+              fi
+
+              # Date update
+              ChunckDebut=$( IGCM_date_AddDaysToGregorianDate ${ChunckFin} 1 )
+
+              (( YearsChunckLoop = YearsChunckLoop + 1 ))
+
+              if [ ${YearsChunckLoop} -eq ${NbYearsChunckLoop} ] ; then
+                ChunckFin=${DateEnd}
+              else
+                ChunckFin=$( IGCM_date_AddDaysToGregorianDate ${ChunckDebut} $(( YearsChunckLength * DaysInYear - 1 )) )
+              fi
+            done
+          done
+        else
+          ListDimension[0]=""
+          TimeSeries=true
+          TimeSeries2D=false
+          TimeSeries3D=false
+          TimeSeriesChunck2D=false
+          TimeSeriesChunck3D=false
+        fi
+      fi
+      (( i=i+3 ))
+    done
+  fi
 done # comp loop
 
@@ -468,46 +486,46 @@
 
 if [ X${Launch2D} = Xtrue ] ; then
-    if [ ${action} = true ] ; then
-        #IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag2D[*]}"
-	IGCM_debug_Print 2 -e "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}"
-	listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask"
-	export libIGCM=${libIGCM}
-	export SUBMIT_DIR=${CARD_DIR}
-	export POST_DIR=${POST_DIR}
-	export DateBegin=${DateBegin}
-	export PeriodDateEnd=${DateEnd}
-	export CompletedFlag=${CompletedFlag}
-	export TsTask=2D
-	export listVarEnv=${listVarEnv}
-	IGCM_sys_MkdirWork ${POST_DIR}
-	IGCM_debug_Verif_Exit_Post
-	Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
-	IGCM_sys_QsubPost create_ts
-	echo
-    else
-	IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit 2D without chunck\033[m period ${DateBegin}-${DateEnd}"
-    fi
+  if [ ${action} = true ] ; then
+    #IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag2D[*]}"
+    IGCM_debug_Print 2 -e "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}"
+    listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask"
+    export libIGCM=${libIGCM}
+    export SUBMIT_DIR=${CARD_DIR}
+    export POST_DIR=${POST_DIR}
+    export DateBegin=${DateBegin}
+    export PeriodDateEnd=${DateEnd}
+    export CompletedFlag=${CompletedFlag}
+    export TsTask=2D
+    export listVarEnv=${listVarEnv}
+    IGCM_sys_MkdirWork ${POST_DIR}
+    IGCM_debug_Verif_Exit_Post
+    Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
+    IGCM_sys_QsubPost create_ts
+    echo
+  else
+    IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit 2D without chunck\033[m period ${DateBegin}-${DateEnd}"
+  fi
 fi
 
 if [ X${Launch3D} = Xtrue ] ; then
-    if [ ${action} = true ] ; then
-        #IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag3D[*]}"
-	IGCM_debug_Print 2 -e "\033[1;31mSubmit 3D\033[m without chunck period ${DateBegin}-${DateEnd}"
-	listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask"
-	export libIGCM=${libIGCM}
-	export SUBMIT_DIR=${CARD_DIR}
-	export POST_DIR=${POST_DIR}
-	export DateBegin=${DateBegin}
-	export PeriodDateEnd=${DateEnd}
-	export CompletedFlag=${CompletedFlag}
-	export TsTask=3D
-	export listVarEnv=${listVarEnv}
-	IGCM_sys_MkdirWork ${POST_DIR}
-	IGCM_debug_Verif_Exit_Post
-	Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
-	IGCM_sys_QsubPost create_ts
-	echo
-    else
-	IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit 3D without chunck\033[m  period ${DateBegin}-${DateEnd}"
-    fi
+  if [ ${action} = true ] ; then
+    #IGCM_debug_Print 2 "Potentials CompletedFlag: ${PotentialCompletedFlag3D[*]}"
+    IGCM_debug_Print 2 -e "\033[1;31mSubmit 3D\033[m without chunck period ${DateBegin}-${DateEnd}"
+    listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,CompletedFlag,TsTask"
+    export libIGCM=${libIGCM}
+    export SUBMIT_DIR=${CARD_DIR}
+    export POST_DIR=${POST_DIR}
+    export DateBegin=${DateBegin}
+    export PeriodDateEnd=${DateEnd}
+    export CompletedFlag=${CompletedFlag}
+    export TsTask=3D
+    export listVarEnv=${listVarEnv}
+    IGCM_sys_MkdirWork ${POST_DIR}
+    IGCM_debug_Verif_Exit_Post
+    Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
+    IGCM_sys_QsubPost create_ts
+    echo
+  else
+    IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit 3D without chunck\033[m  period ${DateBegin}-${DateEnd}"
+  fi
 fi
Index: /trunk/libIGCM/AA_atlas_LMDZ
===================================================================
--- /trunk/libIGCM/AA_atlas_LMDZ	(revision 590)
+++ /trunk/libIGCM/AA_atlas_LMDZ	(revision 591)
@@ -188,4 +188,5 @@
 fi
 #
+IGCM_sys_MkdirArchive ${R_FIGR}
 
 R_ATLAS=ATLAS/SE_${YEARS}
Index: /trunk/libIGCM/AA_atlas_ORCA_LIM
===================================================================
--- /trunk/libIGCM/AA_atlas_ORCA_LIM	(revision 590)
+++ /trunk/libIGCM/AA_atlas_ORCA_LIM	(revision 591)
@@ -188,4 +188,5 @@
 fi
 #
+IGCM_sys_MkdirArchive ${R_FIGR}
 
 R_ATLAS=ATLAS/SE_${YEARS}
Index: /trunk/libIGCM/AA_atlas_ORCHIDEE
===================================================================
--- /trunk/libIGCM/AA_atlas_ORCHIDEE	(revision 590)
+++ /trunk/libIGCM/AA_atlas_ORCHIDEE	(revision 591)
@@ -197,4 +197,5 @@
 fi
 #
+IGCM_sys_MkdirArchive ${R_FIGR}
 
 R_ATLAS=ATLAS/SE_${YEARS}
Index: /trunk/libIGCM/AA_atlas_PISCES
===================================================================
--- /trunk/libIGCM/AA_atlas_PISCES	(revision 590)
+++ /trunk/libIGCM/AA_atlas_PISCES	(revision 591)
@@ -189,4 +189,5 @@
 fi
 #
+IGCM_sys_MkdirArchive ${R_FIGR}
 
 R_ATLAS=ATLAS/SE_${YEARS}
Index: /trunk/libIGCM/AA_create_ts
===================================================================
--- /trunk/libIGCM/AA_create_ts	(revision 590)
+++ /trunk/libIGCM/AA_create_ts	(revision 591)
@@ -237,25 +237,44 @@
 fi
 
-#
+#==================================
 # First of all
 #
+typeset option
+
+#==================================
+# Read UserChoices section: 
 IGCM_card_DefineArrayFromSection       ${CARD_DIR}/config.card UserChoices
-typeset option
+echo
+IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
 for option in ${config_UserChoices[*]} ; do
     IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card UserChoices ${option}
+    eval auxprint=\${config_UserChoices_${option}}
+    IGCM_debug_Print 3 "${option} : ${auxprint}"
 done
 #
 echo
-IGCM_debug_Print 1 "DefineArrayFromOption  : config_UserChoices"
-IGCM_debug_PrintVariables 3 config_UserChoices_JobName
-IGCM_debug_PrintVariables 3 config_UserChoices_LongName
-IGCM_debug_PrintVariables 3 config_UserChoices_TagName
-IGCM_debug_PrintVariables 3 config_UserChoices_SpaceName
-IGCM_debug_PrintVariables 3 config_UserChoices_ExperimentName
-IGCM_debug_PrintVariables 3 config_UserChoices_CalendarType
-IGCM_debug_PrintVariables 3 config_UserChoices_DateBegin
-IGCM_debug_PrintVariables 3 config_UserChoices_DateEnd
-IGCM_debug_PrintVariables 3 config_UserChoices_PeriodLength
+
+#==================================
+# Read Post section: 
+IGCM_card_DefineArrayFromSection ${CARD_DIR}/config.card Post
 echo
+IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
+for option in ${config_Post[*]} ; do
+  IGCM_card_DefineVariableFromOption ${CARD_DIR}/config.card Post ${option}
+  eval auxprint=\${config_Post_${option}}
+  IGCM_debug_Print 3 "${option} : ${auxprint}"
+done
+#
+echo
+
+#==================================
+# Define default value to keep compatibility with previous card: means before changes due to TGCC 
+[ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
+
+#==================================
+# If pack is active then PackFrequency overule the config_UserChoices_PeriodLength
+if ( [ ! X${config_Post_PackFrequency} = X${NULL_STR} ] && [ ! X${config_Post_PackFrequency} = XNONE ] ) ; then
+  config_UserChoices_PeriodLength=${config_Post_PackFrequency}
+fi
 
 #==================================
Index: /trunk/libIGCM/AA_monitoring
===================================================================
--- /trunk/libIGCM/AA_monitoring	(revision 590)
+++ /trunk/libIGCM/AA_monitoring	(revision 591)
@@ -233,9 +233,11 @@
     R_DODS=${config_UserChoices_TagName}/${config_UserChoices_JobName}
 fi
-#
-IGCM_sys_TestDirArchive ${R_SAVE}/MONITORING
+
+IGCM_sys_MkdirArchive ${R_FIGR}
+#
+IGCM_sys_TestDirArchive ${R_FIGR}/MONITORING
 if [ $? = 0 ] ; then
     IGCM_debug_Print 1 "Get MONITORING directory from archive"
-    IGCM_sys_Get_Dir ${R_SAVE}/MONITORING ${RUN_DIR}
+    IGCM_sys_Get_Dir ${R_FIGR}/MONITORING ${RUN_DIR}
 else
     IGCM_debug_Print 1 "MONITORING first pass. Nothing has been done before"
Index: /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 590)
+++ /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 591)
@@ -61,4 +61,5 @@
 
   #==================================
+  # Read UserChoices section: 
   IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card UserChoices
 
@@ -88,5 +89,21 @@
 
   #==================================
-
+  # Read Post section: 
+  IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card Post
+  echo
+  IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
+
+  for option in ${config_Post[*]} ; do
+    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card Post ${option}
+    eval auxprint=\${config_Post_${option}}
+    IGCM_debug_Print 3 "${option} : ${auxprint}"
+  done
+
+  #==================================
+  # Define default value to keep compatibility with previous card: means before changes due to TGCC 
+  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
+
+  #==================================
+  # Read ListOfComponents section: 
   IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card ListOfComponents
   for comp in ${config_ListOfComponents[*]} ; do
@@ -113,6 +130,4 @@
   IGCM_debug_Print 3 "Exe_Output           = ${Exe_Output}"
 
-  #==================================
-
   #===================================================================#
   # Prepare variables available for ${COMP}.card and ${COMP}.driver   #
@@ -211,21 +226,4 @@
     fi
   fi
-
-  #==================================
-  # Read Post section: 
-  IGCM_card_DefineArrayFromSection ${SUBMIT_DIR}/config.card Post
-
-  echo
-  IGCM_debug_Print 1 "DefineArrayFromOption : config_Post"
-
-  for option in ${config_Post[*]} ; do
-    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card Post ${option}
-    eval auxprint=\${config_Post_${option}}
-    IGCM_debug_Print 3 "${option} : ${auxprint}"
-  done
-
-  #==================================
-  # Define default value to keep compatibility with previous card: means before changes due to TGCC 
-  [ X${config_Post_PackFrequency} = X ] && config_Post_PackFrequency=${config_Post_RebuildFrequency}
 
   #====================================================
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 590)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 591)
@@ -1328,10 +1328,12 @@
   RET=0
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
-      echo "Nothing has been done."
-      return
-    fi
-    dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+
+#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
     RET=$?
     
@@ -1361,12 +1363,13 @@
   typeset RET
   RET=0
-  if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${R_SAVE}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
-      echo "Nothing has been done."
-      return
-    fi
-    #
-    dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+
+#  if [ $DRYRUN = 0 ]; then
+#    if [ ! -d ${R_SAVE}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
     RET=$?
 
@@ -1395,14 +1398,29 @@
     echo "IGCM_sys_Put_Dods :" $@
   fi
+  typeset RET
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${R_SAVE}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Put_Dods ${R_SAVE}/${1} DOES NOT EXIST ."
+
+    if ( [ ! -d ${R_SAVE}/${1} ] && [ ! -d ${R_FIGR}/${1} ] ) ; then
+      echo "WARNING IGCM_sys_Put_Dods : None of the following directories exist. Exactly one should."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} DOES NOT EXIST."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} DOES NOT EXIST."
       IGCM_debug_PopStack "IGCM_sys_Put_Dods"
       return
     fi
 
-    typeset RET
-	#
-    cd ${R_SAVE}
+    if ( [ -d ${R_SAVE}/${1} ] && [ -d ${R_FIGR}/${1} ] ) ; then
+      echo "WARNING IGCM_sys_Put_Dods : Both of the following directories exist. Exactly one should."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_SAVE}/${1} EXISTS."
+      echo "WARNING IGCM_sys_Put_Dods : ${R_FIGR}/${1} EXISTS."
+      IGCM_debug_PopStack "IGCM_sys_Put_Dods"
+      return
+    fi
+    #
+    if [ -d ${R_SAVE}/${1} ] ; then
+      cd ${R_SAVE}
+    elif [ -d ${R_FIGR}/${1} ] ; then
+      cd ${R_FIGR}
+    fi
+
     IGCM_sys_Dods_Rm ${1}
     IGCM_sys_Dods_Cp ${1}
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 590)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 591)
@@ -1333,10 +1333,12 @@
   RET=0
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
-      echo "Nothing has been done."
-      return
-    fi
-    dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+
+#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
     RET=$?
     
@@ -1367,11 +1369,12 @@
   RET=0
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${R_SAVE}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
-      echo "Nothing has been done."
-      return
-    fi
-    #
-    dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+
+#    if [ ! -d ${R_SAVE}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
     RET=$?
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 590)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 591)
@@ -1512,10 +1512,12 @@
   RET=0
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
-      echo "Nothing has been done."
-      return
-    fi
-    dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
+
+#    if [ ! -d /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Rm /dmnfs/cont003/dods/public/${LOGIN}/${R_DODS}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1
     RET=$?
     
@@ -1546,11 +1548,12 @@
   RET=0
   if [ $DRYRUN = 0 ]; then
-    if [ ! -d ${R_SAVE}/${1} ] ; then
-      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
-      echo "Nothing has been done."
-      return
-    fi
-    #
-    dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
+
+#    if [ ! -d ${R_SAVE}/${1} ] ; then
+#      echo "WARNING : IGCM_sys_Dods_Cp ${R_SAVE}/${1} DOES NOT EXIST ."
+#      echo "Nothing has been done."
+#      return
+#    fi
+
+    /ccc/cont003/home/dsm/p86maf/bin/dods_cp ${1} public/${LOGIN}/${R_DODS} # > out_dods_cp 2>&1
     RET=$?
 
@@ -1579,4 +1582,5 @@
     echo "IGCM_sys_Put_Dods :" $@
   fi
+  set -vx
   typeset RET
   if [ $DRYRUN = 0 ]; then
