Index: /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh	(revision 41)
@@ -430,20 +430,19 @@
 			
 			eval Path_temp=\${Path_r}/${generic_restart_file_name_in}
-#			IGCM_sys_RshArchive ls ${Path_temp}_????.nc 2>/dev/null | wc -l
-#			nb_restart_file=$( IGCM_sys_RshArchive ls ${Path_temp}_????.nc 2>/dev/null | wc -l )
-
-#			if [ ${nb_restart_file} -gt 2 ] ; 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
+			nb_restart_file=$(IGCM_sys_Nb_files_archive ${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
+			fi
 		
 			(( i=i+3 ))
@@ -483,22 +482,21 @@
 
 		    eval Path_temp=\${R_OUT_${comp}_R}/${generic_restart_file_name_in}
-		    IGCM_debug_Print 1 "TEST RshArchive"
-#		    IGCM_sys_RshArchive ls ${Path_temp}_????.nc 2>/dev/null | wc -l
-#		    nb_restart_file=$( IGCM_sys_RshArchive ls ${Path_temp}_????.nc 2>/dev/null | wc -l )
-#		    IGCM_debug_Print 1 "nb_restart_file=${nb_restart_file}"
-#		    if [ ${nb_restart_file} -gt 2 ] ; 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
+		    IGCM_sys_Nb_files_archive ${Path_temp}_????.nc
+		    nb_restart_file=$(IGCM_sys_Nb_files_archive ${Path_temp}_????.nc)
+		    IGCM_debug_Print 1 "nb_restart_file=${nb_restart_file}"
+		    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
+		    fi
 
 		    (( i=i+3 ))
@@ -602,19 +600,17 @@
 		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 )
-#		IGCM_debug_Print 1 "TEST RshArchive"
-#		IGCM_debug_Print 1 "nb_restart_file=${nb_restart_file}"
-#		if [ ${nb_restart_file} -gt 2 ] ; 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
+		nb_restart_file=$(IGCM_sys_Nb_files_archive ${Path_temp}_????.nc)
+		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
+		fi
 
 		(( i=i+3 ))
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 41)
@@ -144,4 +144,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   rsh gaya -n ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Post-process rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_calculo.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_calculo.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_calculo.ksh	(revision 41)
@@ -170,4 +170,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_claude.ksh	(revision 41)
@@ -186,4 +186,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 41)
@@ -171,4 +171,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 41)
@@ -143,4 +143,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Post-process rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercureTX.ksh	(revision 41)
@@ -178,4 +178,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 41)
@@ -171,4 +171,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 41)
@@ -189,4 +189,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Post-process rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_rhodes.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_rhodes.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_rhodes.ksh	(revision 41)
@@ -165,4 +165,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_zahir.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_zahir.ksh	(revision 40)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_zahir.ksh	(revision 41)
@@ -144,4 +144,16 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Nb_files_archive
+#D-* Purpose: Count files on Archive filesystem
+#D-* Examples:
+#D-
+function IGCM_sys_Nb_files_archive {
+   ls ${@} 2>/dev/null | wc -l
+   if [ $? -gt 0 ] ; then
+       echo "IGCM_sys_RshArchive : erreur."
+   fi
+}
+
+#D-#==================================================
 #D-function IGCM_sys_RshPost
 #D-* Purpose: Master rsh command
