Index: trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
===================================================================
--- trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 938)
+++ trunk/libIGCM/libIGCM_config/libIGCM_config.ksh	(revision 939)
@@ -30,5 +30,5 @@
   # Read libIGCM compatibility version in config.card
   IGCM_card_DefineVariableFromOption ${configPath} Compatibility libIGCM
-  eval CompatibilityTag=${config_Compatibility_libIGCM} > /dev/null 2>&1
+  CompatibilityTag=${config_Compatibility_libIGCM}
 
   if [ ! "${CompatibilityTag}" = "${libIGCM_CurrentTag}" ] ; then
@@ -228,7 +228,7 @@
   echo
   IGCM_debug_Print 2 "Define Script_Output_Prefix and Exe_Output"
-  eval Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}
+  Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}
   IGCM_debug_Print 3 "Script_Output_Prefix = ${Script_Output_Prefix}"
-  eval Exe_Output=out_execution
+  Exe_Output=out_execution
   IGCM_debug_Print 3 "Exe_Output           = ${Exe_Output}"
 
@@ -571,7 +571,7 @@
     IGCM_config_DaysInPeriodLength
 
-    eval PeriodDateBegin=${DateBegin} > /dev/null 2>&1
+    PeriodDateBegin=${DateBegin}
     PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( ${PeriodLengthInDays} - 1 )) )
-    eval CumulPeriod=1 > /dev/null 2>&1
+    CumulPeriod=1
 
     #=================================================#
@@ -616,5 +616,5 @@
     PeriodDateBegin=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateBegin} )
     PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} )
-    eval CumulPeriod="${run_Configuration_CumulPeriod}" > /dev/null 2>&1
+    CumulPeriod=${run_Configuration_CumulPeriod}
 
     LastPeriodDateEnd=$( echo ${run_Configuration_OldPrefix} | sed -e "s/${config_UserChoices_JobName}_//" )
@@ -756,8 +756,8 @@
 
   # Period for save files
-  eval DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd} > /dev/null 2>&1
+  DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd}
 
   # Prefix for save files of this period
-  eval PREFIX=${config_UserChoices_JobName}_${DatesPeriod}  > /dev/null 2>&1
+  PREFIX=${config_UserChoices_JobName}_${DatesPeriod}
 
   # List of files that will be deleted in RUN_DIR after run
@@ -782,11 +782,14 @@
   fi
 
-  typeset ExeNameIn ExeNameFirst CompNameFirst
-  typeset comp i
-  typeset tempvar tempvarMPI tempvarNOD NbElts j NbExec
-
-  (( PROCESSUS_NUMBER = 0 ))
-  (( i=0 ))
-  (( NbExec=0 ))
+  #================================================================#
+  #       Prepare variables available for binary execution         #
+  #================================================================#
+
+  typeset ExeNameIn ExeNameFirst CompNameFirst comp i j
+  typeset tempvar tempvarMPI tempvarNOD NbElts NbExec
+
+  PROCESSUS_NUMBER=0
+  NbExec=0
+  i=0
 
   OK_PARA_MPI=false
@@ -814,5 +817,4 @@
 
     # Only if we really have an executable for the component :
-###    if [ X${ExeNameIn} != X\"\" ] ; then
     if ( [ "X${ExeNameIn}" != X\"\" ] && [ "X${ExeNameIn}" != "Xinca.dat" ] ) ; then
 
@@ -833,37 +835,32 @@
       if [ ${NbElts} -ge 2 ] ; then
         (( j = 2 ))
-
         while [ $j -lt ${NbElts} ] ; do
           eval tempvar=\${config_Executable_${comp}[${j}]}
+          IGCM_debug_Print 2 ${tempvar}
 
           if [ X${tempvar} = X ] ; then
-            echo "Error reading MPI/OMP parameters !!!"
-            echo "Check your config.card."
-            exit 1
+            IGCM_debug_Print 2 "Error reading MPI/OMP parameters !!!"
+            IGCM_debug_Exit "Check your config.card. Exit now"
+            IGCM_debug_Verif_Exit
           fi
-
-          eval IGCM_debug_Print 2 ${tempvar}
 
           case ${tempvar} in
           *[mM][pP][iI]*)
-               # Read MPI parameter for composante
+            # Read MPI parameter for composante
             eval ${comp}_PROC_MPI=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/MPI//" )
             OK_PARA_MPI=true;;
           *[oO][mM][pP]*)
-               # Read OMP parameter for composante
+            # Read OMP parameter for composante
             eval ${comp}_PROC_OMP=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/OMP//" )
             OK_PARA_OMP=true;;
           *[nN][oO][dD]*)
-               # Read NOD (NumBer of Nodes) parameter for composante
+            # Read NOD (NumBer of Nodes) parameter for composante
             eval ${comp}_PROC_NOD=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/NOD//" )
             OK_PARA_NOD=true
             OK_PARA_MPI=true;;
           esac
-
           (( j = j + 1 ))
         done
-
       fi
-
       eval tempvarMPI=\${${comp}_PROC_MPI}
       eval tempvarNOD=\${${comp}_PROC_NOD}
@@ -871,7 +868,5 @@
 
       (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP ))
-
-    fi
-
+    fi
     (( i=i+1 ))
   done
@@ -891,9 +886,8 @@
         if ( ${OK_PARA_MPMD} ) ; then
           # with MPMD ie CPL/oasis method
-          echo "We will use default number of MPI tasks for this machine : "
-          echo "${DEFAULT_NUM_PROC_OCE} for OCE; "
-          echo "${DEFAULT_NUM_PROC_CPL} for CPL; "
-          echo "${DEFAULT_NUM_PROC_ATM} for ATM; "
-          echo "${DEFAULT_NUM_PROC_TOTAL} for the total number of processors; "
+          IGCM_debug_Print 2 "Use default number of MPI tasks for this machine : "
+          IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_OCE} for OCE"
+          IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_CPL} for CPL"
+          IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_ATM} for ATM"
           OK_PARA_MPI=true
           CPL_PROC_MPI=${DEFAULT_NUM_PROC_CPL}
@@ -903,5 +897,5 @@
         else
           # with have only one executable
-          echo "We will use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${ExeNameFirst} "
+          IGCM_debug_Print 2 "Use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${ExeNameFirst} "
           OK_PARA_MPI=true
           eval ${CompNameFirst}_PROC_MPI=${BATCH_NUM_PROC_TOT}
@@ -914,10 +908,9 @@
     # Verification with PBS parameter
     if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then
-      echo "Warning with parallelization parameters !"
-      echo "Job header 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_  = ${PROCESSUS_NUMBER}."
-      echo "We stop now."
-      exit 1
+      IGCM_debug_Exit "ERROR with parallelization parameters !"
+      IGCM_debug_Print 2 "Job header variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} "
+      IGCM_debug_Print 2 "is the total number of _processors_ reserved."
+      IGCM_debug_Print 2 "It is not equal to the sum of _processus_  = ${PROCESSUS_NUMBER}."
+      IGCM_debug_Verif_Exit
     fi
     NUM_PROC_CPL=${CPL_PROC_MPI} # for backward compatibility
@@ -926,15 +919,15 @@
   else # BATCH_NUM_PROC_TOT=""
     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 "Please add BATCH_NUM_PROC_TOT variable in job header."
-      echo "We stop now."
-      exit 1
+      IGCM_debug_Exit "ERROR : missing value for ${BATCH_NUM_PROC_TOT} processors,"
+      IGCM_debug_Print 2 "You have parallel parameters in config->Executable->list."
+      IGCM_debug_Print 2 "Please add BATCH_NUM_PROC_TOT variable in job header as well."
+      IGCM_debug_Exit "Exit now."
+      IGCM_debug_Verif_Exit
     else
       # 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."
+        IGCM_debug_Print 2 "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)."
+        IGCM_debug_Print 2 "We set it to 1."
       fi
     fi
@@ -989,5 +982,5 @@
     IGCM_sys_Put_Out ${Exe_Output} ${R_OUT_KSH}/${PREFIX}_${Exe_Output}
   fi
-  eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}"
+  FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output}
 
   if [ ${DRYRUN} -le 1 ] ; then
@@ -1036,5 +1029,5 @@
         (( ExeSize=0 ))
       else
-        eval LS_bin=${R_EXE}/${ExeNameIn}
+        LS_bin=${R_EXE}/${ExeNameIn}
         IGCM_sys_FileSize ${LS_bin} ExeSize
 
@@ -1055,5 +1048,5 @@
         NextExeSize=${NextExeSize}", "${ExeSize}
       fi
-      eval LastCompExeSize=${run_Log_LastExeSize[$i]}
+      LastCompExeSize=${run_Log_LastExeSize[$i]}
       (( i=i+1 ))
 
@@ -1064,7 +1057,7 @@
           IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !"
           IGCM_debug_Print 1 "Save latest ${ExeNameIn} in ${R_OUT_EXE} !"
-          eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut}
+          FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut}
         fi
-        eval IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw
+        IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw
         UpdateExe=true
 
@@ -1096,5 +1089,5 @@
             $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/run.card
       fi
-      eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}_tail.txt"
+      FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output}_tail.txt
     fi
 
@@ -1166,5 +1159,5 @@
         if [ ${ExperienceLengthInDays} -lt 0 ] ; then
           IGCM_debug_Print 1 "Problem with dates in libIGCM.card : ${DateEnd} < ${DateBegin} ! You must check that."
-          IGCM_debug_Exit "IGCM_PeriodEnd" " Wrong Dates."
+          IGCM_debug_Exit "IGCM_PeriodEnd have wrong dates."
           IGCM_debug_Verif_Exit
         fi
@@ -1299,5 +1292,5 @@
 
     # Name of next Ksh Script output :
-    eval Script_Output="${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${CumulPeriod} )"
+    Script_Output=${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${CumulPeriod} )
 
     IGCM_debug_Print 1 "Submit next job"
