Index: branches/libIGCM_MPI_OpenMP/libIGCM_post/libIGCM_post.ksh
===================================================================
--- branches/libIGCM_MPI_OpenMP/libIGCM_post/libIGCM_post.ksh	(revision 489)
+++ branches/libIGCM_MPI_OpenMP/libIGCM_post/libIGCM_post.ksh	(revision 571)
@@ -16,171 +16,176 @@
 function IGCM_post_Configure
 {
-    IGCM_debug_PushStack "IGCM_post_Configure"
-
-    # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_post_Configure"
-    #
-    # Initialize
-    #
-    POST=false
-    RebuildFrequency=false
-    TimeSeriesFrequency=false
-    SeasonalFrequency=false
-    #
-    # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS
-    #
-    if [ X${AsynchronousRebuild} = Xtrue ] ; then
-	list_post="RebuildFrequency"
+  IGCM_debug_PushStack "IGCM_post_Configure"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_post_Configure"
+  #
+  # Initialize
+  #
+  POST=false
+  RebuildFrequency=false
+  PackFrequency=false
+  TimeSeriesFrequency=false
+  SeasonalFrequency=false
+  unset list_post
+  #
+  # ONLY IF SOMETHING NEEDS TO BE DONE (EATHER TIME SERIES OR SEASONAL) COMPUTE THE MODULOS
+  #
+  if [ X${AsynchronousRebuild} = Xtrue ] ; then
+    list_post="RebuildFrequency"
+  fi
+  #
+  if [ X${Pack} = Xtrue ] ; then
+    list_post="${list_post} PackFrequency"
+  fi
+  #
+  if ( [ X${TimeSeries} = Xtrue ] || [ X${TimeSeries2D} = Xtrue ] || [ X${TimeSeries3D} = Xtrue ] ) ; then
+    list_post="${list_post} TimeSeriesFrequency"
+  fi
+  #
+  if [ X${Seasonal} = Xtrue ] ; then
+    list_post="${list_post} SeasonalFrequency"
+  fi
+
+  # Overrule special cases
+  if ( [ ! X${config_Post_TimeSeriesFrequency} = X${NULL_STR} ] && \
+    [ ! X${config_Post_TimeSeriesFrequency} = XNONE ]           && \
+    [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
+    TimeSeriesFrequency=true
+    POST=true
+  fi
+  #
+  if ( [ X${AsynchronousRebuild} = Xtrue ] && [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
+    RebuildFrequency=true
+    POST=true
+  fi
+
+  # READ REBUILD OR TIME SERIES OR SEASONAL FREQUENCY
+  # AND TURN ON THE SUBMISSION FLAG WHEN MODULO IS ZERO
+  for post_freq in ${list_post} ; do
+    # Extract frequency from previously defined variable
+    config_Post_post_freq=$( eval echo \${config_Post_${post_freq}} )
+    # Offset for Seasonal Average starting period
+    if [ ${post_freq} = SeasonalFrequency ] ; then
+      if ( [ X${config_Post_SeasonalFrequencyOffset} = X${NULL_STR} ] || [ X${config_Post_SeasonalFrequencyOffset} = XNONE ] || [ X${config_Post_SeasonalFrequencyOffset} = X ] ) ; then
+	PeriodOffset=0
+      else
+	PeriodOffset=${config_Post_SeasonalFrequencyOffset}
+      fi
+    else
+      PeriodOffset=0
     fi
-    #
-    if ( [ X${TimeSeries} = Xtrue ] || [ X${TimeSeries2D} = Xtrue ] || [ X${TimeSeries3D} = Xtrue ] ) ; then
-	list_post="${list_post} TimeSeriesFrequency"
+    # Compute Modulo between frequencys (/!\second argument will be multiplied by CumuPeriod/!\)
+    # RebuildFrequency needs additionnal information
+    if [ ${post_freq} = RebuildFrequency ] ; then
+      IGCM_post_ModuloRuntimeFrequency config_Post_post_freq config_UserChoices_PeriodLength NbRebuildDir
+    else
+      IGCM_post_ModuloRuntimeFrequency config_Post_post_freq config_UserChoices_PeriodLength
     fi
     #
-    if [ X${Seasonal} = Xtrue ] ; then
-	list_post="${list_post} SeasonalFrequency"
-    fi
-
-    # Overrule special cases
-    if ( [ ! X${config_Post_TimeSeriesFrequency} = X${NULL_STR} ] && \
-	 [ ! X${config_Post_TimeSeriesFrequency} = XNONE ]        && \
-	 [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
-	TimeSeriesFrequency=true
-	POST=true
-    fi
-    #
-    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && \
-	 [ ! X${config_Post_RebuildFrequency} = XNONE ]        && \
-	 [ ${SimulationLengthInDays} -ge ${ExperienceLengthInDays} ] ) ; then
-	RebuildFrequency=true
-	POST=true
-    fi
-
-    # READ REBUILD OR TIME SERIES OR SEASONAL FREQUENCY
-    # AND TURN ON THE SUBMISSION FLAG WHEN MODULO IS ZERO
-    for post_freq in ${list_post} ; do
-        # Extract frequency from previously defined variable
-        config_Post_post_freq=$( eval echo \${config_Post_${post_freq}} )
-	# Offset for Seasonal Average starting period
-	if [ ${post_freq} = SeasonalFrequency ] ; then
-	    if ( [ X${config_Post_SeasonalFrequencyOffset} = X${NULL_STR} ] || [ X${config_Post_SeasonalFrequencyOffset} = XNONE ] || [ X${config_Post_SeasonalFrequencyOffset} = X ] ) ; then
-		PeriodOffset=0
-	    else
-		PeriodOffset=${config_Post_SeasonalFrequencyOffset}
-	    fi
-	else
-	    PeriodOffset=0
-	fi
-        # Compute Modulo between frequencys (/!\second argument will be multiplied by CumuPeriod/!\)
-	# RebuildFrequency needs additionnal information
-	if [ ${post_freq} = RebuildFrequency ] ; then
-	    IGCM_post_ModuloRuntimeFrequency config_Post_post_freq config_UserChoices_PeriodLength NbRebuildDir
-	else
-	    IGCM_post_ModuloRuntimeFrequency config_Post_post_freq config_UserChoices_PeriodLength
-	fi
-	#
-	IGCM_debug_Print 1 "${post_freq} flag value : ${RebuildFrequency}"
-    done
-    #
-    IGCM_debug_Print 2 "POST-TREATEMENT flag value : ${POST}"
-    #
-    IGCM_debug_PopStack "IGCM_post_Configure"
+    IGCM_debug_Print 1 "${post_freq} flag value : ${RebuildFrequency}"
+  done
+  #
+  IGCM_debug_Print 2 "POST-TREATEMENT flag value : ${POST}"
+  #
+  IGCM_debug_PopStack "IGCM_post_Configure"
 }
 
 function IGCM_post_Submit
 {
-    IGCM_debug_PushStack "IGCM_post_Submit"
-
-    typeset listVarEnv
-
-    POST_DIR=${R_OUT_POST}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
-
-    if [ ${POST} = true ]; then
+  IGCM_debug_PushStack "IGCM_post_Submit"
+
+  typeset listVarEnv DaysTemp
+
+  #POST_DIR=${R_OUT_POST}/${config_UserChoices_TagName}/${config_UserChoices_JobName}
+  POST_DIR=${R_BUF_KSH}
+  # trick for IDRIS
+  POST_DIR=$( echo ${R_BUF_KSH} | sed -e "s/workgpfs/workdir/" )
+
+  if [ ${POST} = true ]; then
+    echo
+    IGCM_debug_Print 1 "IGCM_post_Submit"
+    echo
+    IGCM_debug_Print 2 "POST_DIR = ${POST_DIR}"
+  fi
+
+  #============ TIME SERIES POST-PROCESSING ===========#
+  if [ ${TimeSeriesFrequency} = true ] ; then
+
+    IGCM_debug_Print 1 "TIME SERIES POST-PROCESSING ACTIVATED"
+    echo
+
+
+
+    # Get information from last execution
+    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesCompleted
+    CompletedFlag=${run_PostProcessing_TimeSeriesCompleted}
+    #
+
+
+
+    listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,CompletedFlag,TsTask,CompToRead,FlagToRead,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
+    #
+    jLoop=${#ListDimension[*]}
+    j=0
+    until [ $j -ge ${jLoop} ]; do
+      Dimension=${ListDimension[${j}]}
+      #
+      if [ X$( eval echo \${TimeSeries${Dimension}} ) = Xtrue ] ; then
+	#
+	IGCM_debug_Print 1 "TIME SERIES POST-PROCESSING ${Dimension} ACTIVATED"
 	echo
-	IGCM_debug_Print 1 "IGCM_post_Submit"
-	echo
-	IGCM_debug_Print 2 "POST_DIR = ${POST_DIR}"
-    fi
-
-    #============ TIME SERIES POST-TREATMENT ===========#
-    if [ ${TimeSeriesFrequency} = true ] ; then
-
-        IGCM_debug_Print 1 "TIME SERIES POST-PROCESSING ACTIVATED"
-        echo
-
-
-
-	# Get information from last execution
-	IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card PostProcessing TimeSeriesCompleted
-	CompletedFlag=${run_PostProcessing_TimeSeriesCompleted}
         #
-
-
-
-        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,CompletedFlag,TsTask,CompToRead,FlagToRead,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
+	if [ X${Dimension} = X ] ; then
+	  TsTask="empty"
+	  Script_Post_Output=create_ts.${PeriodDateEnd}
+	else
+	  TsTask=${Dimension}
+	  Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
+	fi
 	#
-	jLoop=${#ListDimension[*]}
-	j=0
-	until [ $j -ge ${jLoop} ]; do
-	    Dimension=${ListDimension[${j}]}
-	    #
-	    if [ X$( eval echo \${TimeSeries${Dimension}} ) = Xtrue ] ; then
-		#
-		IGCM_debug_Print 1 "TIME SERIES POST-PROCESSING ${Dimension} ACTIVATED"
-		echo
-                #
-		if [ X${Dimension} = X ] ; then
-		    TsTask="empty"
-		    Script_Post_Output=create_ts.${PeriodDateEnd}
-		else
-		    TsTask=${Dimension}
-		    Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}
-		fi
-	        #
-		if [ ${RebuildFrequency} = true ] ; then
-	            #
-		    if [ -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
-			if [ X${MASTER} = Xtitane ] ; then
-			    echo "IGCM_sys_RshPost <<-EOF"                     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			fi
-			echo "export DEBUG_debug=${DEBUG_debug}              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export MODIPSL=${MODIPSL}                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export libIGCM_SX=${libIGCM}                   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export libIGCM=${libIGCM_POST}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export SUBMIT_DIR=${SUBMIT_DIR}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export POST_DIR=${POST_DIR}                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export MASTER=${MASTER}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RebuildFrequency=${RebuildFrequency}    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export DateBegin=${DateBegin}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export PeriodDateEnd=${PeriodDateEnd}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export CompletedFlag=${CompletedFlag}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export TsTask=${TsTask}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "unset  CompToRead                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "unset  FlagToRead                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RESOL_ATM=${RESOL_ATM}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RESOL_OCE=${RESOL_OCE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RESOL_ICE=${RESOL_ICE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RESOL_MBG=${RESOL_MBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RESOL_SRF=${RESOL_SRF}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export RESOL_SBG=${RESOL_SBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			if [ X${MASTER} = Xtitane ] ; then
-			    echo ". ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo ". ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh"     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			fi
-			echo "IGCM_sys_MkdirWork ${POST_DIR}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "IGCM_debug_Verif_Exit_Post                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			echo "IGCM_sys_QsubPost create_ts                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			if [ X${MASTER} = Xtitane ] ; then
-			    echo "EOF"                                         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			fi
-		    fi
-	            #
-		else
-	            #
-		    IGCM_sys_RshPost <<-EOF
+	if [ ${RebuildFrequency} = true ] ; then
+	  #
+	  if [ -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
+#	    if [ X${MASTER} = Xtitane ] ; then
+#	      echo "IGCM_sys_RshPost <<-EOF"                       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	    fi
+	    echo "export DEBUG_debug=${DEBUG_debug}              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export MODIPSL=${MODIPSL}                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export libIGCM_SX=${libIGCM}                   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export libIGCM=${libIGCM_POST}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export SUBMIT_DIR=${SUBMIT_DIR}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export POST_DIR=${POST_DIR}                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export MASTER=${MASTER}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RebuildFrequency=${RebuildFrequency}    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export DateBegin=${DateBegin}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export PeriodDateEnd=${PeriodDateEnd}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export CompletedFlag=${CompletedFlag}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export TsTask=${TsTask}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "unset  CompToRead                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "unset  FlagToRead                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RESOL_ATM=${RESOL_ATM}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RESOL_OCE=${RESOL_OCE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RESOL_ICE=${RESOL_ICE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RESOL_MBG=${RESOL_MBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RESOL_SRF=${RESOL_SRF}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export RESOL_SBG=${RESOL_SBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	    if [ X${MASTER} = Xtitane ] ; then
+#	      echo ". ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	      echo ". ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh"     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	    fi
+	    echo "IGCM_sys_MkdirWork ${POST_DIR}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "IGCM_debug_Verif_Exit_Post                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	    echo "IGCM_sys_QsubPost create_ts                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	    if [ X${MASTER} = Xtitane ] ; then
+#	      echo "EOF"                                           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	    fi
+	  fi
+	else
+	  IGCM_sys_RshPost <<-EOF
                     export DEBUG_debug=${DEBUG_debug}
                     export MODIPSL=${MODIPSL}
@@ -212,85 +217,83 @@
                     IGCM_sys_QsubPost create_ts
 EOF
-		fi
+	fi
+      fi
+      #
+      if [ X$( eval echo \${TimeSeriesChunck${Dimension}} ) = Xtrue ] ; then
+	#
+	IGCM_debug_Print 1 "TIME SERIES POST-PROCESSING ${Dimension} WITH CHUNCK ACTIVATED"
+	echo
+	# Need to Remember This One
+	SavedDateBegin=${DateBegin}
+	# Kind of task create_ts will perform
+	TsTask=Chunck${Dimension}
+	# Number of chunck jobs to configure and submit
+	eval NbJob=\${#CHUNCK${Dimension}_COMP[@]}
+	typeset i
+	i=0
+	until [ $i -ge $NbJob ]; do
+	  CompToRead=$( eval echo \${CHUNCK${Dimension}_COMP[\${i}]} )
+	  FlagToRead=$( eval echo \${CHUNCK${Dimension}_FLAG[\${i}]} )
+	  NameToRead=$( eval echo \${CHUNCK${Dimension}_NAME[\${i}]} )
+	  ChunckSize=$( eval echo \${CHUNCK${Dimension}_SIZE[\${i}]} )
+	  # Chunck Length (mandatory in Year)
+	  YearsChunckLength=$( echo ${ChunckSize} | sed -e "s/[yY]//" )
+	  #
+	  IGCM_date_GetYearMonth ${DateBegin}     YearBegin MonthBegin
+	  #
+	  IGCM_date_GetYearMonth ${PeriodDateEnd} YearEnd   MonthEnd
+	  # How many chunck in total since simulation began
+	  NbYearsChunckLoop=$(( ( ${YearEnd} - ${YearBegin} + 1 ) / ${YearsChunckLength} ))
+	  #  Tweak special case
+	  [ $(( ( ${YearEnd} - ${YearBegin} + 1 ) % ${YearsChunckLength} )) = 0 ] && NbYearsChunckLoop=$(( ${NbYearsChunckLoop} - 1 ))
+	  # Starting Year of the current chunck
+	  ChunckTsYearBegin=$(( ${NbYearsChunckLoop} *  ${YearsChunckLength} + ${YearBegin} ))
+	  # Starting date of the current chunck
+	  ChunckTsDateBegin=${ChunckTsYearBegin}${MonthBegin}01
+	  #
+	  Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}.${CompToRead}.${NameToRead}
+	  #
+	  if [ ${RebuildFrequency} = true ] ; then
+	    #
+	    if [ -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
+#	      if [ X${MASTER} = Xtitane ] ; then
+#		echo "IGCM_sys_RshPost <<-EOF"                       >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	      fi
+	      echo "export DEBUG_debug=${DEBUG_debug}              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export MODIPSL=${MODIPSL}                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export libIGCM_SX=${libIGCM}                   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export libIGCM=${libIGCM_POST}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export SUBMIT_DIR=${SUBMIT_DIR}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export POST_DIR=${POST_DIR}                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export MASTER=${MASTER}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RebuildFrequency=${RebuildFrequency}    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export DateBegin=${ChunckTsDateBegin}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export PeriodDateEnd=${PeriodDateEnd}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export CompletedFlag=${CompletedFlag}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export TsTask=${TsTask}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export CompToRead=${CompToRead}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export FlagToRead=${FlagToRead}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RESOL_ATM=${RESOL_ATM}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RESOL_OCE=${RESOL_OCE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RESOL_ICE=${RESOL_ICE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RESOL_MBG=${RESOL_MBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RESOL_SRF=${RESOL_SRF}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export RESOL_SBG=${RESOL_SBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	      if [ X${MASTER} = Xtitane ] ; then
+#		echo ". ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#		echo ". ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh"     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	      fi
+	      echo "IGCM_sys_MkdirWork ${POST_DIR}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "IGCM_debug_Verif_Exit_Post                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      echo "IGCM_sys_QsubPost create_ts                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	      if [ X${MASTER} = Xtitane ] ; then
+#		echo "EOF"                                           >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	      fi
 	    fi
-	    #
-	    if [ X$( eval echo \${TimeSeriesChunck${Dimension}} ) = Xtrue ] ; then
-		#
-		IGCM_debug_Print 1 "TIME SERIES POST-PROCESSING ${Dimension} WITH CHUNCK ACTIVATED"
-		echo
-		# Need to Remember This One
-		SavedDateBegin=${DateBegin}
-		# Kind of task create_ts will perform
-		TsTask=Chunck${Dimension}
-	        # Number of chunck jobs to configure and submit
-		eval NbJob=\${#CHUNCK${Dimension}_COMP[@]}
-		typeset i
-		i=0
-		until [ $i -ge $NbJob ]; do
-		    CompToRead=$( eval echo \${CHUNCK${Dimension}_COMP[\${i}]} )
-		    FlagToRead=$( eval echo \${CHUNCK${Dimension}_FLAG[\${i}]} )
-		    NameToRead=$( eval echo \${CHUNCK${Dimension}_NAME[\${i}]} )
-		    ChunckSize=$( eval echo \${CHUNCK${Dimension}_SIZE[\${i}]} )
-		    # Chunck Length (mandatory in Year)
-		    YearsChunckLength=$( echo ${ChunckSize} | sed -e "s/[yY]//" )
-		    #
-		    IGCM_date_GetYearMonth ${DateBegin}     YearBegin MonthBegin
-		    #
-		    IGCM_date_GetYearMonth ${PeriodDateEnd} YearEnd   MonthEnd
-		    # How many chunck in total since simulation began
-		    NbYearsChunckLoop=$(( ( ${YearEnd} - ${YearBegin} + 1 ) / ${YearsChunckLength} ))
-		    #  Tweak special case
-		    [ $(( ( ${YearEnd} - ${YearBegin} + 1 ) % ${YearsChunckLength} )) = 0 ] && NbYearsChunckLoop=$(( ${NbYearsChunckLoop} - 1 ))
-		    # Starting Year of the current chunck
-		    ChunckTsYearBegin=$(( ${NbYearsChunckLoop} *  ${YearsChunckLength} + ${YearBegin} ))
-		    # Starting date of the current chunck
-		    ChunckTsDateBegin=${ChunckTsYearBegin}${MonthBegin}01
-		    #
-		    Script_Post_Output=create_ts.${PeriodDateEnd}.${TsTask}.${CompToRead}.${NameToRead}
-		    #
-		    if [ ${RebuildFrequency} = true ] ; then
-	                #
-			if [ -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
-			    if [ X${MASTER} = Xtitane ] ; then
-				echo "IGCM_sys_RshPost <<-EOF"                     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    fi
-			    echo "export DEBUG_debug=${DEBUG_debug}              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export MODIPSL=${MODIPSL}                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export libIGCM_SX=${libIGCM}                   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export libIGCM=${libIGCM_POST}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export SUBMIT_DIR=${SUBMIT_DIR}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export POST_DIR=${POST_DIR}                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export MASTER=${MASTER}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RebuildFrequency=${RebuildFrequency}    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export DateBegin=${ChunckTsDateBegin}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export PeriodDateEnd=${PeriodDateEnd}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export CompletedFlag=${CompletedFlag}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export TsTask=${TsTask}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export CompToRead=${CompToRead}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export FlagToRead=${FlagToRead}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RESOL_ATM=${RESOL_ATM}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RESOL_OCE=${RESOL_OCE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RESOL_ICE=${RESOL_ICE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RESOL_MBG=${RESOL_MBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RESOL_SRF=${RESOL_SRF}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export RESOL_SBG=${RESOL_SBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    if [ X${MASTER} = Xtitane ] ; then
-				echo ". ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-				echo ". ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh"     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    fi
-			    echo "IGCM_sys_MkdirWork ${POST_DIR}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "IGCM_debug_Verif_Exit_Post                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    echo "IGCM_sys_QsubPost create_ts                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    if [ X${MASTER} = Xtitane ] ; then
-				echo "EOF"                                         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    fi
-			fi
-	                #
-		    else
-	                #
-			IGCM_sys_RshPost <<-EOF
+	  else
+	    IGCM_sys_RshPost <<-EOF
                         export DEBUG_debug=${DEBUG_debug}
                         export MODIPSL=${MODIPSL}
@@ -322,68 +325,66 @@
                         IGCM_sys_QsubPost create_ts
 EOF
-	                #
-		    fi
-		    #
-		    export DateBegin=${SavedDateBegin}
-		    #
-		    (( i=i+1 ))
-		    #
-		done
-	    fi
-	    (( j=j+1 ))
+	  #
+	  fi
+	  #
+	  export DateBegin=${SavedDateBegin}
+	  #
+	  (( i=i+1 ))
+	  #
 	done
-    fi
-
-    #=============  SEASONAL POST-TREATMENT ============#
-    if [ ${SeasonalFrequency} = true ] ; then
-        #
-        IGCM_debug_Print 1 "SEASONNAL POST-TREATMENT"
-        echo
+      fi
+      (( j=j+1 ))
+    done
+  fi
+
+  #=============  SEASONAL POST-PROCESSING ============#
+  if [ ${SeasonalFrequency} = true ] ; then
+    #
+    IGCM_debug_Print 1 "SEASONNAL POST-PROCESSING"
+    echo
+    #
+    Script_Post_Output=create_se.${PeriodDateEnd}
+    #
+    listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
+
+    if [ ${RebuildFrequency} = true ] ; then
+      #
+      if [ -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
 	#
-	Script_Post_Output=create_se.${PeriodDateEnd}
-        #
-	listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,RebuildFrequency,DateBegin,PeriodDateEnd,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
-
-	if [ ${RebuildFrequency} = true ] ; then
-	    #
-	    if [ -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
-	        #
-		if [ X${MASTER} = Xtitane ] ; then
-		    echo "IGCM_sys_RshPost <<-EOF"                     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		fi
-		echo "export DEBUG_debug=${DEBUG_debug}              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export MODIPSL=${MODIPSL}                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export libIGCM_SX=${libIGCM}                   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export libIGCM=${libIGCM_POST}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export SUBMIT_DIR=${SUBMIT_DIR}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export POST_DIR=${POST_DIR}                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export MASTER=${MASTER}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RebuildFrequency=${RebuildFrequency}    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export DateBegin=${DateBegin}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export PeriodDateEnd=${PeriodDateEnd}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RESOL_ATM=${RESOL_ATM}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RESOL_OCE=${RESOL_OCE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RESOL_ICE=${RESOL_ICE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RESOL_MBG=${RESOL_MBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RESOL_SRF=${RESOL_SRF}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export RESOL_SBG=${RESOL_SBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		if [ X${MASTER} = Xtitane ] ; then
-		    echo ". ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		    echo ". ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh"     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		fi
-		echo "IGCM_sys_MkdirWork ${POST_DIR}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_debug_Verif_Exit_Post                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_sys_QsubPost create_se                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		if [ X${MASTER} = Xtitane ] ; then
-		    echo "EOF"                                         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		fi
-	        #
-	    fi
-	else
-	    #
-            IGCM_sys_RshPost <<-EOF
+#	if [ X${MASTER} = Xtitane ] ; then
+#	  echo "IGCM_sys_RshPost <<-EOF"                     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	fi
+	echo "export DEBUG_debug=${DEBUG_debug}              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export MODIPSL=${MODIPSL}                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export libIGCM_SX=${libIGCM}                   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export libIGCM=${libIGCM_POST}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export SUBMIT_DIR=${SUBMIT_DIR}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export POST_DIR=${POST_DIR}                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export MASTER=${MASTER}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RebuildFrequency=${RebuildFrequency}    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export DateBegin=${DateBegin}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export PeriodDateEnd=${PeriodDateEnd}          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export StandAlone=false                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RESOL_ATM=${RESOL_ATM}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RESOL_OCE=${RESOL_OCE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RESOL_ICE=${RESOL_ICE}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RESOL_MBG=${RESOL_MBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RESOL_SRF=${RESOL_SRF}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export RESOL_SBG=${RESOL_SBG}                  " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export listVarEnv=${listVarEnv}                " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "export Script_Post_Output=${Script_Post_Output}" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	if [ X${MASTER} = Xtitane ] ; then
+#	  echo ". ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	  echo ". ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh"     >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	fi
+	echo "IGCM_sys_MkdirWork ${POST_DIR}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "IGCM_debug_Verif_Exit_Post                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	echo "IGCM_sys_QsubPost create_se                    " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	if [ X${MASTER} = Xtitane ] ; then
+#	  echo "EOF"                                         >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+#	fi
+      fi
+    else
+      IGCM_sys_RshPost <<-EOF
             export DEBUG_debug=${DEBUG_debug}
             export MODIPSL=${MODIPSL}
@@ -411,73 +412,138 @@
             IGCM_sys_QsubPost create_se
 EOF
-	#
-	fi
     fi
-
-    #============== REBUILD POST-TREATMENT =============#
-    if ( [ ! X${config_Post_RebuildFrequency} = X${NULL_STR} ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
-	# -----------------------------------------------------------------------------------
-        # Function IGCM_FlushRebuild define in rebuild.ksh has not been closed yet. Do it now
-        # -----------------------------------------------------------------------------------
-	if [ ${DRYRUN} -le 1 ] ; then
-	    echo "IGCM_debug_PopStack \"IGCM_FlushRebuild\" " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	    echo "}                                         " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	fi
-        if [ ${config_Post_RebuildFromArchive} = true ] ; then
-            IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
-        else
-            IGCM_sys_Mv      REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
-        fi
+  fi
+
+  #============== REBUILD POST-PROCESSING =============#
+  if [ X${AsynchronousRebuild} = Xtrue ] ; then
+    # -----------------------------------------------------------------------------------
+    # Function IGCM_FlushRebuild define in rebuild.ksh has not been closed yet. Do it now
+    # -----------------------------------------------------------------------------------
+    if [ ${DRYRUN} -le 1 ] ; then
+      echo "IGCM_debug_PopStack \"IGCM_FlushRebuild\" " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+      echo "}                                         " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
     fi
-    #
-    if [ ${RebuildFrequency} = true ] ; then
-        if ( [ ${config_Post_RebuildFromArchive} = true ] ) ; then
-            IGCM_debug_Print 1 "REBUILD POST-TREATMENT FROM ARCHIVE"
-            echo
-            #
-	    script=rebuild_fromArchive
-	else
-            IGCM_debug_Print 1 "REBUILD POST-TREATMENT FROM WORKDIR"
-	    echo
-	    #
-	    script=rebuild_fromWorkdir
-	fi
-	#
-	Script_Post_Output=${script}.${PeriodDateEnd}
-	#
-        listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
-        IGCM_sys_RshPost <<-EOF
-        export DEBUG_debug=${DEBUG_debug}
-        export MODIPSL=${MODIPSL}
-	export libIGCM_SX=${libIGCM}
-        export libIGCM=${libIGCM_POST}
-        export SUBMIT_DIR=${SUBMIT_DIR}
-        export REBUILD_DIR=${REBUILD_DIR}
-        export POST_DIR=${POST_DIR}
-        export MASTER=${MASTER}
-        export RebuildFromArchive=${config_Post_RebuildFromArchive}
-        export DateBegin=${DateBegin}
-        export PeriodDateBegin=${PeriodDateBegin}
-        export PeriodDateEnd=${PeriodDateEnd}
-        export NbRebuildDir=${NbRebuildDir}
-        export StandAlone=false
-        export RESOL_ATM=${RESOL_ATM}
-        export RESOL_OCE=${RESOL_OCE}
-        export RESOL_ICE=${RESOL_ICE}
-        export RESOL_MBG=${RESOL_MBG}
-        export RESOL_SRF=${RESOL_SRF}
-        export RESOL_SBG=${RESOL_SBG}
-        export listVarEnv=${listVarEnv}
-        export Script_Post_Output=${Script_Post_Output}
-        . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
-        . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
-        IGCM_sys_MkdirWork ${POST_DIR}
-        IGCM_debug_Verif_Exit_Post
-        IGCM_sys_QsubPost ${script}
+    if [ ${config_Post_RebuildFromArchive} = true ] ; then
+      IGCM_sys_Put_Dir REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
+    else
+      IGCM_sys_Mv      REBUILD_${PeriodDateBegin} ${REBUILD_DIR}
+    fi
+  fi
+  #
+  if [ ${RebuildFrequency} = true ] ; then
+    if ( [ ${config_Post_RebuildFromArchive} = true ] ) ; then
+      IGCM_debug_Print 1 "REBUILD POST-PROCESSING FROM ARCHIVE"
+      echo
+      #
+      script=rebuild_fromArchive
+    else
+      IGCM_debug_Print 1 "REBUILD POST-PROCESSING FROM WORKDIR"
+      echo
+      #
+      script=rebuild_fromWorkdir
+    fi
+    #
+    Script_Post_Output=${script}.${PeriodDateEnd}
+    #
+    listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,REBUILD_DIR,POST_DIR,MASTER,RebuildFromArchive,DateBegin,PeriodDateBegin,PeriodDateEnd,NbRebuildDir,StandAlone,RESOL_ATM,RESOL_OCE,RESOL_ICE,RESOL_MBG,RESOL_SRF,RESOL_SBG"
+    IGCM_sys_RshPost <<-EOF
+    export DEBUG_debug=${DEBUG_debug}
+    export MODIPSL=${MODIPSL}
+    export libIGCM_SX=${libIGCM}
+    export libIGCM=${libIGCM_POST}
+    export SUBMIT_DIR=${SUBMIT_DIR}
+    export REBUILD_DIR=${REBUILD_DIR}
+    export POST_DIR=${POST_DIR}
+    export MASTER=${MASTER}
+    export RebuildFromArchive=${config_Post_RebuildFromArchive}
+    export DateBegin=${DateBegin}
+    export PeriodDateBegin=${PeriodDateBegin}
+    export PeriodDateEnd=${PeriodDateEnd}
+    export NbRebuildDir=${NbRebuildDir}
+    export StandAlone=false
+    export RESOL_ATM=${RESOL_ATM}
+    export RESOL_OCE=${RESOL_OCE}
+    export RESOL_ICE=${RESOL_ICE}
+    export RESOL_MBG=${RESOL_MBG}
+    export RESOL_SRF=${RESOL_SRF}
+    export RESOL_SBG=${RESOL_SBG}
+    export listVarEnv=${listVarEnv}
+    export Script_Post_Output=${Script_Post_Output}
+    . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
+    . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
+    IGCM_sys_MkdirWork ${POST_DIR}
+    IGCM_debug_Verif_Exit_Post
+    IGCM_sys_QsubPost ${script}
 EOF
-
-    fi
-
-    IGCM_debug_PopStack "IGCM_post_Submit"
+  fi
+
+  #============== PACK PROCESSING FOR RESTART AND DEBUG FILES =============#
+  if [ ${PackFrequency} = true ] ; then
+    IGCM_debug_Print 1 "PACK POST-PROCESSING"
+    echo
+    ## Need to Remember This One
+    SavedDateBegin=${DateBegin}
+    ## Need to Remember This One
+    SavedDateEnd=${DateEnd}
+    #
+    DaysTemp=$(( $( IGCM_date_DaysInPreviousPeriod ${PeriodDateEnd} ${config_Post_PackFrequency} end ) - 1 ))
+    #
+    PackDateBegin=$( IGCM_date_AddDaysToGregorianDate ${PeriodDateEnd} -${DaysTemp} )
+    #
+    script=pack_debug
+    #
+    Script_Post_Output=${script}.${PeriodDateEnd}
+    #
+    listVarEnv="DEBUG_debug,MODIPSL,libIGCM,libIGCM_SX,SUBMIT_DIR,POST_DIR,MASTER,DateBegin,DateEnd,PeriodPack,StandAlone"
+    IGCM_sys_RshPost <<-EOF
+    export DEBUG_debug=${DEBUG_debug}
+    export MODIPSL=${MODIPSL}
+    export libIGCM_SX=${libIGCM}
+    export libIGCM=${libIGCM_POST}
+    export SUBMIT_DIR=${SUBMIT_DIR}
+    export POST_DIR=${POST_DIR}
+    export MASTER=${MASTER}
+    export DateBegin=${PackDateBegin}
+    export DateEnd=${PeriodDateEnd}
+    export PeriodPack=${config_Post_PackFrequency}
+    export StandAlone=false
+    export listVarEnv=${listVarEnv}
+    export Script_Post_Output=${Script_Post_Output}
+    . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
+    . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
+    IGCM_sys_MkdirWork ${POST_DIR}
+    IGCM_debug_Verif_Exit_Post
+    IGCM_sys_QsubPost ${script}
+EOF
+    #
+    script=pack_restart
+    #
+    Script_Post_Output=${script}.${PeriodDateEnd}
+    #
+    IGCM_sys_RshPost <<-EOF
+    export DEBUG_debug=${DEBUG_debug}
+    export MODIPSL=${MODIPSL}
+    export libIGCM_SX=${libIGCM}
+    export libIGCM=${libIGCM_POST}
+    export SUBMIT_DIR=${SUBMIT_DIR}
+    export POST_DIR=${POST_DIR}
+    export MASTER=${MASTER}
+    export DateBegin=${PackDateBegin}
+    export DateEnd=${PeriodDateEnd}
+    export PeriodPack=${config_Post_PackFrequency}
+    export StandAlone=false
+    export listVarEnv=${listVarEnv}
+    export Script_Post_Output=${Script_Post_Output}
+    . ${libIGCM_POST}/libIGCM_debug/libIGCM_debug.ksh
+    . ${libIGCM_POST}/libIGCM_sys/libIGCM_sys.ksh
+    IGCM_sys_MkdirWork ${POST_DIR}
+    IGCM_debug_Verif_Exit_Post
+    IGCM_sys_QsubPost ${script}
+EOF
+
+    export DateBegin=${SavedDateBegin}
+    export DateEnd=${SavedDateEnd}
+  fi
+  IGCM_debug_PopStack "IGCM_post_Submit"
 }
 
@@ -485,113 +551,113 @@
 function IGCM_post_CheckModuloFrequency
 {
-    IGCM_debug_PushStack "IGCM_post_CheckModuloFrequency" $*
-
-    # Used by IGCM_config_Check
-    # from 2 libIGCM compatible frequency (*Y, *M, *D, *y, *m, *d)
-    # Issue an exit instruction IGCM_debug_Exit if there modulo is not zero
-    # Input parameter are the name of the variable, not the frequency value itself
-    # example
-    # IGCM_post_ModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength
-
-    typeset MasterName SlaveName MasterFrequency SlaveFrequency PeriodMasterYear PeriodMasterMonth PeriodMasterDay PeriodSlaveYear PeriodSlaveMonth PeriodSlaveDay
-
-    # Get the name of the variable
-    MasterName=$1
-    SlaveName=$2
-    # Get the value the above name points to
-    MasterFrequency=$( eval echo \${${1}} )
-    SlaveFrequency=$( eval echo \${${2}} )
-
-    IGCM_debug_Print 2 "IGCM_post_CheckModuloFrequency : Master=${MasterFrequency} Slave=${SlaveFrequency}"
-
-    case ${MasterFrequency} in
-        *y|*Y)
-            PeriodMasterYear=$( echo ${MasterFrequency} | sed -e "s/[yY]//" )
-	    case ${SlaveFrequency} in
-		*Y|*y)
-		    PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
-		    if ( [ ${PeriodSlaveYear} -gt ${PeriodMasterYear} ] || \
-			[ $(( ${PeriodMasterYear} % ${PeriodSlaveYear} )) -ne 0 ] );  then
-			IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-			IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-			IGCM_debug_Exit "Check your frequency"
-		    fi ;;
-		*M|*m)
- 	            PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
-		    if ( [ ${PeriodSlaveMonth} -gt $(( ${PeriodMasterYear} * 12 )) ] || \
-			[ $(( ( ${PeriodMasterYear} * 12 ) % ${PeriodSlaveMonth} )) -ne 0 ] ) ; then
-			IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-			IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-			IGCM_debug_Exit "Check your frequency"
- 	            fi ;;
-                *D|*d)
-                    PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
-		    NbDays=$( IGCM_date_DaysInYear ${year} )
-		    if [ ${config_UserChoices_CalendarType} = 360d ] || [ ${config_UserChoices_CalendarType} = noleap ] ; then
-			if ( [ ${PeriodSlaveDay} -gt $(( ${PeriodMasterYear} * ${NbDays} )) ] || \
-			    [ $(( ( ${PeriodMasterYear} * ${NbDays} ) % ${PeriodSlaveDay} )) -ne 0 ] ; ) then
-			    IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-			    IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-			    IGCM_debug_Exit "Check your frequency"
-			fi
-		    else
-			IGCM_debug_Print 1 "For ${MasterName} with leap calendar:"
-			IGCM_debug_Print 1 "We have a daily ${SlaveName} frequency and ${MasterName}=${MasterFrequency}"
-			IGCM_debug_Print 1 "No post-treatment. Case not properly handle at this moment by libIGCM. Sorry"
-			IGCM_debug_Exit    "Check your frequency ${MasterName} and choose a daily frequency for this one too."
-                    fi ;;
-	    esac ;;
-	*M|*m)
-	    PeriodMasterMonth=$( echo ${MasterFrequency} | sed -e "s/[mM]//" )
-            case ${SlaveFrequency} in		    
-		*Y|*y)
-		    PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
-		    if ( [ ${PeriodMasterMonth} -gt $(( ${PeriodSlaveYear} * 12 )) ] || \
-			[ $(( ${PeriodMasterMonth} % ( ${PeriodSlaveYear} * 12 ) )) -ne 0 ] ) ; then
-			IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-			IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-			IGCM_debug_Exit "Check your frequency"
- 	            fi ;;
-		*M|*m)
-		    PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
-		    if ( [ ${PeriodSlaveMonth} -gt ${PeriodMasterMonth} ] || \
-			[ $(( ${PeriodMasterMonth} % ${PeriodSlaveMonth} )) -ne 0 ] ) ;  then		
-			IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-			IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-			IGCM_debug_Exit "Check your frequency"
-		    fi ;;
-		*D|*d)
-		    IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-		    IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-		    IGCM_debug_Exit "Check your frequency" ;;
-	    esac ;;
-        *D|*d)
-            PeriodMasterDay=$( echo ${MasterFrequency} | sed -e "s/[dD]//" )
-            case ${SlaveFrequency} in
-                *Y|*y)
-                    IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-                    IGCM_debug_Print 1 "${MasterName} frequency ${MasterFrequency}"
-		    IGCM_debug_Exit "Check your frequency" ;;
-                *M|*m)
-                    IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-                    IGCM_debug_Print 1 "${MasterName} frequency ${MasterFrequency}"
-		    IGCM_debug_Exit "Check your frequency" ;;
-                *D|*d)
-                    PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
-                    if ( [ ${PeriodSlaveDay} -gt ${PeriodMasterDay} ] || \
-                        [ $(( ${PeriodMasterDay} % ${PeriodSlaveDay} )) -ne 0 ] ) ;  then
-                        IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
-                        IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
-			IGCM_debug_Exit "Check your frequency"
-                    fi ;;
-            esac ;;
-        NONE|none) 
-	    ;;
-	*)
-	    IGCM_debug_Print 1 "KeyWord ${MasterFrequency} not allowed for ${MasterName} in config.card"
-	    IGCM_debug_Exit "Check your ${MasterName} in config.card" ;;
-    esac
-
-    IGCM_debug_PopStack "IGCM_post_CheckModuloFrequency"
+  IGCM_debug_PushStack "IGCM_post_CheckModuloFrequency" $*
+
+  # Used by IGCM_config_Check
+  # from 2 libIGCM compatible frequency (*Y, *M, *D, *y, *m, *d)
+  # Issue an exit instruction IGCM_debug_Exit if there modulo is not zero
+  # Input parameter are the name of the variable, not the frequency value itself
+  # example
+  # IGCM_post_ModuloFrequency config_Post_RebuildFrequency config_UserChoices_PeriodLength
+
+  typeset MasterName SlaveName MasterFrequency SlaveFrequency PeriodMasterYear PeriodMasterMonth PeriodMasterDay PeriodSlaveYear PeriodSlaveMonth PeriodSlaveDay
+
+  # Get the name of the variable
+  MasterName=$1
+  SlaveName=$2
+  # Get the value the above name points to
+  MasterFrequency=$( eval echo \${${1}} )
+  SlaveFrequency=$( eval echo \${${2}} )
+
+  IGCM_debug_Print 2 "IGCM_post_CheckModuloFrequency : Master=${MasterFrequency} Slave=${SlaveFrequency}"
+
+  case ${MasterFrequency} in
+  *y|*Y)
+    PeriodMasterYear=$( echo ${MasterFrequency} | sed -e "s/[yY]//" )
+    case ${SlaveFrequency} in
+    *Y|*y)
+      PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
+      if ( [ ${PeriodSlaveYear} -gt ${PeriodMasterYear} ] || \
+	[ $(( ${PeriodMasterYear} % ${PeriodSlaveYear} )) -ne 0 ] );  then
+	IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+	IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+	IGCM_debug_Exit "Check your frequency"
+      fi ;;
+    *M|*m)
+      PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
+      if ( [ ${PeriodSlaveMonth} -gt $(( ${PeriodMasterYear} * 12 )) ] || \
+	[ $(( ( ${PeriodMasterYear} * 12 ) % ${PeriodSlaveMonth} )) -ne 0 ] ) ; then
+	IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+	IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+	IGCM_debug_Exit "Check your frequency"
+      fi ;;
+    *D|*d)
+      PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
+      NbDays=$( IGCM_date_DaysInYear ${year} )
+      if [ ${config_UserChoices_CalendarType} = 360d ] || [ ${config_UserChoices_CalendarType} = noleap ] ; then
+	if ( [ ${PeriodSlaveDay} -gt $(( ${PeriodMasterYear} * ${NbDays} )) ] || \
+	  [ $(( ( ${PeriodMasterYear} * ${NbDays} ) % ${PeriodSlaveDay} )) -ne 0 ] ; ) then
+	  IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+	  IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+	  IGCM_debug_Exit "Check your frequency"
+	fi
+      else
+	IGCM_debug_Print 1 "For ${MasterName} with leap calendar:"
+	IGCM_debug_Print 1 "We have a daily ${SlaveName} frequency and ${MasterName}=${MasterFrequency}"
+	IGCM_debug_Print 1 "No post-treatment. Case not properly handle at this moment by libIGCM. Sorry"
+	IGCM_debug_Exit    "Check your frequency ${MasterName} and choose a daily frequency for this one too."
+      fi ;;
+    esac ;;
+  *M|*m)
+    PeriodMasterMonth=$( echo ${MasterFrequency} | sed -e "s/[mM]//" )
+    case ${SlaveFrequency} in		    
+    *Y|*y)
+      PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
+      if ( [ ${PeriodMasterMonth} -gt $(( ${PeriodSlaveYear} * 12 )) ] || \
+	[ $(( ${PeriodMasterMonth} % ( ${PeriodSlaveYear} * 12 ) )) -ne 0 ] ) ; then
+	IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+	IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+	IGCM_debug_Exit "Check your frequency"
+      fi ;;
+    *M|*m)
+      PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
+      if ( [ ${PeriodSlaveMonth} -gt ${PeriodMasterMonth} ] || \
+	[ $(( ${PeriodMasterMonth} % ${PeriodSlaveMonth} )) -ne 0 ] ) ;  then		
+	IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+	IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+	IGCM_debug_Exit "Check your frequency"
+      fi ;;
+    *D|*d)
+      IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+      IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+      IGCM_debug_Exit "Check your frequency" ;;
+    esac ;;
+  *D|*d)
+    PeriodMasterDay=$( echo ${MasterFrequency} | sed -e "s/[dD]//" )
+    case ${SlaveFrequency} in
+    *Y|*y)
+      IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+      IGCM_debug_Print 1 "${MasterName} frequency ${MasterFrequency}"
+      IGCM_debug_Exit "Check your frequency" ;;
+    *M|*m)
+      IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+      IGCM_debug_Print 1 "${MasterName} frequency ${MasterFrequency}"
+      IGCM_debug_Exit "Check your frequency" ;;
+    *D|*d)
+      PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
+      if ( [ ${PeriodSlaveDay} -gt ${PeriodMasterDay} ] || \
+        [ $(( ${PeriodMasterDay} % ${PeriodSlaveDay} )) -ne 0 ] ) ;  then
+        IGCM_debug_Print 1 "${SlaveName} frequency ${SlaveFrequency} not compatbile with"
+        IGCM_debug_Print 1 "${MasterName} frequency : ${MasterFrequency}"
+	IGCM_debug_Exit "Check your frequency"
+      fi ;;
+    esac ;;
+  NONE|none)
+    ;;
+  *)
+    IGCM_debug_Print 1 "KeyWord ${MasterFrequency} not allowed for ${MasterName} in config.card"
+    IGCM_debug_Exit "Check your ${MasterName} in config.card" ;;
+  esac
+
+  IGCM_debug_PopStack "IGCM_post_CheckModuloFrequency"
 }
 
@@ -599,105 +665,105 @@
 function IGCM_post_ModuloRuntimeFrequency
 {
-    IGCM_debug_PushStack "IGCM_post_ModuloRuntimeFrequency" $*
-
-    # Used by IGCM_post_Configure
-    # - from libIGCM (config_UserChoices_PeriodLength frequency * CumulPeriod) and 
-    # - post-processing compatible frequency (*Y, *M, *D, *y, *m, *d)
-    # --> turn on post-processing submission when their modulo is zero
-    # Input parameter are the name of the variable, not the frequency value itself
-    # example
-    # IGCM_post_ModuloRuntimeFrequency config_Post_SeasonalFrequency config_UserChoices_PeriodLength
-
-    typeset MasterName SlaveName MasterFrequency SlaveFrequency PeriodMasterYear PeriodMasterMonth PeriodMasterDay PeriodSlaveYear PeriodSlaveMonth PeriodSlaveDay
-
-    # Get the name of the variable
-    MasterName=$1
-    SlaveName=$2
- 
-    # Get the value the above name points to
-    eval MasterFrequency=\${${1}}
-    eval SlaveFrequency=\${${2}}
-
-    echo
-    IGCM_debug_Print 2 "IGCM_post_ModuloRuntimeFrequency : Master=${MasterFrequency} Slave=${SlaveFrequency} CumulPeriod=${CumulPeriod}"
-
-    case ${MasterFrequency} in
-	*y|*Y)
-	    PeriodMasterYear=$( echo ${MasterFrequency} | sed -e "s/[yY]//" )
-	    case ${SlaveFrequency} in
-		*Y|*y)
-		    PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
-		    if [ $(( ( ${CumulPeriod} * ${PeriodSlaveYear} - ${PeriodOffset} ) % ${PeriodMasterYear} )) -eq 0 ] ;  then
-			if [ $(( ${CumulPeriod} * ${PeriodSlaveYear} - ${PeriodOffset} )) -ne 0 ] ; then
-			    eval ${post_freq}=true ; POST=true
-			    [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterYear} / ${PeriodSlaveYear} ))
-			fi
-		    fi;;
-		*M|*m)
- 		    PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
-		    if [ $(( ( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} * 12 ) % ( ${PeriodMasterYear} * 12 ) )) -eq 0 ] ; then
-			if [ $(( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} * 12 )) -ne 0 ] ; then
-			    eval ${post_freq}=true ; POST=true
-			    [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ( 12 * ${PeriodMasterYear} ) / ${PeriodSlaveMonth} ))
-			fi
-		    fi;;
-		*D|*d)
-		    PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
-		    NbDays=$( IGCM_date_DaysInYear ${year} )
-		    if [ $(( ( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodSlaveDay} ) ) % ( ${NbDays} * ${PeriodMasterYear} / ${PeriodSlaveDay} ) )) -eq 0 ] ; then
-			if [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodSlaveDay} ) )) -ne 0 ] ; then
-			    eval ${post_freq}=true ; POST=true
-			    [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ( ${NbDays} * ${PeriodMasterYear} ) / ${PeriodSlaveDay} ))
-			fi
-		    fi;;
-	    esac ;;
-	*M|*m)
-	    PeriodMasterMonth=$( echo ${MasterFrequency} | sed -e "s/[mM]//" )
-	    case ${SlaveFrequency} in
-		*Y|*y)
-		    PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
-		    if [ $(( ( ${CumulPeriod} * ${PeriodSlaveYear} * 12 - ${PeriodOffset} ) % ( ${PeriodMasterMonth} ) )) -eq 0 ] ; then
-			if [ $(( ${CumulPeriod} * ${PeriodSlaveYear} * 12 - ${PeriodOffset} )) -ne 0 ] ; then
-			    eval ${post_freq}=true ; POST=true
-			    [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterMonth} / ( 12 * ${PeriodSlaveYear} ) ))
-			fi
-		    fi;;
-		*M|*m)
-		    PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
-		    if [ $(( ( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} ) % ${PeriodMasterMonth} )) -eq 0 ] ;  then
-			if [ $(( ${CumulPeriod} * ${PeriodSlaveMonth} -  ${PeriodOffset} )) -ne 0 ] ; then 
-			    eval ${post_freq}=true ; POST=true
-			    [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterMonth} / ${PeriodSlaveMonth} ))
-			fi
-		    fi;;
-		*D|*d)
-		    IGCM_debug_Print 1 "PeriodLength frequency ${SlaveFrequency} not compatbile with"
-		    IGCM_debug_Print 1 "${flag_post} frequency : ${MasterFrequency} " ;;
-	    esac ;;
-        *D|*d)
-            PeriodMasterDay=$( echo ${MasterFrequency} | sed -e "s/[dD]//" )
-            case ${SlaveFrequency} in
-                *Y|*y)
-                    IGCM_debug_Print 1 "PeriodLength frequency ${SlaveFrequency} not compatbile with"
-                    IGCM_debug_Print 1 "${flag_post} frequency : ${MasterFrequency} " ;;
-                *M|*m)
-                    IGCM_debug_Print 1 "PeriodLength frequency ${SlaveFrequency} not compatbile with"
-                    IGCM_debug_Print 1 "${flag_post} frequency : ${MasterFrequency} " ;;
-                *D|*d)
-                    PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
-                    if [ $(( ( ${CumulPeriod} * ${PeriodSlaveDay} - ${PeriodOffset} ) % ${PeriodMasterDay} )) -eq 0 ] ;  then
-                        if [ $(( ${CumulPeriod} * ${PeriodSlaveDay} - ${PeriodOffset} )) -ne 0 ] ; then
-			    eval ${post_freq}=true ; POST=true
-			    [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterDay} / ${PeriodSlaveDay} ))
-			fi
-                    fi;;
-            esac ;;
-	NONE|none)
-	    ;;
-	*)
-	    IGCM_debug_Print 1 "KeyWord not allowed for ${post_freq} in config.card"
-	    ;;
-    esac
-
-    IGCM_debug_PopStack "IGCM_post_ModuloRuntimeFrequency"
+  IGCM_debug_PushStack "IGCM_post_ModuloRuntimeFrequency" $*
+
+  # Used by IGCM_post_Configure
+  # - from libIGCM (config_UserChoices_PeriodLength frequency * CumulPeriod) and 
+  # - post-processing compatible frequency (*Y, *M, *D, *y, *m, *d)
+  # --> turn on post-processing submission when their modulo is zero
+  # Input parameter are the name of the variable, not the frequency value itself
+  # example
+  # IGCM_post_ModuloRuntimeFrequency config_Post_SeasonalFrequency config_UserChoices_PeriodLength
+
+  typeset MasterName SlaveName MasterFrequency SlaveFrequency PeriodMasterYear PeriodMasterMonth PeriodMasterDay PeriodSlaveYear PeriodSlaveMonth PeriodSlaveDay
+
+  # Get the name of the variable
+  MasterName=$1
+  SlaveName=$2
+  
+  # Get the value the above name points to
+  eval MasterFrequency=\${${1}}
+  eval SlaveFrequency=\${${2}}
+
+  echo
+  IGCM_debug_Print 2 "IGCM_post_ModuloRuntimeFrequency : Master=${MasterFrequency} Slave=${SlaveFrequency} CumulPeriod=${CumulPeriod}"
+
+  case ${MasterFrequency} in
+  *y|*Y)
+    PeriodMasterYear=$( echo ${MasterFrequency} | sed -e "s/[yY]//" )
+    case ${SlaveFrequency} in
+    *Y|*y)
+      PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
+      if [ $(( ( ${CumulPeriod} * ${PeriodSlaveYear} - ${PeriodOffset} ) % ${PeriodMasterYear} )) -eq 0 ] ;  then
+	if [ $(( ${CumulPeriod} * ${PeriodSlaveYear} - ${PeriodOffset} )) -ne 0 ] ; then
+	  eval ${post_freq}=true ; POST=true
+	  [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterYear} / ${PeriodSlaveYear} ))
+	fi
+      fi;;
+    *M|*m)
+      PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
+      if [ $(( ( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} * 12 ) % ( ${PeriodMasterYear} * 12 ) )) -eq 0 ] ; then
+	if [ $(( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} * 12 )) -ne 0 ] ; then
+	  eval ${post_freq}=true ; POST=true
+	  [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ( 12 * ${PeriodMasterYear} ) / ${PeriodSlaveMonth} ))
+	fi
+      fi;;
+    *D|*d)
+      PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
+      NbDays=$( IGCM_date_DaysInYear ${year} )
+      if [ $(( ( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodSlaveDay} ) ) % ( ${NbDays} * ${PeriodMasterYear} / ${PeriodSlaveDay} ) )) -eq 0 ] ; then
+	if [ $(( ${CumulPeriod} - ( ${PeriodOffset} * ${NbDays} / ${PeriodSlaveDay} ) )) -ne 0 ] ; then
+	  eval ${post_freq}=true ; POST=true
+	  [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ( ${NbDays} * ${PeriodMasterYear} ) / ${PeriodSlaveDay} ))
+	fi
+      fi;;
+    esac ;;
+  *M|*m)
+    PeriodMasterMonth=$( echo ${MasterFrequency} | sed -e "s/[mM]//" )
+    case ${SlaveFrequency} in
+    *Y|*y)
+      PeriodSlaveYear=$( echo ${SlaveFrequency} | sed -e "s/[yY]//" )
+      if [ $(( ( ${CumulPeriod} * ${PeriodSlaveYear} * 12 - ${PeriodOffset} ) % ( ${PeriodMasterMonth} ) )) -eq 0 ] ; then
+	if [ $(( ${CumulPeriod} * ${PeriodSlaveYear} * 12 - ${PeriodOffset} )) -ne 0 ] ; then
+	  eval ${post_freq}=true ; POST=true
+	  [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterMonth} / ( 12 * ${PeriodSlaveYear} ) ))
+	fi
+      fi;;
+    *M|*m)
+      PeriodSlaveMonth=$( echo ${SlaveFrequency} | sed -e "s/[mM]//" )
+      if [ $(( ( ${CumulPeriod} * ${PeriodSlaveMonth} - ${PeriodOffset} ) % ${PeriodMasterMonth} )) -eq 0 ] ;  then
+	if [ $(( ${CumulPeriod} * ${PeriodSlaveMonth} -  ${PeriodOffset} )) -ne 0 ] ; then 
+	  eval ${post_freq}=true ; POST=true
+	  [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterMonth} / ${PeriodSlaveMonth} ))
+	fi
+      fi;;
+    *D|*d)
+      IGCM_debug_Print 1 "PeriodLength frequency ${SlaveFrequency} not compatbile with"
+      IGCM_debug_Print 1 "${flag_post} frequency : ${MasterFrequency} " ;;
+    esac ;;
+  *D|*d)
+    PeriodMasterDay=$( echo ${MasterFrequency} | sed -e "s/[dD]//" )
+    case ${SlaveFrequency} in
+    *Y|*y)
+      IGCM_debug_Print 1 "PeriodLength frequency ${SlaveFrequency} not compatbile with"
+      IGCM_debug_Print 1 "${flag_post} frequency : ${MasterFrequency} " ;;
+    *M|*m)
+      IGCM_debug_Print 1 "PeriodLength frequency ${SlaveFrequency} not compatbile with"
+      IGCM_debug_Print 1 "${flag_post} frequency : ${MasterFrequency} " ;;
+    *D|*d)
+      PeriodSlaveDay=$( echo ${SlaveFrequency} | sed -e "s/[dD]//" )
+      if [ $(( ( ${CumulPeriod} * ${PeriodSlaveDay} - ${PeriodOffset} ) % ${PeriodMasterDay} )) -eq 0 ] ;  then
+        if [ $(( ${CumulPeriod} * ${PeriodSlaveDay} - ${PeriodOffset} )) -ne 0 ] ; then
+	  eval ${post_freq}=true ; POST=true
+	  [ X${3} = XNbRebuildDir ] && NbRebuildDir=$(( ${PeriodMasterDay} / ${PeriodSlaveDay} ))
+	fi
+      fi;;
+    esac ;;
+  NONE|none)
+    ;;
+  *)
+    IGCM_debug_Print 1 "KeyWord not allowed for ${post_freq} in config.card"
+    ;;
+  esac
+
+  IGCM_debug_PopStack "IGCM_post_ModuloRuntimeFrequency"
 }
