Index: /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 921)
+++ /trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 922)
@@ -420,5 +420,5 @@
   # DateBegin + CumulPeriod*PeriodLength = PeriodDateBegin
   echo
-  
+
   case ${config_UserChoices_PeriodLength} in
   *Y|*y)
@@ -1108,4 +1108,20 @@
   fi
 
+  # Send some accounting element to the user if CumulPeriod=3
+  if [ ${CumulPeriod} -eq 3 ] ; then
+    echo
+    IGCM_debug_Print 1 "Send email containing some accounting information : "
+
+    RealCpuTime=$( echo ${ExeCpuLog} | gawk '{print $3}' )
+
+    consumeHoursPerPeriod=$( echo "scale=6;${RealCpuTime}*${PROCESSUS_NUMBER}/3600" | bc )
+
+    consumeHoursPerWholeSimulation=$( echo "scale=6;${consumeHoursPerPeriod}/${PeriodLengthInDays}*${ExperienceLengthInDays}" | bc )
+
+    recommendedPeriodNb=$( echo "scale=6;24/${consumeHoursPerPeriod}*${PROCESSUS_NUMBER}" | bc )
+
+    IGCM_sys_SendMail Accounting
+  fi
+
   #=================================================#
   #         Modification of libIGCM behaviour       #
@@ -1280,6 +1296,6 @@
 
     IGCM_debug_Print 1 "Submit next job"
-    # SUBMIT NEXT JOB from SUBMIT_DIR and come back in RUN_DIR 
-    IGCM_sys_Cd ${SUBMIT_DIR} 
+    # SUBMIT NEXT JOB from SUBMIT_DIR and come back in RUN_DIR
+    IGCM_sys_Cd ${SUBMIT_DIR}
     # Keep only the 5 latest ${Script_Output_Prefix}_${config_UserChoices_JobName}
     ScriptTot=$( ls ${Script_Output_Prefix}_${config_UserChoices_JobName}.?????? 2>/dev/null | wc -l )
Index: /trunk/libIGCM/libIGCM_sys/jobAccounting.mail
===================================================================
--- /trunk/libIGCM/libIGCM_sys/jobAccounting.mail	(revision 922)
+++ /trunk/libIGCM/libIGCM_sys/jobAccounting.mail	(revision 922)
@@ -0,0 +1,11 @@
+Dear ${LOGIN},
+
+this mail will be sent once for the simulation ${config_UserChoices_JobName} you recently submitted
+
+The whole simulation will consume around ${consumeHoursPerWholeSimulation} hours. To be compared with your project allocation.
+
+The recommended PeriodNb for a 24 hours job seems to be around ${recommendedPeriodNb}. To be compare with the current setting \(Job_${config_UserChoices_JobName} parameter\) : PeriodNb=${PeriodNb}
+
+Greetings!
+
+Check this out for more information : https://forge.ipsl.jussieu.fr/igcmg/wiki/platform/documentation
Index: /trunk/libIGCM/libIGCM_sys/jobEnd.mail
===================================================================
--- /trunk/libIGCM/libIGCM_sys/jobEnd.mail	(revision 922)
+++ /trunk/libIGCM/libIGCM_sys/jobEnd.mail	(revision 922)
@@ -0,0 +1,17 @@
+Dear ${LOGIN},
+
+Simulation ${config_UserChoices_JobName} ${status} on supercomputer $( hostname )
+Simulation started : ${DateBegin}
+Simulation ended   : ${DateEnd}
+
+Output files are available in ${R_SAVE}
+
+Files to be rebuild are temporarily available in ${REBUILD_DIR}
+
+Pre-packed files are temporarily available in ${R_BUFR}
+
+Script files, Script Outputs and Debug files \(if necessary\) are available in ${SUBMIT_DIR}
+
+Greetings!
+
+Check this out for more information : https://forge.ipsl.jussieu.fr/igcmg/wiki/platform/documentation
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 921)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 922)
@@ -297,37 +297,31 @@
   fi
 
-  if ( ${ExitFlag} ) ; then
+  if [ X${1} = XAccounting ] ; then
+    status=Accounting
+    mailText=jobAccounting.mail
+  elif ( ${ExitFlag} ) ; then
     status=failed
+    mailText=jobEnd.mail
   else
     status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
+    mailText=jobEnd.mail
+  fi
+
+  # Update selected mail template
+  while read -r line; do
+    eval echo $line >> mail.txt ;
+  done < ${libIGCM}/libIGCM_sys/${mailText}
 
   if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
+    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  mail.txt
   elif [ -f ~/.forward ] ; then
-    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt
   else
-    mail -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
+    mail -s "${config_UserChoices_JobName} ${status}" ${USER} < mail.txt
   fi
 
   sleep 10
-  rm -f job_end.mail
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
+  rm -f mail.txt
+
   IGCM_debug_PopStack "IGCM_sys_SendMail"
 }
@@ -376,5 +370,5 @@
     mkdir -p $1
     status=$?
-  fi  
+  fi
 
   if [ ${status} -gt 0 ] ; then
@@ -969,5 +963,5 @@
       status=$?
     else
-      \cp -r $1 $2 > out_rsync 2>&1 
+      \cp -r $1 $2 > out_rsync 2>&1
       status=$?
     fi
@@ -1671,5 +1665,5 @@
 #D-#==================================================
 #D-function IGCM_sys_rebuild_station
-#D-* Purpose: rebuild parallel files describing station 
+#D-* Purpose: rebuild parallel files describing station
 #D-* Examples:
 #D-
@@ -1700,5 +1694,5 @@
   IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
 
-  # Station re-ordering is too expansive to be run within libICGM
+  # Station re-ordering is too expansive to be run within libIGCM
   # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
   # This re-ordering must be done "in memory" by the cmorization process
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 921)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 922)
@@ -357,39 +357,38 @@
 function IGCM_sys_SendMail {
   IGCM_debug_PushStack "IGCM_sys_SendMail" $@
+
+set -vx
+
   if ( $DEBUG_sys ) ; then
     echo "IGCM_sys_SendMail :" $@
   fi
 
-  if ( ${ExitFlag} ) ; then
+  if [ X${1} = XAccounting ] ; then
+    status=Accounting
+    mailText=jobAccounting.mail
+  elif ( ${ExitFlag} ) ; then
     status=failed
+    mailText=jobEnd.mail
   else
     status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
+    mailText=jobEnd.mail
+  fi
+
+  # Update selected mail template
+  while read -r line; do
+    eval echo $line >> mail.txt ;
+  done < ${libIGCM}/libIGCM_sys/${mailText}
 
   if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < job_end.mail
+    mail -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt
   elif [ -f ~/.forward ] ; then
-    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    mail -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt
   fi
 
   sleep 10
-  rm -f job_end.mail
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
+  rm -f mail.txt
+
+set +vx
+
   IGCM_debug_PopStack "IGCM_sys_SendMail"
 }
@@ -1913,5 +1912,5 @@
   IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
 
-  # Station re-ordering is too expansive to be run within libICGM
+  # Station re-ordering is too expansive to be run within libIGCM
   # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
   # This re-ordering must be done "in memory" by the cmorization process
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 921)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 922)
@@ -244,35 +244,29 @@
   fi
 
-  if ( ${ExitFlag} ) ; then
+  if [ X${1} = XAccounting ] ; then
+    status=Accounting
+    mailText=jobAccounting.mail
+  elif ( ${ExitFlag} ) ; then
     status=failed
+    mailText=jobEnd.mail
   else
     status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
+    mailText=jobEnd.mail
+  fi
+
+  # Update selected mail template
+  while read -r line; do
+    eval echo $line >> mail.txt ;
+  done < ${libIGCM}/libIGCM_sys/${mailText}
 
   if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  mail.txt
   elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt
   fi
 
   sleep 10
-  rm -f job_end.mail
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
+  rm -f mail.txt
+
   IGCM_debug_PopStack "IGCM_sys_SendMail"
 }
@@ -1454,5 +1448,5 @@
 #D-#==================================================
 #D-function IGCM_sys_rebuild_station
-#D-* Purpose: rebuild parallel files describing station 
+#D-* Purpose: rebuild parallel files describing station
 #D-* Examples:
 #D-
@@ -1483,5 +1477,5 @@
   IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
 
-  # Station re-ordering is too expansive to be run within libICGM
+  # Station re-ordering is too expansive to be run within libIGCM
   # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
   # This re-ordering must be done "in memory" by the cmorization process
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 921)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 922)
@@ -257,37 +257,31 @@
   fi
 
-  if ( ${ExitFlag} ) ; then
+  if [ X${1} = XAccounting ] ; then
+    status=Accounting
+    mailText=jobAccounting.mail
+  elif ( ${ExitFlag} ) ; then
     status=failed
+    mailText=jobEnd.mail
   else
     status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
+    mailText=jobEnd.mail
+  fi
+
+  # Update selected mail template
+  while read -r line; do
+    eval echo $line >> mail.txt ;
+  done < ${libIGCM}/libIGCM_sys/${mailText}
 
   if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt
   elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt
   else
-    mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" ${USER} < mail.txt
   fi
 
   sleep 10
-  rm -f job_end.mail
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
+  rm -f mail.txt
+
   IGCM_debug_PopStack "IGCM_sys_SendMail"
 }
@@ -1491,5 +1485,5 @@
 #D-#==================================================
 #D-function IGCM_sys_rebuild_station
-#D-* Purpose: rebuild parallel files describing station 
+#D-* Purpose: rebuild parallel files describing station
 #D-* Examples:
 #D-
@@ -1520,5 +1514,5 @@
   IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
 
-  # Station re-ordering is too expansive to be run within libICGM
+  # Station re-ordering is too expansive to be run within libIGCM
   # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
   # This re-ordering must be done "in memory" by the cmorization process
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 921)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 922)
@@ -256,35 +256,29 @@
   fi
 
-  if ( ${ExitFlag} ) ; then
+  if [ X${1} = XAccounting ] ; then
+    status=Accounting
+    mailText=jobAccounting.mail
+  elif ( ${ExitFlag} ) ; then
     status=failed
+    mailText=jobEnd.mail
   else
     status=completed
-  fi
-
-  cat  << END_MAIL > job_end.mail
-Dear ${LOGIN},
-
-  Simulation ${config_UserChoices_JobName} is ${status} on supercomputer `hostname`.
-  Job started : ${DateBegin}
-  Job ended   : ${DateEnd}
-  Output files are available in ${R_SAVE}
-  Files to be rebuild are temporarily available in ${REBUILD_DIR}
-  Pre-packed files are temporarily available in ${R_BUFR}
-  Script files, Script Outputs and Debug files (if necessary) are available in ${SUBMIT_DIR}
-END_MAIL
+    mailText=jobEnd.mail
+  fi
+
+  # Update selected mail template
+  while read -r line; do
+    eval echo $line >> mail.txt ;
+  done < ${libIGCM}/libIGCM_sys/${mailText}
 
   if [ ! -z ${config_UserChoices_MailName} ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} <  job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" ${config_UserChoices_MailName} < mail.txt
   elif [ -f ~/.forward ] ; then
-    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < job_end.mail
+    mailx -s "${config_UserChoices_JobName} ${status}" $( cat ~/.forward ) < mail.txt
   fi
 
   sleep 10
-  rm -f job_end.mail
-
-  if [ $? -gt 0 ] ; then
-    echo "IGCM_sys_SendMail : erreur."
-    IGCM_debug_Exit "IGCM_sys_SendMail"
-  fi
+  rm -f mail.txt
+
   IGCM_debug_PopStack "IGCM_sys_SendMail"
 }
@@ -1482,5 +1476,5 @@
 #D-#==================================================
 #D-function IGCM_sys_rebuild_station
-#D-* Purpose: rebuild parallel files describing station 
+#D-* Purpose: rebuild parallel files describing station
 #D-* Examples:
 #D-
@@ -1511,5 +1505,5 @@
   IGCM_sys_ncpdq -a time_counter,x -a time_counter,presnivs,x histstn_xt.nc ${file_out}
 
-  # Station re-ordering is too expansive to be run within libICGM
+  # Station re-ordering is too expansive to be run within libIGCM
   # This is due to (ncpdq - nrcat - ncpdq) I/O sequence.
   # This re-ordering must be done "in memory" by the cmorization process
