Index: /BOL/script_install/install_lmdz_new.sh
===================================================================
--- /BOL/script_install/install_lmdz_new.sh	(revision 4217)
+++ /BOL/script_install/install_lmdz_new.sh	(revision 4218)
@@ -19,6 +19,6 @@
 #
 # The sources of the models can be found in the "modeles" directory.
-# In the present case, LMDZ, ORCHIDEE, and IOIPSL or XIOS (handling of input-outputs
-# using the NetCDF library).
+# In the present case, LMDZ, ORCHIDEE, and IOIPSL or XIOS (handling of
+# input-outputs using the NetCDF library).
 #
 # The script downloads various source files (including a version of NetCDF)
@@ -56,5 +56,6 @@
 	save_pub_locally=0
 	if [ $save_pub_locally = 1 ] ; then # saving wget files on ~/LMDZ/pub
-	    dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir ; cp -r `basename $1` $dir
+	    dir=~/LMDZ/pub/`dirname $1` ; mkdir -p $dir
+	    cp -r `basename $1` $dir
 	fi
     fi
@@ -197,6 +198,9 @@
 	"-compiler") compiler=$2
                      case $compiler in
-			 "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift ; shift ;;
-			 *) echo "Only gfortran , ifort or pgf90 for the compiler option" ; exit
+			 "gfortran"|"ifort"|"pgf90") compiler=$2 ; shift
+						     shift ;;
+			 *) echo "Only gfortran , ifort or pgf90 for the " \
+				 "compiler option"
+			    exit
                      esac ;;
 	"-d") grid_resolution=$2 ; shift ; shift ;;
@@ -210,5 +214,11 @@
 	"-SCM") SCM=1 ; shift ;;
 	"-opt_makelmdz") OPT_MAKELMDZ="$2" ; shift ; shift ;;
-	"-rrtm") rrtm="$2" ; if [ "$2" = "false" ] ; then rad="oldrad" ; else rad="rrtm" ; fi ; shift ; shift ;;
+	"-rrtm") rrtm="$2"
+		 if [ "$2" = "false" ] ; then
+		     rad="oldrad"
+		 else
+		     rad="rrtm"
+		 fi
+		 shift ; shift ;;
 	"-rad") rad=$2
 		case $rad in
@@ -218,6 +228,9 @@
 	"-parallel") parallel=$2
                      case $parallel in
-			 "none"|"mpi"|"omp"|"mpi_omp") parallel=$2 ; shift ; shift ;;
-			 *) echo Only none mpi omp mpi_omp for the parallel option ; exit
+			 "none"|"mpi"|"omp"|"mpi_omp") parallel=$2 ; shift
+						       shift ;;
+			 *) echo Only none mpi omp mpi_omp for the parallel \
+				 option
+			    exit
                      esac ;;
 	"-bench") bench=$2 ; shift ; shift ;;
@@ -233,5 +246,7 @@
 done
 
-# Option de compilation du rayonnement : depend de $mysvn ><= r4185, sera donc definie plus bas
+# Option de compilation du rayonnement : depend de $mysvn ><= r4185,
+# sera donc definie plus bas
+
 #opt_rad=""
 #case $rad in
@@ -261,5 +276,6 @@
 if [ "$veget" = 'NONE' ] ; then
     suff_orc=''
-    #For use with tutorial, orchidee_rev is also defined (will be written in surface_env at the end of the script)
+    #For use with tutorial, orchidee_rev is also defined (will be
+    #written in surface_env at the end of the script)
     orchidee_rev=''
 else
@@ -268,5 +284,9 @@
 
 
-if [ $parallel = none ] ; then sequential=1; suff_exe='_seq' ; else sequential=0; suff_exe='_para_mem' ; fi
+if [ $parallel = none ] ; then
+    sequential=1; suff_exe='_seq'
+else
+    sequential=0; suff_exe='_para_mem'
+fi
 
 #Chemin pour placer le modele
@@ -418,5 +438,13 @@
 BASE_LD="$OPT_GPROF"
 OPTPREC="$OPT_GPROF"
-ARFLAGS="rs" ; if [ -f /etc/issue ] ; then if [ "`grep -i ubuntu /etc/issue`" != "" ] ; then if [ "`grep -i ubuntu /etc/issue | awk ' { print $2 } ' | cut -d. -f1`" -ge 16 ] ; then ARFLAGS="rU" ; fi ; fi ; fi
+ARFLAGS="rs"
+if [ -f /etc/issue ] ; then
+    if [ "`grep -i ubuntu /etc/issue`" != "" ] ; then
+	if [ "`grep -i ubuntu /etc/issue | awk ' { print $2 } ' | cut -d. -f1`" -ge 16 ]
+	then
+	    ARFLAGS="rU"
+	fi
+    fi
+fi
 
 
@@ -428,5 +456,7 @@
     fmod='I '
     OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
-    if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE" ; fi
+    if [ $real = r8 ] ; then
+	OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE"
+    fi
     export F90FLAGS=" -ffree-form $OPTIMNC"
     export FFLAGS=" $OPTIMNC"
@@ -441,5 +471,7 @@
     BASE_LD="$BASE_LD -lblas"
     fmod='I '
-    if [ $real = r8 ] ; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer" ; fi
+    if [ $real = r8 ] ; then
+	OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer"
+    fi
     export F90FLAGS=" -ffree-form $OPTIMNC"
     export FFLAGS=" $OPTIMNC"
@@ -603,9 +635,12 @@
 	chmod u=rwx install_netcdf4_hdf5.bash
 	if [ "$compiler" = "gfortran" ] ; then
-	    ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc -FC gfortran -CXX g++ -MPI $root_mpi  > $netcdflog 2>&1
+	    ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC gcc \
+			-FC gfortran -CXX g++ -MPI $root_mpi  > $netcdflog 2>&1
 	elif [ "$compiler" = "ifort" ] ; then
-	    ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc -FC ifort -CXX icpc -MPI $root_mpi  > $netcdflog 2>&1
+	    ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC icc \
+			  -FC ifort -CXX icpc -MPI $root_mpi  > $netcdflog 2>&1
 	elif [ "$compiler" = "pgf90" ] ; then
-	    ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc -FC pgf90 -CXX pgCC -MPI $root_mpi  > $netcdflog 2>&1
+	    ./install_netcdf4_hdf5.bash -prefix $MODEL/netcdf4_hdf5 -CC pgcc \
+			  -FC pgf90 -CXX pgCC -MPI $root_mpi  > $netcdflog 2>&1
 	else
             echo "unexpected compiler $compiler" ; exit
@@ -633,5 +668,5 @@
 then
     if [ $ioipsl = 1 ] ; then
-	#=========================================================================
+	#=====================================================================
 	echo OK ioipsl=$ioipsl
 	echo '##########################################################'
@@ -645,8 +680,13 @@
 	cd util
 	cp AA_make.gdef AA_make.orig
-	F_C="$compiler -c " ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then F_C="$compiler -c -cpp " ; fi
+	F_C="$compiler -c "
+	if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ]
+	then
+	    F_C="$compiler -c -cpp "
+	fi
 	if [ "$compiler" = "pgf90" ] ; then F_C="$compiler -c -Mpreprocess" ; fi
 	sed -e 's/^\#.*.g95.*.\#.*.$/\#/' AA_make.gdef > tmp
-	sed -e "s:F_L = g95:F_L = $compiler:" -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
+	sed -e "s:F_L = g95:F_L = $compiler:" \
+	    -e "s:F_C = g95 -c -cpp:F_C = $F_C": \
 	    -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
 	    -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
@@ -669,5 +709,6 @@
 	else # bash
 	    sed -e s:/bin/ksh:/bin/bash:g ins_make > ins_make.bash
-	    if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then # Bidouille pour compiler sur ada des vieux modipsl.tar
+	    if [ "`grep jeanzay AA_make.gdef`" = "" ] ; then
+		# Bidouille pour compiler sur ada des vieux modipsl.tar
 		echo 'Warning jean-zay not in AA_make.gdef'
 		echo 'Think about updating'
@@ -697,5 +738,6 @@
 	$make clean
 	$make > $ioipsllog 2>&1
-	if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then # copy module files to lib
+	if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then
+	    # copy module files to lib
 	    cp -f *.mod ../../../lib
 	fi
@@ -752,9 +794,11 @@
     chmod u=rwx install_xios.bash
     if [ ${hostname:0:5} = jean- ] ; then
-	svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 XIOS
+	svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5 \
+	    XIOS
 	cd XIOS/arch
 	svn update
 	cd ..
-	echo "Compiling XIOS, start" `date` "(it takes about 20 min on Jean-Zay)"
+	echo "Compiling XIOS, start" `date` \
+	     "(it takes about 20 min on Jean-Zay)"
 	echo "log file: $xioslog"
 	./make_xios --prod --arch $arch --job 4 > xios.log 2>&1
@@ -782,5 +826,6 @@
 	orchidee_rev=$veget
 	if [ $veget -lt 4465 ] ; then
-	    echo 'Stopping, ORCHIDEE version too old, script needs work on the CPP flags to pass to makelmdz'
+	    echo 'Stopping, ORCHIDEE version too old, script needs work on ' \
+		 'the CPP flags to pass to makelmdz'
 	    exit 1
 	fi
@@ -789,9 +834,12 @@
 	orcbranch=`svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r $veget |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}'`
 	# switch to that branch
-	echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at orchidee-help@listes.ipsl.fr
-	svn switch -r $veget --accept theirs-full svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch
+	echo IF YOU INSTALL ORCHIDEE THE VERY FIRST TIME, ASK for PASSWORD at \
+	     orchidee-help@listes.ipsl.fr
+	svn switch -r $veget --accept theirs-full \
+	    svn://forge.ipsl.jussieu.fr/orchidee/$orcbranch
 	svn log -r $veget | grep  $veget
 	if [  $? -gt 0 ] ; then
-            echo 'Cannot update ORCHIDEE as not on the right branch for ORCHIDEE'
+            echo 'Cannot update ORCHIDEE as not on the right branch for ' \
+		 'ORCHIDEE'
             exit
 	fi
@@ -800,5 +848,6 @@
     fi
     # Correctif suite debug Jean-Zay
-    sed -i -e 's/9010  FORMAT(A52,F17.14)/9010  FORMAT(A52,F20.14)/' src_stomate/stomate.f90
+    sed -i -e 's/9010  FORMAT(A52,F17.14)/9010  FORMAT(A52,F20.14)/' \
+	src_stomate/stomate.f90
     opt_orc="-prod" ; if [ "$optim" = "-debug" ] ; then opt_orc="-debug" ; fi
 
@@ -821,7 +870,11 @@
 
 	# Correctif suite debug Jean-Zay
-	if [ -f src_global/time.f90 ] ; then sed -i -e 's/CALL tlen2itau/\!CALL tlen2itau/' src_global/time.f90 ; fi
+	if [ -f src_global/time.f90 ] ; then
+	    sed -i -e 's/CALL tlen2itau/\!CALL tlen2itau/' src_global/time.f90
+	fi
 	###################################################################
-	if [ "$veget_version" == "false" ] ; then veget_version=orchidee2.0 ; fi
+	if [ "$veget_version" == "false" ] ; then
+	    veget_version=orchidee2.0
+	fi
 	cd arch
 	sed -e s:"%COMPILER        .*.$":"%COMPILER            $compiler":1 \
@@ -835,5 +888,6 @@
 	    -e s:"%ARFLAGS         .*.$":"%ARFLAGS             $ARFLAGS":1 \
 	    arch-gfortran.fcm > arch-local.fcm
-	echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" > arch-local.path
+	echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \
+	     > arch-local.path
 	echo "NETCDF_INCDIR=${ncdfdir}/include" >> arch-local.path
 	echo "IOIPSL_INCDIR=$ORCHPATH/../../lib" >> arch-local.path
@@ -843,19 +897,29 @@
 	cd ../
 
-	echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none -arch $arch
-	./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel none -arch $arch > $orchideelog 2>&1
+	echo ./makeorchidee_fcm -j $xios_orchid $opt_orc -parallel none \
+	     -arch $arch
+	./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel none \
+			   -arch $arch > $orchideelog 2>&1
 	pwd
     else # of "if [ -d tools ]"
 	if [ -d src_parallel ] ; then
 	    liste_src="parallel parameters global stomate sechiba driver"
-	    if [ "$veget_version" == "false" ] ; then veget_version=orchidee2.0 ; fi
-	fi
-	for d in $liste_src ; do src_d=src_$d
-				 echo src_d $src_d
-				 echo ls ; ls
-				 if [ ! -d $src_d ] ; then echo Problem orchidee : no $src_d ; exit ; fi
-				 cd $src_d ; \rm -f *.mod make ; $make clean
-				 $make > $orchideelog 2>&1 ; if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then cp -f *.mod ../../../lib ; fi
-				 cd ..
+	    if [ "$veget_version" == "false" ] ; then
+		veget_version=orchidee2.0
+	    fi
+	fi
+	for d in $liste_src ; do
+	    src_d=src_$d
+	    echo src_d $src_d
+	    echo ls ; ls
+	    if [ ! -d $src_d ] ; then
+		echo Problem orchidee : no $src_d ; exit
+	    fi
+	    cd $src_d ; \rm -f *.mod make ; $make clean
+	    $make > $orchideelog 2>&1
+	    if [ "$compiler" = "$gfortran" -o "$compiler" = "mpif90" ] ; then
+		cp -f *.mod ../../../lib
+	    fi
+	    cd ..
 	done
     fi # of "if [ -d tools ]"
@@ -887,5 +951,6 @@
     cd arch
     # arch-local.path file
-    echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" > arch-local.path
+    echo "NETCDF_LIBDIR=\"-L${ncdfdir}/lib -lnetcdff -lnetcdf\"" \
+	 > arch-local.path
     echo "NETCDF_INCDIR=-I${ncdfdir}/include" >> arch-local.path
     echo 'NETCDF95_INCDIR=$LMDGCM/../../include' >> arch-local.path
@@ -938,5 +1003,6 @@
     set +e ; svn info | grep -q 'http:'
     if [ $? = 0 ] ; then
-        svn switch --relocate http://svn.lmd.jussieu.fr/LMDZ https://svn.lmd.jussieu.fr/LMDZ
+        svn switch --relocate http://svn.lmd.jussieu.fr/LMDZ \
+	    https://svn.lmd.jussieu.fr/LMDZ
     fi
     svn update $svnopt
@@ -945,5 +1011,6 @@
 
 ##################################################################
-# Retrieve the final svn release number, and adjust compilation options accordingly
+# Retrieve the final svn release number, and adjust compilation
+# options accordingly
 mysvn=`svnversion . | egrep -o "[0-9]+"`
 
@@ -953,10 +1020,17 @@
 case $rad in
     oldrad) iflag_rrtm=0 ; NSW=2 ; opt_rad="" ;;
-    rrtm)   iflag_rrtm=1 ; NSW=6 ; if [ $mysvn -le 4185 ] ; then opt_rad="-rrtm true" ; else opt_rad="-rad rrtm" ; fi ;;
+    rrtm)   iflag_rrtm=1 ; NSW=6
+	    if [ $mysvn -le 4185 ] ; then
+		opt_rad="-rrtm true"
+	    else
+		opt_rad="-rad rrtm"
+	    fi ;;
     ecrad)  iflag_rrtm=2 ; NSW=6 ; opt_rad="-rad ecrad" ;;
     *) echo Only oldrad rrtm ecrad for rad option ; exit
 esac
 
-if [ $mysvn -le 4185 -a $rad = "ecrad" ] ; then echo "ecrad only available for LMDZ rev starting with 4186 " ; exit ; fi
+if [ $mysvn -le 4185 -a $rad = "ecrad" ] ; then
+    echo "ecrad only available for LMDZ rev starting with 4186 " ; exit
+fi
 
 ##################################################################
@@ -984,13 +1058,22 @@
 echo '##################################################################'
 
-if [ "$env_file" != "" ] ; then mv arch/arch-${arch}.env arch/arch-${arch}.orig ; \cp -f $env_file arch/arch-${arch}.env ; fi
-
-if [ $compile_with_fcm = 1 ] ; then makelmdz="makelmdz_fcm $optim -arch $arch -j 8 " ; else makelmdz="makelmdz $optim -arch $arch" ; fi
+if [ "$env_file" != "" ] ; then
+    mv arch/arch-${arch}.env arch/arch-${arch}.orig
+    \cp -f $env_file arch/arch-${arch}.env
+fi
+
+if [ $compile_with_fcm = 1 ] ; then
+    makelmdz="makelmdz_fcm $optim -arch $arch -j 8 "
+else
+    makelmdz="makelmdz $optim -arch $arch"
+fi
 
 # sequential compilation
 if [ "$sequential" = 1 ] ; then
     echo Sequential compilation command, saved in compile.sh:
-    echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm "
-    echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm " > compile.sh
+    echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp " \
+	 "-d ${grid_resolution} -v $veget_version gcm "
+    echo "./$makelmdz $optim $OPT_MAKELMDZ $optim $opt_rad $opt_cosp " \
+	 "-d ${grid_resolution} -v $veget_version gcm " > compile.sh
     chmod +x ./compile.sh
     if [ $bench = 1 ] ; then
@@ -1031,11 +1114,17 @@
 	echo Compiling ORCHIDEE in parallel mode `date`
 	echo logfile $orchideelog
-	echo "NOTE : to recompile it when necessary, use ./compile_orc.sh in modipsl/modeles/ORCHIDEE"
-	echo ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc -parallel $parallel -arch $arch > compile_orc.sh
-	echo ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel -arch $arch >> compile_orc.sh
-	echo echo Now you must also recompile LMDZ, by running ./compile.sh in modeles/LMDZ >> compile_orc.sh
+	echo "NOTE : to recompile it when necessary, use ./compile_orc.sh " \
+	     "in modipsl/modeles/ORCHIDEE"
+	echo ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \
+	     -parallel $parallel -arch $arch > compile_orc.sh
+	echo ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc \
+	     -parallel $parallel -arch $arch >> compile_orc.sh
+	echo echo Now you must also recompile LMDZ, by running ./compile.sh \
+	     in modeles/LMDZ >> compile_orc.sh
 	chmod u+x compile_orc.sh
-	./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc -parallel $parallel -arch $arch > $orchideelog 2>&1
-	./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel -arch $arch >> $orchideelog 2>&1
+	./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc \
+			   -parallel $parallel -arch $arch > $orchideelog 2>&1
+	./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel \
+			   -arch $arch >> $orchideelog 2>&1
 	echo End of ORCHIDEE compilation in parallel mode `date`
     elif [ $veget != 'NONE' ] ; then
@@ -1067,17 +1156,29 @@
     if [ ${hostname:0:5} = jean- -a "$cosp" = "v2" ] ; then
 
-	echo LMDZ compilation command in parallel mode, saved in compile.sh, is :
-	echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige ! )"
-	# ATTENTION le probleme de cospv2 sur jean-zay en mode prod n est pas corrige
-	echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
-	echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm
+	echo LMDZ compilation command in parallel mode, saved in compile.sh, \
+	     is :
+	echo "(ATTENTION le probleme de cospv2 sur jean-zay en mode prod " \
+	     "n est pas corrige ! )"
+	# ATTENTION le probleme de cospv2 sur jean-zay en mode prod n
+	# est pas corrige
+	echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
+	     $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
+	     -parallel $parallel gcm >> compile.sh
+	echo ./$makelmdz -dev $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
+	     $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
+	     -parallel $parallel gcm
     else
-	echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm >> compile.sh
-	echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp $opt_makelmdz_xios -d \$resol -v $veget_version -mem -parallel $parallel gcm
+	echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
+	     $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
+	     -parallel $parallel gcm >> compile.sh
+	echo ./$makelmdz $optim $OPT_MAKELMDZ $opt_rad $opt_cosp \
+	     $opt_makelmdz_xios -d \$resol -v $veget_version -mem \
+	     -parallel $parallel gcm
     fi
     chmod +x ./compile.sh
 
     if [ $bench = 1 ] ; then
-	echo Compiling LMDZ in parallel mode `date`,  LMDZ log file: $lmdzlog ; ./compile.sh > $lmdzlog 2>&1
+	echo Compiling LMDZ in parallel mode `date`,  LMDZ log file: $lmdzlog
+	./compile.sh > $lmdzlog 2>&1
     fi
 
@@ -1094,5 +1195,7 @@
 gcm=""
 #for exe in gcm.e bin/gcm_${grid_resolution}_phylmd_seq_orch.e bin/gcm_${grid_resolution}_phylmd_seq.e bin/gcm_${grid_resolution}_phylmd_para_mem_orch.e bin/gcm_${grid_resolution}_phylmd_para_mem.e  ; do
-for exe in gcm.e bin/gcm_${grid_resolution}_phylmd${suff_exe}${suff_orc}.e ; do   if [ -f $exe ] ; then gcm=$exe ; fi
+for exe in gcm.e bin/gcm_${grid_resolution}_phylmd${suff_exe}${suff_orc}.e
+do
+    if [ -f $exe ] ; then gcm=$exe ; fi
 done
 
@@ -1116,5 +1219,6 @@
 
 if [ $bench = tuto ] ; then
-    myget Training/tutorial.tar ; tar xvf tutorial.tar ; cd TUTORIAL ; ./init.sh
+    myget Training/tutorial.tar ; tar xvf tutorial.tar ; cd TUTORIAL
+    ./init.sh
 
 elif [[ $bench = 1 && ! -d BENCH${grid_resolution} ]] ; then
@@ -1168,5 +1272,6 @@
 	cp ../DefLists/file_def_hist*xml .
 	# adapt iodef.xml to use attached mode
-	sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' iodef.xml > tmp
+	sed -e 's@"using_server" type="bool">true@"using_server" type="bool">false@' \
+	    iodef.xml > tmp
 	\mv -f tmp iodef.xml
 
@@ -1176,9 +1281,17 @@
 	do
 	    if [ "$histfile" = "file_def_histday_lmdz.xml" ] ; then
-		sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile
-		sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile
-		sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile
+		sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".TRUE."@' \
+		    $histfile > tmp
+		\mv -f tmp $histfile
+		sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile \
+		    > tmp
+		\mv -f tmp $histfile
+		sed -e 's@compression_level="2"@compression_level="0"@' \
+		    $histfile > tmp
+		\mv -f tmp $histfile
 	    else
-		sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' $histfile > tmp ; \mv -f tmp $histfile
+		sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \
+		    $histfile > tmp
+		\mv -f tmp $histfile
 	    fi
 	done
@@ -1190,17 +1303,31 @@
 	if [ "$cosp" = "v1" ] ; then
 	    histfile=file_def_histdayCOSP_lmdz.xml
-	    sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp ; \mv -f tmp $histfile
-	    sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp ; \mv -f tmp $histfile
-	    sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile
+	    sed -e 's@enabled=".FALSE."@enabled=".TRUE."@' $histfile > tmp
+	    \mv -f tmp $histfile
+	    sed -e 's@output_level="_AUTO_"@output_level="5"@' $histfile > tmp
+	    \mv -f tmp $histfile
+	    sed -e 's@compression_level="2"@compression_level="0"@' \
+		$histfile > tmp
+	    \mv -f tmp $histfile
 	fi
 	if [ "$cosp" = "v2" ] ; then
 	    histfile=file_def_histdayCOSPv2_lmdz.xml
-	    sed -e 's@compression_level="2"@compression_level="0"@' $histfile > tmp ; \mv -f tmp $histfile
+	    sed -e 's@compression_level="2"@compression_level="0"@' \
+		$histfile > tmp
+	    \mv -f tmp $histfile
 	    contextfile=context_lmdz.xml
-	    sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile
-	    sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile
-	    sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' $contextfile > tmp ; \mv -f tmp $contextfile
+	    sed -e 's@src="./file_def_histdayCOSP_lmdz.xml"@src="./file_def_histdayCOSPv2_lmdz.xml"@' \
+		$contextfile > tmp
+	    \mv -f tmp $contextfile
+	    sed -e 's@src="./file_def_histmthCOSP_lmdz.xml"@src="./file_def_histmthCOSPv2_lmdz.xml"@' \
+		$contextfile > tmp
+	    \mv -f tmp $contextfile
+	    sed -e 's@src="./file_def_histhfCOSP_lmdz.xml"@src="./file_def_histhfCOSPv2_lmdz.xml"@' \
+		$contextfile > tmp
+	    \mv -f tmp $contextfile
 	    fieldfile=field_def_lmdz.xml
-	    sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile > tmp ; \mv -f tmp $fieldfile
+	    sed -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' $fieldfile \
+		> tmp
+	    \mv -f tmp $fieldfile
 	fi
 
@@ -1218,5 +1345,6 @@
     # Adjusting bench physiq.def to radiative code chosen
     cd BENCH${grid_resolution}
-    sed -e 's/iflag_rrtm=.*.$/iflag_rrtm='$iflag_rrtm'/' -e 's/NSW=.*.$/NSW='$NSW'/' physiq.def > tmpdef
+    sed -e 's/iflag_rrtm=.*.$/iflag_rrtm='$iflag_rrtm'/' \
+	-e 's/NSW=.*.$/NSW='$NSW'/' physiq.def > tmpdef
     \mv tmpdef physiq.def
     cd ..
@@ -1253,5 +1381,6 @@
 	if [ ${hostname:0:5} = jean- ] ; then
             . ../arch/arch-${arch}.env
-            echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing  2>&1" >> bench.sh
+            echo "srun -n 2 -A $idris_acct@cpu gcm.e > listing  2>&1" \
+		 >> bench.sh
 	else
             echo "$mpirun -np 2 gcm.e > listing  2>&1" >> bench.sh
@@ -1259,5 +1388,7 @@
 	# Add rebuild, using reb.sh if it is there
 	echo 'if [ -f reb.sh ] ; then' >> bench.sh
-	echo '  ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ./reb.sh histins ; ./reb.sh stomate_history ; ./reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh
+	echo '  ./reb.sh histday ; ./reb.sh histmth ; ./reb.sh histhf ; ' \
+	     './reb.sh histins ; ./reb.sh stomate_history ; ' \
+	     './reb.sh sechiba_history ; ./reb.sh sechiba_out_2 ' >> bench.sh
 	echo 'fi' >> bench.sh
     else
@@ -1276,5 +1407,6 @@
 	if [ "$with_xios" = "y" ] ; then
             cp ../../ORCHIDEE/src_xml/context_orchidee.xml .
-            echo '<context id="orchidee" src="./context_orchidee.xml"/>' > add.tmp
+            echo '<context id="orchidee" src="./context_orchidee.xml"/>' \
+		 > add.tmp
             cp ../../ORCHIDEE/src_xml/field_def_orchidee.xml .
             cp ../../ORCHIDEE/src_xml/file_def_orchidee.xml .
@@ -1282,14 +1414,27 @@
             if [ -f ../../ORCHIDEE/src_xml/context_input_orchidee.xml ] ; then
    		cp ../../ORCHIDEE/src_xml/context_input_orchidee.xml .
-   		echo '<context id="orchidee" src="./context_input_orchidee.xml"/>' >> add.tmp
+   		echo '<context id="orchidee" ' \
+		     'src="./context_input_orchidee.xml"/>' >> add.tmp
             fi
             sed -e '/id="LMDZ"/r add.tmp' iodef.xml > tmp
             mv tmp iodef.xml
-            sed -e'{/sechiba1/ s/enabled="_AUTO_"/type="one_file" enabled=".TRUE."/}' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml
-            sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml
-            sed -e 's@output_level="_AUTO_"@output_level="1"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml
-            sed -e 's@output_freq="_AUTO_"@output_freq="1d"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml
-            sed -e 's@compression_level="4"@compression_level="0"@' file_def_orchidee.xml > tmp ; \mv -f tmp file_def_orchidee.xml
-            sed -e 's@XIOS_ORCHIDEE_OK = n@XIOS_ORCHIDEE_OK = y@' orchidee.def > tmp ; \mv -f tmp orchidee.def
+            sed -e'{/sechiba1/ s/enabled="_AUTO_"/type="one_file" enabled=".TRUE."/}' \
+		file_def_orchidee.xml > tmp
+	    \mv -f tmp file_def_orchidee.xml
+            sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \
+		file_def_orchidee.xml > tmp
+	    \mv -f tmp file_def_orchidee.xml
+            sed -e 's@output_level="_AUTO_"@output_level="1"@' \
+		file_def_orchidee.xml > tmp
+	    \mv -f tmp file_def_orchidee.xml
+            sed -e 's@output_freq="_AUTO_"@output_freq="1d"@' \
+		file_def_orchidee.xml > tmp
+	    \mv -f tmp file_def_orchidee.xml
+            sed -e 's@compression_level="4"@compression_level="0"@' \
+		file_def_orchidee.xml > tmp
+	    \mv -f tmp file_def_orchidee.xml
+            sed -e 's@XIOS_ORCHIDEE_OK = n@XIOS_ORCHIDEE_OK = y@' \
+		orchidee.def > tmp
+	    \mv -f tmp orchidee.def
 	fi
     fi
