Index: branches/libIGCM_MPI_OpenMP/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- branches/libIGCM_MPI_OpenMP/libIGCM_comp/libIGCM_comp.ksh	(revision 561)
+++ branches/libIGCM_MPI_OpenMP/libIGCM_comp/libIGCM_comp.ksh	(revision 571)
@@ -15,187 +15,217 @@
 function IGCM_comp_Initialize
 {
-    IGCM_debug_PushStack "IGCM_comp_Initialize"
+  IGCM_debug_PushStack "IGCM_comp_Initialize"
 
     # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_Initialize"
+  echo
+
+  typeset comp compname comptagname CompatibilityTag auxprint card_UserChoices first_option option i j
+  for comp in ${config_ListOfComponents[*]} ; do
+    # Debug Print
+    IGCM_debug_Print 1 "Initialize ${comp} : ${compname} component."
+
+    # Define component 
+    IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card ListOfComponents ${comp}
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
+
+    # Read libIGCM compatibility version in ${compname}.card
+    card=${SUBMIT_DIR}/COMP/${compname}.card
+    IGCM_card_DefineVariableFromOption ${card} Compatibility libIGCM
+
+    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 ."
+    fi
+
+    # Manage component executable
+    IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card Executable ${comp}
+
+    # Read component Write Frequency in config.card
+    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} WriteFrequency
+    # Debug Print :
+    eval auxprint=\${config_${comp}_WriteFrequency}
+    IGCM_debug_Print 1 "Write frequency for ${compname} : ${auxprint} "
+    #2> /dev/null
+
+    # Debug Print :
+    IGCM_debug_Print 2 "Initialize following component library"
+
+    # Source drivers in directory DRIVER if it exist
+    # else source them from directory COMP
+    if [ -d ${SUBMIT_DIR}/DRIVER ] ; then
+      IGCM_debug_Print 2 ${SUBMIT_DIR}/DRIVER/${compname}.driver
+      # Source component library
+      . ${SUBMIT_DIR}/DRIVER/${compname}.driver
+    else
+      IGCM_debug_Print 2 ${SUBMIT_DIR}/COMP/${compname}.driver
+      # Source component library
+      . ${SUBMIT_DIR}/COMP/${compname}.driver
+    fi
+    IGCM_debug_Print 3 "With tag : ${comptagname}"
+
+    # Debug Print
+    IGCM_debug_Print 3 "Initialize ${comp} output directory."
+
+    # Define ARCHIVED Dirs
+    eval R_OUT_${comp}=${R_SAVE}/${comp}
+    eval IGCM_sys_MkdirArchive \${R_OUT_${comp}}
+
+    eval R_OUT_${comp}_O=\${R_OUT_${comp}}/Output
+    eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_O}
+
+    eval R_OUT_${comp}_R=\${R_OUT_${comp}}/Restart
+    eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_R}
+
+    eval R_OUT_${comp}_D=\${R_OUT_${comp}}/Debug
+    eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_D}
+
+    eval R_OUT_${comp}_O_I=\${R_OUT_${comp}_O}/INS
+    eval R_OUT_${comp}_O_H=\${R_OUT_${comp}_O}/HF
+    eval R_OUT_${comp}_O_D=\${R_OUT_${comp}_O}/DA
+    eval R_OUT_${comp}_O_M=\${R_OUT_${comp}_O}/MO
+    eval R_OUT_${comp}_O_Y=\${R_OUT_${comp}_O}/YE
+
+    # Define BUFFERED Dirs
+    eval R_BUF_${comp}=${R_BUFR}/${comp}
+    eval IGCM_sys_Mkdir \${R_BUF_${comp}}
+
+    eval R_BUF_${comp}_O=\${R_BUF_${comp}}/Output
+    eval IGCM_sys_Mkdir \${R_BUF_${comp}_O}
+
+    eval R_BUF_${comp}_R=\${R_BUF_${comp}}/Restart
+    eval IGCM_sys_Mkdir \${R_BUF_${comp}_R}
+
+    eval R_BUF_${comp}_D=\${R_BUF_${comp}}/Debug
+    eval IGCM_sys_Mkdir \${R_BUF_${comp}_D}
+
+    eval R_BUF_${comp}_O_I=\${R_BUF_${comp}_O}/INS
+    eval R_BUF_${comp}_O_H=\${R_BUF_${comp}_O}/HF
+    eval R_BUF_${comp}_O_D=\${R_BUF_${comp}_O}/DA
+    eval R_BUF_${comp}_O_M=\${R_BUF_${comp}_O}/MO
+    eval R_BUF_${comp}_O_Y=\${R_BUF_${comp}_O}/YE
+
+    # Read UserChoices section of component card
+    IGCM_debug_Print 2 "DefineArrayFromSection : ${compname}_UserChoices ${card}"
+    IGCM_card_DefineArrayFromSection ${card} UserChoices
+    eval first_option=\${${compname}_UserChoices[0]} > /dev/null 2>&1
+    # If section is not empty we define corresponding variables
+    if [ X${first_option} != X"Error:" ] ; then
+      if [ X${card_UserChoices[0]} != X ] ; then
+	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}}"
+      done
+    fi
+
+    # Read and Build Output File stuff
+    IGCM_debug_Print 2 "DefineArrayFromOption  : ${compname}_OutputFiles ${card}"
+    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
+    ListFilesName=${compname}_OutputFiles_List
+    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+    #
+    if [ X${FileName0} != X${NULL_STR} ] ; then
+      #
+      #IGCM_debug_Print 1 "Component      : ${compname}"
+      #
+      # INITIALISATION
+      #
+      eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+      #
+      i=2
+      #
+      until [ $i -ge $NbFiles ]; do
+	#
+	eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
+	#
+	if [ X${flag_post} != XNONE ] ; then
+	  #
+          # First of all
+          #
+	  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
+              #
+	      # 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
+    # Debug Print
+    IGCM_debug_Print 3 "Initialize ${compname} with driver."
+    # INIT component
+    ${comp}_Initialize
     echo
-    IGCM_debug_Print 1 "IGCM_comp_Initialize"
-    echo
-
-    typeset comp compname comptagname CompatibilityTag auxprint card_UserChoices first_option option i j
-    for comp in ${config_ListOfComponents[*]} ; do
-        # Debug Print
-	IGCM_debug_Print 1 ${comp}
-	# Define component 
-        IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card ListOfComponents ${comp}
-	eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
-	eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
-
-	# Read libIGCM compatibility version in ${compname}.card
-	card=${SUBMIT_DIR}/COMP/${compname}.card
-	IGCM_card_DefineVariableFromOption ${card} Compatibility libIGCM
-
-	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 ."
-	fi
-
-	# Manage component executable
-	IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/config.card Executable ${comp}
-
-	# Read component Write Frequency in config.card
-	IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ${comp} WriteFrequency
-	# Debug Print :
-	eval auxprint=\${config_${comp}_WriteFrequency}
-	IGCM_debug_Print 1 "Write frequency for ${compname} : ${auxprint} "
-        #2> /dev/null
-
-	# Debug Print :
-	IGCM_debug_Print 2 "Initialize following component library"
-	IGCM_debug_Print 2 ${SUBMIT_DIR}/COMP/${compname}.driver
-	IGCM_debug_Print 3 "With tag : ${comptagname}"
-	# Source component library
-	. ${SUBMIT_DIR}/COMP/${compname}.driver
-
-	# Debug Print
-	IGCM_debug_Print 3 "Initialize ${comp} output directory."
-	# Define Dirs	
-	eval R_OUT_${comp}=${R_SAVE}/${comp}
-	eval IGCM_sys_MkdirArchive \${R_OUT_${comp}}
-
-	eval R_OUT_${comp}_O=\${R_OUT_${comp}}/Output
-	eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_O}
-
-	eval R_OUT_${comp}_R=\${R_OUT_${comp}}/Restart
-	eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_R}
-
-	eval R_OUT_${comp}_D=\${R_OUT_${comp}}/Debug
-	eval IGCM_sys_MkdirArchive \${R_OUT_${comp}_D}
-
- 	eval R_OUT_${comp}_O_I=\${R_OUT_${comp}_O}/INS
- 	eval R_OUT_${comp}_O_H=\${R_OUT_${comp}_O}/HF
- 	eval R_OUT_${comp}_O_D=\${R_OUT_${comp}_O}/DA
- 	eval R_OUT_${comp}_O_M=\${R_OUT_${comp}_O}/MO
-	eval R_OUT_${comp}_O_Y=\${R_OUT_${comp}_O}/YE
-
-	# Read UserChoices section of component card
-	IGCM_debug_Print 2 "DefineArrayFromSection : ${compname}_UserChoices ${card}"
-	IGCM_card_DefineArrayFromSection ${card} UserChoices
-	eval first_option=\${${compname}_UserChoices[0]} > /dev/null 2>&1
-	# If section is not empty we define corresponding variables
-	if [ X${first_option} != X"Error:" ] ; then
-	    if [ X${card_UserChoices[0]} != X ] ; then
-		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}}"
-	    done
-	fi
-
-	# Read and Build Output File stuff
-	IGCM_debug_Print 2 "DefineArrayFromOption  : ${compname}_OutputFiles ${card}"
-	IGCM_card_DefineArrayFromOption ${card} OutputFiles List
-	ListFilesName=${compname}_OutputFiles_List
-	eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-	#
-	if [ X${FileName0} != X${NULL_STR} ] ; then
-            #
-	    #IGCM_debug_Print 1 "Component      : ${compname}"
-	    #
-	    # INITIALISATION
-	    #
-	    eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-	    #
-	    i=2
-	    #
-	    until [ $i -ge $NbFiles ]; do
-	        #
-		eval flag_post=\${${ListFilesName}[$i]} > /dev/null 2>&1
-		#
-		if [ X${flag_post} != XNONE ] ; then
-		    #
-                    # First of all
-                    #
-		    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
-                            #
-	                    # 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
-	# Debug Print
-	IGCM_debug_Print 3 "Initialize ${compname} with driver."
-	# INIT component
-	${comp}_Initialize
-	echo
-    done
-
-    IGCM_debug_PopStack "IGCM_comp_Initialize"
+  done
+
+  IGCM_debug_PopStack "IGCM_comp_Initialize"
 }
 
@@ -203,13 +233,13 @@
 function IGCM_comp_PrepareDeletedFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_PrepareDeletedFiles" $@
-    
-    if [ X${2} != X. ] ; then
-	eval FileToBeDeleted[${#FileToBeDeleted[@]}]=$( basename ${2} ) > /dev/null 2>&1
-    else
-	eval FileToBeDeleted[${#FileToBeDeleted[@]}]=$( basename ${1} ) > /dev/null 2>&1
-    fi
-
-    IGCM_debug_PopStack "IGCM_comp_PrepareDeletedFiles"
+  IGCM_debug_PushStack "IGCM_comp_PrepareDeletedFiles" $@
+  
+  if [ X${2} != X. ] ; then
+    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=$( basename ${2} ) > /dev/null 2>&1
+  else
+    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=$( basename ${1} ) > /dev/null 2>&1
+  fi
+
+  IGCM_debug_PopStack "IGCM_comp_PrepareDeletedFiles"
 }
 
@@ -217,67 +247,71 @@
 function IGCM_comp_GetInputInitialStateFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_GetInputInitialStateFiles"
-
-    # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_GetInputInitialStateFiles"
-    echo
-
-    # Only the first time step need InitialStateFiles 
-    # otherwise it's BoundaryConditions
-    if ( ${FirstInitialize} ) ; then
-      typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ 
-      typeset file_in_ file_in file_out_ file_out do_init 
-      for comp in ${config_ListOfComponents[*]} ; do
-	  # Initialize
+  IGCM_debug_PushStack "IGCM_comp_GetInputInitialStateFiles"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_GetInputInitialStateFiles"
+  echo
+
+  # Only the first time step need InitialStateFiles 
+  # otherwise it's BoundaryConditions
+  if ( ${FirstInitialize} ) ; then
+    typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ 
+    typeset file_in_ file_in file_out_ file_out do_init 
+    for comp in ${config_ListOfComponents[*]} ; do
+      # Initialize
+      do_init="y"
+      # Do we need to bring initial state file for this component
+      if [ "${config_Restarts_OverRule}" = "y" ] ; then
+	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"
-	  # Do we need to bring initial state file for this component
-	  if [ "${config_Restarts_OverRule}" = "y" ] ; then
-	      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
-	  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_Get ${file_in} ${file_out}
-		      #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-
-		      (( i=i+2 ))
-		  done
-	      fi
-	  fi
-      done
-    fi
-    IGCM_debug_PopStack "IGCM_comp_GetInputInitialStateFiles"
+	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
+      fi
+    done
+  fi
+  IGCM_debug_PopStack "IGCM_comp_GetInputInitialStateFiles"
 }
 
@@ -301,39 +335,37 @@
 function IGCM_SmoothModulo
 {
-    IGCM_debug_PushStack "IGCM_SmoothModulo"
-    typeset defVector ModValue
-
-    eval set +A defVector -- $( echo "${1}" | \
-	gawk -F ':' '{print ($1 == "" ? 1 : $1) " " (NF==3 ? ($2 == "" ? 1 : $2) : 1) " " (NF==3 ? ($3 == "" ? -1 : $3) : ($2 == "" ? -1 : $2))}' )
-
-    # Save Smooth Min and Max. Needed to call IGCM_sys_Get when appropriate
-    arr[1]=${defVector[0]}
-    arr[2]=${defVector[2]}
-
-    # Test limits : 
-    # ${defVector[0]} <= ${2} <= ${defVector[2]} 
-    #                                      or ${defVector[2]} == -1
-    if ( [ ${2} -ge ${defVector[0]} ] && \
-         ( [ ${2} -le ${defVector[2]} ] || \
-           [ ${defVector[2]} -lt 0 ] ) ) ; then
-        # Test modulo
-        ModValue=$( expr \( ${2} - ${defVector[0]} \) % ${defVector[1]} )
-        if [ ${ModValue} -eq 0 ] ;  then
-	    arr[3]=true
-	    echo ${arr[@]}
-	    IGCM_debug_PopStack "IGCM_SmoothModulo"
-	    return 1
-	else
-	    arr[3]=false
-	    echo ${arr[@]}
-	    IGCM_debug_PopStack "IGCM_SmoothModulo"
-	    return 0
-	fi
+  IGCM_debug_PushStack "IGCM_SmoothModulo"
+  typeset defVector ModValue
+
+  eval set +A defVector -- $( echo "${1}" | \
+    gawk -F ':' '{print ($1 == "" ? 1 : $1) " " (NF==3 ? ($2 == "" ? 1 : $2) : 1) " " (NF==3 ? ($3 == "" ? -1 : $3) : ($2 == "" ? -1 : $2))}' )
+
+  # Save Smooth Min and Max. Needed to call IGCM_sys_Get when appropriate
+  arr[1]=${defVector[0]}
+  arr[2]=${defVector[2]}
+
+  # Test limits : 
+  # ${defVector[0]} <= ${2} <= ${defVector[2]} 
+  #          or ${defVector[2]} == -1
+  if ( [ ${2} -ge ${defVector[0]} ] && ( [ ${2} -le ${defVector[2]} ] || [ ${defVector[2]} -lt 0 ] ) ) ; then
+    # Test modulo
+    ModValue=$( expr \( ${2} - ${defVector[0]} \) % ${defVector[1]} )
+    if [ ${ModValue} -eq 0 ] ;  then
+      arr[3]=true
+      echo ${arr[@]}
+      IGCM_debug_PopStack "IGCM_SmoothModulo"
+      return 1
     else
-	arr[3]=false
-	echo ${arr[@]}
-	IGCM_debug_PopStack "IGCM_SmoothModulo"
-	return 0
-    fi
+      arr[3]=false
+      echo ${arr[@]}
+      IGCM_debug_PopStack "IGCM_SmoothModulo"
+      return 0
+    fi
+  else
+    arr[3]=false
+    echo ${arr[@]}
+    IGCM_debug_PopStack "IGCM_SmoothModulo"
+    return 0
+  fi
 }
 
@@ -341,63 +373,68 @@
 function IGCM_comp_GetInputSmoothFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_GetInputSmoothFiles"
+  IGCM_debug_PushStack "IGCM_comp_GetInputSmoothFiles"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_GetInputSmoothFiles"
+  echo
+
+  typeset comp compname comptagname card ListFilesName FileName0 NbFiles j i i_ i__
+  typeset file_in_ file_in file_out_ file_out ret SmoothDef aux val
+
+  for comp in ${config_ListOfComponents[*]} ; do
+    # Define component
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
 
     # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_GetInputSmoothFiles"
-    echo
-
-    typeset comp compname comptagname card ListFilesName FileName0 NbFiles j i i_ i__
-    typeset file_in_ file_in file_out_ file_out ret SmoothDef aux val
-
-    for comp in ${config_ListOfComponents[*]} ; do
-	# 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 "Smooth files ${compname}"
-
-	card=${SUBMIT_DIR}/COMP/${compname}.card
-
-	IGCM_card_DefineArrayFromOption ${card} SmoothFiles List
-	ListFilesName=${compname}_SmoothFiles_List
- 	eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-
-	if ( [ X${FileName0} != X${NULL_STR} ] && [ X${FileName0} != X"Section" ] ) ; 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_}
-
-		# 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
-		#if ( [ X${ret} = Xtrue ] || [ ${Period} -eq 1 ] ) ; then
-		    IGCM_sys_Get ${file_in} ${file_out}
-		    #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-		fi
-		(( i=i+3 ))
-	    done
+    IGCM_debug_Print 3 "Smooth files ${compname}"
+
+    card=${SUBMIT_DIR}/COMP/${compname}.card
+
+    IGCM_card_DefineArrayFromOption ${card} SmoothFiles List
+    ListFilesName=${compname}_SmoothFiles_List
+    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+
+    if ( [ X${FileName0} != X${NULL_STR} ] && [ X${FileName0} != X"Section" ] ) ; 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_}
+
+	# 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
-    done
-    
-    IGCM_debug_PopStack "IGCM_comp_GetInputSmoothFiles"
+	(( i=i+3 ))
+      done
+    fi
+  done
+  
+  IGCM_debug_PopStack "IGCM_comp_GetInputSmoothFiles"
 }
 
@@ -405,84 +442,90 @@
 function IGCM_comp_GetInputBoundaryFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_GetInputBoundaryFiles"
+  IGCM_debug_PushStack "IGCM_comp_GetInputBoundaryFiles"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_GetInputBoundaryFiles"
+  echo
+
+  typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ 
+  typeset file_in_ file_in file_out_ file_out 
+
+  if [ ${Period} = 1 ]; then
+    ListFixBoundary=" "
+  fi
+
+  for comp in ${config_ListOfComponents[*]} ; do
+
+    # Define component
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
 
     # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_GetInputBoundaryFiles"
-    echo
-
-    typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ 
-    typeset file_in_ file_in file_out_ file_out 
-
+    IGCM_debug_Print 3 "Boundary files ${compname}"
+
+    card=${SUBMIT_DIR}/COMP/${compname}.card
+
+    IGCM_card_DefineArrayFromOption ${card} BoundaryFiles List
+    ListFilesName=${compname}_BoundaryFiles_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_Get ${file_in} ${file_out}
+	IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+
+	(( i=i+2 ))
+      done
+    fi
+
+    # Get non deleted files
     if [ ${Period} = 1 ]; then
-	ListFixBoundary=" "
-    fi
-
-    for comp in ${config_ListOfComponents[*]} ; do
-
-	# 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 "Boundary files ${compname}"
-
-	card=${SUBMIT_DIR}/COMP/${compname}.card
-
-	IGCM_card_DefineArrayFromOption ${card} BoundaryFiles List
-	ListFilesName=${compname}_BoundaryFiles_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_Get ${file_in} ${file_out}
-		IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-
-		(( i=i+2 ))
-	    done
-	fi
-
-	# Get non deleted files
-	if [ ${Period} = 1 ]; then
-
-	    IGCM_card_DefineArrayFromOption ${card} BoundaryFiles ListNonDel
-	    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_Get ${file_in} ${file_out}
-
-		    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"
+
+      IGCM_card_DefineArrayFromOption ${card} BoundaryFiles ListNonDel
+      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
+      fi
+    fi
+  done
+  
+  IGCM_debug_PopStack "IGCM_comp_GetInputBoundaryFiles"
 }
 
@@ -490,15 +533,15 @@
 function IGCM_comp_DelFixeBoundaryFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_DelFixeBoundaryFiles"
-
-    # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_DelFixeBoundaryFiles"
-    echo
-
-    ls -l ${ListFixBoundary}
-    rm -f ${ListFixBoundary}
-
-    IGCM_debug_PopStack "IGCM_comp_DelFixeBoundaryFiles"
+  IGCM_debug_PushStack "IGCM_comp_DelFixeBoundaryFiles"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_DelFixeBoundaryFiles"
+  echo
+
+  ls -l ${ListFixBoundary}
+  rm -f ${ListFixBoundary}
+
+  IGCM_debug_PopStack "IGCM_comp_DelFixeBoundaryFiles"
 }
 
@@ -506,46 +549,46 @@
 function IGCM_comp_GetInputParametersFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_GetInputParametersFiles"
+  IGCM_debug_PushStack "IGCM_comp_GetInputParametersFiles"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_GetInputParametersFiles"
+  echo
+
+  typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ file_in file_out
+  for comp in ${config_ListOfComponents[*]} ; do
+    # Define component 
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
 
     # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_GetInputParametersFiles"
-    echo
-
-    typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ file_in file_out
-    for comp in ${config_ListOfComponents[*]} ; do
-	# 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 "Parameters ${compname}"
-
-	card=${SUBMIT_DIR}/COMP/${compname}.card	
-
-	IGCM_card_DefineArrayFromOption ${card} ParametersFiles List
-	ListFilesName=${compname}_ParametersFiles_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_Cp ${file_in} ${file_out} 
-		IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-
-		(( i=i+2 ))
-	    done
-	fi
-    done
-
-    IGCM_debug_PopStack "IGCM_comp_GetInputParametersFiles"
+    IGCM_debug_Print 3 "Parameters ${compname}"
+
+    card=${SUBMIT_DIR}/COMP/${compname}.card	
+
+    IGCM_card_DefineArrayFromOption ${card} ParametersFiles List
+    ListFilesName=${compname}_ParametersFiles_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_Cp ${file_in} ${file_out} 
+	IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+
+	(( i=i+2 ))
+      done
+    fi
+  done
+
+  IGCM_debug_PopStack "IGCM_comp_GetInputParametersFiles"
 }
 
@@ -553,167 +596,178 @@
 function IGCM_comp_GetInputRestartFiles
 {
-    IGCM_debug_PushStack "IGCM_comp_GetInputRestartFiles"
+  IGCM_debug_PushStack "IGCM_comp_GetInputRestartFiles"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_GetInputRestartFiles"
+  echo
+
+  typeset Date_tmp Date_r Path_r do_start CompOldName Path_OUT Path_BUF Buffered
+  typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ 
+  typeset file_in file_out file_in_ file_out_ file_in_Name
+  typeset -Z4 j4
+
+  for comp in ${config_ListOfComponents[*]} ; do
+    # Define component 
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
+    #
+    card=${SUBMIT_DIR}/COMP/${compname}.card
+    #
+    IGCM_card_DefineArrayFromOption ${card} RestartFiles List
+    ListFilesName=${compname}_RestartFiles_List
+    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
 
     # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_GetInputRestartFiles"
-    echo
-
-    typeset Date_tmp Date_r Path_r do_start CompOldName Path_temp
-    typeset comp compname comptagname card ListFilesName FileName0 NbFiles i i_ 
-    typeset file_in file_out file_in_ file_out_ file_in_Name
-    typeset -Z4 j4
-
-    for comp in ${config_ListOfComponents[*]} ; do
-	# Define component 
-	eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
-	eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
-	#
-	card=${SUBMIT_DIR}/COMP/${compname}.card
-	#
-	IGCM_card_DefineArrayFromOption ${card} RestartFiles List
-	ListFilesName=${compname}_RestartFiles_List
-	eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-
-	# Debug Print :
-	IGCM_debug_Print 3 "restart ${compname}"
-
-	if ( ${FirstInitialize} ) ; then
-
-	    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}
+    IGCM_debug_Print 3 "restart ${compname}"
+
+    if ( ${FirstInitialize} ) ; then
+
+      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}
+      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
+      fi
+
+      if [ "${do_start}" = "y" ] ; then
+
+	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} )
+	    eval Path_r=\${config_${comp}_RestartPath}/\${config_${comp}_RestartJobName}/${CompOldName}/Restart
+	    eval file_in_Name=\${config_${comp}_RestartJobName}_${Date_r}_${file_in}
+
+	    generic_restart_file_name_in=$( basename ${file_in_Name} .nc )
+	    generic_restart_file_name_out=$( basename ${file_out} .nc )
+	    
+	    eval Path_OUT=\${Path_r}/${generic_restart_file_name_in}
+	    nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_OUT}_????.nc)
+
+	    if [ ${nb_restart_file} -gt 1 ] ; then
+	      j=0
+	      until [ $j -ge $nb_restart_file ]; do
+		j4=${j}
+		eval IGCM_sys_Get ${Path_r}/${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
+		#IGCM_comp_PrepareDeletedFiles ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
+		#eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${generic_restart_file_name_out}_${j4}.nc" > /dev/null 2>&1
+		(( j=j+1 ))
+	      done
 	    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
-	    fi
-
-	    if [ "${do_start}" = "y" ] ; then
-
-		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} )
-			eval Path_r=\${config_${comp}_RestartPath}/\${config_${comp}_RestartJobName}/${CompOldName}/Restart
-			eval file_in_Name=\${config_${comp}_RestartJobName}_${Date_r}_${file_in}
-
-			generic_restart_file_name_in=$( basename ${file_in_Name} .nc )
-			generic_restart_file_name_out=$( basename ${file_out} .nc )
-			
-			eval Path_temp=\${Path_r}/${generic_restart_file_name_in}
-			nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_temp}_????.nc)
-
-			if [ ${nb_restart_file} -gt 1 ] ; then
-			    j=0
-			    until [ $j -ge $nb_restart_file ]; do
-				j4=${j}
-				eval IGCM_sys_Get ${Path_r}/${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
-				#IGCM_comp_PrepareDeletedFiles ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
-				#eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${generic_restart_file_name_out}_${j4}.nc" > /dev/null 2>&1
-				(( j=j+1 ))
-			    done
-			else
-			    eval IGCM_sys_Get ${Path_r}/${file_in_Name} ${file_out}  
-			    #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-			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
-            # if not FirstInitialize and first loop of this job
-
-	    # 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_}
-		    
-		    file_in_Name=${run_Configuration_OldPrefix}_${file_in}
-
-		    generic_restart_file_name_in=$( basename ${file_in_Name} .nc )
-		    generic_restart_file_name_out=$( basename ${file_out} .nc )
-
-		    eval Path_temp=\${R_OUT_${comp}_R}/${generic_restart_file_name_in}
-		    nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_temp}_????.nc)
-
-		    if [ ${nb_restart_file} -gt 1 ] ; then
-			j=0
-			until [ $j -ge $nb_restart_file ]; do
-			    j4=${j}
-			    eval IGCM_sys_Get \${R_OUT_${comp}_R}/${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
-			    #IGCM_comp_PrepareDeletedFiles ${generic_restart_file_name_in}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
-			    #eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${generic_restart_file_name_out}_${j4}.nc" > /dev/null 2>&1
-
-			    (( j=j+1 ))
-			done
-		    else
-			eval IGCM_sys_Get \${R_OUT_${comp}_R}/${file_in_Name} ${file_out}
-			#IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
-		    fi
-
-		    (( i=i+3 ))
-		done
+	      eval IGCM_sys_Get ${Path_r}/${file_in_Name} ${file_out}  
+	      #IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+	    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
+      # if not FirstInitialize and first loop of this job
+
+      # 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_}
+	  
+	  file_in_Name=${run_Configuration_OldPrefix}_${file_in}
+
+	  generic_restart_file_name_in=$( basename ${file_in_Name} .nc )
+	  generic_restart_file_name_out=$( basename ${file_out} .nc )
+
+	  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 [ -f ${Path_BUF}*.nc ] ; then
+	    Buffered=true
+	    nb_restart_file=$(IGCM_sys_CountFileBuffer ${Path_BUF}_????.nc)
+	  else
+	    Buffered=false
+	    nb_restart_file=$(IGCM_sys_CountFileArchive ${Path_OUT}_????.nc)
+	  fi
+
+	  if [ ${nb_restart_file} -gt 1 ] ; then
+	    j=0
+	    until [ $j -ge $nb_restart_file ]; do
+	      j4=${j}
+	      if [ ${Buffered} ] ; then
+		IGCM_sys_GetBuffer ${Path_BUF}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
+	      else
+		IGCM_sys_Get ${Path_OUT}_${j4}.nc ${generic_restart_file_name_out}_${j4}.nc
+	      fi
+	      (( j=j+1 ))
+	    done
+	  else
+	    if [ ${Buffered} ] ; then
+	      eval IGCM_sys_GetBuffer \${R_BUF_${comp}_R}/${file_in_Name} ${file_out}
 	    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
+	      eval IGCM_sys_Get \${R_OUT_${comp}_R}/${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
-    done
-
-    typeset NbFichs
-    NbFiles=$( ls * 2> /dev/null | wc -l )
-    if [ ${NbFiles} -gt 0 ] ; then
-	IGCM_sys_Chmod u+rw *
-    fi
-
-    IGCM_debug_PopStack "IGCM_comp_GetInputRestartFiles"
+      fi
+    fi
+  done
+
+  NbFiles=$( ls * 2> /dev/null | wc -l )
+  if [ ${NbFiles} -gt 0 ] ; then
+    IGCM_sys_Chmod u+rw *
+  fi
+
+  IGCM_debug_PopStack "IGCM_comp_GetInputRestartFiles"
 }
 
@@ -721,30 +775,30 @@
 function IGCM_comp_PeriodStart
 {
-    IGCM_debug_PushStack "IGCM_comp_PeriodStart"
-
-    # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_PeriodStart"
-    echo
-
-    typeset ExeNameIn ExeNameOut 
-    typeset comp compname comptagname
-    for comp in ${config_ListOfComponents[*]} ; do
-	# Define component 
-	eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
-	eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
-
-	# Copy executable for this component
-	eval ExeNameIn=\${config_Executable_${comp}[0]}
-	eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-	# Debug Print
-	IGCM_debug_Print 3 "PeriodStart ${compname} Driver Function (if any)."
-	# UPDATE component
-        ${comp}_PeriodStart 2> /dev/null
-
-    done
-
-    IGCM_debug_PopStack "IGCM_comp_PeriodStart"
+  IGCM_debug_PushStack "IGCM_comp_PeriodStart"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_PeriodStart"
+  echo
+
+  typeset ExeNameIn ExeNameOut 
+  typeset comp compname comptagname
+  for comp in ${config_ListOfComponents[*]} ; do
+    # Define component 
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
+
+    # Copy executable for this component
+    eval ExeNameIn=\${config_Executable_${comp}[0]}
+    eval ExeNameOut=\${config_Executable_${comp}[1]}
+
+    # Debug Print
+    IGCM_debug_Print 3 "PeriodStart ${compname} Driver Function (if any)."
+    # UPDATE component
+    ${comp}_PeriodStart 2> /dev/null
+
+  done
+
+  IGCM_debug_PopStack "IGCM_comp_PeriodStart"
 }
 
@@ -752,47 +806,47 @@
 function IGCM_comp_Update
 {
-    IGCM_debug_PushStack "IGCM_comp_Update"
+  IGCM_debug_PushStack "IGCM_comp_Update"
 
     # Debug Print :
-    echo
-    IGCM_debug_Print 1 "IGCM_comp_Update"
-    echo
-
-    typeset ExeNameIn ExeNameOut 
-    typeset comp compname comptagname
-    for comp in ${config_ListOfComponents[*]} ; do
-	# Define component 
-	eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
-	eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
-
-	# Copy executable for this component
-	eval ExeNameIn=\${config_Executable_${comp}[0]}
-	eval ExeNameOut=\${config_Executable_${comp}[1]}
-
-	# If missing executable and DRYRUN is set to 0 or 1  then stop!
-	if [ ${DRYRUN} -le 1 ] && [ X${ExeNameIn} != X\"\" ] &&  [ ! -f ${R_EXE}/${ExeNameIn} ] ; then
-	    IGCM_debug_Exit "IGCM_comp_Update missing executable ${ExeNameIn}"
-	fi 
-
-	if [ ${Period} -eq 1 ] && [ -f ${R_EXE}/${ExeNameIn} ] ; then
-	    eval IGCM_sys_Cp ${R_EXE}/${ExeNameIn} ${ExeNameOut}
-	    if [ -f ${RUN_DIR}/${ExeNameOut} ] ; then
-                eval IGCM_sys_Chmod +rx ${RUN_DIR}/${ExeNameOut}
-	    fi
-	elif [ -f ${R_EXE}/${ExeNameIn} ] && [ ! -f ${RUN_DIR}/${ExeNameOut} ] ; then
-	    eval IGCM_sys_Cp ${R_EXE}/${ExeNameIn} ${ExeNameOut}
-	    if [ -f ${RUN_DIR}/${ExeNameOut} ] ; then
-                eval IGCM_sys_Chmod +rx ${RUN_DIR}/${ExeNameOut}
-	    fi
-	fi
-
-	# Debug Print
-	IGCM_debug_Print 1 "Update ${compname} Parameter Files."
-	# UPDATE component
-        ${comp}_Update
-
-    done
-
-    IGCM_debug_PopStack "IGCM_comp_Update"
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_Update"
+  echo
+
+  typeset ExeNameIn ExeNameOut 
+  typeset comp compname comptagname
+  for comp in ${config_ListOfComponents[*]} ; do
+    # Define component 
+    eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1
+    eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1
+
+    # Copy executable for this component
+    eval ExeNameIn=\${config_Executable_${comp}[0]}
+    eval ExeNameOut=\${config_Executable_${comp}[1]}
+
+    # If missing executable and DRYRUN is set to 0 or 1  then stop!
+    if [ ${DRYRUN} -le 1 ] && [ X${ExeNameIn} != X\"\" ] &&  [ ! -f ${R_EXE}/${ExeNameIn} ] ; then
+      IGCM_debug_Exit "IGCM_comp_Update missing executable ${ExeNameIn}"
+    fi 
+
+    if [ ${Period} -eq 1 ] && [ -f ${R_EXE}/${ExeNameIn} ] ; then
+      eval IGCM_sys_Cp ${R_EXE}/${ExeNameIn} ${ExeNameOut}
+      if [ -f ${RUN_DIR}/${ExeNameOut} ] ; then
+        eval IGCM_sys_Chmod +rx ${RUN_DIR}/${ExeNameOut}
+      fi
+    elif [ -f ${R_EXE}/${ExeNameIn} ] && [ ! -f ${RUN_DIR}/${ExeNameOut} ] ; then
+      eval IGCM_sys_Cp ${R_EXE}/${ExeNameIn} ${ExeNameOut}
+      if [ -f ${RUN_DIR}/${ExeNameOut} ] ; then
+        eval IGCM_sys_Chmod +rx ${RUN_DIR}/${ExeNameOut}
+      fi
+    fi
+
+    # Debug Print
+    IGCM_debug_Print 1 "Update ${compname} Parameter Files."
+    # UPDATE component
+    ${comp}_Update
+
+  done
+
+  IGCM_debug_PopStack "IGCM_comp_Update"
 }
 
@@ -800,310 +854,323 @@
 function IGCM_comp_Finalize
 {
-    IGCM_debug_PushStack "IGCM_comp_Finalize"
-
-    # Debug Print :
+  IGCM_debug_PushStack "IGCM_comp_Finalize"
+
+  # Debug Print :
+  echo
+  IGCM_debug_Print 1 "IGCM_comp_Finalize"
+  echo
+
+  typeset ListTextName TextName0
+  typeset comp compname comptagname card ListFilesName FileName0 NbFiles SaveOnArchive
+  typeset i i_ file_in file_in_ file_out file_out_ file_outin file_outin_ generic_file_name nb_rebuild_file
+  typeset -Z4 j4
+  typeset list_file nlist_file
+  typeset compactoutputs
+
+  compactoutputs=false
+  if [ X${JobType} != XRUN ] ; then
+    compactoutputs=true
+  elif [ X${config_UserChoices_CompactText} != Xn ] ; then
+    compactoutputs=true
+  fi
+
+  for comp in ${config_ListOfComponents[*]} ; do
+    # 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 1 "Finalize ${comp} : ${compname} component."
+    # FINALIZE component
+    ${comp}_Finalize
+
+    card=${SUBMIT_DIR}/COMP/${compname}.card	
+
+    # Save Restarts files
+    #--------------------
+    IGCM_debug_Print 2 "Save Restart files for ${comp} : ${compname} component."
+    IGCM_card_DefineArrayFromOption ${card} RestartFiles List
+    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 ))
+      done
+    else
+      if [ X${FileName0} != XNONE ] ; then
+	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}."
+      fi
+    fi
+
+    # Save Output files
+    #------------------
+    IGCM_debug_Print 2 "Save Output files for ${comp} : ${compname} component."
+    IGCM_card_DefineArrayFromOption ${card} OutputFiles List
+    ListFilesName=${compname}_OutputFiles_List
+    eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
+
+    if [ X${FileName0} != X${NULL_STR} ] ; then
+      eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
+
+      (( i=0 ))
+      until [ $i -ge $NbFiles ]; do
+	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_}
+	(( 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 config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      fi
+	    fi
+	    # Prepare the shell dedicated to offline rebuild
+	    if [ $DRYRUN -le 1 ]; then
+	      echo "IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc" >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      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
+	      echo "IGCM_sys_Put_Out ${file_in} ${file_out}             " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      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
+	      #
+	      echo "IGCM_sys_Put_Out ${file_in} ${file_out}           " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
+	      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
+	    #
+	    IGCM_sys_Put_Out ${file_in} ${file_out}
+	    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
+
+    # Save Output Text files of models
+    #---------------------------------
+    IGCM_debug_Print 2 "Save Output Text files for ${comp} : ${compname} component."
+    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
+      eval NbFiles=\${#${ListTextName}[@]} > /dev/null 2>&1
+
+      (( 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 )
+        # 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 "
+" >> ${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 "
+" >> ${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
+      done
+    fi
     echo
-    IGCM_debug_Print 1 "IGCM_comp_Finalize"
-    echo
-
-    typeset ListTextName TextName0
-    typeset comp compname comptagname card ListFilesName FileName0 NbFiles SaveOnArchive
-    typeset i i_ file_in file_in_ file_out file_out_ file_outin file_outin_ generic_file_name nb_rebuild_file
-    typeset -Z4 j4
-    typeset list_file nlist_file
-    typeset compactoutputs
-
-    compactoutputs=false
-    if [ X${JobType} != XRUN ] ; then
-	compactoutputs=true
-    elif [ X${config_UserChoices_CompactText} != Xn ] ; then
-	compactoutputs=true
-    fi
-
-    for comp in ${config_ListOfComponents[*]} ; do
-	# 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 1 "Finalize ${compname} component."
-	# FINALIZE component
-        ${comp}_Finalize
-
-	card=${SUBMIT_DIR}/COMP/${compname}.card	
-
-	# Save Restarts files
-	#--------------------
-	IGCM_card_DefineArrayFromOption ${card} RestartFiles List
-	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}
-			eval IGCM_sys_Put_Rest ${generic_restart_file_name_in}_${j4}.nc \${R_OUT_${comp}_R}/${generic_restart_file_name_out}_${j4}.nc
-			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
-			#eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${generic_restart_file_name_in}_${j4}.nc" > /dev/null 2>&1
-			(( j=j+1 ))
-		    done
-		else
-		    eval IGCM_sys_Put_Rest ${file_in} \${R_OUT_${comp}_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out}
-		    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
-		    #eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
-		fi
-
-		(( i=i+3 ))
-	    done
-	else
-	    if [ X${FileName0} != XNONE ] ; then
-		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}."
-	    fi
-	fi
-
-	# Save Output files
-	#------------------
-	IGCM_card_DefineArrayFromOption ${card} OutputFiles List
-	ListFilesName=${compname}_OutputFiles_List
- 	eval FileName0=\${${ListFilesName}[0]} > /dev/null 2>&1
-
-	if [ X${FileName0} != X${NULL_STR} ] ; then
-	    eval NbFiles=\${#${ListFilesName}[@]} > /dev/null 2>&1
-
-	    (( i=0 ))
-	    until [ $i -ge $NbFiles ]; do
-		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_}
-		(( 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${config_Post_RebuildFrequency} = X${NULL_STR} ] || [ X${config_Post_RebuildFrequency} = XNONE ] ) ; 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 config_UserChoices_JobName=${config_UserChoices_JobName} " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    fi
-			fi
-			# Prepare the shell dedicated to offline rebuild
-			if [ $DRYRUN -le 1 ]; then
-			    echo "IGCM_sys_rebuild ${file_in} ${generic_file_name}_*.nc   " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    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
-			    echo "IGCM_sys_Put_Out ${file_in} ${file_out}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-			    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
-		    #
-		    # 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${config_Post_RebuildFrequency} = X ] && [ ! X${config_Post_RebuildFrequency} = XNONE ] ) ; then
-			if [ -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
-				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
-			        #
-				echo "IGCM_sys_Put_Out ${file_in} ${file_out}                 " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-				echo "IGCM_debug_Verif_Exit_Post                              " >> ${RUN_DIR}/REBUILD_${PeriodDateBegin}/rebuild.ksh
-		                #
-			    fi
-			fi
-		    else
-                        [ ! -d ${RUN_DIR}/REBUILD_${PeriodDateBegin} ] && IGCM_sys_Mkdir ${RUN_DIR}/REBUILD_${PeriodDateBegin}
-			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
-			fi
-
-			IGCM_sys_Put_Out ${file_in} ${file_out}
-			[ $? -eq 0 ] && 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
-
-	# Save Output Text files of models
-	#---------------------------------
-	
-	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
-	    eval NbFiles=\${#${ListTextName}[@]} > /dev/null 2>&1
-
-	    (( i=0 ))
-	    until [ $i -eq $NbFiles ]; do
-		eval file_in=\${${ListTextName}[$i]} > /dev/null 2>&1
-		(( 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
-			eval file_out=${PREFIX}_${file_in}
-
-			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 "
-" >> ${file_out}
-			    eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
-			    (( i_ = i_ + 1 ))
-			done
-			eval IGCM_sys_Put_Out ${file_out} \${R_OUT_${comp}_D}/${file_out}
-			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
-			    eval IGCM_sys_Put_Out ${file} \${R_OUT_${comp}_D}/${PREFIX}_${file}
-			    eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file}" > /dev/null 2>&1
-			done
-			if ( ${ExecutionFail} ) ; then
-			    IGCM_sys_Cp ${file} ${SUBMIT_DIR}/Debug/${PREFIX}_${file}
-			fi
-		    fi
-		else
-		    if ( [ -f ${file_in}_0000 ] || [ -f ${file_in}0 ] ) ; then
-			eval IGCM_sys_Mv ${file_in}* ${file_in}
-		    fi
-		    eval IGCM_sys_Put_Out ${file_in} \${R_OUT_${comp}_D}/${PREFIX}_${file_in}
-		    [ $? -eq 0 ] && eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
-
-		    if ( ${ExecutionFail} ) ; then
-			IGCM_sys_Cp ${file_in} ${SUBMIT_DIR}/Debug/${PREFIX}_${file_in}
-		    fi
-		fi
-	    done
-	fi
-    done
-
-    IGCM_debug_PopStack "IGCM_comp_Finalize"
+  done
+  IGCM_debug_PopStack "IGCM_comp_Finalize"
 }
