Index: /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 37)
+++ /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 38)
@@ -358,7 +358,8 @@
     echo
 
-    typeset Date_tmp Date_r Path_r do_start CompOldName
+    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
@@ -425,7 +426,24 @@
 			eval file_in_Name=\${config_${comp}_RestartJobName}_${Date_r}_${file_in}
 
-			eval IGCM_sys_Get ${Path_r}/${file_in_Name} ${file_out} 
-
-			IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+			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_RshArchive ls ${Path_temp}_????.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_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 ))
@@ -460,7 +478,25 @@
 		    
 		    file_in_Name=${run_Configuration_OldPrefix}_${file_in}
-		    eval IGCM_sys_Get \${R_OUT_${comp}_R}/${file_in_Name} ${file_out}
-
-		    IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+
+		    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_RshArchive ls ${Path_temp}_????.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_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 ))
@@ -530,4 +566,5 @@
     typeset comp compname comptagname card ListFilesName FileName0 NbFiles SaveOnArchive
     typeset i i_ file_in file_in_ file_out file_out_ generic_file_name nb_rebuild_file
+    typeset -Z4 j4
     for comp in ${config_ListOfComponents[*]} ; do
 	# Define component 
@@ -560,7 +597,21 @@
 		eval file_out=${file_out_}
 		
-		eval IGCM_sys_Put_Rest ${file_in} \${R_OUT_${comp}_R}/${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out}
-
-		eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
+		generic_restart_file_name_in=$( basename ${file_in} .nc )
+		generic_restart_file_name_out=$( basename ${config_UserChoices_JobName}_${PeriodDateEnd}_${file_out} .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
+			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}
+		    eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${file_in}" > /dev/null 2>&1
+		fi
 
 		(( i=i+3 ))
