Index: /trunk/libIGCM/AA_job
===================================================================
--- /trunk/libIGCM/AA_job	(revision 436)
+++ /trunk/libIGCM/AA_job	(revision 437)
@@ -276,10 +276,4 @@
 # Test if all was right before proceeding further
 # ------------------------------------------------------------------
-IGCM_debug_Verif_Exit_Post
-
-#D-
-# ------------------------------------------------------------------
-#D- Test if all was right before proceeding further
-# ------------------------------------------------------------------
 IGCM_debug_Verif_Exit
 
Index: /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh	(revision 437)
@@ -207,4 +207,7 @@
 	    echo
 	fi
+	# Mail notification
+	IGCM_sys_SendMail
+	# And Good Bye
 	date
 	exit 1
@@ -228,4 +231,7 @@
 		echo
 	    fi
+	    # Mail notification
+	    #IGCM_sys_SendMail
+	    # And Good Bye
 	    date
 	    exit 1
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_brodie.ksh	(revision 437)
@@ -183,5 +183,18 @@
     fi
 
-    cat  << END_MAIL > job_end.mail
+    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},
 
@@ -193,10 +206,12 @@
 END_MAIL
 
+    fi
+
     if [ X${config_UserChoices_MailName} != X ] ; then
-        mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
+        mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
     elif [ -f ~/.forward ] ; then
-        mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+        mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     else
-        mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail
+        mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
     fi
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh	(revision 437)
@@ -252,5 +252,4 @@
        mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
     fi
-
     sleep 10
     rm -f job_end.mail
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 437)
@@ -214,5 +214,18 @@
     fi
 
-    cat  << END_MAIL > job_end.mail
+    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},
 
@@ -223,9 +236,10 @@
   Script files and Script Outputs are available in ${SUBMIT_DIR}
 END_MAIL
+    fi
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
     elif [ -f ~/.forward ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     fi
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 437)
@@ -201,5 +201,19 @@
 	echo "IGCM_sys_SendMail :" $@
     fi
-    cat  << END_MAIL > job_end.mail
+
+    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},
 
@@ -210,11 +224,12 @@
   Script files and Script Outputs are available in ${SUBMIT_DIR}
 END_MAIL
+    fi
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
     elif [ -f ~/.forward ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     else
-	mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
     fi
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex8.ksh	(revision 437)
@@ -228,5 +228,10 @@
     fi
 
-    ssh mercure /bin/ksh <<-EOF
+    if ( ${ExitFlag} ) ; then
+	status=FAILED
+	# Nothing fo now
+    else
+	status=COMPLETED
+	ssh mercure /bin/ksh <<-EOF
     export LOGIN=${LOGIN}
     export config_UserChoices_JobName=${config_UserChoices_JobName}
@@ -256,4 +261,5 @@
     rm -f job_end.mail
 EOF
+    fi
 
     if [ $? -gt 0 ] ; then
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercurex9.ksh	(revision 437)
@@ -236,5 +236,18 @@
     fi
 
-    cat  << END_MAIL > job_end.mail
+    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},
 
@@ -245,11 +258,12 @@
   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} completed" ${config_UserChoices_MailName} <  job_end.mail
+       mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
     elif [ -f ~/.forward ] ; then
-       mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+       mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     else
-       mailx -s "${config_UserChoices_JobName} completed" ${LOGIN} < job_end.mail
+       mailx -s "${config_UserChoices_JobName} ${status}" ${LOGIN} < job_end.mail
     fi
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 437)
@@ -230,5 +230,18 @@
     fi
 
-    cat  << END_MAIL > job_end.mail
+    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},
 
@@ -239,9 +252,10 @@
   Script files and Script Outputs are available in ${SUBMIT_DIR}
 END_MAIL
+    fi
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
     elif [ -f ~/.forward ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     fi
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh	(revision 437)
@@ -224,5 +224,19 @@
        echo "IGCM_sys_SendMail :" $@
     fi
-    cat  << END_MAIL > job_end.mail
+
+    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},
 
@@ -233,9 +247,10 @@
   Script files and Script Outputs are available in ${SUBMIT_DIR}
 END_MAIL
+    fi
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
     elif [ -f ~/.forward ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     fi
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_titane.ksh	(revision 437)
@@ -252,5 +252,10 @@
     fi
 
-    IGCM_sys_RshPost <<-EOF
+    if ( ${ExitFlag} ) ; then
+	status=FAILED
+	# Nothing more at this point of time
+    else
+	status=COMPLETED
+	IGCM_sys_RshPost <<-EOF
     export LOGIN=${LOGIN}
     export config_UserChoices_JobName=${config_UserChoices_JobName}
@@ -280,4 +285,5 @@
     rm -f job_end.mail
 EOF
+    fi
 
     if [ $? -gt 0 ] ; then
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 436)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_vargas.ksh	(revision 437)
@@ -183,5 +183,19 @@
 	echo "IGCM_sys_SendMail :" $@
     fi
-    cat  << END_MAIL > job_end.mail
+
+    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},
 
@@ -192,11 +206,12 @@
   Script files and Script Outputs are available in ${SUBMIT_DIR}
 END_MAIL
+    fi
 
     if [ ! -z ${config_UserChoices_MailName} ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" ${config_UserChoices_MailName} <  job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
     elif [ -f ~/.forward ] ; then
-	mailx -s "${config_UserChoices_JobName} completed" $( cat ~/.forward ) < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
     else
-	mailx -s "${config_UserChoices_JobName} completed" ${USER} < job_end.mail
+	mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
     fi
 
