Index: branches/libIGCM_MPI_OpenMP/libIGCM_config/libIGCM_config.ksh
===================================================================
--- branches/libIGCM_MPI_OpenMP/libIGCM_config/libIGCM_config.ksh	(revision 489)
+++ branches/libIGCM_MPI_OpenMP/libIGCM_config/libIGCM_config.ksh	(revision 490)
@@ -108,6 +108,8 @@
     eval Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}
     IGCM_debug_Print 3 "Script_Output_Prefix = ${Script_Output_Prefix}"
-    eval Exe_Output=out_${config_Executable_Name}
-    IGCM_debug_Print 3 "Exe_Output           = ${Exe_Output}"
+#MM : obsolete !
+#    eval Exe_Output=out_${config_Executable_Name}
+    eval Exe_Output=out_execution
+#    IGCM_debug_Print 3 "Exe_Output           = ${Exe_Output}"
 
     #==================================
@@ -536,4 +538,133 @@
     fi
 
+    typeset ExeNameIn
+    typeset comp i
+    typeset tempvar tempvarMPI tempvarNOD NbElts j
+
+    (( PROCESSUS_NUMBER = 0 ))
+    (( i=0 ))
+
+    OK_PARA_MPI=false
+    OK_PARA_OMP=false
+    OK_PARA_NOD=false
+    for comp in ${config_ListOfComponents[*]} ; do
+
+	IGCM_debug_Print 1 ${comp}
+
+	eval ExeNameIn=\${config_Executable_${comp}[0]}
+
+	# NO order in config.card for parallelized values ! 
+	# just use suffix : MPI , OMP and NOD (for number of NODes.)
+
+	# NOD is the number of NODes allocated
+	eval ${comp}_PROC_NOD=0
+
+	# MPI is the number of MPI processus per nodes
+	eval ${comp}_PROC_MPI=0
+
+	# OMP is the number of OpenMP threads per MPI processus
+	eval ${comp}_PROC_OMP=0
+	
+	# Only if we really have an executable for the component :
+	if [ X${ExeNameIn} != X\"\" ] ; then
+	    eval NbElts=\${#config_Executable_${comp}[@]}
+	    if [ ${NbElts} -gt 2 ] ; then
+		(( j = 2 ))
+		eval ${comp}_PROC_MPI=1
+		eval ${comp}_PROC_OMP=1
+		eval ${comp}_PROC_NOD=1
+
+		while [ $j -lt ${NbElts} ] ; do 
+		    eval tempvar=\${config_Executable_${comp}[${j}]}
+
+		    echo 
+#MM BUG impossible ?!
+		    if [ X${tempvar} == X ] ; then
+			echo "Error reading MPI/OMP parameters !!!" 
+			echo "Check your config.card." 
+		    # MM : Ã  enlever :
+			exit 1
+                        #break
+		    fi
+
+# pb		    eval ${comp}_PROC_MPI=1
+# pb 		    eval ${comp}_PROC_OMP=1
+# pb		    eval ${comp}_PROC_NOD=1
+
+		    eval IGCM_debug_Print 2 ${tempvar}
+
+		    case ${tempvar} in
+			*MPI)
+                            # Read MPI parameter for composante
+			    eval ${comp}_PROC_MPI=$( echo ${tempvar} | sed -e "s/MPI//" )
+			    OK_PARA_MPI=true;;
+			*OMP)
+                            # Read OMP parameter for composante
+			    eval ${comp}_PROC_OMP=$( echo ${tempvar} | sed -e "s/OMP//" )
+			    OK_PARA_OMP=true;;
+			*NOD)
+                            # Read NOD (NumBer of Nodes) parameter for composante
+			    eval ${comp}_PROC_NOD=$( echo ${tempvar} | sed -e "s/NOD//" )
+			    OK_PARA_NOD=true
+			    OK_PARA_MPI=true;;
+		    esac
+
+		    (( j = j + 1 ))
+		done
+
+		eval tempvarMPI=\${${comp}_PROC_MPI}
+		eval tempvarNOD=\${${comp}_PROC_NOD}
+		eval tempvarOMP=\${${comp}_PROC_OMP}
+		(( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP ))
+ 	    fi
+	fi
+
+	(( i=i+1 ))
+    done
+
+    # sequential case !
+    if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then
+	(( PROCESSUS_NUMBER = 1 ))
+	echo "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)."
+	echo "We set it to 1."
+    fi
+
+    IGCM_debug_Print 1 "MPI/OMP treatment PROCESSUS_NUMBER = ${PROCESSUS_NUMBER}"
+
+    # Verification with PBS parameter
+    if [ X${BATCH_NUM_PROC_TOT} != X ] ; then
+	if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then
+	    echo "Warning with parallelization parameters !"
+	    echo "PBS variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} "
+	    echo " is the total number of _processors_ reserved."
+	    echo "It is not equal to the sum of _processus_ in config.card = ${PROCESSUS_NUMBER}."
+	fi
+	if ( ! ${OK_PARA_MPI} ) ; then
+	    if [ ${BATCH_NUM_PROC_TOT} -gt 1 ] ; then
+		echo "You have given a reservation of ${BATCH_NUM_PROC_TOT} processors,"
+		echo "but you havn't filled the parallel parameter in config->Executable->list."
+		echo "This is the old method and it is no more supported."
+		echo "Please read documentation or config specific comments."
+		echo "We stop now."
+		exit 1
+	    else 
+		PROCESSUS_NUMBER=1
+	    fi
+	fi
+    else
+	if ( ${OK_PARA_MPI} ) ; then
+	    echo "You have not given a value of ${BATCH_NUM_PROC_TOT} processors,"
+	    echo "but you have filled the parallel parameter in config->Executable->list."
+	    echo "This is the old method and it is no more supported."
+	    echo "Please read documentation or config specific comments."
+	    echo "We stop now."
+	    exit 1
+	fi
+    fi
+
+#     if ( ${OK_PARA_MPI} || ${OK_PARA_OMP} || ${OK_PARA_NOD} ) ; then
+    IGCM_sys_build_execution_scripts
+#     fi
+
     ExecutionFail=false
 
