Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 441)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 442)
@@ -1119,6 +1119,4 @@
 	    echo "IGCM_sys_Get, ERROR : regular file ${dm_liste[0]} DOES NOT EXIST ."
 	    IGCM_debug_Exit "IGCM_sys_Get"
-	    #IGCM_debug_PopStack "IGCM_sys_Get"
-	    #return
 	fi
 
@@ -1128,7 +1126,5 @@
 	    echo "WARNING IGCM_sys_Get : demigration error."
 	    cat out_rsync
-	    #IGCM_debug_Exit "IGCM_sys_Get"
-	    #IGCM_debug_PopStack "IGCM_sys_Get"
-	    #return
+	    IGCM_debug_Exit "IGCM_sys_Get"
 	fi
 
Index: trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh
===================================================================
--- trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 441)
+++ trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh	(revision 442)
@@ -195,4 +195,54 @@
 
 #D-#==================================================
+#D-function IGCM_sys_SendMail
+#D-* Purpose: Send mail when simulation is over
+#D-* Examples:
+#D-
+function IGCM_sys_SendMail {
+    IGCM_debug_PushStack "IGCM_sys_SendMail" $@
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_SendMail :" $@
+    fi
+
+    if ( ${ExitFlag} ) ; then
+	status=FAILED
+	cat  << END_MAIL > job_end.mail
+Dear ${LOGIN},
+
+  Simulation ${config_UserChoices_JobName} failed on supercomputer `hostname`.
+  Job started : ${PeriodDateBegin}
+  Job ended   : ${PeriodDateEnd}
+  Output files are available in ${R_SAVE}
+  Script files, Script Outputs and Debug files are available in ${SUBMIT_DIR}
+END_MAIL
+    else
+	status=COMPLETED
+	cat  << END_MAIL > job_end.mail
+Dear ${LOGIN},
+
+  Simulation ${config_UserChoices_JobName} is finished on supercomputer `hostname`.
+  Job started : ${DateBegin}
+  Job ended   : ${DateEnd}
+  Output files are available in ${R_SAVE}
+  Script files and Script Outputs are available in ${SUBMIT_DIR}
+END_MAIL
+    fi
+
+    if  [ X"${config_UserChoices_MailName}" != X ] ; then
+       mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
+    elif [ -f ~/.forward ] ; then
+       mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    else
+       mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail
+    fi
+
+    if [ $? -gt 0 ] ; then
+	echo "IGCM_sys_SendMail : erreur."
+	IGCM_debug_Exit "IGCM_sys_SendMail"
+    fi
+    IGCM_debug_PopStack "IGCM_sys_SendMail"
+}
+
+#D-#==================================================
 #D-function IGCM_sys_Mkdir
 #D-* Purpose: Master locale mkdir command
@@ -791,4 +841,60 @@
 
 #D-#==================================================
+#D-function IGCM_sys_Put_Rest
+#D-* Purpose: Put computied restarts on $(ARCHIVE).
+#D-           File and target directory must exist.
+#D-* Examples:
+#D-
+function IGCM_sys_Put_Rest {
+    IGCM_debug_PushStack "IGCM_sys_Put_Rest" $@
+    if ( $DEBUG_sys ) ; then
+	echo "IGCM_sys_Put_Rest :" $@
+    fi
+    if [ $DRYRUN = 0 ]; then
+	if [ ! -f ${1} ] ; then
+	    echo "ERROR : IGCM_sys_Put_Rest ${1} DOES NOT EXIST ."
+	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
+	fi
+
+	typeset RET
+	#
+	if [ X${JobType} = XRUN ] ; then
+	    IGCM_sys_Chmod 444 ${1}
+	fi
+	#
+	IGCM_sys_TestDirArchive $( dirname $2 )
+	#
+	# USUAL WAY
+	putfer $1 $2 > out_rsync 2>&1
+        RET=$?
+
+# 	#RSYNC WITH NETWORK SSH CALL
+# 	echo ${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} > out_rsync 2>&1
+# 	${RSYNC} ${RSYNC_opt} -e ssh ${RUN_DIR}/$1 ${RHOST}:${2} >> out_rsync 2>&1
+
+#  	#RSYNC WITH NFS USE
+#  	echo ${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} > out_rsync 2>&1
+#  	${RSYNC} ${RSYNC_opt} ${RUN_DIR}/$1 ${2} >> out_rsync 2>&1
+
+#  	RET=$?
+#  	IGCM_sys_Rsync_out $RET
+
+#  	${libIGCM}/libIGCM_sys/IGCM_analyse_rsync_out.awk out_rsync
+#  	(( RET=RET+$? ))
+
+	if [ ${RET} -gt 0 ] ; then
+	    echo "IGCM_sys_Put_Rest : error."
+	    cat out_rsync
+	    IGCM_debug_Exit "IGCM_sys_Put_Rest"
+	else
+	    \rm out_rsync
+	fi
+    else
+	( ${DEBUG_debug} ) && echo "DRYRUN mode = " $DRYRUN >> stack
+    fi
+    IGCM_debug_PopStack "IGCM_sys_Put_Rest"
+}
+
+#D-#==================================================
 #D-function IGCM_sys_Put_Out
 #D-* Purpose: Copy a file on $(ARCHIVE) after have chmod it in readonly
