Index: /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 777)
+++ /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 778)
@@ -17,5 +17,5 @@
   IGCM_debug_PushStack "IGCM_comp_Initialize"
 
-    # Debug Print :
+  # Debug Print :
   echo
   IGCM_debug_Print 1 "IGCM_comp_Initialize"
@@ -37,5 +37,5 @@
     IGCM_card_DefineVariableFromOption ${card} Compatibility libIGCM
 
-    eval CompatibilityTag=\${${compname}_Compatibility_libIGCM} > /dev/null 2>&1	
+    eval CompatibilityTag=\${${compname}_Compatibility_libIGCM} > /dev/null 2>&1
     if [ ! "${CompatibilityTag}" = "${libIGCM_CurrentTag}" ] ; then
       IGCM_debug_Exit "${compname}.card is not compatible with libIGCM version ${libIGCM_CurrentTag} see libIGCM FAQ http://wiki.ipsl.jussieu.fr/wiki_ipsl/IGCMG/libIGCM/DocUtilisateur/FAQ ."
@@ -116,11 +116,11 @@
     if [ X${first_option} != X"Error:" ] ; then
       if [ X${card_UserChoices[0]} != X ] ; then
-	unset card_UserChoices
+        unset card_UserChoices
       fi
       eval set +A card_UserChoices -- \${${compname}_UserChoices[*]} > /dev/null 2>&1
       IGCM_debug_Print 3 "${compname}_UserChoices_values:"
       for option in ${card_UserChoices[*]} ; do
-	IGCM_card_DefineVariableFromOption ${card} UserChoices ${option}
-	eval IGCM_debug_Print 3 "${option}=\${${compname}_UserChoices_${option}}"
+        IGCM_card_DefineVariableFromOption ${card} UserChoices ${option}
+        eval IGCM_debug_Print 3 "${option}=\${${compname}_UserChoices_${option}}"
       done
     fi
@@ -143,80 +143,80 @@
       #
       until [ $i -ge $NbFiles ]; do
-	#
-	eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	#
-	if [ X${flag_post} != XNONE ] ; then
-	  #
+        #
+        eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
+        #
+        if [ X${flag_post} != XNONE ] ; then
+          #
           # First of all
           #
-	  IGCM_card_DefineArrayFromSection ${card} ${flag_post}
-	  #
-	  # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default
-	  #
-	  # variable option allready typeset above
-	  for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do
-	    if [ ${option} = Seasonal ] ; then
-	      FoundSeasonal=true
-	      IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal
-	    fi
-	  done
-	  #
-	  if [ ! X${FoundSeasonal} = Xtrue ] ; then
-	    eval ${compname}_${flag_post}_Seasonal=ON
-	  fi
-	  #
-	  if [ $( eval echo \${${compname}_${flag_post}_Seasonal} ) = ON ] ; then
-	    Seasonal=true
-	  fi
-	  
-	  # Dimension = vide si vieille card.
-	  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.
-	    ListDimension[0]=2D
-	    ListDimension[1]=3D
-	    TimeSeries=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 3 "${Dimension} time series activated for ${flag_post}"
-		  eval TimeSeries${Dimension}=true
-		fi
-	      fi
+          IGCM_card_DefineArrayFromSection ${card} ${flag_post}
+          #
+          # Seasonal case : If option Seasonal is not found (old cards) put SEASONAL ON by default
+          #
+          # variable option allready typeset above
+          for option in $( eval echo \${${compname}_${flag_post}[*]} ) ; do
+            if [ ${option} = Seasonal ] ; then
+              FoundSeasonal=true
+              IGCM_card_DefineVariableFromOption ${card} ${flag_post} Seasonal
+            fi
+          done
+          #
+          if [ ! X${FoundSeasonal} = Xtrue ] ; then
+            eval ${compname}_${flag_post}_Seasonal=ON
+          fi
+          #
+          if [ $( eval echo \${${compname}_${flag_post}_Seasonal} ) = ON ] ; then
+            Seasonal=true
+          fi
+
+          # Dimension = vide si vieille card.
+          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.
+            ListDimension[0]=2D
+            ListDimension[1]=3D
+            TimeSeries=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 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 3 "${Dimension} time series activated with chunck for ${flag_post}"
-		  eval TimeSeriesChunck${Dimension}=true
-		  eval set +A CHUNCK${Dimension}_COMP \${CHUNCK${Dimension}_COMP[*]} ${comp}
-		  eval set +A CHUNCK${Dimension}_FLAG \${CHUNCK${Dimension}_FLAG[*]} ${i}
-		  eval set +A CHUNCK${Dimension}_NAME \${CHUNCK${Dimension}_NAME[*]} ${flag_post}
-		  eval set +A CHUNCK${Dimension}_SIZE \${CHUNCK${Dimension}_SIZE[*]} ${chunck_size}
-		fi
-	      fi
-	      (( j=j+1 ))
-	    done
-	  else
-	    ListDimension[0]=""
-	    TimeSeries=true
-	    TimeSeries2D=false
-	    TimeSeries3D=false
-	    TimeSeriesChunck2D=false
-	    TimeSeriesChunck3D=false
-	  fi
-	fi
-	(( i=i+3 ))
+              # 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 3 "${Dimension} time series activated for ${flag_post}"
+                  eval TimeSeries${Dimension}=true
+                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 3 "${Dimension} time series activated with chunck for ${flag_post}"
+                  eval TimeSeriesChunck${Dimension}=true
+                  eval set +A CHUNCK${Dimension}_COMP \${CHUNCK${Dimension}_COMP[*]} ${comp}
+                  eval set +A CHUNCK${Dimension}_FLAG \${CHUNCK${Dimension}_FLAG[*]} ${i}
+                  eval set +A CHUNCK${Dimension}_NAME \${CHUNCK${Dimension}_NAME[*]} ${flag_post}
+                  eval set +A CHUNCK${Dimension}_SIZE \${CHUNCK${Dimension}_SIZE[*]} ${chunck_size}
+                fi
+              fi
+              (( j=j+1 ))
+            done
+          else
+            ListDimension[0]=""
+            TimeSeries=true
+            TimeSeries2D=false
+            TimeSeries3D=false
+            TimeSeriesChunck2D=false
+            TimeSeriesChunck3D=false
+          fi
+        fi
+        (( i=i+3 ))
       done
     fi
@@ -235,5 +235,5 @@
 {
   IGCM_debug_PushStack "IGCM_comp_PrepareDeletedFiles" $@
-  
+
   if [ X${2} != X. ] ; then
     eval FileToBeDeleted[${#FileToBeDeleted[@]}]=$( basename ${2} ) > /dev/null 2>&1
@@ -265,50 +265,50 @@
       # Do we need to bring initial state file for this component
       if [ "${config_Restarts_OverRule}" = "y" ] ; then
-	eval do_init="n"
+        eval do_init="n"
       else
-	# Read component Restarts parameters
-	IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} Restart
-	eval do_start=\${config_${comp}_Restart} > /dev/null 2>&1
-	if [ "${do_start}" = "y" ] ; then
-	  do_init="n"
-	else
-	  do_init="y"
-	fi
+        # Read component Restarts parameters
+        IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} Restart
+        eval do_start=\${config_${comp}_Restart} > /dev/null 2>&1
+        if [ "${do_start}" = "y" ] ; then
+          do_init="n"
+        else
+          do_init="y"
+        fi
       fi
 
       if [ "${do_init}" = "y" ] ; then
-	# Define component 
-	eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
-	eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
-
-	# Debug Print :
-	IGCM_debug_Print 3 "Initialisation files ${compname}"
-
-	card=${SUBMIT_DIR}/COMP/${compname}.card
-
-	IGCM_card_DefineArrayFromOption ${card} InitialStateFiles List
-	ListFilesName=${compname}_InitialStateFiles_List
-
-	eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-	if [ X${FileName0} != X${NULL_STR} ] ; then
-	  eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-	  (( i=0 ))
-	  until [ $i -ge $NbFiles ]; do
-	    eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	    eval file_in=${file_in_}
-	    (( i_ = i+1 ))
-	    eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	    eval file_out=${file_out_}
-
-	    IGCM_sys_IsFileArchived ${file_in}
-	    if [ $? = 0 ] ; then
-	      IGCM_sys_Get ${file_in} ${file_out}
-	      #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-	    else
-	      IGCM_sys_Cp ${file_in} ${file_out}
-	    fi
-	    (( i=i+2 ))
-	  done
-	fi
+        # Define component 
+        eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+        eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
+
+        # Debug Print :
+        IGCM_debug_Print 3 "Initialisation files ${compname}"
+
+        card=${SUBMIT_DIR}/COMP/${compname}.card
+
+        IGCM_card_DefineArrayFromOption ${card} InitialStateFiles List
+        ListFilesName=${compname}_InitialStateFiles_List
+
+        eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+        if [ X${FileName0} != X${NULL_STR} ] ; then
+          eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+          (( i=0 ))
+          until [ $i -ge $NbFiles ]; do
+            eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+            eval file_in=${file_in_}
+            (( i_ = i+1 ))
+            eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+            eval file_out=${file_out_}
+
+            IGCM_sys_IsFileArchived ${file_in}
+            if [ $? = 0 ] ; then
+              IGCM_sys_Get ${file_in} ${file_out}
+              #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+            else
+              IGCM_sys_Cp ${file_in} ${file_out}
+            fi
+            (( i=i+2 ))
+          done
+        fi
       fi
     done
@@ -403,38 +403,38 @@
       (( i=0 ))
       until [ $i -ge $NbFiles ]; do
-	eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	eval file_in=${file_in_}
-	(( i_ = i+1 ))
-	eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	eval file_out=${file_out_}
-
-	# define CumulPeriod definition for this file
-	(( i__ = i+2 ))
-	eval SmoothDef=\${${ListFilesName}[$i__]}
-	IGCM_debug_Print 3 "  ${file_in} ${SmoothDef}"
-	aux=$( IGCM_SmoothModulo ${SmoothDef} ${CumulPeriod} )
-	j=1
-	for val in ${aux} ; do
-	  [ ${j} -eq 1 ] && SmoothMin=${val}
-	  [ ${j} -eq 2 ] && SmoothMax=${val}
-	  [ ${j} -eq 3 ] && ret=${val}
-	  (( j=j+1 ))
-	done
-	[ ${SmoothMax} -eq -1 ] && SmoothMax=${CumulPeriod}
-	if ( [ X${ret} = Xtrue ] || ( [ ${Period} -eq 1 ] && [ ${CumulPeriod} -ge ${SmoothMin} ] && [ ${CumulPeriod} -le ${SmoothMax} ] ) ) ; then
-
-	  IGCM_sys_IsFileArchived ${file_in}
-	  if [ $? = 0 ] ; then
-	    IGCM_sys_Get ${file_in} ${file_out}
-	    #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-	  else
-	    IGCM_sys_Cp ${file_in} ${file_out}
-	  fi
-	fi
-	(( i=i+3 ))
+        eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+        eval file_in=${file_in_}
+        (( i_ = i+1 ))
+        eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        eval file_out=${file_out_}
+
+        # define CumulPeriod definition for this file
+        (( i__ = i+2 ))
+        eval SmoothDef=\${${ListFilesName}[$i__]}
+        IGCM_debug_Print 3 "  ${file_in} ${SmoothDef}"
+        aux=$( IGCM_SmoothModulo ${SmoothDef} ${CumulPeriod} )
+        j=1
+        for val in ${aux} ; do
+          [ ${j} -eq 1 ] && SmoothMin=${val}
+          [ ${j} -eq 2 ] && SmoothMax=${val}
+          [ ${j} -eq 3 ] && ret=${val}
+          (( j=j+1 ))
+        done
+        [ ${SmoothMax} -eq -1 ] && SmoothMax=${CumulPeriod}
+        if ( [ X${ret} = Xtrue ] || ( [ ${Period} -eq 1 ] && [ ${CumulPeriod} -ge ${SmoothMin} ] && [ ${CumulPeriod} -le ${SmoothMax} ] ) ) ; then
+
+          IGCM_sys_IsFileArchived ${file_in}
+          if [ $? = 0 ] ; then
+            IGCM_sys_Get ${file_in} ${file_out}
+            #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+          else
+            IGCM_sys_Cp ${file_in} ${file_out}
+          fi
+        fi
+        (( i=i+3 ))
       done
     fi
   done
-  
+
   IGCM_debug_PopStack "IGCM_comp_GetInputSmoothFiles"
 }
@@ -477,19 +477,19 @@
       (( i=0 ))
       until [ $i -ge $NbFiles ]; do
-	eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	eval file_in=${file_in_}
-	(( i_ = i+1 ))
-	eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	eval file_out=${file_out_}
-
-	IGCM_sys_IsFileArchived ${file_in}
-	if [ $? = 0 ] ; then
-	  IGCM_sys_Get ${file_in} ${file_out}
-	  #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-	else
-	  IGCM_sys_Cp ${file_in} ${file_out}
-	fi
-
-	(( i=i+2 ))
+        eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+        eval file_in=${file_in_}
+        (( i_ = i+1 ))
+        eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        eval file_out=${file_out_}
+
+        IGCM_sys_IsFileArchived ${file_in}
+        if [ $? = 0 ] ; then
+          IGCM_sys_Get ${file_in} ${file_out}
+          #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+        else
+          IGCM_sys_Cp ${file_in} ${file_out}
+        fi
+
+        (( i=i+2 ))
       done
     fi
@@ -501,36 +501,36 @@
       ListFilesName=${compname}_BoundaryFiles_ListNonDel
       eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-      
+
       if [ X${FileName0} != X${NULL_STR} ] ; then
-	eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-	
-	(( i=0 ))
-	until [ $i -ge $NbFiles ]; do
-	  eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	  eval file_in=${file_in_}
-	  (( i_ = i+1 ))
-	  eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	  eval file_out=${file_out_}
-
-	  IGCM_sys_IsFileArchived ${file_in}
-	  if [ $? = 0 ] ; then
-	    IGCM_sys_Get ${file_in} ${file_out}
-	    #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-	  else
-	    IGCM_sys_Cp ${file_in} ${file_out}
-	  fi
-
-	  if [ X${file_out} != X. ] ; then
-	    ListFixBoundary=${ListFixBoundary}" "${file_out}
-	  else
-	    ListFixBoundary=${ListFixBoundary}" "$( basename ${file_in} )
-	  fi
-
-	  (( i=i+2 ))
-	done
+        eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+
+        (( i=0 ))
+        until [ $i -ge $NbFiles ]; do
+          eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+          eval file_in=${file_in_}
+          (( i_ = i+1 ))
+          eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+          eval file_out=${file_out_}
+
+          IGCM_sys_IsFileArchived ${file_in}
+          if [ $? = 0 ] ; then
+            IGCM_sys_Get ${file_in} ${file_out}
+            #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+          else
+            IGCM_sys_Cp ${file_in} ${file_out}
+          fi
+
+          if [ X${file_out} != X. ] ; then
+            ListFixBoundary=${ListFixBoundary}" "${file_out}
+          else
+            ListFixBoundary=${ListFixBoundary}" "$( basename ${file_in} )
+          fi
+
+          (( i=i+2 ))
+        done
       fi
     fi
   done
-  
+
   IGCM_debug_PopStack "IGCM_comp_GetInputBoundaryFiles"
 }
@@ -571,5 +571,5 @@
     IGCM_debug_Print 3 "Parameters ${compname}"
 
-    card=${SUBMIT_DIR}/COMP/${compname}.card	
+    card=${SUBMIT_DIR}/COMP/${compname}.card
 
     IGCM_card_DefineArrayFromOption ${card} ParametersFiles List
@@ -582,14 +582,14 @@
       (( i=0 ))
       until [ $i -ge $NbFiles ]; do
-	eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	eval file_in=${file_in_}
-	(( i_ = i+1 ))
-	eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	eval file_out=${file_out_} 
-
-	IGCM_sys_Cp ${file_in} ${file_out} 
-	IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-
-	(( i=i+2 ))
+        eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+        eval file_in=${file_in_}
+        (( i_ = i+1 ))
+        eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        eval file_out=${file_out_} 
+
+        IGCM_sys_Cp ${file_in} ${file_out} 
+        IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+
+        (( i=i+2 ))
       done
     fi
@@ -614,4 +614,6 @@
   typeset file_in file_out file_in_ file_out_ file_in_Name
   typeset -Z4 j4
+
+  IsMatching=""
 
   for comp in ${config_ListOfComponents[*]} ; do
@@ -632,29 +634,33 @@
 
       if [ "${config_Restarts_OverRule}" = "y" ] ; then
-	eval config_${comp}_Restart="y"
-	eval config_${comp}_RestartDate=${config_Restarts_RestartDate}
-	eval config_${comp}_RestartJobName=${config_Restarts_RestartJobName}
-	eval config_${comp}_RestartPath=${config_Restarts_RestartPath}
-	eval do_start=\${config_${comp}_Restart} > /dev/null 2>&1
-	eval CompOldName=${comp}
+        eval config_${comp}_Restart="y"
+        eval config_${comp}_RestartDate=${config_Restarts_RestartDate}
+        eval config_${comp}_RestartJobName=${config_Restarts_RestartJobName}
+        eval config_${comp}_RestartPath=${config_Restarts_RestartPath}
+        eval do_start=\${config_${comp}_Restart} > /dev/null 2>&1
+        eval CompOldName=${comp}
       else
-	# Read component Restarts parameters
-	IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} Restart
-	eval do_start=\${config_${comp}_Restart} > /dev/null 2>&1
-
-	if [ "${do_start}" = "y" ] ; then
-	  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} RestartDate
-	  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} RestartJobName
-	  IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} RestartPath
-	else
-	  eval config_${comp}_RestartDate=-1
-	  eval config_${comp}_RestartJobName=${NULL_STR}
-	  eval config_${comp}_RestartPath=${NULL_STR}
-	fi
-	IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} OldName
-	eval CompOldName=\${config_${comp}_OldName}
-	if [ X${CompOldName} = X ] ; then
-	  eval CompOldName=${comp}
-	fi
+        # Read component Restarts parameters
+        IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} Restart
+        eval do_start=\${config_${comp}_Restart} > /dev/null 2>&1
+
+        if [ "${do_start}" = "y" ] ; then
+          IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} RestartDate
+          IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} RestartJobName
+          IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} RestartPath
+        else
+          eval config_${comp}_RestartDate=-1
+          eval config_${comp}_RestartJobName=${NULL_STR}
+          eval config_${comp}_RestartPath=${NULL_STR}
+        fi
+        IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} OldName
+        eval CompOldName=\${config_${comp}_OldName}
+        if [ X${CompOldName} = X ] ; then
+          eval CompOldName=${comp}
+        fi
+
+        # Reinitialize IsMatching to allow searching for a different tar file for each component.
+        IsMatching=""
+        TarFileFound=""
       fi
 
@@ -663,77 +669,81 @@
         # Restore Restarts files
         #-----------------------
-	if ( [ X${FileName0} != X${NULL_STR} ] && [ X${FileName0} != XNONE ] ) ; then
-	  eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-
-	  (( i=1 ))
-	  until [ $i -gt $NbFiles ]; do
-	    eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	    eval file_in=${file_in_}
-	    (( i_ = i+1 ))
-	    eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	    eval file_out=${file_out_}
-	    
-	    eval Date_tmp=\${config_${comp}_RestartDate}
-	    Date_r=$( IGCM_date_ConvertFormatToGregorian ${Date_tmp} )
+        if ( [ X${FileName0} != X${NULL_STR} ] && [ X${FileName0} != XNONE ] ) ; then
+          eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+
+          (( i=1 ))
+          until [ $i -gt $NbFiles ]; do
+            eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+            eval file_in=${file_in_}
+            (( i_ = i+1 ))
+            eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+            eval file_out=${file_out_}
+
+            eval Date_tmp=\${config_${comp}_RestartDate}
+            Date_r=$( IGCM_date_ConvertFormatToGregorian ${Date_tmp} )
             # will be re-use
             eval RestartPath=\${config_${comp}_RestartPath}
             eval RestartJobName=\${config_${comp}_RestartJobName}
             #
-	    Path_r=${RestartPath}/${RestartJobName}/${CompOldName}/Restart
-	    file_in_Name=${RestartJobName}_${Date_r}_${file_in}
-
-	    extension_in=$( echo ${file_in_Name##*.} )
-	    extension_out=$( echo ${file_out##*.} )
-
-	    generic_restart_file_name_in=$( basename ${file_in_Name} .${extension_in} )
-	    generic_restart_file_name_out=$( basename ${file_out} .${extension_out} )
-	    
-	    Path_OUT=${Path_r}/${generic_restart_file_name_in}
+            Path_r=${RestartPath}/${RestartJobName}/${CompOldName}/Restart
+            file_in_Name=${RestartJobName}_${Date_r}_${file_in}
+
+            extension_in=$( echo ${file_in_Name##*.} )
+            extension_out=$( echo ${file_out##*.} )
+
+            generic_restart_file_name_in=$( basename ${file_in_Name} .${extension_in} )
+            generic_restart_file_name_out=$( basename ${file_out} .${extension_out} )
+
+            Path_OUT=${Path_r}/${generic_restart_file_name_in}
 
             if [ $( IGCM_sys_TestFileBuffer ${Path_OUT}*.${extension_in} ; echo $? ) = 0 ] ; then
-	      IGCM_debug_Print 3 "Buffered restart"
-	      Buffered=true
-	      Archived=false
-	      Tared=false
-	      nb_restart_file=$(IGCM_sys_CountFileBuffer ${Path_OUT}_????.${extension_in})
+              IGCM_debug_Print 3 "Buffered restart"
+              Buffered=true
+              Archived=false
+              Tared=false
+              nb_restart_file=$(IGCM_sys_CountFileBuffer ${Path_OUT}_????.${extension_in})
             elif [ $( IGCM_sys_TestFileArchive ${Path_OUT}*.${extension_in} ; echo $? ) = 0 ] ; then
-	      IGCM_debug_Print 3 "Archived restart"
-	      Buffered=false
-	      Archived=true
-	      Tared=false
-	      nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_OUT}_????.${extension_in})
+              IGCM_debug_Print 3 "Archived restart"
+              Buffered=false
+              Archived=true
+              Tared=false
+              nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_OUT}_????.${extension_in})
             else
               IGCM_debug_Print 3 "Tared restart"
-	      Buffered=false
-	      Archived=false
-	      Tared=true
+              Buffered=false
+              Archived=false
+              Tared=true
               # Look after the tar file we want if we did not found it already
-	      if [ X${IsMatching} = X ] ; then
-	        for PotentialTarFile in $( find ${RestartPath}/${RestartJobName}/RESTART -name "${RestartJobName}_*_restart.tar" -print ) ; do
-		  IsMatching=$( echo ${PotentialTarFile##*/} | sed "s:^${RestartJobName}_::" | sed "s:\.restart\.tar$::" | gawk -F_ -v restartdate=${Date_r} '{if (($1 < restartdate) && ($2 >= restartdate)) {print $1"_"$2}}' )
-		  if [ ! X${IsMatching} = X ] ; then
-		    TarFileFound=${PotentialTarFile}
-		    break
-		  fi
-	        done
-	      fi
+              if [ X${IsMatching} = X ] ; then
+                for PotentialTarFile in $( find ${RestartPath}/${RestartJobName}/RESTART -name "${RestartJobName}_*_restart.tar" -print ) ; do
+                  IsMatching=$( echo ${PotentialTarFile##*/} | \
+                        sed "s:^${RestartJobName}_::" | \
+                        sed "s:\.restart\.tar$::" | \
+                        gawk -F_ -v restartdate=${Date_r} \
+                             '{if (($1 < restartdate) && ($2 >= restartdate)) {print $1"_"$2}}' )
+                  if [ ! X${IsMatching} = X ] ; then
+                    TarFileFound=${PotentialTarFile}
+                    break
+                  fi
+                done
+              fi
               IGCM_debug_Print 1 "tar xvf ${TarFileFound} ${comp}_${generic_restart_file_name_in}*.${extension_in}"
-	      tar xvf ${TarFileFound} ${comp}_${generic_restart_file_name_in}*.${extension_in}
-	      nb_restart_file=$( IGCM_sys_CountFileBuffer ${comp}_${generic_restart_file_name_in}_????.${extension_in} )
-	    fi
+              tar xvf ${TarFileFound} ${comp}_${generic_restart_file_name_in}*.${extension_in}
+              nb_restart_file=$( IGCM_sys_CountFileBuffer ${comp}_${generic_restart_file_name_in}_????.${extension_in} )
+            fi
 
             if [ ${nb_restart_file} -gt 1 ] ; then
-	      j=0
-	      until [ $j -ge ${nb_restart_file} ]; do
-	        j4=${j}
-	        if [ X${Buffered} = Xtrue ] ; then
-		  IGCM_sys_GetBuffer ${Path_OUT}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
-	        elif [ X${Archived} = Xtrue ] ; then
-		  IGCM_sys_Get ${Path_OUT}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
-	        elif [ X${Tared} = Xtrue ] ; then
-		  IGCM_sys_Mv ${comp}_${generic_restart_file_name_in}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
-	        fi
-	        (( j=j+1 ))
-	      done
+              j=0
+              until [ $j -ge ${nb_restart_file} ]; do
+                j4=${j}
+                if [ X${Buffered} = Xtrue ] ; then
+                  IGCM_sys_GetBuffer ${Path_OUT}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
+                elif [ X${Archived} = Xtrue ] ; then
+                  IGCM_sys_Get ${Path_OUT}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
+                elif [ X${Tared} = Xtrue ] ; then
+                  IGCM_sys_Mv ${comp}_${generic_restart_file_name_in}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
+                fi
+                (( j=j+1 ))
+              done
 
               if [ X${NUM_PROC_OCE} != X ] ; then
@@ -743,23 +753,23 @@
                 fi
               fi
-	    else
-	      if [ X${Buffered} = Xtrue ] ; then
-	        IGCM_sys_GetBuffer ${Path_r}/${file_in_Name} ${file_out}
-	      elif [ X${Archived} = Xtrue ] ; then
-	        IGCM_sys_Get ${Path_r}/${file_in_Name} ${file_out}
-	      elif [ X${Tared} = Xtrue ] ; then
-	        IGCM_sys_Mv ${comp}_${file_in_Name} ${file_out}
-	      fi
-	    fi
-	    (( i=i+3 ))
-	  done
-
-	else
-	  if [ X${FileName0} != XNONE ] ; then
-	    IGCM_debug_Exit "IGCM_comp_GetInputRestartFiles : No file in list for ${compname}."
-	  else
-	    IGCM_debug_Print 1 "IGCM_comp_GetInputRestartFiles : NONE specified in Restart List ${compname}."
-	  fi
-	fi
+            else
+              if [ X${Buffered} = Xtrue ] ; then
+                IGCM_sys_GetBuffer ${Path_r}/${file_in_Name} ${file_out}
+              elif [ X${Archived} = Xtrue ] ; then
+                IGCM_sys_Get ${Path_r}/${file_in_Name} ${file_out}
+              elif [ X${Tared} = Xtrue ] ; then
+                IGCM_sys_Mv ${comp}_${file_in_Name} ${file_out}
+              fi
+            fi
+            (( i=i+3 ))
+          done
+
+        else
+          if [ X${FileName0} != XNONE ] ; then
+            IGCM_debug_Exit "IGCM_comp_GetInputRestartFiles : No file in list for ${compname}."
+          else
+            IGCM_debug_Print 1 "IGCM_comp_GetInputRestartFiles : NONE specified in Restart List ${compname}."
+          fi
+        fi
       fi
     elif [ ${Period} -eq 1 ] ; then
@@ -769,86 +779,86 @@
       #-----------------------
       if ( [ X${FileName0} != X${NULL_STR} ] && [ X${FileName0} != XNONE ] ) ; then
-	eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-
-	(( i=1 ))
-	until [ $i -gt $NbFiles ]; do
-	  eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	  eval file_in=${file_in_}
-	  (( i_ = i+1 ))
-	  eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	  eval file_out=${file_out_}
-	  
-	  file_in_Name=${run_Configuration_OldPrefix}_${file_in}
-	  
-	  extension_in=$( echo ${file_in_Name##*.} )
-	  extension_out=$( echo ${file_out##*.} )
-
-	  generic_restart_file_name_in=$( basename ${file_in_Name} .${extension_in} )
-	  generic_restart_file_name_out=$( basename ${file_out} .${extension_out} )
-
-	  eval Path_BUF=\${R_BUF_${comp}_R}/${generic_restart_file_name_in}
-	  eval Path_OUT=\${R_OUT_${comp}_R}/${generic_restart_file_name_in}
+        eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+
+        (( i=1 ))
+        until [ $i -gt $NbFiles ]; do
+          eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+          eval file_in=${file_in_}
+          (( i_ = i+1 ))
+          eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+          eval file_out=${file_out_}
+
+          file_in_Name=${run_Configuration_OldPrefix}_${file_in}
+
+          extension_in=$( echo ${file_in_Name##*.} )
+          extension_out=$( echo ${file_out##*.} )
+
+          generic_restart_file_name_in=$( basename ${file_in_Name} .${extension_in} )
+          generic_restart_file_name_out=$( basename ${file_out} .${extension_out} )
+
+          eval Path_BUF=\${R_BUF_${comp}_R}/${generic_restart_file_name_in}
+          eval Path_OUT=\${R_OUT_${comp}_R}/${generic_restart_file_name_in}
 
           if [ $( IGCM_sys_TestFileBuffer ${Path_BUF}*.${extension_in} ; echo $? ) = 0 ] ; then
-	    IGCM_debug_Print 3 "Buffered restart"
-	    Buffered=true
-	    Archived=false
-	    Tared=false
-	    nb_restart_file=$(IGCM_sys_CountFileBuffer ${Path_BUF}_????.${extension_in})
+            IGCM_debug_Print 3 "Buffered restart"
+            Buffered=true
+            Archived=false
+            Tared=false
+            nb_restart_file=$(IGCM_sys_CountFileBuffer ${Path_BUF}_????.${extension_in})
           elif [ $( IGCM_sys_TestFileArchive ${Path_OUT}*.${extension_in} ; echo $? ) = 0 ] ; then
-	    IGCM_debug_Print 3 "Archived restart"
-	    Buffered=false
-	    Archived=true
-	    Tared=false
-	    nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_OUT}_????.${extension_in})
-	  else
-	    IGCM_debug_Print 3 "Tared restart"
-	    Buffered=false
-	    Archived=false
-	    Tared=true
-	    # Look after the tar file we want if we did not found it already
-	    if [ X${IsMatching} = X ] ; then
-	      for PotentialTarFile in $( find ${R_SAVE}/RESTART -name "${config_UserChoices_JobName}_*_restart.tar" -print ) ; do
-		IsMatching=$( echo ${PotentialTarFile##*/} | sed "s:^${config_UserChoices_JobName}_::" | sed "s:\.restart\.tar$::" | gawk -F_ -v restartdate=${LastPeriodDateEnd} '{if (($1 < restartdate) && ($2 >= restartdate)) {print $1"_"$2}}' )
-		if [ ! X${IsMatching} = X ] ; then
-		  TarFileFound=${PotentialTarFile}
-		  break
-		fi
-	      done
-	    fi
-	    tar xvf ${TarFileFound} ${comp}_${generic_restart_file_name_in}*.${extension_in}
-	    nb_restart_file=$( IGCM_sys_CountFileBuffer ${comp}_${generic_restart_file_name_in}_????.${extension_in} )
-	  fi
-
-	  if [ ${nb_restart_file} -gt 1 ] ; then
-	    j=0
-	    until [ $j -ge ${nb_restart_file} ]; do
-	      j4=${j}
-	      if [ X${Buffered} = Xtrue ] ; then
-		IGCM_sys_GetBuffer ${Path_BUF}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
-	      elif [ X${Archived} = Xtrue ] ; then
-		IGCM_sys_Get ${Path_OUT}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
-	      elif [ X${Tared} = Xtrue ] ; then
-		IGCM_sys_Mv ${comp}_${generic_restart_file_name_in}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
-	      fi
-	      (( j=j+1 ))
-	    done
-	  else
-	    if [ X${Buffered} = Xtrue ] ; then
-	      eval IGCM_sys_GetBuffer \${R_BUF_${comp}_R}/${file_in_Name} ${file_out}
-	    elif [ X${Archived} = Xtrue ] ; then
-	      eval IGCM_sys_Get \${R_OUT_${comp}_R}/${file_in_Name} ${file_out}
-	    elif [ X${Tared} = Xtrue ] ; then
-	      IGCM_sys_Mv ${comp}_${file_in_Name} ${file_out}
-	    fi
-	  fi
-	  (( i=i+3 ))
-	done
+            IGCM_debug_Print 3 "Archived restart"
+            Buffered=false
+            Archived=true
+            Tared=false
+            nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_OUT}_????.${extension_in})
+          else
+            IGCM_debug_Print 3 "Tared restart"
+            Buffered=false
+            Archived=false
+            Tared=true
+            # Look after the tar file we want if we did not found it already
+            if [ X${IsMatching} = X ] ; then
+              for PotentialTarFile in $( find ${R_SAVE}/RESTART -name "${config_UserChoices_JobName}_*_restart.tar" -print ) ; do
+                IsMatching=$( echo ${PotentialTarFile##*/} | sed "s:^${config_UserChoices_JobName}_::" | sed "s:\.restart\.tar$::" | gawk -F_ -v restartdate=${LastPeriodDateEnd} '{if (($1 < restartdate) && ($2 >= restartdate)) {print $1"_"$2}}' )
+                if [ ! X${IsMatching} = X ] ; then
+                  TarFileFound=${PotentialTarFile}
+                  break
+                fi
+              done
+            fi
+            tar xvf ${TarFileFound} ${comp}_${generic_restart_file_name_in}*.${extension_in}
+            nb_restart_file=$( IGCM_sys_CountFileBuffer ${comp}_${generic_restart_file_name_in}_????.${extension_in} )
+          fi
+
+          if [ ${nb_restart_file} -gt 1 ] ; then
+            j=0
+            until [ $j -ge ${nb_restart_file} ]; do
+              j4=${j}
+              if [ X${Buffered} = Xtrue ] ; then
+                IGCM_sys_GetBuffer ${Path_BUF}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
+              elif [ X${Archived} = Xtrue ] ; then
+                IGCM_sys_Get ${Path_OUT}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
+              elif [ X${Tared} = Xtrue ] ; then
+                IGCM_sys_Mv ${comp}_${generic_restart_file_name_in}_${j4}.${extension_in} ${generic_restart_file_name_out}_${j4}.${extension_out}
+              fi
+              (( j=j+1 ))
+            done
+          else
+            if [ X${Buffered} = Xtrue ] ; then
+              eval IGCM_sys_GetBuffer \${R_BUF_${comp}_R}/${file_in_Name} ${file_out}
+            elif [ X${Archived} = Xtrue ] ; then
+              eval IGCM_sys_Get \${R_OUT_${comp}_R}/${file_in_Name} ${file_out}
+            elif [ X${Tared} = Xtrue ] ; then
+              IGCM_sys_Mv ${comp}_${file_in_Name} ${file_out}
+            fi
+          fi
+          (( i=i+3 ))
+        done
       else
-	if [ X${FileName0} != XNONE ] ; then
-	  IGCM_debug_Exit "IGCM_comp_GetInputRestartFiles : No file in list for ${compname}."
-	else
-	  IGCM_debug_Print 1 "IGCM_comp_GetInputRestartFiles : NONE specified in Restart List ${compname}."
-	fi
+        if [ X${FileName0} != XNONE ] ; then
+          IGCM_debug_Exit "IGCM_comp_GetInputRestartFiles : No file in list for ${compname}."
+        else
+          IGCM_debug_Print 1 "IGCM_comp_GetInputRestartFiles : NONE specified in Restart List ${compname}."
+        fi
       fi
     fi
@@ -918,5 +928,5 @@
     if [ ${DRYRUN} -le 1 ] && [ X${ExeNameIn} != X\"\" ] &&  [ ! -f ${R_EXE}/${ExeNameIn} ] ; then
       IGCM_debug_Exit "IGCM_comp_Update missing executable ${ExeNameIn}"
-    fi 
+    fi
 
     if [ ${Period} -eq 1 ] && [ -f ${R_EXE}/${ExeNameIn} ] ; then
@@ -976,5 +986,5 @@
     ${comp}_Finalize
 
-    card=${SUBMIT_DIR}/COMP/${compname}.card	
+    card=${SUBMIT_DIR}/COMP/${compname}.card
 
     # Save Restarts files
@@ -984,66 +994,66 @@
     ListFilesName=${compname}_RestartFiles_List
     eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-    
+
     if ( [ X${FileName0} != X${NULL_STR} ] && [ X${FileName0} != XNONE ] ) ; then
       eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-      
+
       (( i=0 ))
       until [ $i -ge $NbFiles ]; do
-	eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	eval file_in=${file_in_}
-
-	(( i_ = i+1 ))
-	eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	eval file_out=${file_out_}
-
-	(( i_ = i+2 ))
-	eval file_outin_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	eval file_outin=${file_outin_}
-
-	generic_restart_file_name_in=$(    basename ${file_in} .nc )
-	generic_restart_file_name_out=$(   basename ${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out} .nc )
-	generic_restart_file_name_outin=$( basename ${file_outin} .nc )
-	
-	nb_restart_file=$( ls ${generic_restart_file_name_in}_????.nc 2>/dev/null | wc -l ) 
-	if [ ${nb_restart_file} -gt 1 ] ; then
-	  j=0
-	  until [ $j -ge ${nb_restart_file} ]; do
-	    j4=${j}
-	    if [ X${Pack} = Xtrue ] ; then
-	      eval IGCM_sys_PutBuffer_Rest ${generic_restart_file_name_in}_${j4}.nc \${R_BUF_${comp}_R}/${generic_restart_file_name_out}_${j4}.nc
-	    else
-	      eval IGCM_sys_Put_Rest ${generic_restart_file_name_in}_${j4}.nc \${R_OUT_${comp}_R}/${generic_restart_file_name_out}_${j4}.nc
-	    fi
-	    if [ ! ${file_in} = ${file_outin} ] ; then
-	      if ( ${ExitFlag} ) ; then
-		echo "IGCM_sys_Mv ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_outin}_${j4}.nc not executed."
-	      else
-		IGCM_sys_Mv ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_outin}_${j4}.nc
-	      fi
-	    fi
-	    (( j=j+1 ))
-	  done
-	else
-	  if [ X${Pack} = Xtrue ] ; then
-	    eval IGCM_sys_PutBuffer_Rest ${file_in} \${R_BUF_${comp}_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out}
-	  else
-	    eval IGCM_sys_Put_Rest ${file_in} \${R_OUT_${comp}_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out}
-	  fi
-	  if [ ! ${file_in} = ${file_outin} ] ; then
-	    if ( ${ExitFlag} ) ; then
-	      echo "IGCM_sys_Mv ${file_in} ${file_outin} not executed."
-	    else
-	      IGCM_sys_Mv ${file_in} ${file_outin}
-	    fi
-	  fi
-	fi
-
-	(( i=i+3 ))
+        eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+        eval file_in=${file_in_}
+
+        (( i_ = i+1 ))
+        eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        eval file_out=${file_out_}
+
+        (( i_ = i+2 ))
+        eval file_outin_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        eval file_outin=${file_outin_}
+
+        generic_restart_file_name_in=$(    basename ${file_in} .nc )
+        generic_restart_file_name_out=$(   basename ${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out} .nc )
+        generic_restart_file_name_outin=$( basename ${file_outin} .nc )
+
+        nb_restart_file=$( ls ${generic_restart_file_name_in}_????.nc 2>/dev/null | wc -l ) 
+        if [ ${nb_restart_file} -gt 1 ] ; then
+          j=0
+          until [ $j -ge ${nb_restart_file} ]; do
+            j4=${j}
+            if [ X${Pack} = Xtrue ] ; then
+              eval IGCM_sys_PutBuffer_Rest ${generic_restart_file_name_in}_${j4}.nc \${R_BUF_${comp}_R}/${generic_restart_file_name_out}_${j4}.nc
+            else
+              eval IGCM_sys_Put_Rest ${generic_restart_file_name_in}_${j4}.nc \${R_OUT_${comp}_R}/${generic_restart_file_name_out}_${j4}.nc
+            fi
+            if [ ! ${file_in} = ${file_outin} ] ; then
+              if ( ${ExitFlag} ) ; then
+                echo "IGCM_sys_Mv ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_outin}_${j4}.nc not executed."
+              else
+                IGCM_sys_Mv ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_outin}_${j4}.nc
+              fi
+            fi
+            (( j=j+1 ))
+          done
+        else
+          if [ X${Pack} = Xtrue ] ; then
+            eval IGCM_sys_PutBuffer_Rest ${file_in} \${R_BUF_${comp}_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out}
+          else
+            eval IGCM_sys_Put_Rest ${file_in} \${R_OUT_${comp}_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out}
+          fi
+          if [ ! ${file_in} = ${file_outin} ] ; then
+            if ( ${ExitFlag} ) ; then
+              echo "IGCM_sys_Mv ${file_in} ${file_outin} not executed."
+            else
+              IGCM_sys_Mv ${file_in} ${file_outin}
+            fi
+          fi
+        fi
+
+        (( i=i+3 ))
       done
     else
       if [ X${FileName0} != XNONE ] ; then
-	IGCM_debug_Exit "IGCM_comp_Finalize : No file in restart list for ${compname}."
+        IGCM_debug_Exit "IGCM_comp_Finalize : No file in restart list for ${compname}."
       else
-	IGCM_debug_Print 1 "IGCM_comp_Finalize : NONE specified in Restart List ${compname}."
+        IGCM_debug_Print 1 "IGCM_comp_Finalize : NONE specified in Restart List ${compname}."
       fi
     fi
@@ -1061,147 +1071,147 @@
       (( i=0 ))
       until [ $i -ge $NbFiles ]; do
-	SaveOnArchive=true
-	eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
-	eval file_in=${file_in_}
-	(( i_ = i+1 ))
-	eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	eval file_out=${file_out_}
-	#
-	# Override file_out path remplacing R_SAVE by R_BUFR
-	#
-	if [ X${Pack} = Xtrue ] ; then
-	  file_out=$( echo $file_out | sed "s:^$R_SAVE:$R_BUFR:" )
-	fi
-	#
-	# Not necessarily the best option. /!\ Potential side effects /!\
-	#
-	(( i_ = i+2 ))
-	eval flag_post=\${${ListFilesName}[$i_]} > /dev/null 2>&1
-	#
-	generic_file_name=$( basename ${file_in} .nc )
-	nb_rebuild_file=$( ls | grep "^${generic_file_name}_[0-9]*.nc" | wc -l )
-	#
-	if ( [ ${nb_rebuild_file} -eq 1 ] && [ -f ${generic_file_name}_0000.nc ] ) ; then
-	  IGCM_debug_Print 2 "Parallelism with 1 process. Rebuilding ${file_in} not needed"
-	  IGCM_sys_Mv ${generic_file_name}_0000.nc ${file_in}
-	elif [ ${nb_rebuild_file} -gt 1 ] ; then
-	  IGCM_debug_Print 2 "Parallelism detected rebuilding ${file_in} is needed"
-	  if [ X${AsynchronousRebuild} = Xfalse ] ; then
-	    IGCM_debug_Print 2 "Rebuilding ${file_in} online"
-	    IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc
-	  else
-	    IGCM_debug_Print 2 "Preparing offline rebuild for ${file_in}"
-	    [ ! -d ${RUN_DIR}/REBUILD_${PeriodDateBegin} ] && IGCM_sys_Mkdir ${RUN_DIR}/REBUILD_${PeriodDateBegin}
-	    IGCM_sys_Mv ${generic_file_name}_????.nc ${RUN_DIR}/REBUILD_${PeriodDateBegin}
-
-	    # Prepare headers for the shell dedicated to offline rebuild
-	    if [ ! -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
-	      if [ $DRYRUN -le 1 ]; then
-		echo "#!/bin/ksh                                        " >  ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "function IGCM_FlushRebuild                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "{                                                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_debug_PushStack \"IGCM_FlushRebuild\"        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "echo                                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_debug_Print 1 \"IGCM_FlushRebuild\"          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "echo                                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export R_SAVE=${R_SAVE}                           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export R_BUFR=${R_BUFR}                           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+        SaveOnArchive=true
+        eval file_in_=\${${ListFilesName}[$i]} > /dev/null 2>&1
+        eval file_in=${file_in_}
+        (( i_ = i+1 ))
+        eval file_out_=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        eval file_out=${file_out_}
+        #
+        # Override file_out path remplacing R_SAVE by R_BUFR
+        #
+        if [ X${Pack} = Xtrue ] ; then
+          file_out=$( echo $file_out | sed "s:^$R_SAVE:$R_BUFR:" )
+        fi
+        #
+        # Not necessarily the best option. /!\ Potential side effects /!\
+        #
+        (( i_ = i+2 ))
+        eval flag_post=\${${ListFilesName}[$i_]} > /dev/null 2>&1
+        #
+        generic_file_name=$( basename ${file_in} .nc )
+        nb_rebuild_file=$( ls | grep "^${generic_file_name}_[0-9]*.nc" | wc -l )
+        #
+        if ( [ ${nb_rebuild_file} -eq 1 ] && [ -f ${generic_file_name}_0000.nc ] ) ; then
+          IGCM_debug_Print 2 "Parallelism with 1 process. Rebuilding ${file_in} not needed"
+          IGCM_sys_Mv ${generic_file_name}_0000.nc ${file_in}
+        elif [ ${nb_rebuild_file} -gt 1 ] ; then
+          IGCM_debug_Print 2 "Parallelism detected rebuilding ${file_in} is needed"
+          if [ X${AsynchronousRebuild} = Xfalse ] ; then
+            IGCM_debug_Print 2 "Rebuilding ${file_in} online"
+            IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc
+          else
+            IGCM_debug_Print 2 "Preparing offline rebuild for ${file_in}"
+            [ ! -d ${RUN_DIR}/REBUILD_${PeriodDateBegin} ] && IGCM_sys_Mkdir ${RUN_DIR}/REBUILD_${PeriodDateBegin}
+            IGCM_sys_Mv ${generic_file_name}_????.nc ${RUN_DIR}/REBUILD_${PeriodDateBegin}
+
+            # Prepare headers for the shell dedicated to offline rebuild
+            if [ ! -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
+              if [ $DRYRUN -le 1 ]; then
+                echo "#!/bin/ksh                                        " >  ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "function IGCM_FlushRebuild                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "{                                                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_debug_PushStack \"IGCM_FlushRebuild\"        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "echo                                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_debug_Print 1 \"IGCM_FlushRebuild\"          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "echo                                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "export R_SAVE=${R_SAVE}                           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "export R_BUFR=${R_BUFR}                           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
                 echo "export R_OUT_KSH=${R_OUT_KSH}                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
                 echo "export R_BUF_KSH=${R_BUF_KSH}                     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
                 echo "export config_UserChoices_JobName=${config_UserChoices_JobName}     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
                 echo "export config_UserChoices_SpaceName=${config_UserChoices_SpaceName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      fi
-	    fi
-	    # Prepare the shell dedicated to offline rebuild
-	    if [ $DRYRUN -le 1 ]; then
+              fi
+            fi
+            # Prepare the shell dedicated to offline rebuild
+            if [ $DRYRUN -le 1 ]; then
               if [ ${file_in} = histstn.nc ] ; then
                 echo "IGCM_sys_rebuild_station ${file_in} ${generic_file_name}_*.nc" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
               else
-	        echo "IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
               fi
               echo "IGCM_debug_Verif_Exit_Post" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	    fi
-	    #
-	    # Load Patch we need to apply and apply
-	    if [ $DRYRUN -le 1 ]; then
-	      if [ X$( eval echo \${${compname}_${flag_post}_Patches[0]} ) !=  X${NULL_STR} ]; then
-		for Patch in $( eval echo \${${compname}_${flag_post}_Patches[*]} ); do
-		  echo ". ${libIGCM_POST}/libIGCM_post/IGCM_${Patch}.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		  echo "IGCM_${Patch} ${file_in}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		  echo "IGCM_debug_Verif_Exit_Post                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		done
-	      fi
-	    fi
-	    #
-	    if [ $DRYRUN -le 1 ]; then
-	      if [ X${Pack} = Xtrue ] ; then
-		echo "IGCM_sys_PutBuffer_Out ${file_in} ${file_out}     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      else
-		echo "IGCM_sys_Put_Out ${file_in} ${file_out}           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      fi
-	      echo "IGCM_debug_Verif_Exit_Post                          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      echo "IGCM_sys_Rm ${generic_file_name}_*.nc               " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	    fi
-	    SaveOnArchive=false
-	  fi
-	fi
-	#
-	if [ ${SaveOnArchive} = true ] ; then
-	  #
-	  # Rebuild has been done online or it was not needed
-	  #
-	  # If we need to apply a patch we use TMP DIRECTORY before ARCHIVING if asynchronous rebuild is on
-	  #
-	  thereisapatch=$( eval echo \${${compname}_${flag_post}_Patches[0]} )
-	  if ( [ ! X${thereisapatch} = X${NULL_STR} ] && [ X${AsynchronousRebuild} = Xtrue ] && [ -f ${file_in} ] ) ; then
-	    [ ! -d ${RUN_DIR}/REBUILD_${PeriodDateBegin} ] && IGCM_sys_Mkdir ${RUN_DIR}/REBUILD_${PeriodDateBegin}
-	    IGCM_sys_Mv ${file_in} ${RUN_DIR}/REBUILD_${PeriodDateBegin}
-	    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=REBUILD_${PeriodDateBegin}/${file_in} > /dev/null 2>&1
-	    #
-	    if [ $DRYRUN -le 1 ]; then
-	      if [ ! -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
-		echo "#!/bin/ksh                                      " >  ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "function IGCM_FlushRebuild                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "{                                               " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_debug_PushStack \"IGCM_FlushRebuild\"      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "echo                                            " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_debug_Print 1 \"IGCM_FlushRebuild\"        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "echo                                            " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export R_SAVE=${R_SAVE}                         " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "export config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      fi
+            fi
+            #
+            # Load Patch we need to apply and apply
+            if [ $DRYRUN -le 1 ]; then
+              if [ X$( eval echo \${${compname}_${flag_post}_Patches[0]} ) !=  X${NULL_STR} ]; then
+                for Patch in $( eval echo \${${compname}_${flag_post}_Patches[*]} ); do
+                  echo ". ${libIGCM_POST}/libIGCM_post/IGCM_${Patch}.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                  echo "IGCM_${Patch} ${file_in}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                  echo "IGCM_debug_Verif_Exit_Post                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                done
+              fi
+            fi
+            #
+            if [ $DRYRUN -le 1 ]; then
+              if [ X${Pack} = Xtrue ] ; then
+                echo "IGCM_sys_PutBuffer_Out ${file_in} ${file_out}     " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              else
+                echo "IGCM_sys_Put_Out ${file_in} ${file_out}           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              fi
+              echo "IGCM_debug_Verif_Exit_Post                          " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              echo "IGCM_sys_Rm ${generic_file_name}_*.nc               " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+            fi
+            SaveOnArchive=false
+          fi
+        fi
+        #
+        if [ ${SaveOnArchive} = true ] ; then
+          #
+          # Rebuild has been done online or it was not needed
+          #
+          # If we need to apply a patch we use TMP DIRECTORY before ARCHIVING if asynchronous rebuild is on
+          #
+          thereisapatch=$( eval echo \${${compname}_${flag_post}_Patches[0]} )
+          if ( [ ! X${thereisapatch} = X${NULL_STR} ] && [ X${AsynchronousRebuild} = Xtrue ] && [ -f ${file_in} ] ) ; then
+            [ ! -d ${RUN_DIR}/REBUILD_${PeriodDateBegin} ] && IGCM_sys_Mkdir ${RUN_DIR}/REBUILD_${PeriodDateBegin}
+            IGCM_sys_Mv ${file_in} ${RUN_DIR}/REBUILD_${PeriodDateBegin}
+            eval FileToBeDeleted[${#FileToBeDeleted[@]}]=REBUILD_${PeriodDateBegin}/${file_in} > /dev/null 2>&1
+            #
+            if [ $DRYRUN -le 1 ]; then
+              if [ ! -f ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh ] ; then
+                echo "#!/bin/ksh                                      " >  ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "function IGCM_FlushRebuild                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "{                                               " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_debug_PushStack \"IGCM_FlushRebuild\"      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "echo                                            " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_debug_Print 1 \"IGCM_FlushRebuild\"        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "echo                                            " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "export R_SAVE=${R_SAVE}                         " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "export config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              fi
               #
-	      for Patch in $( eval echo \${${compname}_${flag_post}_Patches[*]} ); do
-		echo ". ${libIGCM_POST}/libIGCM_post/IGCM_${Patch}.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_${Patch} ${file_in}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		echo "IGCM_debug_Verif_Exit_Post                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      done
-	      #
-	      if [ X${Pack} = Xtrue ] ; then
-		echo "IGCM_sys_PutBuffer_Out ${file_in} ${file_out}   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      else
-		echo "IGCM_sys_Put_Out ${file_in} ${file_out}         " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      fi
-	      echo "IGCM_debug_Verif_Exit_Post                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-	      #
-	    fi
-	  else
-	    #
-	    # No Patch, No Asynchronous rebuild, online rebuild has been done or was not needed
-	    #
-	    if [ X${Pack} = Xtrue ] ; then
-	      IGCM_sys_PutBuffer_Out ${file_in} ${file_out}
-	    else
-	      IGCM_sys_Put_Out ${file_in} ${file_out}
-	    fi
-	    eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
-	    if [ ${nb_rebuild_file} -gt 1 ] ; then
-	      for DelFile in $( ls | grep "${generic_file_name}[_0-9]*.nc" ) ; do
-		eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${DelFile} > /dev/null 2>&1
-	      done
-	    fi
-	  fi
-	fi
-	(( i=i+3 ))
+              for Patch in $( eval echo \${${compname}_${flag_post}_Patches[*]} ); do
+                echo ". ${libIGCM_POST}/libIGCM_post/IGCM_${Patch}.ksh" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_${Patch} ${file_in}                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+                echo "IGCM_debug_Verif_Exit_Post                      " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              done
+              #
+              if [ X${Pack} = Xtrue ] ; then
+                echo "IGCM_sys_PutBuffer_Out ${file_in} ${file_out}   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              else
+                echo "IGCM_sys_Put_Out ${file_in} ${file_out}         " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              fi
+              echo "IGCM_debug_Verif_Exit_Post                        " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+              #
+            fi
+          else
+            #
+            # No Patch, No Asynchronous rebuild, online rebuild has been done or was not needed
+            #
+            if [ X${Pack} = Xtrue ] ; then
+              IGCM_sys_PutBuffer_Out ${file_in} ${file_out}
+            else
+              IGCM_sys_Put_Out ${file_in} ${file_out}
+            fi
+            eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
+            if [ ${nb_rebuild_file} -gt 1 ] ; then
+              for DelFile in $( ls | grep "${generic_file_name}[_0-9]*.nc" ) ; do
+                eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${DelFile} > /dev/null 2>&1
+              done
+            fi
+          fi
+        fi
+        (( i=i+3 ))
       done
     fi
@@ -1212,5 +1222,5 @@
     IGCM_card_DefineArrayFromOption ${card} OutputText List
     ListTextName=${compname}_OutputText_List
-    
+
     eval TextName0=\${${ListTextName}[0]} > /dev/null 2>&1
     if [ X${TextName0} != X${NULL_STR} ] ; then
@@ -1219,74 +1229,74 @@
       (( i=0 ))
       until [ $i -eq $NbFiles ]; do
-	eval file_in=\${${ListTextName}[$i]} > /dev/null 2>&1
-	eval file_out=${PREFIX}_${file_in}
-
-	(( i=i+1 ))
-
-	unset list_file
-	#set +A list_file -- $( ls ${file_in}* | sort 2>/dev/null )
+        eval file_in=\${${ListTextName}[$i]} > /dev/null 2>&1
+        eval file_out=${PREFIX}_${file_in}
+
+        (( i=i+1 ))
+
+        unset list_file
+        #set +A list_file -- $( ls ${file_in}* | sort 2>/dev/null )
         # result for a a1 a10 a2 with file_in=a a a1 a2 a10
-	set +A list_file -- $( [ -f ${file_in} ] && ls ${file_in} ; for i in $(ls ${file_in}* 2>/dev/null | sed "s/${file_in}//" | sort -n) ; do ls ${file_in}$i ; done )
-	nlist_file=${#list_file[@]}
-	  if [ ${nlist_file} -gt 1 ] ; then
-	    if ( ${compactoutputs} ) ; then
-	      IGCM_debug_Print 2 "Parallelism of Text Output with ${nlist_file} files."
-	      IGCM_debug_Print 2 "Compact files in ${file_out} : " ${list_file[*]}
-	      echo ${list_file[*]} > ${file_out}
-	      echo "
+        set +A list_file -- $( [ -f ${file_in} ] && ls ${file_in} ; for i in $(ls ${file_in}* 2>/dev/null | sed "s/${file_in}//" | sort -n) ; do ls ${file_in}$i ; done )
+        nlist_file=${#list_file[@]}
+        if [ ${nlist_file} -gt 1 ] ; then
+          if ( ${compactoutputs} ) ; then
+            IGCM_debug_Print 2 "Parallelism of Text Output with ${nlist_file} files."
+            IGCM_debug_Print 2 "Compact files in ${file_out} : " ${list_file[*]}
+            echo ${list_file[*]} > ${file_out}
+            echo "
 " >> ${file_out}
-	      
-	      (( i_ = 0 ))
-	      for file in ${list_file[@]}
-	      do
-		echo "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " >> ${file_out}
-		echo "| " ${i_} " " ${file} >> ${file_out}
-		echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " >> ${file_out}
-		cat ${file} | sed "s/\(.*\)/${i_}\1/" ${file} >> ${file_out}
-		echo "
+
+            (( i_ = 0 ))
+            for file in ${list_file[@]}
+            do
+              echo "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ " >> ${file_out}
+              echo "| " ${i_} " " ${file} >> ${file_out}
+              echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " >> ${file_out}
+              cat ${file} | sed "s/\(.*\)/${i_}\1/" ${file} >> ${file_out}
+              echo "
 " >> ${file_out}
-		eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
-		    (( i_ = i_ + 1 ))
-	      done
-	      if [ X${Pack} = Xtrue ] ; then
-		eval IGCM_sys_PutBuffer_Out ${file_out} \${R_BUF_${comp}_D}/${file_out}
-	      else
-		eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}_D}/${file_out}
-	      fi
-	      eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_out}" > /dev/null 2>&1
-
-	      if ( ${ExecutionFail} ) ; then
-		IGCM_sys_Cp ${file_out} ${SUBMIT_DIR}/Debug
-	      fi
-	    else
-	      for file in ${list_file[@]}
-	      do
-		if [ X${Pack} = Xtrue ] ; then
-		  eval IGCM_sys_PutBuffer_Out ${file} \${R_BUF_${comp}_D}/${PREFIX}_${file}
-		else
-		  eval IGCM_sys_Put_Out ${file} \${R_OUT_${comp}_D}/${PREFIX}_${file}
-		fi
-		eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
-
-		if ( ${ExecutionFail} ) ; then
-		  IGCM_sys_Cp ${file} ${SUBMIT_DIR}/Debug/${PREFIX}_${file}
-		fi
-	      done
-	    fi
-	  else
-	    if ( [ -f ${file_in}_0000 ] || [ -f ${file_in}0 ] ) ; then
-	      eval IGCM_sys_Mv ${file_in}* ${file_in}
-	    fi
-	    if [ X${Pack} = Xtrue ] ; then
-	      eval IGCM_sys_PutBuffer_Out ${file_in} \${R_BUF_${comp}_D}/${file_out}
-	    else
-	      eval IGCM_sys_Put_Out ${file_in} \${R_OUT_${comp}_D}/${file_out}
-	    fi
-	    eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
-
-	    if ( ${ExecutionFail} ) ; then
-	      IGCM_sys_Cp ${file_in} ${SUBMIT_DIR}/Debug/${file_out}
-	    fi
-	  fi
+              eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
+                  (( i_ = i_ + 1 ))
+            done
+            if [ X${Pack} = Xtrue ] ; then
+              eval IGCM_sys_PutBuffer_Out ${file_out} \${R_BUF_${comp}_D}/${file_out}
+            else
+              eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}_D}/${file_out}
+            fi
+            eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_out}" > /dev/null 2>&1
+
+            if ( ${ExecutionFail} ) ; then
+              IGCM_sys_Cp ${file_out} ${SUBMIT_DIR}/Debug
+            fi
+          else
+            for file in ${list_file[@]}
+            do
+              if [ X${Pack} = Xtrue ] ; then
+                eval IGCM_sys_PutBuffer_Out ${file} \${R_BUF_${comp}_D}/${PREFIX}_${file}
+              else
+                eval IGCM_sys_Put_Out ${file} \${R_OUT_${comp}_D}/${PREFIX}_${file}
+              fi
+              eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
+
+              if ( ${ExecutionFail} ) ; then
+                IGCM_sys_Cp ${file} ${SUBMIT_DIR}/Debug/${PREFIX}_${file}
+              fi
+            done
+          fi
+        else
+          if ( [ -f ${file_in}_0000 ] || [ -f ${file_in}0 ] ) ; then
+            eval IGCM_sys_Mv ${file_in}* ${file_in}
+          fi
+          if [ X${Pack} = Xtrue ] ; then
+            eval IGCM_sys_PutBuffer_Out ${file_in} \${R_BUF_${comp}_D}/${file_out}
+          else
+            eval IGCM_sys_Put_Out ${file_in} \${R_OUT_${comp}_D}/${file_out}
+          fi
+          eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
+
+          if ( ${ExecutionFail} ) ; then
+            IGCM_sys_Cp ${file_in} ${SUBMIT_DIR}/Debug/${file_out}
+          fi
+        fi
       done
     fi
