Index: BOL/script_install_amaury/install_lmdz.sh
===================================================================
--- BOL/script_install_amaury/install_lmdz.sh	(revision 4909)
+++ BOL/script_install_amaury/install_lmdz.sh	(revision 4914)
@@ -26,5 +26,5 @@
 # minimal configuration.
 #
-# Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ...
+# Prerequisites : gfortran, bash or ksh, wget, gunzip, tar, ...
 #
 # Modif 18/11/2011
@@ -50,5 +50,5 @@
 function set_default_params {
     # Valeur par défaut des parametres
-    svn=""
+    svn_lmdz=""
     version="20231022.trunk"
 
@@ -108,5 +108,5 @@
         -v       "version" like 20150828.trunk, see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk (default <$version>)
 
-        -r       "svn_release" : either the svn release number or "last" (default <$svn>)
+        -r       "svn_release" : either the svn release number or "last" (default <$svn_lmdz>)
 
         -parallel parallel support: mpi, omp, mpi_omp (mpi with openMP) or none (default: <$parallel>)
@@ -147,5 +147,5 @@
                   exit 1;;
             "-v") version=$2; shift; shift;;
-            "-r") svn=$2; shift; shift;;
+            "-r") svn_lmdz=$2; shift; shift;;
             "-d") grid_resolution=$2; shift; shift;;
             "-unstable"|"-testing") trusting=$(echo "$1" | cut -c2-); shift;;
@@ -211,5 +211,5 @@
 
     #Chemin pour placer le modele
-    if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version$svn$optim_debug"; fi
+    if [[ $MODEL = "" ]]; then MODEL="./LMDZ$version$svn_lmdz$optim_debug"; fi
 
     ## if also compiling XIOS, parallel must be mpi_omp
@@ -350,12 +350,10 @@
 
         # Convert non-basic compiler
-        case $compiler in  # TODO test with pgf90
-            mpif90) ncdf_compiler=$($compiler 2> <(head -n 1 | cut -f 1 -d ":"))
+        case $compiler in
+            mpif90) ncdf_compiler=$($compiler 2>&1 >/dev/null | head -n 1 | cut -f 1 -d ":")
         esac
 
         case $ncdf_compiler in
             gfortran) opt1="-compiler gnu"; opt2="-CC gcc -FC gfortran -CXX g++";;
-            ifort)  opt1="-compiler intel"; opt2="-CC icc -FC ifort -CXX icpc";;
-            pgf90)  opt1="-compiler pgf90"; opt2="-CC pgcc -FC pgf90 -CXX pgCC";;
             *)      echo "unexpected compiler $ncdf_compiler for netcdf"; exit 1
         esac
@@ -505,5 +503,5 @@
     if [[ -n $fetch_rev ]]; then
         echo "Fetching orch $fetch_rev from the repository"
-        orcbranch=$(svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r "$fetch_rev" |grep ORCHIDEE |head -1| sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}')
+        orcbranch=$(svn log -v -q svn://forge.ipsl.jussieu.fr/orchidee/ -r "$fetch_rev" | grep ORCHIDEE | head -1 | sed -e 's:ORCHIDEE/.*$:ORCHIDEE:' | awk '{print $2}')
         echo "branch is $orcbranch"
         if [[ $fetch_rev -lt 4465 ]]; then echo 'ORCHIDEE version must be >=4465, exiting'; exit 1; fi
@@ -516,8 +514,13 @@
         cd -
     fi
+
+
+    # Check parallel LMDZ+ORCH
+    if [[ (! $veget = "none") && (! $parallel = "none") && ($used_lmdz_rev -lt 4894) ]]; then
+        echo "LMDZ revision must be >=4894 for orchidee with parallel support"; exit 1
+    fi
 }
 
 function compile_orchidee {
-    get_orchidee_version
     install_arch "ORCHIDEE"
 
@@ -568,25 +571,23 @@
     lmdzlog="$(pwd)/lmdz.log"
 
-    set +e
-    svn upgrade
-    if [[ $svn = "last" ]]; then
-        svnopt=""
-    else
-        svnopt="-r $svn"
-    fi
-    if [[ $svn != "" ]]; then
-        if svn info | grep -q 'https:'; then svn switch --relocate https://svn.lmd.jussieu.fr/LMDZ http://svn.lmd.jussieu.fr/LMDZ; fi
-        svn update "$svnopt"
-    fi
-    mysvn=$(svnversion . | grep -E -o "[0-9]+" 2>/dev/null)
-    set -e
-
-    if [[ $mysvn = "" ]]; then mysvn=$(grep 'Revision: [0-9]' "$MODEL"/Read*.md | awk ' { print $2 } ' 2>/dev/null); fi
-    if [[ $mysvn = "" ]]; then mysvn=4190; fi
+    used_lmdz_rev=$svn_lmdz
+    if [[ -n $svn_lmdz ]]; then
+        local lmdzbranch
+        echo "Fetching LMDZ $svn_lmdz from the repository"
+        lmdzbranch=$(svn log -v -q https://svn.lmd.jussieu.fr/LMDZ -r "$svn_lmdz" | grep LMDZ | head -1 | sed -e 's:trunk/.*$:trunk:' | awk '{print $2}')
+        \rm -rf "$MODEL/modipsl/modeles/LMDZ"
+        cd "$MODEL/modipsl/modeles"
+        set +e
+        svn co -r "$svn_lmdz" "https://svn.lmd.jussieu.fr/LMDZ$lmdzbranch" LMDZ
+        set -e
+        cd -
+    else  # get svn from info
+         used_lmdz_rev=$(svn info | grep "Last Changed Rev" | cut -c 19-)
+    fi
 }
 
 function compile_lmdz {
-    get_lmdz_version
     install_arch "LMDZ"
+    cd "$LMDZPATH"
 
     exe_name="bin/gcm_${grid_resolution}_phylmd_${rad}${suff_exe}${suff_orc}.e"
@@ -596,5 +597,5 @@
         oldrad) iflag_rrtm=0; NSW=2; opt_rad="";;
         rrtm)   iflag_rrtm=1; NSW=6
-            if [[ $mysvn -le 4185 ]]; then
+            if [[ $used_lmdz_rev -le 4185 ]]; then
                 opt_rad="-rrtm true"
             else
@@ -604,5 +605,5 @@
         *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
     esac
-    if [[ $mysvn -le 4185 && $rad = "ecrad" ]]; then
+    if [[ $used_lmdz_rev -le 4185 && $rad = "ecrad" ]]; then
         echo "ecrad only available for LMDZ rev starting with 4186 "; exit 1
     fi
@@ -841,4 +842,6 @@
 init_arch
 check_available_software
+get_lmdz_version
+get_orchidee_version
 install_netcdf
 install_IOIPSL
Index: BOL/script_install_amaury/test_compils.sh
===================================================================
--- BOL/script_install_amaury/test_compils.sh	(revision 4909)
+++ BOL/script_install_amaury/test_compils.sh	(revision 4914)
@@ -14,5 +14,7 @@
         args="$args-parallel"
     fi
-    args="$args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios"
+    args="$args -rad $rad -parallel $parallel -netcdf 0 -veget $veget $xios $lmdzrev"
+    # trim
+    args=$(echo "$args" | xargs)
 
     logfile="test_logs/$args.out"
@@ -38,6 +40,8 @@
     for veget in "none" "orch2.0" "orch2.2"; do
     for xios in "" "-xios"; do
-        if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
+    if [[ $xios = "-xios" && $parallel = "none" ]]; then continue; fi
+    for lmdzrev in "" "-r 4894"; do
         do_one_test
+    done
     done
     done
