Index: branches/SmoothFiles/libIGCM_comp/libIGCM_comp.ksh
===================================================================
--- branches/SmoothFiles/libIGCM_comp/libIGCM_comp.ksh	(revision 6)
+++ branches/SmoothFiles/libIGCM_comp/libIGCM_comp.ksh	(revision 8)
@@ -94,5 +94,5 @@
 	    for option in ${card_UserChoices[*]} ; do
 		IGCM_card_DefineVariableFromOption ${card} UserChoices ${option}
-		eval IGCM_debug_Print 3 "${compname}_UserChoices_values: ${card_UserChoices[*]}"
+		eval IGCM_debug_Print 3 "${compname}_UserChoices_values: ${option} \${card_UserChoices_${option}}"
 	    done
 	fi
@@ -198,4 +198,113 @@
 
 #=======================================================================
+# Definition of Smooth modulo function
+# usage : 
+# IGCM_SmoothModulo StringModulo value
+#
+# StringModulo : A string of min max and modulo like definition of Scilab vectors.
+# [min]:[modulo:][max]
+# where :
+# [] value are optionnals; 
+# empty min equal 1
+# empty max equal infinity
+# modulo not given or empty equal 1
+# empty string or just ':' equal always.
+#
+# value : the value to test with the definition
+#
+# return : true(1)/false(0) 
+function IGCM_SmoothModulo
+{
+    IGCM_debug_PushStack "IGCM_SmoothModulo"
+    typeset defVector ModValue
+
+    eval set +A defVector -- $( echo "${1}" | \
+	awk -F ':' '{print ($1 == "" ? 1 : $1) " " (NF==3 ? ($2 == "" ? 1 : $2) : 1) " " (NF==3 ? ($3 == "" ? -1 : $3) : ($2 == "" ? -1 : $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
+	    echo true
+	    IGCM_debug_PopStack "IGCM_SmoothModulo"
+	    return 1
+	else
+	    echo false
+	    IGCM_debug_PopStack "IGCM_SmoothModulo"
+	    return 0
+	fi
+    else
+	echo false
+	IGCM_debug_PopStack "IGCM_SmoothModulo"
+	return 0
+    fi
+}
+
+#=======================================================================
+function 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 i i_ i__
+    typeset file_in_ file_in file_out_ file_out ret SmoothDef
+
+    for comp in ${config_ListOfComponents[*]} ; do
+
+	echo "-----"
+	# 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} ] ; 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}"
+		eval ret=$( IGCM_SmoothModulo ${SmoothDef} ${CumulPeriod} )
+		if [ X${ret} = Xtrue ] ; then
+		    IGCM_sys_Get ${file_in} ${file_out}
+
+		    IGCM_comp_PrepareDeletedFiles ${file_in} ${file_out}
+		fi
+		(( i=i+3 ))
+	    done
+	fi
+    done
+    
+    IGCM_debug_PopStack "IGCM_comp_GetInputSmoothFiles"
+}
+
+#=======================================================================
 function IGCM_comp_GetInputBoundaryFiles
 {
