Index: /trunk/NVTK/INSTALL/JOBS/lance_batch.ksh
===================================================================
--- /trunk/NVTK/INSTALL/JOBS/lance_batch.ksh	(revision 1452)
+++ /trunk/NVTK/INSTALL/JOBS/lance_batch.ksh	(revision 1453)
@@ -149,62 +149,62 @@
 # --------------------------------------------------------------
 if [ ${CONF} == 'ORCA2_LIM' ] ; then
-CONFS=ORCA2
+    CONFS=ORCA2
 elif [ ${CONF} == 'GYRE' ] ; then
-CONFS=GYREO
+    CONFS=GYREO
 elif [ ${CONF} == 'GYRE_LOBSTER' ] ; then
-CONFS=GYREL
+    CONFS=GYREL
 elif [ ${CONF} == 'ORCA2_LIM_PISCES' ] ; then
-CONFS=OR2LP
+    CONFS=OR2LP
 elif [ ${CONF} == 'ORCA2_OFF_PISCES' ] ; then
-CONFS=OR2OP
+    CONFS=OR2OP
 elif [ ${CONF} == 'ZAGRIF' ] ; then
-CONFS=ZAGRI
+    CONFS=ZAGRI
 else
-CONFS=${CONF}
+    CONFS=${CONF}
 fi
 
 case ${TARGET} in
-     'osxxlf' )
-	  cp jhd_${TARGET}_${RUN} jhd_${TARGET}_${RUN}_tmp  ;;
-     'aix6' )
-          CAR_JNAM=$( grep '\# @ job_name' jhd_${TARGET}_${RUN} )
-          CAR_JMPI=$( grep '\# @ total_tasks' jhd_${TARGET}_${RUN} )
-          sed    -e "s%$CAR_JNAM%\# @ job_name = ${RUN}${CONFS}%" \
-          -e "s%$CAR_JMPI%\# @ total_tasks = $(( ${PRC} + ${NB_PROCS_IOSERVER} ))%" \
-          jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp  ;;
-     'sx8brodie' )
-          CAR_JNAM=$( grep '\#PBS -N ' jhd_${TARGET}_${RUN} )
-          CAR_JNAMO=$( grep '\#PBS -o ' jhd_${TARGET}_${RUN} )
-          CAR_JNAME=$( grep '\#PBS -e ' jhd_${TARGET}_${RUN} )
-          if [ ${RUN} = 'mpi' -o ${RUN} = 'omp' ] ; then
-              CAR_JMPI=$( grep '\#PBS -l cpunum_job' jhd_${TARGET}_${RUN} )
-              sed    -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
-              -e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
-              -e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
-              -e "s%$CAR_JMPI%\#PBS -l cpunum_job=$(( ${PRC} + ${NB_PROCS_IOSERVER} ))%" \
-              jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
-          else
-              sed    -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
-              -e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
-              -e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
-              jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
-          fi ;;
-     'sx8mercure' )
-          CAR_JNAM=$( grep '\#PBS -N ' jhd_${TARGET}_${RUN} )
-          CAR_JNAMO=$( grep '\#PBS -o ' jhd_${TARGET}_${RUN} )
-          CAR_JNAME=$( grep '\#PBS -e ' jhd_${TARGET}_${RUN} )
-          if [ ${RUN} = 'mpi' -o ${RUN} = 'omp' ] ; then
-              CAR_JMPI=$( grep '\#PBS -l cpunum_job' jhd_${TARGET}_${RUN} )
-              sed    -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
-              -e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
-              -e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
-              -e "s%$CAR_JMPI%\#PBS -l cpunum_job=$(( ${PRC} + ${NB_PROCS_IOSERVER} ))%" \
-              jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
-          else
-              sed    -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
-              -e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
-              -e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
-              jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
-          fi ;;
+    'osxxlf' )
+	cp jhd_${TARGET}_${RUN} jhd_${TARGET}_${RUN}_tmp  ;;
+    'aix6' )
+	CAR_JNAM=$( grep '\# @ job_name' jhd_${TARGET}_${RUN} )
+	CAR_JMPI=$( grep '\# @ total_tasks' jhd_${TARGET}_${RUN} )
+	sed -e "s%$CAR_JNAM%\# @ job_name = ${RUN}${CONFS}%" \
+	    -e "s%$CAR_JMPI%\# @ total_tasks = $(( ${PRC} + ${NB_PROCS_IOSERVER} ))%" \
+	    jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp  ;;
+    'sx8brodie' )
+	CAR_JNAM=$( grep '\#PBS -N ' jhd_${TARGET}_${RUN} )
+	CAR_JNAMO=$( grep '\#PBS -o ' jhd_${TARGET}_${RUN} )
+	CAR_JNAME=$( grep '\#PBS -e ' jhd_${TARGET}_${RUN} )
+	if [ ${RUN} = 'mpi' -o ${RUN} = 'omp' ] ; then
+	    CAR_JMPI=$( grep '\#PBS -l cpunum_job' jhd_${TARGET}_${RUN} )
+	    sed -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
+		-e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
+		-e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
+		-e "s%$CAR_JMPI%\#PBS -l cpunum_job=$(( ${PRC} + ${NB_PROCS_IOSERVER} ))%" \
+		jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
+	else
+	    sed -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
+		-e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
+		-e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
+		jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
+	fi ;;
+    'sx8mercure' )
+	CAR_JNAM=$( grep '\#PBS -N ' jhd_${TARGET}_${RUN} )
+	CAR_JNAMO=$( grep '\#PBS -o ' jhd_${TARGET}_${RUN} )
+	CAR_JNAME=$( grep '\#PBS -e ' jhd_${TARGET}_${RUN} )
+	if [ ${RUN} = 'mpi' -o ${RUN} = 'omp' ] ; then
+	    CAR_JMPI=$( grep '\#PBS -l cpunum_job' jhd_${TARGET}_${RUN} )
+	    sed -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
+		-e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
+		-e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
+		-e "s%$CAR_JMPI%\#PBS -l cpunum_job=$(( ${PRC} + ${NB_PROCS_IOSERVER} ))%" \
+		jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
+	else
+	    sed -e "s%$CAR_JNAM%\#PBS -N  ${RUN}${CONFS}%" \
+		-e "s%$CAR_JNAMO%\#PBS -o  ${RUN}${CONFS}_std%" \
+		-e "s%$CAR_JNAME%\#PBS -e  ${RUN}${CONFS}_err%" \
+		jhd_${TARGET}_${RUN} > jhd_${TARGET}_${RUN}_tmp
+	fi ;;
 esac
 
@@ -226,90 +226,91 @@
 
 case ${JOBTOL} in
-     'all' )
-              if [ ${MTIME} = 'timing' ] ; then 
-	          ind=0 
-		  iloop=4
-	      else
-	          ind=0 
-		  iloop=3
-              fi 
-	      ;;
-     'long' )
-              ind=0 
-	      iloop=1 ;;
-     'short' )
-              ind=1 
-	      iloop=3 ;;
-     'gtime' )
-              ind=3 
-	      iloop=4 ;;
+    'all' )
+	if [ ${MTIME} = 'timing' ] ; then 
+	    ind=0 
+	    iloop=4
+	else
+	    ind=0 
+	    iloop=3
+	fi 
+	;;
+    'long' )
+	ind=0 
+	iloop=1 ;;
+    'short' )
+	ind=1 
+	iloop=3 ;;
+    'gtime' )
+	ind=3 
+	iloop=4 ;;
 esac
 
+chwd () { 
+    word=$( grep "^ *${1}" job_tmp_${RUN}.ksh | cut -f 1 -d " " )
+    if [ "${word}" != "" ] 
+	then
+	sed -e "s@${word}@${1%=*}=\"${2}\"@" job_tmp_${RUN}.ksh > tmp$$
+	mv tmp$$ job_tmp_${RUN}.ksh
+    fi
+}
+
+chwd "RUN=xxx"              "${RUN}"
+chwd "NB_PROCS=xxx"          ${PRC}
+chwd "LAUNCH=xxx"           "${LAUN}"
+chwd "LEXE=xxx"             "${LSUB}"
+chwd "CPERF=xxx"            "${LPERF}"
+chwd "D_INPUT=xxx"          "${IODIR}"
+chwd "D_GET=xxx"            "${CMDGET}"
+chwd "REF_TAG=xxx"          "${REFTAG}" 
+chwd "MYO_EXP=xxx"          "${OWNEXP}"
+chwd "TSYMB=xxx"            "${SYMBOL}"
+chwd "USE_IOMPUT=xxx"        ${USE_IOMPUT}
+chwd "USE_IOSERVER=xxx"      ${USE_IOSERVER}
+chwd "NB_PROCS_IOSERVER=xxx" ${NB_PROCS_IOSERVER}
+
 while [ $ind -lt ${iloop} ]
-do
-
-    chwd () { 
-	word=$( grep "^ *${1}" job_tmp_${RUN}.ksh | cut -f 1 -d " " )
-	if [ "${word}" != "" ] 
-	then
-	    sed -e "s@${word}@${1%=*}=\"${2}\"@" job_tmp_${RUN}.ksh > tmp$$
-	    mv tmp$$ job_tmp_${RUN}.ksh
-	fi
-    }
-       chwd "type="                "${jobnam[$ind]}"
-       chwd "RUN=xxx"              "${RUN}"
-       chwd "NB_PROCS=xxx"          ${PRC}
-       chwd "LAUNCH=xxx"           "${LAUN}"
-       chwd "LEXE=xxx"             "${LSUB}"
-       chwd "CPERF=xxx"            "${LPERF}"
-       chwd "D_INPUT=xxx"          "${IODIR}"
-       chwd "D_GET=xxx"            "${CMDGET}"
-       chwd "REF_TAG=xxx"          "${REFTAG}" 
-       chwd "MYO_EXP=xxx"          "${OWNEXP}"
-       chwd "TSYMB=xxx"            "${SYMBOL}"
-       chwd "USE_IOMPUT=xxx"        ${USE_IOMPUT}
-       chwd "USE_IOSERVER=xxx"      ${USE_IOSERVER}
-       chwd "NB_PROCS_IOSERVER=xxx" ${NB_PROCS_IOSERVER}
-
-       mv job_tmp_${RUN}.ksh job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh
-
-       if [ ${jobnam[$ind]} = 'gtime' ] ; then
-
-           case ${TARGET} in
-                'aix6' )
-                     CAR_JTIM=$( grep '\# @ wall_clock_limit' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
-                     sed    -e "s%$CAR_JTIM%\# @ wall_clock_limit = ${LJTIM}%" \
-                     job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
-                'sx8brodie' )
-                     CAR_JTIMP=$( grep '\#PBS -l cputim_prc' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
-                     CAR_JTIMJ=$( grep '\#PBS -l cputim_job' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
-                     sed    -e "s%$CAR_JTIMP%\#PBS -l cputim_prc=${LJTIM}%" \
-                     -e "s%$CAR_JTIMJ%\#PBS -l cputim_job=${LJTIMJ}%" \
-                     job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
-                'sx8mercure' )
-                     CAR_JTIMP=$( grep '\#PBS -l cputim_prc' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
-                     CAR_JTIMJ=$( grep '\#PBS -l cputim_job' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
-                     sed    -e "s%$CAR_JTIMP%\#PBS -l cputim_prc=${LJTIM}%" \
-                     -e "s%$CAR_JTIMJ%\#PBS -l cputim_job=${LJTIMJ}%" \
-                     job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
-           esac
-           mv job_${RUN}_${jobnam[$ind]}.ksh_tmp job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh
-
-       fi
-
-       chmod 750 job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh
-
-       if [ ! -d ${dirjob[$ind]}/$OWNEXP ] ;  then
-           mkdir ${dirjob[$ind]}/$OWNEXP
-       fi
-       mv job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh ${dirjob[$ind]}/${OWNEXP}/.
-
-       if [ ${jobnam[$ind]} != '2_short' ] ; then
-           cd ${dirjob[$ind]}/${OWNEXP}
-           ${LAUN}job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh &
-           cd ../..
-       fi
-
-       let ind=$ind+1
+  do
+  
+  chwd "type=" "${jobnam[$ind]}"  
+  cp job_tmp_${RUN}.ksh job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh
+  
+  if [ ${jobnam[$ind]} = 'gtime' ] ; then
+      
+      case ${TARGET} in
+	  'aix6' )
+	      CAR_JTIM=$( grep '\# @ wall_clock_limit' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
+	      sed -e "s%$CAR_JTIM%\# @ wall_clock_limit = ${LJTIM}%" \
+		  job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
+	  'sx8brodie' )
+	      CAR_JTIMP=$( grep '\#PBS -l cputim_prc' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
+	      CAR_JTIMJ=$( grep '\#PBS -l cputim_job' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
+	      sed -e "s%$CAR_JTIMP%\#PBS -l cputim_prc=${LJTIM}%" \
+		  -e "s%$CAR_JTIMJ%\#PBS -l cputim_job=${LJTIMJ}%" \
+		  job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
+	  'sx8mercure' )
+	      CAR_JTIMP=$( grep '\#PBS -l cputim_prc' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
+	      CAR_JTIMJ=$( grep '\#PBS -l cputim_job' job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh )
+	      sed -e "s%$CAR_JTIMP%\#PBS -l cputim_prc=${LJTIM}%" \
+		  -e "s%$CAR_JTIMJ%\#PBS -l cputim_job=${LJTIMJ}%" \
+		  job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh > job_${RUN}_${jobnam[$ind]}.ksh_tmp  ;;
+      esac
+      mv job_${RUN}_${jobnam[$ind]}.ksh_tmp job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh
+      
+  fi
+  
+  chmod 750 job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh
+  
+  if [ ! -d ${dirjob[$ind]}/$OWNEXP ] ;  then
+      mkdir ${dirjob[$ind]}/$OWNEXP
+  fi
+  mv job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh ${dirjob[$ind]}/${OWNEXP}/.
+  
+  if [ ${jobnam[$ind]} != '2_short' ] ; then
+      cd ${dirjob[$ind]}/${OWNEXP}
+      ${LAUN}job_${RUN}_${jobnam[$ind]}_${OWNEXP}.ksh &
+      cd ../..
+  fi
+  
+  let ind=$ind+1
 done
 rm -f job_tmp_${RUN}.ksh
@@ -330,5 +331,5 @@
     mv cron_jobs.$$ cron_jobs.ksh &&  rm -rf cron_jobs.$$
     chmod 744 cron_jobs.ksh 
-
+    
     if [ ${TARGET} != 'osxxlf' ]; then
         ./cron_jobs.ksh ${CONF} ${CONFS} &
