Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 1238)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh	(revision 1239)
@@ -856,5 +856,5 @@
 
 #D-#==================================================
-#D-function IGCM_sys_desactiv_variables
+#D-function IGCM_sys_activ_variables
 #D-* Purpose: set environement variables prior to execution
 #D-* Examples:
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ciclad.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ciclad.ksh	(revision 1238)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_ciclad.ksh	(revision 1239)
@@ -744,5 +744,5 @@
 
 #D-#==================================================
-#D-function IGCM_sys_desactiv_variables
+#D-function IGCM_sys_activ_variables
 #D-* Purpose: set environement variables prior to execution
 #D-* Examples:
@@ -789,4 +789,63 @@
 
   IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
+}
+
+############################################################
+# Update job headers to be used by the scheduler
+
+#D-#==================================================
+#D-function IGCM_sys_updateHeaders
+#D-* Purpose: Update job headers to be used by the scheduler
+#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP
+#D-
+function IGCM_sys_updateHeaders {
+  IGCM_debug_PushStack "IGCM_sys_updateHeaders"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_updateHeaders"
+  fi
+  typeset file
+  file=$1
+
+  if [ ${executionType} -eq 1 ] ; then
+    # MPMD + MPI
+    sed -e "/::openMPthreads::/d"                  \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 2 ] ; then
+    # MPMD + MPI + OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 3 ] ; then
+    # SPMD + MPI/OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 4 ] ; then
+    # SPMD + MPI only
+    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 5 ] ; then
+    # SPMD + OMP only
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "/::JobNumProcTot::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 6 ] ; then
+    # SEQUENTIAL THEN
+    sed -e "s/::JobNumProcTot::/1/"                \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  fi
+
+  IGCM_sys_Mv ${file}.tmp ${file}
+
+  IGCM_debug_PopStack "IGCM_sys_updateHeaders"
 }
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 1238)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh	(revision 1239)
@@ -1036,5 +1036,5 @@
 
 #D-#==================================================
-#D-function IGCM_sys_desactiv_variables
+#D-function IGCM_sys_activ_variables
 #D-* Purpose: set environement variables prior to execution
 #D-* Examples:
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 1238)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh	(revision 1239)
@@ -704,5 +704,5 @@
 
 #D-#==================================================
-#D-function IGCM_sys_desactiv_variables
+#D-function IGCM_sys_activ_variables
 #D-* Purpose: set environement variables prior to execution
 #D-* Examples:
@@ -747,4 +747,63 @@
 
   IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
+}
+
+############################################################
+# Update job headers to be used by the scheduler
+
+#D-#==================================================
+#D-function IGCM_sys_updateHeaders
+#D-* Purpose: Update job headers to be used by the scheduler
+#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP
+#D-
+function IGCM_sys_updateHeaders {
+  IGCM_debug_PushStack "IGCM_sys_updateHeaders"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_updateHeaders"
+  fi
+  typeset file
+  file=$1
+
+  if [ ${executionType} -eq 1 ] ; then
+    # MPMD + MPI
+    sed -e "/::openMPthreads::/d"                  \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 2 ] ; then
+    # MPMD + MPI + OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 3 ] ; then
+    # SPMD + MPI/OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 4 ] ; then
+    # SPMD + MPI only
+    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 5 ] ; then
+    # SPMD + OMP only
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "/::JobNumProcTot::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 6 ] ; then
+    # SEQUENTIAL THEN
+    sed -e "s/::JobNumProcTot::/1/"                \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  fi
+
+  IGCM_sys_Mv ${file}.tmp ${file}
+
+  IGCM_debug_PopStack "IGCM_sys_updateHeaders"
 }
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 1238)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_iitm.ksh	(revision 1239)
@@ -696,5 +696,5 @@
 
 #D-#==================================================
-#D-function IGCM_sys_desactiv_variables
+#D-function IGCM_sys_activ_variables
 #D-* Purpose: set environement variables prior to execution
 #D-* Examples:
@@ -739,4 +739,63 @@
 
   IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
+}
+
+############################################################
+# Update job headers to be used by the scheduler
+
+#D-#==================================================
+#D-function IGCM_sys_updateHeaders
+#D-* Purpose: Update job headers to be used by the scheduler
+#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP
+#D-
+function IGCM_sys_updateHeaders {
+  IGCM_debug_PushStack "IGCM_sys_updateHeaders"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_updateHeaders"
+  fi
+  typeset file
+  file=$1
+
+  if [ ${executionType} -eq 1 ] ; then
+    # MPMD + MPI
+    sed -e "/::openMPthreads::/d"                  \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 2 ] ; then
+    # MPMD + MPI + OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 3 ] ; then
+    # SPMD + MPI/OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 4 ] ; then
+    # SPMD + MPI only
+    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 5 ] ; then
+    # SPMD + OMP only
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "/::JobNumProcTot::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 6 ] ; then
+    # SEQUENTIAL THEN
+    sed -e "s/::JobNumProcTot::/1/"                \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  fi
+
+  IGCM_sys_Mv ${file}.tmp ${file}
+
+  IGCM_debug_PopStack "IGCM_sys_updateHeaders"
 }
 
Index: /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh
===================================================================
--- /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1238)
+++ /trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh	(revision 1239)
@@ -728,5 +728,5 @@
 
 #D-#==================================================
-#D-function IGCM_sys_desactiv_variables
+#D-function IGCM_sys_activ_variables
 #D-* Purpose: set environement variables prior to execution
 #D-* Examples:
@@ -771,4 +771,63 @@
 
   IGCM_debug_PopStack "IGCM_sys_desactiv_variables"
+}
+
+############################################################
+# Update job headers to be used by the scheduler
+
+#D-#==================================================
+#D-function IGCM_sys_updateHeaders
+#D-* Purpose: Update job headers to be used by the scheduler
+#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP
+#D-
+function IGCM_sys_updateHeaders {
+  IGCM_debug_PushStack "IGCM_sys_updateHeaders"
+  if ( $DEBUG_sys ) ; then
+    echo "IGCM_sys_updateHeaders"
+  fi
+  typeset file
+  file=$1
+
+  if [ ${executionType} -eq 1 ] ; then
+    # MPMD + MPI
+    sed -e "/::openMPthreads::/d"                  \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 2 ] ; then
+    # MPMD + MPI + OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${coreNumber}/"    \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 3 ] ; then
+    # SPMD + MPI/OMP
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 4 ] ; then
+    # SPMD + MPI only
+    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 5 ] ; then
+    # SPMD + OMP only
+    sed -e "s/::openMPthreads::/${openMPthreads}/" \
+        -e "/::JobNumProcTot::/d"                  \
+      ${file} > ${file}.tmp
+
+  elif [ ${executionType} -eq 6 ] ; then
+    # SEQUENTIAL THEN
+    sed -e "s/::JobNumProcTot::/1/"                \
+        -e "/::openMPthreads::/d"                  \
+      ${file} > ${file}.tmp
+
+  fi
+
+  IGCM_sys_Mv ${file}.tmp ${file}
+
+  IGCM_debug_PopStack "IGCM_sys_updateHeaders"
 }
 
