Index: /BOL/script_install_amaury/Install_PC_Ubuntu22_Howto
===================================================================
--- /BOL/script_install_amaury/Install_PC_Ubuntu22_Howto	(revision 4850)
+++ /BOL/script_install_amaury/Install_PC_Ubuntu22_Howto	(revision 4850)
@@ -0,0 +1,58 @@
+Récapitulatif de l'installation d'un PC pour pouvoir travailler confortablement
+avec LMDZ.
+
+Installation ubuntu 22, Howto
+=============================
+récupérer une image iso
+puis exécuter usb-creator-gtk pour créer une clé live usb
+
+
+Installation des paquets pour LMDZ
+==================================
+lancer le script
+http://lmdz.lmd.jussieu.fr/pub/script_install/install_ubuntu22_packages.sh
+qui va installer tous les pacquets nécessaires et aussi pas mal de
+bureautique et paquets graphiques.
+Seule subtilité : l'installation d'acroread, non distribuée en standard.
+
+
+Installation d'un espace de travail en matrice
+==============================================
+(optionnel)
+Pour cela, il faut  commencer par une désinstallation/réinstallation
+des versions firefox (snap/apt).
+Cette dernière étape est nécessaire pour activer une matrice de bureaux
+sous gnome. C'est un peu subtile et optionnel.
+script :
+http://lmdz.lmd.jussieu.fr/pub/env/install_workspace_matrix.sh
+
+
+Installation conda/ferret
+=========================
+Installation de miniconda et de ferret par miniconda.
+A cause de problèmes sur certains PCs, il faut activer un pyferret de 202003.
+En plus, avec le conda récent qui utilise par défaut phython3.9,
+il faut lui préciser que c'est python=3.7 qu'il faut utiliser.
+Le script inclus l'installation de basemap, qu'Etienne utilise pour les
+mini projets LMDZ du cours de M2 de modélisation.
+script :
+http://lmdz.lmd.jussieu.fr/pub/env/install_conda_ferret.sh
+
+
+LMDZ
+====
+testé avec succès la version 20221028.trunk
+* une installation install_lmdz.sh séquentielle avec -SCM
+* une installation parallèle en récupérant directement
+   http://lmdz.lmd.jussieu.fr/pub/Training/tutorial.tar
+ sur ~/
+Un seul souci via tutorial :
+dans ecrad lié à la version récente de gfortran sur la ubuntu22.
+la ligne 
+random_numbers_mix.F90:  INTEGER(KIND=JPIM), PARAMETER :: IVAR=Z"3FFFFFFF"
+ne compile pas.
+Corriger d'ici la formation
+
+à vous,
+
+Frédéric
Index: /BOL/script_install_amaury/Readme.md
===================================================================
--- /BOL/script_install_amaury/Readme.md	(revision 4850)
+++ /BOL/script_install_amaury/Readme.md	(revision 4850)
@@ -0,0 +1,15 @@
+** Le répertoire `~lmdz/pub/script_install` **
+
+est maintenant un le résultat de 
+```
+svn checkout https://svn.lmd.jussieu.fr/LMDZ/BOL/script_install
+```
+
+Il contient :
+- le script d'installation lmdz : `install_lmdz.sh`
+- les scripts d'installation netcdf, `install_netcdf4_hdf5.bash`  `install_netcdf4_hdf5_seq.bash` (utilisés par `install_lmdz.sh`)
+- les scripts et fichier Howto d'installation des ordinateurs portables sous ubuntu : `install_ubuntu22_packages.sh`, `install_conda_ferret.sh`, `Install_PC_Ubuntu22_Howto`
+- les scripts de creation et de tests des archives .tar de LMDZ, `check_version.sh`  `creation_modipsl.sh` (expert)
+
+A faire :
+Les deux scripts d'installation `netcdf` devraient/pourraient être fusionés.
Index: /BOL/script_install_amaury/check_version.sh
===================================================================
--- /BOL/script_install_amaury/check_version.sh	(revision 4850)
+++ /BOL/script_install_amaury/check_version.sh	(revision 4850)
@@ -0,0 +1,443 @@
+#!/bin/bash
+# $Id$
+
+#set -vx 
+
+# AFAIRE
+# On pourrait gerer le justcheck en creant un repertoire
+# avec
+#  if recheck
+#   resubench=./RESUBENCH$$
+#  else
+#   resubench=$RESU_D/$datelmdz$rel_svn
+#On pourrait ainsi utiliser une fonction independante qui genere les messages
+# comme check_version_message
+
+
+
+#########################################################################
+# Verification de a convergence du modele par rapport aux versions
+# precedentes
+# + 1+1=2
+#########################################################################
+
+version_ref=latest
+resolution=48x36x39
+compilo=gfortran
+parallel=mpi_omp
+# Option pour le debug du script check_version lui meme qui consiste a ne
+# pars reexecuter l'installation et les simulations mais a simplement
+# refaire les diff sur des simulations existantes.
+justcheck=0 # just compare results not writing of results in RESUBENCH
+tmpdir=/tmp/`whoami` ; mkdir -p $tmpdir
+tmpdir=/home/lmdz/tmp
+rel_svn=""
+local_d=`pwd`
+
+install=1
+rad=rrtm
+check_1D=1
+check_SP=1
+check_1p1=1
+check_Debug=1
+check_isotopes=1
+check_parallel=1
+check_compile=1
+check_ini=1
+mail_address=lmdz-commit@listes.lmd.ipsl.fr
+MODEL=""
+branche=trunk
+
+#########################################################################
+# Pour aller chercher des fichiers par wget si pas sur le cpte lmdz
+#########################################################################
+
+if [ `whoami` = lmdz ] ; then
+   get="ln -sf /u/lmdz/WWW"
+else
+   get="wget https://www.lmd.jussieu.fr/~lmdz"
+fi
+
+#########################################################################
+# Options du script
+#########################################################################
+
+while (($# > 0))
+  do
+  case $1 in
+      "-h") cat <<fin
+check_version.sh [-h] version [-latest version_ref]
+version is the name of the version of LMDZ to be checked modipsl.version.tar.gz
+version_ref is the version to be compared with.
+Default "latest".
+options:
+  -c compiler : sets the compiler to use
+  -justcheck  : just check results, do not overwrite anything
+  -r svn : revision 
+  -latest latest : latest is the date of the last version tested
+  -model_dir : directory where tun run the bench if LMDZ is already installed 
+fin
+          exit;;
+
+      "-c") compilo="$2" ; shift ; shift ;;
+      "-justcheck") justcheck=1 ; shift ;;
+      "-r") rel_svn="$2" ; shift ; shift ;;
+      "-latest") version_ref="$2" ; shift ; shift ;;
+      "-model_dir") MODEL="$2" ; shift ; shift ;;
+      *) version="$1" ; shift ;;
+   esac
+done
+
+################################################################################
+# Definition des noms des repertoires à comparer
+################################################################################
+
+# branche=`echo $version | cut -d. -f2`
+if [ "$MODEL" = "" ] ; then
+   MODEL=$tmpdir/LMDZ$version$rel_svn
+   branche=`echo $version |cut -c 10-`
+   datelmdz=`echo $version | cut -d. -f1`
+else
+   #if [ $install = 1 ] ; then echo Use model_dir only if the model is already installed ; exit ; fi
+   install=0
+   if [ "`echo $MODEL | cut -c1`" != "/" ] ; then MODEL=`pwd`/$MODEL ; fi # MODEL transformed in absolute path if not
+   datelmdz=`date +%Y%m%d`$$
+fi
+
+echo version $version $branche $datelmdz
+RESU_D=~/WWW/RESUBENCH/$branche/$compilo
+if [ $justcheck = 0 ] ; then
+   resubench=$RESU_D/$datelmdz$rel_svn
+   if [ -d $resubench ] ; then mv $resubench $resubench$$ ; fi
+   mkdir -p $resubench
+fi
+latest=$RESU_D/$version_ref
+echo $latest 
+
+# recuperation de la version a laquelle on compare pour le message final :
+comparea=`ls -ld $RESU_D/$version_ref | awk -F/ ' { print $NF } '`
+echo comparea $comparea
+
+################################################################################
+echo 0. Installation du modele
+################################################################################
+
+# Edition de install.sh, install.sh avec bench 48x36x19
+if [ $install = 1 ] ; then
+   cd $tmpdir
+   if [ "$rel_svn" = "" ] ; then opt_svn="" ; else opt_svn="-r $rel_svn" ; fi
+   \rm -f install_lmdz.sh ; $get/pub/install_lmdz.sh ; chmod +x install_lmdz.sh
+   # On install sans les bench pour que les benchs soient faits à la main
+   # ./install_lmdz.sh -v $version $opt_svn -d $resolution -SCM -parallel $parallel -veget CMIP6
+     ./install_lmdz.sh -unstable -v $version $opt_svn -d $resolution      -parallel $parallel -veget CMIP6 -bench 0
+fi
+
+################################################################################
+echo 1. Sauvegarde du 1D execute automatiquement a l installation
+################################################################################
+
+if [ $check_1D = 1 ] ; then
+   cd $MODEL
+   if [ ! -d 1D ] ; then $get/pub/1D/1D.tar.gz ; tar xvf 1D.tar.gz ; fi     # get 1D model
+   if [ ! -d 1D/EXEC ] ; then mv 1D/EXEC 1D/SAVE_EXEC$$ ; fi
+   cd 1D ; sed -e "s:^listecas=.*$:listecas=ARMCU/REF:" run.sh ; ./run.sh   # run 1D model
+   # Controling outputs for the ARMCU/REF test case
+   outf=$MODEL/1D/EXEC/6AL79/ARMCU/REF/restartphy.nc
+   if [ -f $outf ] ; then
+       if [ $justcheck = 0 ] ; then
+          mkdir -p $resubench/ARMCU/REF
+          cp $outf $resubench/ARMCU/REF/
+       fi
+       cmp -s $outf $latest/ARMCU/REF/restartphy.nc
+       if [ $? = 0 ] ; then converge1D=U ; else converge1D=u ; fi
+   else
+      converge1D=-
+   fi
+fi
+
+
+################################################################################
+echo DEBUT DES TESTS 3D
+################################################################################
+BENCH=BENCH$resolution
+cd $MODEL/modipsl/mod*/LMD*
+LMDZdir=`pwd`
+echo LMDZdir $LMDZdir
+if [ -d $BENCH ] ; then mkdir -p SAVE$$ ; mv BENCH$resolution SAVE$$ ; fi
+$get/pub/3DBenchs/bench_lmdz_$resolution.tar.gz ; tar xvf bench_lmdz_$resolution.tar.gz
+cd $BENCH ; $get/pub/3DBenchs/BENCHCMIP6.tar.gz . ;  tar xvf BENCHCMIP6.tar.gz 
+sed -i'' -e "s:VEGET=n:VEGET=y:" config.def
+./compilegcm_fcm.sh ; ./bench.sh > out.bench 2>&1
+
+
+if [ -f restartphy.nc ] ; then
+   if [ ! -f gcm.install ] ; then \cp -f gcm.e gcm.install ; fi
+
+#########################################################################
+echo 3. Verification de la convergence avec la version precedente
+echo Physique Standard
+#########################################################################
+
+   # Faite soit sur les restart.nc soit sur une exctraction de ps.nc
+   # Il est arrive qu'on ait convergence meteo sans identite des restart
+   #  (pb d'entete, de traceurs ...)
+   # Aide a l'interpretation de resultats problematiques
+   #    Les resultats de la simu ancienne physique sont directement 
+   #      dans BENC*
+   #    Les resultats de la nouvelle physique sont dans SIM1 utilise
+   #      pour 1+1=2
+   #    Les resultats de la simulation debug sont dans SIMD
+
+   # Ici on se contente d'analyser le bench automatique qui vient de tourner
+   if [ $justcheck = 0 ] ; then mkdir -p $resubench/$BENCH; fi
+   if [ -f restartphy.nc ] ; then
+       if [ $justcheck = 0 ] ; then
+           ncks -M -m -h -v ps -O restart.nc $resubench/$BENCH/ps.nc
+           cp restart.nc $resubench/$BENCH/restart.nc
+       fi
+       cmp -s ./restart.nc $latest/$BENCH/restart.nc
+      if [ $? = 0 ] ; then converge=S ; else converge=s ; fi
+   else
+      converge=-
+   fi
+
+   #########################################################################
+   echo 4. Verification de 1+1=2
+   echo Avec la nouvelle physique
+   #########################################################################
+   # On utilse l'executable du bench de base
+
+   if [ $check_1p1 = 1 ] ; then
+      \cp -f gcm.install gcm.e
+      suf=NPv6.0.14splith
+      sed -e 's/VEGET=y/VEGET=n/' config.def_oraer > config.def
+      if [ -f physiq.def_$suf ] ; then \cp -f physiq.def_$suf physiq.def ; fi
+      $get/Distrib/unpun.sh
+      chmod +x unpun.sh ; ./unpun.sh -parallel $parallel
+      cmp -s SIM2/ps_end.nc SIM1+1/ps_end.nc
+      if [ $? = 0 ] ; then
+          unpun=OK
+      else
+          unpun=-
+      fi
+   fi
+
+
+# 2016/06/21 : comparaison des versions nouvelles physique (dans SIM1)
+   cd $LMDZdir/$BENCH
+   if [ -f SIM1/restartphy.nc ] ; then
+       if [ $justcheck = 0 ] ; then
+           ncks -M -m -h -v ps -O SIM1/restart.nc $resubench/$BENCH/ps$suf.nc
+           cp SIM1/restart.nc $resubench/$BENCH/restart$suf.nc
+       fi
+       \rm sechiba_out_2.nc sechiba_history.nc sechiba_rest_out.nc
+       cmp -s SIM1/restart.nc $latest/$BENCH/restart$suf.nc
+      if [ $? = 0 ] ; then convergeNP=N ; else convergeNP=n ; fi
+   else
+      convergeNP=-
+   fi
+
+   #########################################################################
+      echo Verification en mode debug + parallele, compile avec makelmdz
+   #########################################################################
+
+   cd $LMDZdir/$BENCH
+   if [ -f compilegcm.sh -a $check_compile = 1 ] ; then
+      \rm -f gcm.e
+      ./compilegcm.sh -debug
+      mkdir SIMD
+      cd SIMD
+      ln -s ../SIM1/start* ../SIM1/limit* ../SIM1/sechiba_rest_in.nc ../SIM1/aer*nc ../SIM1/*def .
+      ../run_local.sh 2 2 ../gcm.e > listing 2>&1
+      cd ../
+      suf=D
+      if [ -f SIMD/restartphy.nc ] ; then
+          if [ $justcheck = 0 ] ; then
+              ncks -M -m -h -v ps -O SIMD/restart.nc $resubench/$BENCH/ps$suf.nc
+              cp SIMD/restart.nc $resubench/$BENCH/restart$suf.nc
+          fi
+          cmp -s SIMD/restart.nc $latest/$BENCH/restart$suf.nc
+          if [ $? = 0 ] ; then convergeD=D ; else convergeD=d ; fi
+      else
+         convergeD=-
+      fi
+   fi
+
+   #########################################################################
+      echo Test en fonction du nombre de processeurs
+   #########################################################################
+
+echo CHECK $parallel $check_parallel
+   if [ "$parallel" = "mpi_omp" -a $check_parallel = 1 ] ; then
+      mkdir -p $LMDZdir/$BENCH/SIM1_41
+      cd $LMDZdir/$BENCH/SIM1_41
+      ln -s ../SIM1/start* ../SIM1/limit* ../SIM1/sechiba_rest_in.nc ../SIM1/aer*nc ../SIM1/*def .
+      ../run_local.sh 4 1 ../gcm.e > listing
+      cd ..
+      echo ON EST AVANT LE CMP
+      cmp -s SIMD/restart.nc SIM1_41/restart.nc
+      if [ $? = 0 ] ; then
+          if [ "$unpun" = "OK" ] ; then
+             unpun=OK2
+          else
+             unpun=-OK
+          fi
+      else
+          unpun=${unpun}-
+      fi
+   fi
+
+   #########################################################################
+      echo Verification des isotopes
+   #########################################################################
+
+   if [ $check_isotopes = 1 ] ; then
+      cd $LMDZdir
+      pwd
+      $get/pub/3DBenchs/bench_lmdz_iso_48x36x39.tar.gz
+      tar xvf bench_lmdz_iso_48x36x39.tar.gz
+      cd BENCHiso48x36x39
+      ./compile.sh
+      exec=../bin/gcm_48x36x39_phylmdiso_${rad}_seq_iso_isoverif.e
+      if [ -f $exec ] ; then
+             $exec > listing 2>&1
+             suf=I
+             if [ -f restartphy.nc ] ; then
+                 if [ $justcheck = 0 ] ; then
+                     cp restart.nc $resubench/$BENCH/restart$suf.nc
+                 fi
+                 cmp -s restart.nc $latest/$BENCH/restart$suf.nc
+                 if [ $? = 0 ] ; then convergeI=I ; else convergeI=i ; fi
+             else
+                 # compiled but failed the isoverif test
+                 convergeI=x
+             fi
+      else
+          # compilation failed; cleaning up for next compilation
+          convergeI=-
+          \rm -f libf/grid/dimensions.h
+          \rm -f .lock
+      fi
+   fi
+
+   #########################################################################
+      echo Verification de initialisation
+   #########################################################################
+
+   if [ $check_ini = 1 ] ; then
+      cd $LMDZdir
+      rm -rf INIT
+      mkdir INIT
+      cp $BENCH/*def INIT
+      cd INIT
+      pwd
+      $get/Distrib/initialisation.sh
+      sed -e 's/grid_resolution=48x36x39/grid_resolution='$resolution'/' initialisation.sh > ini.sh
+      chmod +x ini.sh ; ./ini.sh
+      if [ -f limit.nc ] ; then
+         var=Tsoil01srf01
+         if [ $justcheck = 0 ] ; then
+             mkdir -p $resubench/START$resolution
+             ncks -M -m -h -v $var startphy.nc -O  $resubench/START$resolution/$var.nc
+             cp startphy.nc $resubench/START$resolution/
+         fi
+          cmp -s  startphy.nc  $latest/START$resolution/startphy.nc
+         if [ $? = 0 ] ; then
+             init=OK
+         else
+             init=noc
+         fi
+      else
+         init=-
+      fi
+   fi
+
+   ########################################################################
+      echo end of test cases
+   ########################################################################   
+   bench=OK
+else
+   echo PROBLEME : LE BENCH N EST PAS ALLE AU BOUT
+   bench=-
+fi
+
+if [ $justcheck = 0 ] ; then
+    latest=$RESU_D/latest
+    \rm -f $latest
+    ln -sf  $resubench $latest
+fi
+
+
+cd $LMDZdir/..
+LMDZ=`\ls -d LMD*` #Nom du modele LMDZ sur modeles/ : LMDZ4, LMDZ5, LMDZ
+
+svn upgrade # Il faut mettre à jour le svn si la version sur 
+            # laquelle le checkout a ete fait est plus ancienne
+            # ce qu'on souhaite par ailleurs pour pouvoir ensuite
+            # commettre depuis une version ancienne de svn (comme celles
+            # des SL du réseau local
+svnrel=`svn info $LMDZ | grep 'Changed Rev' | head -1 | awk ' { print $4 } '`
+#FH 20160822
+if [ "$svnrel" = "" ] ; then
+  svnrel=`svn info $LMDZ | grep vision | head -1 | awk ' { print $2 } '`
+fi
+
+ccc=$converge$convergeNP$convergeD$converge1D$convergeI
+if [ "$ccc" = "SNDUI" ] ; then ccc="OK " ;  fi
+
+
+
+########################################################################
+# Ectiture du message de bilan
+########################################################################
+
+cd $local_d
+
+echo $version'		'$svnrel'	'$bench'	'$ccc '	'$unpun'	'$init'   (ref:' $comparea ')' > tmp.resu
+cat > tmp.message <<eod
+disponible sur
+https://www.lmd.jussieu.fr/~lmdz/Distrib/modipsl.$version.tar.gz
+
+      Test local LMD network, gfortran, 48x36x19
+      ==========================================
+
+install version         SVN     Bench   Conv.   1+1=2   Init
+                                run     Nnum.      &
+                                        /prev.  mpiXomp
+
+eod
+cat tmp.resu >> tmp.message
+cat >> tmp.message <<eod
+
+
+                                        ||
+                                        \/
+
+S/s/-: 3D standard physics  Converging/runing/not runing
+N/n/-: -  new        -                  -
+D/d/-: new with debug                   -
+U/u/-: unicolonne                       -
+I/i/x/-: isotope            Converging/runing/run failed /compiled failed
+noc: runs but no convergence
+OK <=> SNDUI
+eod
+
+cat tmp.message
+
+if [ $mail_address != "" ] &&  [ $justcheck = 0 ] ; then
+   ssh lmdz@django "mail -s 'Nouvelle version pour install_lmdz.sh' $mail_address < "$local_d"/tmp.message"
+#   ssh lmdz@lmdz-forge "mail -s 'Nouvelle version pour install_lmdz.sh' $mail_address < "$local_d"/tmp.message"
+fi
+
+#
+# clean up of /tmp/lmdz if everything went smoothly
+#
+grep -q 'OK	OK 	OK2	OK' tmp.resu
+RET=$?
+if [ ${RET} -eq 0 ] ; then
+  echo "Quality control checks out for version $version"
+  echo "We cleanup $tmpdir/LMDZ$version"
+  echo "\rm -rf $tmpdir/LMDZ$version"
+  \rm -rf $tmpdir/LMDZ$version
+fi
+
Index: /BOL/script_install_amaury/creation_modipsl.sh
===================================================================
--- /BOL/script_install_amaury/creation_modipsl.sh	(revision 4850)
+++ /BOL/script_install_amaury/creation_modipsl.sh	(revision 4850)
@@ -0,0 +1,227 @@
+#!/bin/bash
+
+#set -vx
+unset LANG
+
+#####################################################################
+# Choix eventuel de la version : branche ou trunk et svn particuliere
+# Le script est lancé tous les soirs par un script sur lmdz-cq par lmdz
+# On peut aussi le relancé depuis la même machine en interactif
+# si le trusting de la nuit a échoué, soit que la raison soit extérieure
+# au modèle, soit qu'on fasse une correction svn entre temps :
+#   ./creation_modipsl.sh -force -latest 20221004 
+# où la dernière version ayant marché est 20221004.trunk
+#####################################################################
+
+branche=IPSLCM6.0.15
+branche=trunk
+rev="-r 4370"
+rev=""
+latest=""
+latest="20230902"
+latest="20231102"
+latest="20231215"
+#latest=20210512 # Pour imposer de tester la convergence avec une version passee
+
+TMP_D=/tmp/lmdz ; mkdir -p $TMP_D
+
+if [ $branche != trunk ] ; then
+    echo cas non prevu
+#     exit
+fi
+
+check=0
+check=1 # On verifie un certain nombre de choses.
+force=0
+
+optionnel=" -cpp ORCHIDEE_NOZ0H "
+
+local=`pwd`
+while (($# > 0)) ; do
+  case $1 in
+      "-h") cat <<fin
+USAGE creation_modipsl.sh
+Crée les archives du modele pour installation par install.sh
+-force : pour créeer une seconde version le meme jour
+fin
+        exit ;;
+      "-force") force=1 ; shift ;;
+      "-r") rev="-r $2" ; shift ; shift ;;
+      "-b") branche="$2" ; shift ; shift ;;
+      "-latest") latest=$2 ; shift ; shift ;;
+      *) echo option non prevue ; ./creation_modipsl.sh -h ; exit
+  esac
+done
+
+# machine_cible=erskine.lmd.jussieu.fr
+#machine_cible=carey
+machine_cible=lmdz-cq
+if [ "`hostname`" != "$machine_cible" ] ; then echo Lancer sur $machine_cible ; exit ; fi
+set -ex
+
+###########################################################################
+# localisation svn
+###########################################################################
+# cvs -d :pserver:lmdzbrowse@cvs.lmd.jussieu.fr:/home/cvsroot checkout LMDZ5 
+LMDZv=LMDZ6
+if [ $LMDZv = LMDZ6 ] ; then
+   LMDZ=LMDZ
+else
+   LMDZ=LMDZ5
+fi
+
+if [ $branche == trunk ] ; then
+   branchepath=trunk
+else
+   branchepath=branches/$branche
+fi
+svnmodel=http://svn.lmd.jussieu.fr/LMDZ/$LMDZv/$branchepath
+
+
+##########################################################################
+# Recuperation des infos svn pour le choix du nom du modele
+##########################################################################
+echo svn info $rev $svnmodel :
+svn info $rev $svnmodel
+datesvn=`svn info $rev $svnmodel | grep "Last Changed Date" | awk ' { print $4 } ' | sed -e 's/-//g'`
+echo DATESVN $datesvn
+
+if [  "$datesvn" = "" ] ; then
+#    DATESVN vide
+    datesvn=`svn info http://svn.lmd.jussieu.fr/LMDZ/$LMDZv/$branchepath $rev | grep 'Date de la dern' | awk ' { print $6 } '  | sed -e 's/-//g'`
+fi
+echo datesvn $datesvn
+version=$datesvn.$branche
+echo version $version
+
+##########################################################################
+# Sauvegarde eventuelle de la version precedente si deux versions
+# sont creees le meme jour
+##########################################################################
+if [ -f modipsl.$version.tar.gz ] ; then
+   if [ $force = 1 ] ; then
+      if [ -d $TMP_D/LMDZ$version ] ; then mv -f $TMP_D/LMDZ$version $TMP_D/LMDZ${version}_$$ ; fi
+      cd /home/users/lmdz/WWW/RESUBENCH/$branche/gfortran
+      if [ -f ${datesvn} ] ; then mv -f ${datesvn} ${datesvn}_$$ ; fi
+      ln -sf ${datesvn}_$$ latest
+      cd $local
+      if [ -f modipsl.$version.tar.gz ] ; then mv modipsl.$version.tar.gz modipsl.${version}_$$.tar.gz ; fi
+      echo ${datesvn} ${datesvn}_$$
+    else
+      echo Le fichier modipsl.$version.tar.gz existe deja
+      echo Preparer un changement automatique de nom pour automatiser
+      echo la creation de plusieurs versions dans la journee
+      exit
+    fi
+fi
+
+
+if [ "$latest" != "" ] ; then
+   cd /home/users/lmdz/WWW/RESUBENCH/$branche/gfortran
+   \rm -f latest
+   ln -s `pwd`/$latest latest
+   cd -
+fi
+
+#####################################################################
+# Les fichiers modipsl.vN.tar.gz contiennent des versions successives
+# de IOIPSL
+# Les versions modipsl.20080305.v5.tar.gz contiennent des versions
+# successives avec de modipsl les dates correspondant a des versions
+# successives de LMDZ4 puis LMDZ5
+#####################################################################
+vorig=v8  # updated version of IOIPSL 04/04/2012, including 'rebuild' script
+vorig=v9  # updated version of IOIPSL 07/08/2013, modfication de AA_male.ldef pour g95
+vorig=v10 # 'rebuild' is reintroduced in v9 . Was lost even in v8 ... (FH)
+vorig=v11 # update ORCHIDEE version to r2247, changes needed in install.sh for ORCHIDEE compilation
+vorig=v12 # modification AA_make.gdef pour ada. on garde g95 pour install alors qu'il a disparu dans modipsl
+vorig=v13 # mise a jour ORCHIDEE (r3013) pour problème d'interface après le rajout de sinang=rmu0 dans surf_land_orchidee_mod.F90
+vorig=v14 # dans ioipsl/histcom.f9, nb_var_max : 600 -> 1OOO, nb_zax_max : 5 -> 100, flio_max_dims : 15 -> 50 pour rebuild cosp
+vorig=v15 # modifications pour tenir compte de jean-zay nouvelle machine Idris
+vorig=v16 # 2022/02/17 on bascule sur orchidee CMIP6
+vorig=v18 # 2023/03/09 modification ORCHIDEE pour compatibilité IOIPSL: on rajoute 360_day comme attribut
+vorig=v19 # 2023/03/10 IOIPSL updated to version 2.2.5
+
+modipsltar=modipsl.$vorig.tar
+
+##### tmpdir=/tmp/tmpmodipsl$$
+tmpdir=$local/tmpmodipsl$$
+mkdir -p $tmpdir
+cd $tmpdir
+if [ -f /u/lmdz/WWW/Distrib/$modipsltar.gz ] ; then
+   cp /u/lmdz/WWW/Distrib/$modipsltar.gz .
+else
+   wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$modipsltar.gz
+fi
+
+tar xvf $modipsltar.gz
+#gzip -9 $modipsltar
+
+readme_file=Readme_LMDZ$version.md
+
+cat > $readme_file <<eod
+This model was downloaded from
+http://www.lmd.jussieu.fr/~lmdz/pub/src_archives/unstable/modipsl.$version.tar.gz
+
+It was insalled with the \`install_lmdz.sh\` soft
+
+In order to see all the available versions, check
+http://www.lmd.jussieu.fr/~lmdz/pub/src_archives/unstable/Readme
+
+``
+eod
+
+cd modipsl/modeles
+
+###########################################################################
+# On effectue le svn checkout sur une machine avec un ancien svn
+# pour eviter que les utilisateurs se retrouvent avec un svn plus ancien
+# que celui sur lequel la version a été créée.
+echo Premier svn checkout $rev $svnmodel $LMDZ
+#ssh butler ' ( cd '`pwd`' ; svn checkout '$rev' '$svnmodel' '$LMDZ' ) '
+echo svn checkout $rev $svnmodel $LMDZ  
+svn checkout $rev $svnmodel $LMDZ  
+svn info LMDZ   >> ../../$readme_file
+echo '``'       >> ../../$readme_file
+
+###########################################################################
+
+cd -
+echo $version
+tar cvf modipsl.$version.tar modipsl $readme_file
+
+gzip modipsl.$version.tar
+mv modipsl.$version.tar.gz ~/WWW/Distrib
+
+cd  ~/WWW/Distrib
+ln -sf modipsl.$version.tar.gz modipsl.$branche.tar.gz
+cd ~/WWW/pub/src_archives/unstable/
+
+# Ajout pour la nouvelle arborescence
+ln -sf ../../../Distrib/modipsl.$version.tar.gz .
+ln -sf modipsl.$version.tar.gz modipsl.$branche.tar.gz
+cd  ~/WWW/Distrib
+
+
+####################################################################
+# La partie ci-dessous concerne le check des versions.
+# On devrait sans doute appeler rechech.sh
+####################################################################
+
+if [ $check = 1 ] ; then
+   ./check_version.sh $version  >| WORK/check.out.$version 2>&1
+   cat tmp.resu >> Correspondance
+   cat tmp.resu >> LISMOI.$branche
+   \cp -f LISMOI.trunk ../pub/src_archives/Readme
+###
+### clean up of /tmp/lmdz if everything went smoothly
+###
+grep -q 'OK	OK 	OK2	OK' tmp.resu
+RET=$?
+   if [ ${RET} -eq 0 ] ; then
+      echo "Quality control checks out for version $version"
+      echo "We could cleanup /tmp/lmdz/LMDZ$version" 
+      echo "\rm -rf /tmp/lmdz/LMDZ$version" 
+      \rm -rf /tmp/lmdz/LMDZ$version
+   fi
+fi
Index: /BOL/script_install_amaury/install_conda_ferret.sh
===================================================================
--- /BOL/script_install_amaury/install_conda_ferret.sh	(revision 4850)
+++ /BOL/script_install_amaury/install_conda_ferret.sh	(revision 4850)
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+cat <<eod
+Ce script installe miniconda puis la version conda de ferret.
+
+Rm :
+1) Il faut répondre aux questions de l'installation conda.
+2) Tout à la fin, il commente les lignes rajoutées automatiquement dans
+le .bashrc pour éviter que conda soit actif par défaut.
+3) On fait une rétroinstallation de ferret qui sans ça ne marche pas
+sur certains ordis.
+eod
+sleep 12
+
+# Installation de miniconda (notamment pour ferret)
+=======================================
+
+wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
+bash Miniconda3-latest-Linux-x86_64.sh
+# desactiver conda par defaut
+cd $HOME/miniconda3/bin
+./conda config --set auto_activate_base false
+
+./conda create --name python2 python=2.7
+./conda create --name python3 python=3.7
+./conda install -y netcdf4 h5py jinja2 pip sqlalchemy basemap matplotlib numpy scipy
+
+
+# Installation de ferret via conda
+=========================
+
+# Il faut installer une ancienne version d’abord à cause d’un bug
+# cf. https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2019/msg01061.html
+./conda install -y -c "conda-forge/label/cf202003" pyferret
+./conda create -n FERRET -c conda-forge/label/cf202003 pyferret ferret_datasets --yes
+
+
+# Installation basemap
+=================
+https://github.com/conda-forge/basemap-feedstock/issues/45
+#suggère pour un des problèmes rencontrés de faire une install comme suit
+conda create -n basemap python=3.7 basemap proj4=5.2.0
+conda activate basemap
+python -c "from mpl_toolkits.basemap import Basemap"
+
+#PB identifiés avec le nouveau compilateur
+#  INTEGER(KIND=JPIM), PARAMETER :: IVAR=0 !Z"3FFFFFFF"
+
+
+
Index: /BOL/script_install_amaury/install_lmdz.sh
===================================================================
--- /BOL/script_install_amaury/install_lmdz.sh	(revision 4850)
+++ /BOL/script_install_amaury/install_lmdz.sh	(revision 4850)
@@ -0,0 +1,1539 @@
+#!/bin/bash
+set -eu  # error on command failure, and on unset variables
+export LC_ALL=C  # standardize awk format
+
+###########################################################################
+# Author : Laurent Fairhead et Frédéric Hourdin
+# Usage  : install_lmdz.sh -help
+#
+# bash installation script of the LMDZ model on different computer types :
+# Linux PC, "mesocentre" (IPSL-UPMC, IPSL-X), super-computer (IDRIS)
+#
+# The model is downloaded in the following directory tree
+# $MODEL/modipsl/modeles/...
+# using the "modipsl" infrastructure created by the "IPSL"
+# for coupled (atmosphere/ocean/vegetation/chemistry) climate modeling
+# activities.
+# Here we only download atmospheric (LMDZ) and vegetation (ORCHIDEE)
+# components.
+#
+# 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).
+#
+# The script downloads various source files (including a version of NetCDF)
+# and utilities, compiles the model, and runs a test simulation in a
+# minimal configuration.
+#
+# Prerequisites : pgf90/gfortran, bash or ksh, wget , gunzip, tar, ...
+#
+# Modif 18/11/2011
+#    changes for option real 8.
+#      We compile with -r8 (or equivalent) and -DNC_DOUBLE for the GCM
+#      but with -r4 for netcdf. Variable real must be set to
+#      r4 or r8 at the beginning of the script below.
+#
+###########################################################################
+
+echo install_lmdz.sh DEBUT "$(date)"
+
+################################################################
+# Choice of installation options
+################################################################
+
+################################################################
+# A function to fetch files either locally or on the internet
+################################################################
+function myget { #1st and only argument should be file name
+    # Path on local computer where to look for the datafile
+    if [[ -f /u/lmdz/WWW/LMDZ/pub/$1 ]]; then
+        \cp -f -p "/u/lmdz/WWW/LMDZ/pub/$1" .
+    elif [[ -f ~/LMDZ/pub/$1 ]]; then
+        \cp -f -p ~"/LMDZ/pub/$1" .
+    else
+        wget --no-check-certificate -nv "http://lmdz.lmd.jussieu.fr/pub/$1"
+        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"
+        fi
+    fi
+}
+
+# 04_2021 : tester si r4 marche encore !
+real="r8"  # ou "r4"
+
+
+#########################################################################
+# Valeur par défaut des parametres
+#########################################################################
+svn=""
+version="20231022.trunk"
+
+getlmdzor=1
+netcdf=1   #  1: for automatic installation;
+#          or 0: do not install NetCDF and look for it in standard locations;
+#          or absolute path: look for NetCDF there
+check_linux=1
+ioipsl=1
+bench=1
+pclinux=1
+pcmac=0 # default: not on a Mac
+compiler="gfortran"
+if [[ $(gfortran -dumpversion | cut -d. -f1) -ge 10 ]]; then allow_arg_mismatch="-fallow-argument-mismatch"; fi
+SCM=0
+# surface/vegetation scheme treatment
+# controlled by the single variable veget which can have the following values
+# - NONE: bucket scheme (default)
+# - CMIP6: orchidee version used in CMIP exercise, rev 5661
+# - number: orchidee version number
+veget="NONE"
+# choose the resolution for the bench runs
+# grid_resolution= 32x24x11 or 48x36x19 for tests (test without ORCHIDEE)
+#                  96x71x19  standard configuration
+grid_resolution="144x142x79"
+grid_resolution="96x95x39"
+grid_resolution="48x36x19"
+grid_resolution="32x32x39"
+# choose the physiq version you want to test
+#physiq=NPv6.0.14splith
+physiq=""
+
+## parallel can take the values none/mpi/omp/mpi_omp
+parallel="mpi_omp"
+parallel="none"
+idris_acct="lmd"
+trusting="testing"
+OPT_GPROF=""
+OPT_MAKELMDZ=""
+MODEL=""
+
+## also compile XIOS? (and more recent NetCDF/HDF5 libraries) Default=no
+with_xios="n"
+opt_makelmdz_xios=""
+
+## compile with oldrad/rrtm/ecrad radiatif code (Default=rrtm)
+rad="rrtm"
+
+## compile_with_fcm=1 : use makelmdz_fcm (1) or makelmdz (0)
+compile_with_fcm=1
+
+#Compilation with Cosp (cosp=NONE/v1/v2; default=NONE)
+cosp="NONE"
+opt_cosp=""
+
+# Check if on a Mac
+if [[ $(uname) = "Darwin" ]]; then
+    pcmac=1
+    export MAKE=make
+fi
+
+env_file=""
+optim=""
+
+#########################################################################
+#  Options interactives
+#########################################################################
+while (($# > 0))
+do
+    case $1 in
+        "-h") cat <<........fin
+    $0 [ -v version ] [ -r svn_release ]
+           [ -parallel PARA ] [ -d GRID_RESOLUTION ] [ -bench 0/1 ]
+           [-name LOCAL_MODEL_NAME] [-gprof] [-opt_makelmdz] [-rad RADIATIF]
+
+    -v       "version" like 20150828.trunk
+             see http://www.lmd.jussieu.fr/~lmdz/Distrib/LISMOI.trunk
+
+    -r       "svn_release" : either the svn release number or "last"
+
+    -compiler gfortran|ifort|pgf90 (default: gfortran)
+
+    -parallel PARA : can be mpi_omp (mpi with openMP) or none (for sequential)
+
+    -d        GRID_RESOLUTION should be among the available benchs if -bench 1
+              among which : 48x36x19, 48x36x39
+              if wanting to run a bench simulation in addition to compilation
+              default : 48x36x19
+
+    -bench     activating the bench or not (0/1). Default 1
+
+    -testing/unstable 
+
+    -name      LOCAL_MODEL_NAME : default = LMDZversion.release
+
+    -netcdf    0, 1 or PATH
+                   0: do not download NetCDF, look for it in standard locations
+               1: download and compile NetCDF
+                   PATH: full path to an existing installed NetCDF library
+
+    -xios      also download and compile the XIOS library
+               (requires the NetCDF4-HDF5 library, also installed by default)
+               (requires to also have -parallel mpi_omp)
+
+    -gprof     to compile with -pg to enable profiling with gprof
+
+    -cosp      to run without our with cospv1 or cospv2 [none/v1/v2]
+
+    -rad RADIATIF can be oldrad, rrtm or ecrad radiatif code
+
+    -nofcm     to compile without fcm
+
+    -SCM        install 1D version automatically
+
+    -debug      compile everything in debug mode
+
+    -opt_makelmdz     to call makelmdz or makelmdz_fcm with additional options
+
+    -physiq    to choose which physics package to use
+
+    -env_file  specify an arch.env file to overwrite the existing one
+
+    -veget surface model to run [NONE/CMIP6/xxxx]
+
+........fin
+              exit 1;;
+        "-v") version=$2; shift; shift;;
+        "-r") svn=$2; shift; shift;;
+        "-compiler") compiler=$2
+                     case $compiler in
+                         "gfortran"|"ifort"|"pgf90") compiler=$2; shift
+                                                     shift;;
+                         *) echo "Only gfortran , ifort or pgf90 for the " \
+                                 "compiler option"
+                            exit 1
+                     esac;;
+        "-d") grid_resolution=$2; shift; shift;;
+        "-gprof") OPT_GPROF="-pg"; shift;;
+        "-unstable"|"-testing") trusting=$(echo "$1" | cut -c2-) ; shift;;
+        "-cosp") cosp=$2
+                 case $cosp in
+                     "none"|"v1"|"v2") cosp=$2; shift; shift;;
+                     *) echo Only none v1 v2 for cosp option; exit 1
+                 esac;;
+        "-nofcm") compile_with_fcm=0; echo This option will be reactivated soon '(promesse du 8dec2022)'; exit 1;  shift;;
+        "-SCM") SCM=1; shift;;
+        "-opt_makelmdz") OPT_MAKELMDZ="$2"; shift; shift;;
+        "-rrtm") if [[ $2 = "false" ]]; then
+                     rad="oldrad"
+                 else
+                     rad="rrtm"
+                 fi
+                 shift; shift;;
+        "-rad") rad=$2
+                case $rad in
+                    "oldrad"|"rrtm"|"ecrad") rad=$2; shift; shift;;
+                    *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
+                esac;;
+        "-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 1
+                     esac;;
+        "-bench") bench=$2; shift; shift;;
+        "-debug") optim=-debug; shift;;
+        "-name") MODEL=$2; shift; shift;;
+        "-netcdf") netcdf=$2; shift; shift;;
+        "-physiq") physiq=$2; shift; shift;;
+        "-xios") with_xios="y"; shift;;
+        "-env_file") env_file=$2; shift; shift;;
+        "-veget") veget=$2; shift; shift;;
+        *)  bash install_lmdz.sh -h; exit 1
+    esac
+done
+
+# Option de compilation du rayonnement : depend de $mysvn ><= r4185,
+# sera donc definie plus bas
+
+#opt_rad=""
+#case $rad in
+#   rrtm) opt_rad="-rad rrtm";;
+#   ecrad) opt_rad="-rad ecrad";;
+#esac
+
+
+# Option de compilation pour Cosp
+opt_cosp=""
+case $cosp in
+    v1) opt_cosp="-cosp true";;
+    v2) opt_cosp="-cospv2 true";;
+esac
+
+# Check on veget version
+if [[ $veget != 'NONE' && $veget != "CMIP6" ]]; then
+    re='^[0-9]+$'
+    if ! [[ $veget =~ $re ]]; then
+        echo 'Valeur de l option veget non valable'
+        exit 1
+    fi
+fi
+
+#Define veget-related suffix for gcm name
+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)
+    orchidee_rev=''
+else
+    suff_orc='_orch'
+fi
+
+
+if [[ $parallel = none ]]; then
+    sequential=1; suff_exe='_seq'
+else
+    sequential=0; suff_exe='_para_mem'
+fi
+
+#Chemin pour placer le modele
+if [[ $MODEL = "" ]]; then MODEL=./LMDZ$version$svn$optim; fi
+
+
+arch=local
+
+
+if [[ $compiler = g95 ]]; then echo g95 is not supported anymore; exit 1; fi
+
+################################################################
+# Specificite des machines
+################################################################
+
+hostname=$(hostname)
+if [[ $pclinux = 1 ]]; then o_ins_make="-t g95"; else o_ins_make=""; fi
+
+case ${hostname:0:5} in
+
+    jean-)   compiler="mpiifort";
+             par_comp="mpiifort";
+             o_ins_make="-t jeanzay";
+             make=gmake;
+             module purge
+             module load intel-compilers/19.0.4;
+             #module load intel-mpi/19.0.4;
+             #module load intel-mkl/19.0.4;
+             module load hdf5/1.10.5-mpi;
+             module load netcdf/4.7.2-mpi;
+             module load netcdf-fortran/4.5.2-mpi;
+             module load subversion/1.9.7;
+	     module load cmake
+             export NETCDF_LIBDIR=./
+             export NETCDFFORTRAN_INCDIR=./
+             export NETCDFFORTRAN_LIBDIR=./
+             arch=X64_JEANZAY;;
+
+    cicla|camel)   compiler="gfortran";
+                   module purge
+                   module load gnu/10.2.0
+                   module load openmpi/4.0.5
+                   module load hdf5/1.10.7-mpi
+                   module load netcdf-c/4.7.4-mpi
+                   module load netcdf-fortran/4.5.3-mpi
+                   netcdf=/net/nfs/tools/PrgEnv/linux-scientific6-x86_64/gcc-10.2.0/netcdf-fortran-4.5.3-k3drgfqok3lip62hnm3tsyof4cjen5sk
+                   module load svn/1.14.0
+
+                   if [[ $parallel != none ]]; then
+                       root_mpi=/net/nfs/tools/meso-sl6/openmpi/4.0.5-gcc-10.2.0
+                       path_mpi=$root_mpi/bin;
+                       par_comp=${path_mpi}/mpif90;
+                       mpirun=${path_mpi}/mpirun;
+                   fi;
+                   arch="local" ;
+                   make="make";
+                   o_ins_make="-t g95";;
+
+    *)       if [[ $parallel = none || -f /usr/bin/mpif90 ]]; then
+                 path_mpi=$(which mpif90 | sed -e s:/mpif90::);
+                 if [[ -d /usr/lib64/openmpi ]]; then
+                     root_mpi="/usr/lib64/openmpi"
+                 else
+                     root_mpi="/usr"
+                 fi
+             else
+                 echo "Cannot find mpif90";
+                 if [[ $parallel = none ]]; then exit 1; fi;
+             fi;
+             if [[ $parallel != none ]]; then
+                 root_mpi=$(which mpif90 | sed -e s:/bin/mpif90::)
+                 path_mpi=$(which mpif90 | sed -e s:/mpif90::)
+                 export LD_LIBRARY_PATH=${root_mpi}/lib:$LD_LIBRARY_PATH
+             fi
+             par_comp=${path_mpi}/mpif90;
+             mpirun=${path_mpi}/mpirun;
+             arch="local" ;
+             make="make";
+             o_ins_make="-t g95"
+esac
+
+# Flags for parallelism:
+if [[ $parallel != none ]]; then
+    # MPI_LD are the flags needed for linking with MPI
+    MPI_LD="-L${root_mpi}/lib -lmpi"
+    if [[ "$compiler" = "gfortran" ]]; then
+        # MPI_FLAGS are the flags needed for compilation with MPI
+        MPI_FLAGS="-fcray-pointer"
+        # OMP_FLAGS are the flags needed for compilation with OpenMP
+        OMP_FLAGS="-fopenmp -fcray-pointer"
+        # OMP_LD are the flags needed for linking with OpenMP
+        OMP_LD="-fopenmp"
+    elif [[ "$compiler" = "ifort" ]]; then
+        MPI_FLAGS=""
+        OMP_FLAGS="-openmp"
+        OMP_LD="-openmp"
+    else # pgf90
+        MPI_FLAGS=""
+        OMP_FLAGS="-mp"
+        OMP_LD="-mp"
+    fi
+fi
+
+#####################################################################
+# Test for old gfortran compilers
+# If the compiler is too old (older than 4.3.x) we test if the
+# temporary gfortran44 patch is available on the computer in which
+# case the compiler is changed from gfortran to gfortran44
+# Must be aware than parallelism can not be activated in this case
+#####################################################################
+
+if [[ "$compiler" = "gfortran" ]]; then
+    gfortran=gfortran
+    gfortranv=$(gfortran --version | \
+   head -1 | awk ' { print $NF } ' | awk -F. ' { print $1 * 10 + $2 } ')
+    if [[ $gfortranv -le 43 ]]; then
+        \cat <<EOF
+ERROR : Your gfortran compiler is too old
+Please choose a new one (ifort) and change the line
+compiler=xxx
+in the install_lmdz.sh script and rerun it
+EOF
+        if [[ $(which gfortran44 | wc -w) -ne 0 ]]; then
+            gfortran=gfortran44
+        else
+            echo gfotran trop vieux; exit 1
+        fi
+    fi
+    compiler=$gfortran
+fi
+#####################################################################
+
+## if also compiling XIOS, parallel must be mpi_omp
+if [[ "$with_xios" = "y" && "$parallel" != "mpi_omp" ]]; then
+    echo "Error, you must set -parallel mpi_omp if you want XIOS"
+    exit 1
+fi
+
+if [[ "$with_xios" = "y" ]]; then
+    opt_makelmdz_xios="-io xios"
+fi
+
+if [[ "$cosp" = "v2" && "$with_xios" = "n" ]]; then
+    echo "Error, Cospv2 cannot run without Xios"
+    exit 1
+fi
+
+echo '################################################################'
+echo  Choix des options de compilation
+echo '################################################################'
+
+export FC=$compiler
+export F90=$compiler
+export F77=$compiler
+export CPPFLAGS=
+OPTIMNC=""
+BASE_LD="$OPT_GPROF"
+OPTPREC="$OPT_GPROF"
+ARFLAGS="rs"
+if [[ "$(lsb_release -i -s)" = "Ubuntu" ]]; then
+    if [[ "$(lsb_release -r -s | cut -d. -f1)" -ge 16 ]]; then
+            ARFLAGS="rU"
+    fi
+fi
+
+if [[ "$compiler" = "$gfortran" ]]; then
+   OPTIM="-O3 $allow_arg_mismatch"
+   OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan  $allow_arg_mismatch"
+   OPTDEV="-Wall -fbounds-check  $allow_arg_mismatch"
+   fmod='I '
+   OPTPREC="$OPTPREC -cpp -ffree-line-length-0"
+   if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE"; fi
+   export F90FLAGS=" -ffree-form $OPTIMNC"
+   export FFLAGS=" $OPTIMNC"
+   export CC=gcc
+   export CXX=g++
+   export fpp_flags="-P -C -traditional -ffreestanding"
+
+elif [[ $compiler = mpif90 ]]; then
+    OPTIM='-O3'
+    OPTDEB="-g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all"
+    OPTDEV="-Wall -fbounds-check"
+    BASE_LD="$BASE_LD -lblas"
+    fmod='I '
+    if [[ $real = r8 ]]; then
+        OPTPREC="$OPTPREC -fdefault-real-8 -DNC_DOUBLE -fcray-pointer"
+    fi
+    export F90FLAGS=" -ffree-form $OPTIMNC"
+    export FFLAGS=" $OPTIMNC"
+    export CC=gcc
+    export CXX=g++
+
+elif [[ $compiler = pgf90 ]]; then
+    OPTIM='-O2 -Mipa -Munroll -Mnoframe -Mautoinline -Mcache_align'
+    OPTDEB='-g -Mdclchk -Mbounds -Mchkfpstk -Mchkptr -Minform=inform -Mstandard -Ktrap=fp -traceback'
+    OPTDEV='-g -Mbounds -Ktrap=fp -traceback'
+    fmod='module '
+    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -r8 -DNC_DOUBLE"; fi
+    export CPPFLAGS="-DpgiFortran"
+    export CC=pgcc
+    export CFLAGS="-O2 -Msignextend"
+    export CXX=pgCC
+    export CXXFLAGS="-O2 -Msignextend"
+    export FFLAGS="-O2 $OPTIMNC"
+    export F90FLAGS="-O2 $OPTIMNC"
+    compile_with_fcm=1
+
+elif [[ $compiler = ifort || $compiler = mpiifort ]]; then
+    OPTIM="-O2 -fp-model strict -ip -align all "
+    OPTDEV="-p -g -O2 -traceback -fp-stack-check -ftrapuv -check"
+    OPTDEB="-g -no-ftz -traceback -ftrapuv -fp-stack-check -check"
+    fmod='module '
+    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -real-size 64 -DNC_DOUBLE"; fi
+    export CPP="icc -E"
+    export FFLAGS="-O2 -ip -fpic -mcmodel=large"
+    export FCFLAGS="-O2 -ip -fpic -mcmodel=large"
+    export CC=icc
+    export CFLAGS="-O2 -ip -fpic -mcmodel=large"
+    export CXX=icpc
+    export CXXFLAGS="-O2 -ip -fpic -mcmodel=large"
+    export fpp_flags="-P -traditional"
+    # Pourquoi forcer la compilation fcm. Marche mieux sans
+    #compile_with_fcm=1
+else
+    echo "unexpected compiler $compiler"; exit 1
+fi
+
+OPTIMGCM="$OPTIM $OPTPREC"
+
+hostname=$(hostname)
+
+##########################################################################
+# If installing on known machines such as Jean-Zay at IDRIS,
+# don't check for available software and don't install netcdf
+if [[ ${hostname:0:5} = jean- ]]; then
+    netcdf=0 # no need to recompile netcdf, alreday available
+    check_linux=0
+    pclinux=0
+    ioipsl=0 # no need to recompile ioipsl, already available
+    #netcdf="/smplocal/pub/NetCDF/4.1.3"
+    compiler="mpiifort"
+    fmod='module '
+    if [[ $real = r8 ]]; then OPTPREC="$OPTPREC -i4 -r8 -DNC_DOUBLE"; fi
+    OPTIM="-auto -align all -O2 -fp-model strict -xHost "
+    OPTIMGCM="$OPTIM $OPTPREC"
+fi
+##########################################################################
+
+
+mkdir -p "$MODEL"
+echo "$MODEL"
+MODEL=$( cd "$MODEL"; pwd ) # to get absolute path, if necessary
+
+
+if [[ "$check_linux" = 1 ]]; then
+    echo "################################################################"
+    echo "Check if required software is available"
+    echo "################################################################"
+
+    #### Ehouarn: test if the required shell is available
+    #### Maj FH-LF-AS 2021-04 : default=bash; if bash missing, use ksh
+    use_shell="bash" # default
+    if [[ $(which bash) = "" ]]; then
+        echo "no bash; we will use ksh"
+        use_shell="ksh"
+        if [[ $(which ksh) = "" ]]; then
+            echo "bash (or ksh) needed!! Install it!"
+            exit 1
+        fi
+    fi
+
+    for logiciel in wget tar gzip make $compiler gcc cmake m4 c++; do
+        if [[ $(which $logiciel) = "" ]]; then
+            echo "You must first install $logiciel on your system"
+            exit 1
+        fi
+    done
+
+    if [[ $pclinux = 1 ]]; then
+        cd "$MODEL"
+        cat <<eod > tt.f90
+print*,'coucou'
+end
+eod
+        $compiler tt.f90 || a.out
+        ./a.out >| tt
+        if [[ $(< tt sed -e 's/ //g' ) != "coucou" ]]; then
+            echo "problem installing with compiler $compiler"; exit 1; fi
+        \rm tt a.out tt.f90
+    fi
+fi
+
+###########################################################################
+if [[ $getlmdzor = 1 && ! -d $MODEL/modipsl ]]; then
+###########################################################################
+   echo "##########################################################"
+   echo "Download a slightly modified version of  LMDZ"
+   echo "##########################################################"
+   cd "$MODEL"
+   getlog=$(pwd)/get.log
+   echo logfile : "$getlog"
+   myget "src_archives/$trusting/modipsl.$version.tar.gz" >> get.log 2>&1
+   echo install_lmdz.sh wget_OK "$(date)"
+   gunzip "modipsl.$version.tar.gz" >> get.log 2>&1
+   tar xf "modipsl.$version.tar" >> get.log 2>&1
+   \rm "modipsl.$version.tar"
+fi
+
+###########################################################################
+echo Installing Netcdf
+###########################################################################
+
+if [[ $netcdf = 0 ]]; then
+    ncdfdir=/usr
+
+else
+    cd "$MODEL"
+
+    case $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 $compiler" for netcdf; exit 1
+    esac
+
+    case $with_xios in
+        n) script_install_netcdf=install_netcdf4_hdf5_seq.bash
+           ncdfdir=netcdf4_hdf5_seq
+           opt_=$opt1;;
+        y) script_install_netcdf=install_netcdf4_hdf5.bash
+           ncdfdir=netcdf4_hdf5
+           opt_="$opt2 -MPI $root_mpi";;
+        *) echo with_xios=$with_xios, should be n or y; exit 1
+    esac
+    if [[ $netcdf = 1 ]]; then
+       ncdfdir=$MODEL/$ncdfdir
+    else
+       mkdir -p $netcdf; ncdfdir=$netcdf/$ncdfdir
+    fi
+         
+    echo "Repertoire netcdf $ncdfdir"
+    if [[ ! -d $ncdfdir ]]; then
+        netcdflog=$(pwd)/netcdf.log
+        echo "----------------------------------------------------------"
+        echo "Compiling the Netcdf library"
+        echo "----------------------------------------------------------"
+        echo "log file : $netcdflog"
+        myget script_install/$script_install_netcdf >> "$netcdflog" 2>&1
+        chmod u=rwx $script_install_netcdf
+        # shellcheck disable=SC2086
+        ./$script_install_netcdf -prefix "$ncdfdir" $opt_ >> "$netcdflog" 2>&1
+    fi
+
+    #----------------------------------------------------------------------------
+    # LF rajout d'une verrue, pour une raison non encore expliquee,
+    # la librairie est parfois rang�e dans lib64 et non dans lib
+    # par certains compilateurs
+    if [[ ! -e lib && -d lib64 ]]; then ln -s lib64 lib; fi
+    #----------------------------------------------------------------------------
+
+    echo install_lmdz.sh netcdf_OK "$(date)"
+
+fi
+
+cat >test_netcdf90.f90 <<EOF
+use netcdf
+print *, "NetCDF library version: ", nf90_inq_libvers()
+end
+EOF
+
+if $compiler -I"$ncdfdir"/include test_netcdf90.f90 -L"$ncdfdir"/lib -lnetcdff \
+          -lnetcdf -Wl,-rpath="$ncdfdir"/lib && ./a.out
+then
+    rm test_netcdf90.f90 a.out
+else
+    echo "Failed test program using NetCDF-Fortran."
+    echo "You can:"
+    echo "- check that you have NetCDF-Fortran installed in your system"
+    echo "- or specify an installation directory with option -netcdf of" \
+         "install_lmdz.sh"
+    echo "- or download and compile NetCDF-Fortran with option -netcdf 1 of" \
+         "install_lmdz.sh"
+    exit 1
+fi
+
+if [[ ! -f $MODEL/modipsl/lib/libioipsl.a ]]
+then
+    if [[ $ioipsl = 1 ]]; then
+        cat <<EOF
+OK ioipsl=$ioipsl
+##########################################################
+Installing MODIPSL, the installation package manager for the
+IPSL models and tools
+##########################################################
+$(date)
+EOF
+        cd "$MODEL/modipsl"
+        \rm -rf lib/*
+        cd util
+        cp AA_make.gdef AA_make.orig
+        F_C="$compiler -c "
+        if [[ $compiler = "$gfortran" || $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": \
+            -e 's/g95.*.w_w.*.(F_D)/g95      w_w = '"$OPTIMGCM"'/' \
+            -e 's:g95.*.NCDF_INC.*.$:g95      NCDF_INC= '"$ncdfdir"'/include:' \
+            -e 's:g95.*.NCDF_LIB.*.$:g95      NCDF_LIB= -L'"$ncdfdir"'/lib -lnetcdff -lnetcdf:' \
+            -e 's:g95      L_O =:g95      L_O = -Wl,-rpath='"$ncdfdir"'/lib:' \
+            -e "s:-fmod=:-$fmod:" -e 's/-fno-second-underscore//' \
+            -e 's:#-Q- g95      M_K = gmake:#-Q- g95      M_K = make:' \
+            tmp >| AA_make.gdef
+
+        if [[ $pcmac == 1 ]]
+        then
+            cp AA_make.gdef tmp
+            sed -e 's/rpath=/rpath,/g' tmp > AA_make.gdef
+        fi
+
+
+        # We use lines for g95 even for the other compilers to run ins_make
+        if [[ "$use_shell" = "ksh" ]]; then
+            ./ins_make "$o_ins_make"
+        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
+                echo 'Warning jean-zay not in AA_make.gdef'
+                echo 'Think about updating'
+                exit 1
+            fi
+
+            chmod u=rwx ins_make.bash
+            ./ins_make.bash "$o_ins_make"
+        fi # of if [[ "$use_shell" = "ksh" ]]
+
+        echo "install_lmdz.sh MODIPSL_OK $(date)"
+
+        cd "$MODEL/modipsl/modeles/IOIPSL/src"
+        ioipsllog=$(pwd)/ioipsl.log
+        echo '##########################################################'
+        echo 'Compiling IOIPSL, the interface library with Netcdf'
+        echo '##########################################################'
+        echo "log file : $ioipsllog   $(date)"
+
+        if [[ "$use_shell" = "bash" ]]; then
+            cp Makefile Makefile.ksh
+            sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
+        fi
+        ### if [[ "$pclinux" = 1 ]]; then
+        # Build IOIPSL modules and library
+        $make clean
+        $make > "$ioipsllog" 2>&1
+        if [[ $compiler = "$gfortran" || $compiler = "mpif90" ]]; then
+            # copy module files to lib
+            cp -f -- *.mod ../../../lib
+        fi
+        # Build IOIPSL tools (ie: "rebuild", if present)
+        # For IOIPSLv_2_2_2, "rebuild" files are in IOIPSL/tools
+        rebuild_dir=""
+        if [[ -f $MODEL/modipsl/modeles/IOIPSL/tools/rebuild ]]; then 
+            rebuild_dir=$MODEL/modipsl/modeles/IOIPSL/tools
+	elif [[ -d $MODEL/modipsl/modeles/IOIPSL/rebuild ]]; then
+              rebuild_dir=$MODEL/modipsl/modeles/IOIPSL/rebuild
+        fi
+        if [[ $rebuild_dir != "" ]]; then
+	    cd "$rebuild_dir"
+            # adapt Makefile & rebuild script if in bash
+            if [[ "$use_shell" = "bash" ]]; then
+                cp Makefile Makefile.ksh
+                sed -e s:/bin/ksh:/bin/bash:g Makefile.ksh > Makefile
+                cp rebuild rebuild.ksh
+                sed -e 's:/bin/ksh:/bin/bash:g' \
+                    -e 's:print -u2:echo:g' \
+                    -e 's:print:echo:g' rebuild.ksh > rebuild
+            fi
+            $make clean
+            $make > "$ioipsllog" 2>&1
+        fi
+        ### fi # of if [[ "$pclinux" = 1 ]] which is commented out
+
+    else # of if [[ $ioipsl = 1 ]]
+        if [[ ${hostname:0:5} = jean- ]]; then
+            cd "$MODEL/modipsl"
+            cd util
+            if [[ $(grep jeanzay AA_make.gdef) = "" ]]; then
+                echo 'Warning jean-zay not in AA_make.gdef'
+                echo 'Think about updating'
+                exit 1
+            fi
+            ./ins_make "$o_ins_make"
+            # Compile IOIPSL on jean-zay
+            cd "$MODEL/modipsl/modeles/IOIPSL/src"
+            gmake > ioipsl.log
+	    # For IOIPSLv_2_2_2, "rebuild" files are in IOIPSL/tools, so "gmake" in IOIPSL/tools is enough
+	    # For IOIPSLv_2_2_5, "rebuild" files are in a separate IOIPSL/rebuild folder , while "tools" only contains "FCM"
+	    if [[ -f $MODEL/modipsl/modeles/IOIPSL/tools/Makefile ]]; then
+              cd "$MODEL/modipsl/modeles/IOIPSL/tools"
+              gmake > ioipsl.log
+            fi
+            if [[ -d $MODEL/modipsl/modeles/IOIPSL/rebuild ]]; then
+              cd "$MODEL/modipsl/modeles/IOIPSL/rebuild"
+              gmake > ioipsl.log
+            fi
+
+        fi
+        echo "install_lmdz.sh ioipsl_OK $(date)"
+    fi # of if [[ $ioipsl = 1 ]]
+fi # of if [[ ! -f $MODEL/modipsl/lib/libioipsl.a ]]
+
+#=========================================================================
+if [[ "$with_xios" = "y" ]]; then
+    echo '##########################################################'
+    echo 'Compiling XIOS'
+    echo '##########################################################'
+    cd "$MODEL/modipsl/modeles"
+    xioslog="$(pwd)/xios.log"
+    #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/install_xios.bash
+    myget script_install/install_xios.bash
+    chmod u=rwx install_xios.bash
+# following will be recalculated later on once LMDZ is updated
+#    mysvn=`svnversion LMDZ | egrep || "[0-9]+" 2>/dev/null`
+    mysvn=$(grep 'Revision: [0-9]' "$MODEL"/Read*.md | awk ' { print $2 } ' 2>/dev/null)
+    if [[ $svn != "" ]]; then mysvn=$svn; fi
+    echo "mysvn $mysvn"
+
+    if [[ ${hostname:0:5} = jean- ]]; then
+	if [[ $mysvn -ge 4619 ]]; then 
+          svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/branches/xios-2.6 \
+            XIOS
+	else
+          svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/branches/xios-2.5 \
+            XIOS
+        fi
+        cd XIOS/arch
+        svn update
+        cd ..
+        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
+    else
+        ./install_xios.bash -prefix "$MODEL/modipsl/modeles" \
+                            -netcdf "$ncdfdir" -hdf5 "$ncdfdir" \
+                            -MPI "$root_mpi" -arch $arch > xios.log 2>&1
+    fi # of case Jean-Zay
+    if [[ -f XIOS/lib/libxios.a ]]; then
+        echo "XIOS library successfully generated"
+        echo install_lmdz.sh XIOS_OK "$(date)"
+    fi
+fi
+
+#============================================================================
+veget_version=false
+if [[ "$veget" != 'NONE' ]]; then
+    cd "$MODEL/modipsl/modeles/ORCHIDEE"
+    set +e; svn upgrade; set -e
+    if [[ "$veget" = "CMIP6" ]]; then
+        veget_version=orchidee2.0
+        orchidee_rev=6592
+    else # specific orchidee revision newer than CMIP6, on 2_1 or 2_2 branches
+        veget_version=orchidee2.1
+        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'
+            exit 1
+        fi
+        set +e
+        # which branch is my version on?
+        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"
+        if ! (svn log -r "$veget" | grep "$veget"); then
+            echo 'Cannot update ORCHIDEE as not on the right branch for ORCHIDEE'
+            exit 1
+        fi
+        set -e
+        set +e; svn update -r "$veget"; set -e
+    fi
+    # Correctif suite debug Jean-Zay
+    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
+
+    orchideelog=$(pwd)/orchidee.log
+    echo '########################################################'
+    echo 'Compiling ORCHIDEE, the continental surface model '
+    echo '########################################################'
+    echo "Start of the first compilation of orchidee, in sequential mode: $(date)"
+    echo "log file : $orchideelog"
+
+    ORCHPATH=$(pwd)
+    export ORCHPATH=$ORCHPATH
+    xios_orchid="-noxios"
+    if [[ "$with_xios" = "y" ]]; then
+        xios_orchid="-xios"
+    fi
+    if [[ -d tools ]]; then
+        ###################################################################
+        # Pour les experts qui voudraient changer de version d'orchidee.
+        # Attention : necessite d'avoir le password pour orchidee
+
+        # 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 [[ "$veget_version" == "false" ]]; then
+            veget_version=orchidee2.0
+        fi
+        cd arch
+        sed -e s:"%COMPILER        .*.$:%COMPILER            $compiler":1 \
+            -e s:"%LINK            .*.$:%LINK                $compiler":1 \
+            -e s:"%FPP_FLAGS       .*.$:%FPP_FLAGS           $fpp_flags":1 \
+            -e s:"%PROD_FFLAGS     .*.$:%PROD_FFLAGS         $OPTIM":1 \
+            -e s:"%DEV_FFLAGS      .*.$:%DEV_FFLAGS          $OPTDEV":1 \
+            -e s:"%DEBUG_FFLAGS    .*.$:%DEBUG_FFLAGS        $OPTDEB":1 \
+            -e s:"%BASE_FFLAGS     .*.$:%BASE_FFLAGS         $OPTPREC":1 \
+            -e s:"%BASE_LD         .*.$:%BASE_LD             $BASE_LD":1 \
+            -e s:"%ARFLAGS         .*.$:%ARFLAGS             $ARFLAGS":1 \
+            arch-gfortran.fcm > arch-local.fcm
+        cat <<EOF > arch-local.path
+NETCDF_LIBDIR="-L$ncdfdir/lib -lnetcdff -lnetcdf"
+NETCDF_INCDIR="$ncdfdir/include"
+IOIPSL_INCDIR="$ORCHPATH/../../lib"
+IOIPSL_LIBDIR="$ORCHPATH/../../lib"
+XIOS_INCDIR="\$ORCHDIR/../XIOS/inc"
+XIOS_LIBDIR="\$ORCHDIR/../XIOS/lib -lxios"
+EOF
+        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
+        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 1
+            fi
+            cd "$src_d"; \rm -f -- *.mod make; $make clean
+            $make > "$orchideelog" 2>&1
+            if [[ "$compiler" = "$gfortran" || "$compiler" = "mpif90" ]]; then
+                cp -f -- *.mod ../../../lib
+            fi
+            cd ..
+        done
+    fi # of "if [[ -d tools ]]"
+    echo "install_lmdz.sh orchidee_compil_seq_OK $(date)"
+fi # of if [[ "$veget" != 'NONE' ]]
+
+
+#============================================================================
+# Ehouarn: the directory name LMDZ* depends on version/tar file...
+if [[ -d $MODEL/modipsl/modeles/LMD* ]]; then
+    echo '###############################################################'
+    echo 'Preparing LMDZ compilation : arch file, svn switch if needed...'
+    echo '###############################################################'
+    cd "$MODEL/modipsl/modeles/"LMD*
+    LMDZPATH=$(pwd)
+else
+    echo "ERROR: No LMD* directory !!!"
+    exit 1
+fi
+
+###########################################################
+# For those who want to use fcm to compile via :
+#  makelmdz_fcm -arch local .....
+############################################################
+
+
+
+cd "$MODEL/modipsl/modeles"/LMDZ*
+lmdzlog=$(pwd)/lmdz.log
+
+##################################################################
+# Possibly update LMDZ if a specific svn release is requested
+##################################################################
+
+set +e; svn upgrade; set -e
+
+if [[ $svn = "last" ]]; then svnopt=""; else svnopt="-r $svn"; fi
+if [[ $svn != "" ]]; then
+    if set +e; 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"
+    set -e
+fi
+
+#---------------------------------------------------------------------
+# Retrieve the final svn release number, and adjust compilation
+# options accordingly
+# If svn not available, will use the svn writen in $MODEL/Readm*md
+# For old version it assumes that it is before 4185 (the version
+# for which the test was introduced
+#---------------------------------------------------------------------
+
+set +e; mysvn=$(svnversion . | grep -E || "[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
+
+if [[ "$pclinux" = "1" && ! -f arch/arch-local.path ]]; then
+
+    # create local 'arch' files (if on Linux PC):
+    cd arch
+    # arch-local.path file
+    # test for version as arch.pth file changed format with rev 4426
+    if [[ "$mysvn" -gt 4425 ]]; then
+      cat <<EOF > arch-local.path
+NETCDF_LIBDIR="-L$ncdfdir/lib"
+NETCDF_LIB="-lnetcdff -lnetcdf\"
+NETCDF_INCDIR=-I$ncdfdir/include
+NETCDF95_INCDIR=-I\$LMDGCM/../../include
+NETCDF95_LIBDIR=-L\$LMDGCM/../../lib
+NETCDF95_LIB=-lnetcdf95
+IOIPSL_INCDIR=-I\$LMDGCM/../../lib
+IOIPSL_LIBDIR=-L\$LMDGCM/../../lib
+IOIPSL_LIB=-lioipsl
+XIOS_INCDIR=-I\$LMDGCM/../XIOS/inc
+XIOS_LIBDIR=-L\$LMDGCM/../XIOS/lib
+XIOS_LIB="-lxios -lstdc++"
+ORCH_INCDIR=-I\$LMDGCM/../../lib
+ORCH_LIBDIR=-L\$LMDGCM/../../lib
+EOF
+    else
+      cat <<EOF > arch-local.path
+NETCDF_LIBDIR="-L$ncdfdir/lib -lnetcdff -lnetcdf"
+NETCDF_INCDIR=-I$ncdfdir/include
+NETCDF95_INCDIR=\$LMDGCM/../../include
+NETCDF95_LIBDIR=\$LMDGCM/../../lib
+IOIPSL_INCDIR=\$LMDGCM/../../lib
+IOIPSL_LIBDIR=\$LMDGCM/../../lib
+XIOS_INCDIR=\$LMDGCM/../XIOS/inc
+XIOS_LIBDIR=\$LMDGCM/../XIOS/lib
+ORCH_INCDIR=\$LMDGCM/../../lib
+ORCH_LIBDIR=\$LMDGCM/../../lib
+EOF
+    fi 
+
+    if [[ $pcmac == 1 ]]; then
+        BASE_LD="$BASE_LD -Wl,-rpath,${ncdfdir}/lib"
+    else
+        BASE_LD="$BASE_LD -Wl,-rpath=${ncdfdir}/lib"
+    fi
+    # Arch-local.fcm file (adapted from arch-linux-32bit.fcm)
+
+    if [[ $real = r8 ]]; then FPP_DEF=NC_DOUBLE; else FPP_DEF=""; fi
+    sed -e s:"%COMPILER        .*.$:%COMPILER            $compiler":1 \
+        -e s:"%LINK            .*.$:%LINK                $compiler":1 \
+        -e s:"%PROD_FFLAGS     .*.$:%PROD_FFLAGS         $OPTIM":1 \
+        -e s:"%DEV_FFLAGS      .*.$:%DEV_FFLAGS          $OPTDEV":1 \
+        -e s:"%DEBUG_FFLAGS    .*.$:%DEBUG_FFLAGS        $OPTDEB":1 \
+        -e s:"%BASE_FFLAGS     .*.$:%BASE_FFLAGS         $OPTPREC":1 \
+        -e s:"%FPP_DEF         .*.$:%FPP_DEF             $FPP_DEF":1 \
+        -e s:"%BASE_LD         .*.$:%BASE_LD             $BASE_LD":1 \
+        -e s:"%ARFLAGS         .*.$:%ARFLAGS             $ARFLAGS":1 \
+        arch-linux-32bit.fcm > arch-local.fcm
+
+    cd ..
+    ### Adapt "bld.cfg" (add the shell):
+    #whereisthatshell=$(which ${use_shell})
+    #echo "bld::tool::SHELL   $whereisthatshell" >> bld.cfg
+
+fi # of if [[ "$pclinux" = 1 ]]
+#---------------------------------------------------------------------
+# Option de compilation du rayonnement : depend de $mysvn ><= r4185
+#---------------------------------------------------------------------
+opt_rad=""
+
+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;;
+    ecrad)  iflag_rrtm=2; NSW=6; opt_rad="-rad ecrad";;
+    *) echo "Only oldrad rrtm ecrad for rad option"; exit 1
+esac
+
+if [[ $mysvn -le 4185 && $rad = "ecrad" ]]; then
+    echo "ecrad only available for LMDZ rev starting with 4186 "; exit 1
+fi
+
+##################################################################
+
+
+if [[ ! -f libf/misc/netcdf95.F90 &&  ! -d $MODEL/NetCDF95-0.3 ]]; then
+    cd "$MODEL"
+    myget src_archives/netcdf/NetCDF95-0.3.tar.gz
+    tar -xf NetCDF95-0.3.tar.gz
+    rm NetCDF95-0.3.tar.gz
+    cd NetCDF95-0.3
+    mkdir build
+    cd build
+    cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$ncdfdir" \
+          -DCMAKE_INSTALL_PREFIX="$MODEL/modipsl"
+    make install
+    cd "$MODEL/modipsl/modeles/"LMDZ*
+fi
+
+echo '##################################################################'
+echo "Preparing script compile.sh for LMDZ compilation"
+echo "It will only be run automatically if bench=1/tuto"
+echo "Here bench=$bench"
+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
+
+# 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
+    chmod +x ./compile.sh
+    if [[ $bench = 1 ]]; then
+        echo "install_lmdz.sh start_lmdz_seq_compilation $(date)"
+        echo "log file: $lmdzlog"
+        ./compile.sh > "$lmdzlog" 2>&1
+        echo "install_lmdz.sh end_lmdz_seq_compilation $(date)"
+    fi
+fi # fin sequential
+
+# compiling in parallel mode
+if [[ $parallel != "none" ]]; then
+    echo '##########################################################'
+    echo ' Parallel compile '
+    echo '##########################################################'
+    echo "(after saving the sequential libs and binaries)"
+    cd "$MODEL/modipsl"
+    tar cf sequential.tar bin/ lib/
+    #
+    # Orchidee
+    #
+    cd "$ORCHPATH"
+    if [[ -d src_parallel && $veget != 'NONE' ]]; then
+        cd arch
+        sed  \
+            -e s:"%COMPILER.*.$:%COMPILER            $par_comp":1 \
+            -e s:"%LINK.*.$:%LINK                $par_comp":1 \
+            -e s:"%MPI_FFLAG.*.$:%MPI_FFLAGS          $MPI_FLAGS":1 \
+            -e s:"%OMP_FFLAG.*.$:%OMP_FFLAGS          $OMP_FLAGS":1 \
+            -e s:"%MPI_LD.*.$:%MPI_LD              $MPI_LD":1 \
+            -e s:"%OMP_LD.*.$:%OMP_LD              $OMP_LD":1 \
+            arch-local.fcm > tmp.fcm
+
+        mv tmp.fcm arch-local.fcm
+        cd ../
+        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
+        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
+        echo "End of ORCHIDEE compilation in parallel mode $(date)"
+    elif [[ $veget != 'NONE' ]]; then
+        echo '##########################################################'
+        echo ' Orchidee version too old                                 '
+        echo ' Please update to new version                             '
+        echo '##########################################################'
+        exit 1
+    fi #�of [ -d src_parallel && $veget != 'NONE' ]
+
+    # LMDZ
+    cd "$LMDZPATH"
+    if [[ $arch = local ]]; then
+        cd arch
+        sed -e s:"%COMPILER.*.$:%COMPILER            $par_comp":1 \
+            -e s:"%LINK.*.$:%LINK                $par_comp":1 \
+            -e s:"%MPI_FFLAG.*.$:%MPI_FFLAGS          $MPI_FLAGS":1 \
+            -e s:"%OMP_FFLAG.*.$:%OMP_FFLAGS          $OMP_FLAGS":1 \
+            -e s:"%ARFLAGS.*.$:%ARFLAGS          $ARFLAGS":1 \
+            -e "s§%BASE_LD.*.$§%BASE_LD             -Wl,-rpath=${root_mpi}/lib:${ncdfdir}/lib§1" \
+            -e s:"%MPI_LD.*.$:%MPI_LD              $MPI_LD":1 \
+            -e s:"%OMP_LD.*.$:%OMP_LD              $OMP_LD":1 \
+            arch-local.fcm > tmp.fcm
+        mv tmp.fcm arch-local.fcm
+        cd ../
+    fi
+    rm -f compile.sh
+    echo resol="$grid_resolution" >> compile.sh
+    if [[ ${hostname:0:5} = jean- && "$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
+    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
+    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
+    fi
+
+fi # of if [[ $parallel != "none" ]]
+
+
+##################################################################
+# Verification du succes de la compilation
+##################################################################
+
+# Recherche de l'executable dont le nom a change au fil du temps ...
+# suffix contains radiative option starting with revision 4186
+if [[ $mysvn -ge 4186 ]]; then suff_exe=_${rad}${suff_exe}; fi
+gcm=""
+
+for exe in gcm.e bin/gcm_${grid_resolution}_phylmd${suff_exe}${suff_orc}.e
+do
+    if [[ -f $exe ]]; then gcm=$exe; fi
+done
+
+if [[ "$gcm" = "" ]]; then
+    if [[ $bench = 1 ]]; then
+        echo 'Compilation failed !! Cannot run the benchmark;'
+        exit 1
+    else
+        echo 'Compilation not done (only done when bench=1)'
+    fi
+else
+    echo '##########################################################'
+    echo "Compilation successfull !!  $(date)"
+    echo '##########################################################'
+    echo "The executable is $gcm"
+fi
+
+##################################################################
+# Below, we run a benchmark if bench=1 or tuto
+##################################################################
+
+if [[ $bench = tuto ]]; then
+    myget Training/tutorial.tar; tar xf tutorial.tar; cd TUTORIAL
+    ./init.sh
+
+elif [[ $bench = 1 && ! -d BENCH${grid_resolution} ]]; then
+    # TOUTE CETTE SECTION DEVRAIT DISPARAITRE POUR UNE COMMANDE
+    # OU DES BENCHS PAR MOTS CLES COMME tuto
+
+    echo '##########################################################'
+    echo ' Running a test run '
+    echo '##########################################################'
+
+    \rm -rf "BENCH${grid_resolution}"
+    bench=bench_lmdz_${grid_resolution}
+    echo "install_lmdz.sh before bench download  $(date)"
+    #wget http://www.lmd.jussieu.fr/~lmdz/Distrib/$bench.tar.gz
+    myget "3DBenchs/$bench.tar.gz"
+    echo "install_lmdz.sh after bench download  $(date)"
+    tar xf "$bench.tar.gz"
+
+    if [[ "$cosp" = "v1" || "$cosp" = "v2" ]]; then
+        cd "BENCH${grid_resolution}"
+        # copier les fichiers namelist input et output our COSP
+        cp ../DefLists/cosp*_input_nl.txt .
+        cp ../DefLists/cosp*_output_nl.txt .
+        # Activer la cles ok_cosp pour tourner avec COSP
+        sed -e 's@ok_cosp=n@ok_cosp=y@' config.def > tmp
+        \mv -f tmp config.def
+        cd ..
+    fi
+
+    if [[ -n "$physiq" ]]; then
+        cd "BENCH${grid_resolution}"
+        if [[ -f "physiq.def_${physiq}" ]]; then
+            cp "physiq.def_${physiq}" physiq.def
+            echo using "physiq.def_${physiq}"
+        else
+            echo using standard physiq.def
+        fi
+        cd ..
+    else
+        echo using standard physiq.def
+    fi
+
+    if [[ "$with_xios" = "y" ]]; then
+        cd "BENCH${grid_resolution}"
+        cp ../DefLists/iodef.xml .
+        cp ../DefLists/context_lmdz.xml .
+        cp ../DefLists/field_def_lmdz.xml .
+        # A raffiner par la suite
+        echo "A FAIRE : Copier les *xml en fonction de l option cosp"
+        cp ../DefLists/field_def_cosp*.xml .
+        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
+        \mv -f tmp iodef.xml
+
+        # and convert all the enabled="_AUTO_" (for libIGCM) to enabled=.FALSE.
+        # except for histday
+        for histfile in file_def_hist*xml
+        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"
+            else
+                sed -e 's@enabled="_AUTO_"@type="one_file" enabled=".FALSE."@' \
+                    "$histfile" > tmp
+                \mv -f tmp "$histfile"
+            fi
+        done
+        # and add option "ok_all_xml=y" in config.def
+        echo "### XIOS outputs" >> config.def
+        echo 'ok_all_xml=.true.' >> config.def
+
+        #activer les sorties pour Cosp
+        if [[ "$cosp" = "v1" ]]; then
+            sed -i'' -e 's@enabled=".FALSE."@enabled=".TRUE."@' \
+                     -e 's@output_level="_AUTO_"@output_level="5"@' \
+                     -e 's@compression_level="2"@compression_level="0"@' \
+                     file_def_histdayCOSP_lmdz.xml
+        fi
+        if [[ "$cosp" = "v2" ]]; then
+            sed -e 's@compression_level="2"@compression_level="0"@' file_def_histdayCOSPv2_lmdz.xml
+            for type_ in hf day mth; do
+                file=file_def_hist${type_}COSP
+                sed -i'' -e 's@src="./'${file}'_lmdz.xml"@src="./'${file}'v2_lmdz.xml"@' context_lmdz.xml
+            done
+            sed -i '' -e 's@field_def_cosp1.xml@field_def_cospv2.xml@' field_def_lmdz.xml
+        fi
+
+        cd ..
+    fi
+
+    # Cas Bensh avec ecrad
+    if [[ "$rad" = "ecrad" ]]; then
+        cd "BENCH${grid_resolution}"
+        cp  ../DefLists/namelist_ecrad .
+        cp -r ../libf/phylmd/ecrad/data .
+        cd ..
+    fi
+
+    # 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
+    \mv tmpdef physiq.def
+    cd ..
+
+    cp "$gcm" "BENCH${grid_resolution}/gcm.e"
+
+    cd "BENCH${grid_resolution}"
+    # On cree le fichier bench.sh au besoin
+    # Dans le cas 48x36x39 le bench.sh existe deja en parallele
+
+    if [[ "$grid_resolution" = "48x36x39" ]]; then
+        echo On ne touche pas au bench.sh
+        # But we have to adapt "run_local.sh" for $mpirun
+        sed -e "s@mpirun@$mpirun@g" run_local.sh > tmp
+        mv -f tmp run_local.sh
+        chmod u=rwx run_local.sh
+    elif [[ "${parallel:0:3}" = "mpi" ]]; then
+        # Lancement avec deux procs mpi et 2 openMP
+        echo "export OMP_STACKSIZE=800M" > bench.sh
+        if [[ "${parallel:4:3}" = "omp" ]]; then
+            echo "export OMP_NUM_THREADS=2" >> bench.sh
+        fi
+        if [[ "$cosp" = "v1" || "$cosp" = "v2" ]]; then
+            if [[ ${hostname:0:5} = jean- ]]; then
+                   chmod +x ../arch.env
+                ../arch.env        
+                echo "ulimit -s 2000000" >> bench.sh
+            else
+                echo "ulimit -s 200000" >> bench.sh
+            fi        
+        else
+            echo "ulimit -s unlimited" >> bench.sh
+        fi
+        if [[ ${hostname:0:5} = jean- ]]; then
+            . ../arch/arch-${arch}.env
+            echo "srun -n 2 && $idris_acct@cpu gcm.e > listing  2>&1" \
+                 >> bench.sh
+        else
+            echo "$mpirun -np 2 gcm.e > listing  2>&1" >> bench.sh
+        fi
+        # Add rebuild, using reb.sh if it is there
+        cat <<EOF >> bench.sh
+if [[ -f reb.sh ]]; then
+  ./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
+fi
+EOF
+    else
+        echo "./gcm.e > listing  2>&1" > bench.sh
+    fi
+    # Getting orchidee stuff
+    if [[ $veget == 'CMIP6' ]]; then
+        #echo 'myget 3DBenchs/BENCHorch11.tar.gz'
+        #myget 3DBenchs/BENCHorch11.tar.gz
+        #tar xvzf BENCHorch11.tar.gz
+        echo 'myget 3DBenchs/BENCHCMIP6.tar.gz'
+        myget 3DBenchs/BENCHCMIP6.tar.gz
+        tar xvzf BENCHCMIP6.tar.gz
+        sed -e "s:VEGET=n:VEGET=y:" config.def > tmp
+        mv -f tmp config.def
+        if [[ "$with_xios" = "y" ]]; then
+            cp ../../ORCHIDEE/src_xml/context_orchidee.xml .
+            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 .
+            cp ../../ORCHIDEE/src_xml/file_def_input_orchidee.xml .
+            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
+            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
+        fi
+    fi
+
+    if [[ -f ../arch.env ]]
+    then
+        source ../arch.env
+    fi
+
+    echo EXECUTION DU BENCH
+    set +e
+    date; ./bench.sh > out.bench 2>&1; date
+    set -e
+    tail listing
+
+
+    echo "##########################################################"
+    echo "Simulation finished in $(pwd)"
+    echo "You have compiled with:"
+    cat ../compile.sh
+    if [[ $parallel = "none" ]]; then
+        echo "You may re-run it with : cd  $(pwd) ; gcm.e"
+        echo "or ./bench.sh"
+    else
+        echo "You may re-run it with : "
+        echo "cd  $(pwd) ; ./bench.sh"
+        #  echo 'ulimit -s unlimited'
+        #  echo 'export OMP_NUM_THREADS=2'
+        #  echo 'export OMP_STACKSIZE=800M'
+        #  echo "$mpirun -np 2 gcm.e "
+    fi
+    echo '##########################################################'
+
+fi # bench
+
+
+#################################################################
+# Installation eventuelle du 1D
+#################################################################
+
+if [[ $SCM = 1 ]]; then
+    cd "$MODEL"
+    myget 1D/1D.tar.gz
+    tar xf 1D.tar.gz
+    cd 1D
+    if [[ $rad = oldrad ]]; then
+        sed -i'' -e 's/^rad=.*$/rad=oldrad/' run.sh
+        sed -i'' -e 's/^rad=.*$/rad=oldrad/' bin/compile
+    fi
+    echo "Running 1D/run.sh, log in $(pwd)/run1d.log"
+    ./run.sh > "$(pwd)/run1d.log" 2>&1
+fi
+
+
+#################################################################
+# sauvegarde des options veget pour utilisation eventuelle tutorial_prod
+#################################################################
+cd "$MODEL/modipsl/modeles"
+#echo surface_env file created in $MODEL
+cat <<EOF >surface_env
+veget=$veget
+opt_veget="-v $veget_version"
+orchidee_rev=$orchidee_rev
+suforch=$suff_orc
+EOF
Index: /BOL/script_install_amaury/install_netcdf4_hdf5.bash
===================================================================
--- /BOL/script_install_amaury/install_netcdf4_hdf5.bash	(revision 4850)
+++ /BOL/script_install_amaury/install_netcdf4_hdf5.bash	(revision 4850)
@@ -0,0 +1,173 @@
+#!/bin/bash 
+#########################################################################
+# Defaults
+#########################################################################
+install_dir=$(pwd)
+c_compiler=gcc
+f_compiler=gfortran
+cxx_compiler=g++
+mpi_home="/usr/lib64/openmpi"
+#########################################################################
+#  Options 
+#########################################################################
+while (($# > 0))
+   do
+   case $1 in
+     "-h") cat <<........fin
+    $0 [ -prefix path ]       where (path) to install
+                              (default: $install_dir)
+       [ -CC compiler ]       C compiler to use
+                              (default: $c_compiler)
+       [ -FC compiler ]       Fortran compiler to use
+                              (default: $f_compiler)
+       [ -CXX compiler ]      C++ compiler to use
+                              (default: $cxx_compiler)
+       [ -MPI path ]          top directory of the MPI library
+                              (default: $mpi_home)
+........fin
+     exit ;;
+     "-prefix") install_dir=$2 ; shift ; shift ;;
+     "-CC") c_compiler=$2 ; shift ; shift ;;
+     "-FC") f_compiler=$2 ; shift ; shift ;;
+     "-CXX") cxx_compiler=$2 ; shift ; shift ;;
+     "-MPI") mpi_home=$2 ; shift ; shift ;;
+     *) echo "Error, bad argument $1" ; $0 -h ; exit
+   esac
+done
+
+# Install directory (get full path)
+mkdir -p $install_dir
+install_dir=$(cd $install_dir ; pwd -P )
+
+# Install location for packages
+mkdir -p $install_dir/src
+
+# CURL
+APP=curl-7.26.0
+CURL_PATH=$install_dir/$APP
+rm -rf $CURL_PATH 
+cd $install_dir/src 
+rm -rf curl-7.26.0* 
+wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/curl-7.26.0.tar.gz
+tar xvf curl-7.26.0.tar.gz ; cd curl-7.26.0
+export CC=$c_compiler
+./configure \
+--prefix=$install_dir | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make install 2>&1 | tee $APP.install.log
+
+# ZLIB
+APP=zlib-1.2.8
+ZLIB_PATH=$install_dir/$APP 
+rm -rf $ZLIB_PATH 
+cd $install_dir/src 
+rm -rf zlib-1.2.8* 
+wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/zlib-1.2.8.tar.gz
+tar zxf zlib-1.2.8.tar.gz ; cd zlib-1.2.8
+export CC=$c_compiler
+export FC=$f_compiler
+export CXX=$cxx_compiler 
+./configure \
+--prefix=$install_dir | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+# HDF5
+APP=hdf5-1.10.7
+HDF5_PATH=$install_dir/$APP 
+rm -rf $HDF5_PATH 
+cd $install_dir/src 
+rm -rf ${APP}* 
+wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/$APP.tar.gz
+tar xzf $APP.tar.gz ; cd $APP
+export PATH=$mpi_home/bin:$PATH
+if [[ ${LD_LIBRARY_PATH} == '' ]]
+then
+  export LD_LIBRARY_PATH=$mpi_home/lib
+else
+  export LD_LIBRARY_PATH=$mpi_home/lib:${LD_LIBRARY_PATH}
+fi
+export CFLAGS="-I$mpi_home/include -m64"
+export LDFLAGS="-L$mpi_home/lib -lmpi"
+export MPI_BIN=$mpi_home/bin
+export MPI_SYSCONFIG=$mpi_home/etc
+export MPI_FORTRAN_MOD_DIR=$mpi_home/lib
+export MPI_INCLUDE=$mpi_home/include
+export MPI_LIB=$mpi_home/lib
+export MPI_HOME=$mpi_home
+export CC=mpicc
+export FC=mpif90
+export CXX=mpiCC 
+./configure \
+--prefix=$install_dir \
+--enable-fortran \
+--enable-parallel \
+--with-zlib=$install_dir  \
+--with-pic 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+#make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+# NetCDF4
+APP=netcdf-4.3.3.1
+NETCDF4_PATH=$install_dir/$APP
+rm -rf $NETCDF4_PATH 
+cd $install_dir/src 
+rm -rf netcdf-4.3.3.1* 
+wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/netcdf-4.3.3.1.tar.gz
+tar xzf netcdf-4.3.3.1.tar.gz ; cd netcdf-4.3.3.1 
+export LDFLAGS="-L${install_dir}/lib -L${mpi_home}/lib -lmpi"
+export CFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
+export LD_LIBRARY_PATH="${install_dir}/lib:${LD_LIBRARY_PATH}"
+CC=mpicc ./configure \
+--prefix=${install_dir} \
+--enable-static \
+--enable-shared \
+--enable-netcdf4 \
+--enable-dap \
+--with-pic 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+# NetCDF4-Fortran
+APP=netcdf-fortran-4.4.2
+NETCDF4_FORTRAN_PATH=${install_dir}/$APP
+rm -rf $NETCDF4_FORTRAN_PATH
+cd ${install_dir}/src 
+rm -rf netcdf-fortran-4.4.2* 
+wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/netcdf-fortran-4.4.2.tar.gz
+tar xzf netcdf-fortran-4.4.2.tar.gz ; cd netcdf-fortran-4.4.2
+#export LD_LIBRARY_PATH=${install_dir}/lib:${LD_LIBRARY_PATH}
+export LDFLAGS="-L${install_dir}/lib -L${install_dir}/lib -L${mpi_home}/lib -lmpi"
+export CPPFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
+export CC=mpicc
+export FC=mpif90
+export F77=mpif77 
+export LDFLAGS=-L${install_dir}/lib 
+./configure \
+--prefix=${install_dir} 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+# NetCDF4-C++
+APP=netcdf-cxx4-4.2.1
+NETCDF4_CXX_PATH=${install_dir}/$APP
+rm -rf $NETCDF4_CXX_PATH
+cd ${install_dir}/src 
+rm -rf netcdf-cxx4-4.2.1* 
+wget -nv --no-check-certificate http://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/netcdf-cxx4-4.2.1.tar.gz
+tar xzf netcdf-cxx4-4.2.1.tar.gz ; cd netcdf-cxx4-4.2.1
+#export LD_LIBRARY_PATH=${install_dir}/lib:${LD_LIBRARY_PATH}
+export LDFLAGS="-L${install_dir}/lib -L${mpi_home}/lib -lmpi"
+export CPPFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
+export CC=mpicc
+export CXX=mpiCC
+export LDFLAGS=-L${install_dir}/lib
+./configure \
+--prefix=${install_dir} 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
Index: /BOL/script_install_amaury/install_netcdf4_hdf5_seq.bash
===================================================================
--- /BOL/script_install_amaury/install_netcdf4_hdf5_seq.bash	(revision 4850)
+++ /BOL/script_install_amaury/install_netcdf4_hdf5_seq.bash	(revision 4850)
@@ -0,0 +1,175 @@
+#!/bin/bash 
+#########################################################################
+# Script to automatically install the HDF5 1.10.5, NetCDF 4.3.3.1 C library
+#  and the NetCDF 4.4.2 Fortran library
+#########################################################################
+# Defaults
+#########################################################################
+install_dir=$(pwd)
+compiler_suite=gnu
+#########################################################################
+#  Options 
+#########################################################################
+while (($# > 0))
+   do
+   case $1 in
+     "-h") cat <<........fin
+    $0 [ -prefix path ]       where (path) to install
+                              (default: $install_dir)
+       [ -compiler gnu | intel ] compiler suite (Fortran, C, C++) to use
+                              (default: $compiler_suite)
+........fin
+     exit ;;
+     "-prefix") install_dir=$2 ; shift ; shift ;;
+     "-compiler") compiler_suite=$2 ; shift ; shift ;;
+     *) echo "Error, bad argument $1" ; $0 -h ; exit
+   esac
+done
+
+# Install directory (get full path)
+mkdir -p $install_dir
+install_dir=$(cd $install_dir ; pwd -P )
+
+# Install location for packages
+mkdir -p $install_dir/src
+
+
+if [[ ${compiler_suite} == "gnu" ]] ; then
+  f_compiler="gfortran"
+  c_compiler="gcc"
+  cxx_compiler="g++"
+elif [[ ${compiler_suite} == "intel" ]] ; then
+  f_compiler="ifort"
+  c_compiler="icc"
+  cxx_compiler="icpc"
+else
+  echo "unknown compiler family $compiler_suite"
+  echo "might as well stop here"
+  exit
+fi
+
+export FC=$f_compiler
+export F90=$f_compiler
+export CC=$c_compiler
+export CXX=$cxx_compiler
+allow_arg_mismatch=""
+if [[ ${f_compiler} == "gfortran" ]] ; then
+  if [ `gfortran -dumpversion | cut -d. -f1` -ge 10 ] ; then 
+    allow_arg_mismatch="-fallow-argument-mismatch" 
+  fi
+  export FFLAGS=" -O2 -fPIC $allow_arg_mismatch"
+  export FCFLAGS="-O2 -ffree-form -fPIC $allow_arg_mismatch"
+  export CPPFLAGS="-I${install_dir}/include"
+  export CFLAGS="-O2 -fPIC"
+  export CXXFLAGS="-O2 -fPIC"
+elif [[ ${f_compiler} == "ifort" ]] ; then
+  export CPP="icc -E"
+  export FFLAGS="-O2 -ip -fpic"
+  export FCFLAGS="-O2 -ip -fpic"
+  export CPPFLAGS="-I${install_dir}/include"
+  export CFLAGS="-O2 -ip -fpic"
+  export CXXFLAGS="-O2 -ip -fpic"
+else
+  echo "unknown compiler $f_compiler"
+  echo "might as well stop here"
+  exit
+fi
+
+#---------------------------------------------------------------------------
+function myget() {
+\rm -f ${1}*
+wget -nv --no-check-certificate https://lmdz.lmd.jussieu.fr/pub/src_archives/netcdf/$1.tar.gz
+tar xvf $1.tar.gz
+}
+#---------------------------------------------------------------------------
+
+
+# CURL
+APP=curl-7.26.0
+CURL_PATH=$install_dir/$APP
+rm -rf $CURL_PATH 
+cd $install_dir/src 
+myget curl-7.26.0
+cd    curl-7.26.0
+export CC=$c_compiler
+./configure \
+--prefix=$install_dir | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make install 2>&1 | tee $APP.install.log
+
+# ZLIB
+APP=zlib-1.2.8
+ZLIB_PATH=$install_dir/$APP 
+rm -rf $ZLIB_PATH 
+cd $install_dir/src 
+myget zlib-1.2.8
+cd    zlib-1.2.8
+export CC=$c_compiler
+export FC=$f_compiler
+export CXX=$cxx_compiler 
+./configure \
+--prefix=$install_dir | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+
+# HDF5
+APP=hdf5-1.10.5
+HDF5_PATH=$install_dir/$APP 
+rm -rf $HDF5_PATH 
+cd $install_dir/src 
+rm -rf hdf5-1.10.5* 
+wget -nv --no-check-certificate https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.5/src/hdf5-1.10.5.tar.gz
+tar xzf hdf5-1.10.5.tar.gz ; cd hdf5-1.10.5
+export CC=$c_compiler
+export FC=$f_compiler
+export CXX=$cxx_compiler 
+./configure \
+--prefix=$install_dir \
+--enable-fortran \
+--with-zlib=$install_dir  \
+--with-pic 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+#make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+# NetCDF4
+APP=netcdf-4.3.3.1
+NETCDF4_PATH=$install_dir/$APP
+rm -rf $NETCDF4_PATH 
+cd $install_dir/src 
+myget netcdf-4.3.3.1 
+cd    netcdf-4.3.3.1
+export LDFLAGS="-L${install_dir}/lib"
+export CFLAGS="-I${install_dir}/include/curl -I${install_dir}/include"
+export LD_LIBRARY_PATH="${install_dir}/lib:${LD_LIBRARY_PATH}"
+./configure \
+--prefix=${install_dir} \
+--enable-static \
+--enable-shared \
+--enable-netcdf4 \
+--enable-dap \
+--with-pic 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+# NetCDF4-Fortran
+APP=netcdf-fortran-4.4.2
+NETCDF4_FORTRAN_PATH=${install_dir}/$APP
+rm -rf $NETCDF4_FORTRAN_PATH
+cd ${install_dir}/src 
+myget netcdf-fortran-4.4.2
+cd    netcdf-fortran-4.4.2
+export LDFLAGS=-L${install_dir}/lib 
+./configure \
+--prefix=${install_dir} 2>&1 | tee $APP.config.log
+make 2>&1 | tee $APP.make.log
+make check 2>&1 | tee $APP.make_check.log
+make install 2>&1 | tee $APP.install.log
+
+
+if [[ -f $install_dir/bin/nf-config ]] ; then
+  echo "successfully installed the netcdf library in $install_dir"
+fi
Index: /BOL/script_install_amaury/install_ubuntu22_packages.sh
===================================================================
--- /BOL/script_install_amaury/install_ubuntu22_packages.sh	(revision 4850)
+++ /BOL/script_install_amaury/install_ubuntu22_packages.sh	(revision 4850)
@@ -0,0 +1,194 @@
+#!/bin/bash
+
+################################################################
+# Complément d'installation Ubuntu22
+# Frédéric Hourdin.
+#
+# Developpe et utilise a fins personnelles et pour les PCs
+# enseignement.
+# Permet de faire tourner entre autres LMDZ et les outils HighTune
+################################################################
+
+base=1
+compilation=1
+hightune=1
+bureautique=1
+latex=1
+graphique=1
+ferret=1
+system=1
+son=0
+acroread=1
+workspace_matrix=0
+miniconda=1
+panoply=1
+cours_m2=1
+
+install="sudo apt install -y"
+sudo apt update
+sudo apt upgrade
+
+#===============================================================================
+if [ $base = 1 ] ; then
+    # Base :
+    # ======
+    $install locate
+    $install ncftp vim nfs-common
+    # keychain semble etre devenu obsolete.
+    # ksh et csh inutile ?
+    for file in /home/*/.bashrc ; do
+        cat >> $file <<........eod
+        alias rm='rm -i'
+        alias cp='cp -i'
+        alias mv='mv -i'
+........eod
+    done
+fi
+#===============================================================================
+if [ $compilation = 1 ] ; then
+    # Pour compilation dont LMDZ
+    # ==========================
+    $install cdo nco netcdf-bin libnetcdf-dev libnetcdff-dev ncview   # netcdf
+    $install gfortran g++ libblas-dev subversion git git-lfs   # fortran et svn
+    $install openmpi-common libopenmpi-dev openmpi-bin # openmpi
+    $install make cmake
+fi
+#===============================================================================
+if [ $hightune = 1 ] ; then
+    # Pour HitghTune
+    # ==============
+    $install r-base
+    $install pip
+    $install python3-pip
+fi
+#===============================================================================
+if [ $bureautique = 1 ] ; then
+    # bureautique
+    # ===========
+    $install xournal
+    $install unoconv # conversion associee a libreoffice
+    $install dos2unix
+    $install qpdfview # un visualiseur remplissant mieux les pdf
+    $install pdftk # Autre package de concatenation de pdf
+    $install chromium-browser
+    $install pandoc # markdown
+fi
+#===============================================================================
+if [ $latex = 1 ] ; then
+    # LaTeX dont pdfjam
+    # =================
+    $install texlive-base texlive-latex-extra texlive-lang-french latexdiff  texlive-publishers
+    $install latexmk texlive-science
+    $install latex2html
+    $install texlive-extra-utils texlive-font-utils # pdfjam
+fi
+#===============================================================================
+if [ $graphique = 1 ] ; then
+    # graphique / video
+    # =================
+    $install xfig grads imagemagick gv grace           # graphique
+    $install inkscape gimp                             # dessin
+    $install gifsicle
+    $install ffmpeg
+    $install winff  # autre convertisseur video
+fi
+#===============================================================================
+if [ $ferret = 1 ] ; then
+    $install ferret-vis ferret-datasets
+    # Finalisation de l'installation de ferret-vis
+    # ============================================
+    # Active le bon environnement pour ferret
+    # Attention, pour que ca fonctionne completement (notamment le trace
+    # des frontieres) il manque des données.
+    # Pour le moment, on va chercher ces données dans le répertoire de
+    # l'installation conda. On a donc une double installation
+    for file in /home/*/.bashrc ; do
+        sed -i'' -e '/ferret-vis/d' $file
+        cat <<........eod>> $file
+        . /usr/share/ferret-vis/bin/ferret_paths # ferret-vis
+        alias ferret=ferret_c
+        export FER_DATA=". \$FER_DATA"
+........eod
+    done
+    cd /tmp
+    wget http://www.lmd.jussieu.fr/~lmdz/data_ferret.tar
+    cd /usr/share/ferret-vis
+    sudo tar xvf /tmp/data_ferret.tar
+fi
+#===============================================================================
+if [ $system = 1 ] ; then
+    # Outils systeme / collaboratifs
+    # ==============================
+    $install traceroute # aide systeme
+    $install synaptic gdebi                            # install paquets
+    $install tmate
+fi
+#===============================================================================
+if [ $son = 1 ] ; then
+    # Son
+    #=====
+    $install audacity
+fi
+#===============================================================================
+if [ $acroread = 1 ] ; then
+    # Acroread
+    # ========
+    sudo dpkg --add-architecture i386
+    $install libxml2:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386
+    $install libatk-adaptor:i386 libgdk-pixbuf2.0-0:i386
+    wget -O /tmp/adobe.deb ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
+    sudo dpkg -i /tmp/adobe.deb
+fi
+#===============================================================================
+if [ $workspace_matrix = 1 ] ; then 
+    # Firefox
+    # =======
+    # Reinstallation d’une version de firefox pour permettre le multigrille
+    # https://ubuntuhandbook.org/index.php/2022/04/install-firefox-deb-ubuntu-22-04/
+    sudo snap remove firefox
+    sudo apt remove firefox
+    sudo add-apt-repository ppa:mozillateam/ppa
+    sudo cat <<....eod> /tmp/mozillateamppa
+    Package: firefox*
+    Pin: release o=LP-PPA-mozillateam
+    Pin-Priority: 501
+....eod
+    sudo cp /tmp/mozillateamppa /etc/apt/preferences.d/
+    sudo apt install -y chrome-gnome-shell
+    sudo apt install -y firefox
+    
+    echo Run firefox https://extensions.gnome.org/extension/1485/workspace-matrix/
+    echo first clicks in the top frame, install gnome extension, or so.
+    echo then reload browser
+    echo then click on the OFF button
+fi
+
+#===============================================================================
+if [ $miniconda = 1 ] ; then 
+   cd /tmp
+   wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
+   cd
+   # Option -b pour installer sans repondre aux droits
+   bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b
+   export PATH=~/miniconda3/bin:$PATH
+   conda activater ; conda init ; conda deactivate
+   #conda init --reverse bash
+   conda create -n FERRET -c conda-forge pyferret ferret_datasets --yes
+   \rm -f Miniconda3-latest-Linux-x86_64.sh
+   wget http://www.lmd.jussieu.fr/~hourdin/COURS/UTILS/environment.yaml
+   if [ $cours_m2 ] ; then
+      conda env create -f environment.yaml
+      \rm -f environment.yaml
+   fi
+fi
+
+#===============================================================================
+if [ $panoply = 1 ] ; then 
+    cd
+    sudo apt-get install openjdk-11-jre
+    wget https://www.giss.nasa.gov/tools/panoply/download/PanoplyJ-5.3.0.tgz
+    tar xvzf PanoplyJ-5.3.0.tgz
+    \rm -f PanoplyJ-5.3.0.tgz
+    cd PanoplyJ/
+    # ./panoply.sh devrait ouvrir la fenêtre Panoply
+fi
Index: /BOL/script_install_amaury/install_xios.bash
===================================================================
--- /BOL/script_install_amaury/install_xios.bash	(revision 4850)
+++ /BOL/script_install_amaury/install_xios.bash	(revision 4850)
@@ -0,0 +1,129 @@
+#!/bin/bash 
+#########################################################################
+# Defaults
+#########################################################################
+hostname=`hostname`
+install_dir=$(pwd)
+netcdf_home="/usr/local/netcdf"
+hdf5_home="/usr/local/hdf5"
+if [ -d /usr/lib64/openmpi ] ; then
+  mpi_home="/usr/lib64/openmpi"
+else
+  mpi_home="/usr"
+fi
+arch="local"
+#xios_branch="trunk"
+xios_branch="2.6"
+#xios_rev="HEAD"
+xios_rev="2568"
+
+#########################################################################
+#  Options 
+#########################################################################
+while (($# > 0))
+   do
+   case $1 in
+     "-h") cat <<........fin
+    $0 [ -prefix path ]       where (path) to install
+                              (default: $install_dir)
+       [ -netcdf path ]       top directory of the netcdf library
+                              (default: $netcdf_home)
+       [ -hdf5 path ]         top directory of the hdf5 library
+                              (default: $hdf5_home)
+       [ -MPI path ]          top directory of the MPI library
+                              (default: $mpi_home)
+       [ -branch branch]      XIOS branch trunk|2.5|2.6
+                              (default: $xios_branch)
+       [ -rev number ]        XIOS revision
+                              (default: $xios_rev)
+       [ -arch ARCH ]         Use ARCH file (provided by XIOS)
+                              (default: make/use a local arch file)
+........fin
+     exit ;;
+     "-prefix") install_dir=$2 ; shift ; shift ;;
+     "-netcdf") netcdf_home=$2 ; shift ; shift ;;
+     "-hdf5" ) hdf5_home=$2 ; shift ; shift ;;
+     "-MPI") mpi_home=$2 ; shift ; shift ;;
+     "-branch") xios_branch=$2 ; shift ; shift ;;
+     "-rev") xios_rev=$2 ; shift ; shift ;;
+     "-arch") arch=$2 ; shift ; shift ;;
+     *) echo "Error, bad argument $1" ; $0 -h ; exit
+   esac
+done
+
+# Install directory (get full path)
+mkdir -p $install_dir
+install_dir=$(cd $install_dir ; pwd -P )
+
+# Download XIOS
+case $xios_branch in
+  "trunk")
+  xios_http="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk" ;;
+  "2.5")
+  xios_http="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5" ;;
+  "2.6")
+  xios_http="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS2/branches/xios-2.6" ;;
+*)
+echo "Error, bad argument for -branch ! Did not expect $xios_branch" ; exit ;;
+esac
+
+cd $install_dir
+svn co --revision $xios_rev $xios_http XIOS
+
+# Make arch files, if necesary:
+if [ "$arch" = "local" ] ; then
+cd $install_dir/XIOS/arch
+# arch-local.env
+echo 'export MPI_LIB="-L'${mpi_home}'/lib -lmpi"'     > arch-local.env
+echo ''                                              >> arch-local.env
+echo 'export NETCDFC='${netcdf_home}                 >> arch-local.env
+echo 'export NETCDFC_LIB=$NETCDFC/lib'               >> arch-local.env
+echo 'export NETCDFC_INC=$NETCDFC/include'           >> arch-local.env
+echo ''                                              >> arch-local.env
+echo 'export NETCDFF='${netcdf_home}                 >> arch-local.env
+echo 'export NETCDFF_LIB=$NETCDFF/lib'               >> arch-local.env
+echo 'export NETCDFF_INC=$NETCDFF/include'           >> arch-local.env
+echo ''                                              >> arch-local.env
+echo 'export NETCDFCXX='${netcdf_home}               >> arch-local.env
+echo 'export NETCDFCXX_LIB=$NETCDFCXX/lib'           >> arch-local.env
+echo 'export NETCDFCXX_INC=$NETCDFCXX/include'       >> arch-local.env
+
+# arch-local.fcm
+echo '%CCOMPILER      '${mpi_home}'/bin/mpicc'             > arch-local.fcm
+echo '%FCOMPILER      '${mpi_home}'/bin/mpif90'           >> arch-local.fcm
+echo '%LINKER         '${mpi_home}'/bin/mpif90'           >> arch-local.fcm
+echo ''                                                   >> arch-local.fcm
+if [ ${hostname:0:5} = cicla ] ; then
+echo '%BASE_CFLAGS    -w -ansi'                >> arch-local.fcm
+else
+echo '%BASE_CFLAGS    -w -std=c++11 -D__XIOS_EXCEPTION'   >> arch-local.fcm
+fi
+echo '%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS'       >> arch-local.fcm
+echo '%DEV_CFLAGS     -g -O2'                             >> arch-local.fcm
+echo '%DEBUG_CFLAGS   -g -DBZ_DEBUG'                      >> arch-local.fcm
+echo ''                                                   >> arch-local.fcm
+echo '%BASE_FFLAGS    -D__NONE__ -ffree-line-length-none' >> arch-local.fcm
+echo '%PROD_FFLAGS    -O3'                                >> arch-local.fcm
+echo '%DEV_FFLAGS     -g -O2'                             >> arch-local.fcm
+echo '%DEBUG_FFLAGS   -g'                                 >> arch-local.fcm
+echo ''                                                   >> arch-local.fcm
+echo '%BASE_INC       -D__NONE__'                         >> arch-local.fcm
+echo '%BASE_LD        -lstdc++ -Wl,-rpath='${mpi_home}'/lib' >> arch-local.fcm
+echo ''                                                   >> arch-local.fcm
+echo '%CPP            '${mpi_home}'/bin/mpicc -EP'        >> arch-local.fcm
+echo '%FPP            cpp -P'                             >> arch-local.fcm
+echo '%MAKE           make'                               >> arch-local.fcm
+
+# arch-local.path
+echo 'NETCDF_INCDIR="-I${NETCDFC_INC} -I${NETCDFF_INC} -I${NETCDFCXX_INC} "'  > arch-local.path
+echo 'NETCDF_LIBDIR="-L${NETCDFC_LIB} -L${NETCDFF_LIB} -L${NETCDFCXX_LIB} "' >> arch-local.path
+echo 'NETCDF_LIB="-lnetcdf -lnetcdff -lnetcdf_c++4"'                         >> arch-local.path
+echo 'HDF5_INCDIR="-I'${hdf5_home}'/include"'                                >> arch-local.path
+echo 'HDF5_LIBDIR="-L'${hdf5_home}'/lib"'                                    >> arch-local.path
+echo 'HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"'                         >> arch-local.path
+fi
+
+# make XIOS
+cd $install_dir/XIOS
+./make_xios --arch $arch --job 8 2>&1 | tee make_xios.out
+
Index: /BOL/script_install_amaury/verif_commit.sh
===================================================================
--- /BOL/script_install_amaury/verif_commit.sh	(revision 4850)
+++ /BOL/script_install_amaury/verif_commit.sh	(revision 4850)
@@ -0,0 +1,68 @@
+#!/bin/bash
+#
+# Lancement d'un install_lmdz.sh immédiatement apres un commit
+# pour tester la compilation et l'execution. Retour d'un code erreur adequat
+# au serveur svn pour notifier qui de droit
+
+set -vx
+
+REV="$1"
+
+TMP_OUT=/u/lmdz/WWW/Distrib/OUT
+TMP_D=/tmp/lmdz/test_rev_${REV}_$$ ; mkdir -p $TMP_D
+
+resolution=48x36x39 
+physiq=NPv6.0.14splith
+# Changed on 15/03/2023 r4473
+physiq=NPv6.3
+
+cd $TMP_D
+cp /u/lmdz/WWW/pub/install_lmdz.sh .
+#chmod 755 /u/lmdz/WWW/pub/install_lmdz.sh
+chmod +x install_lmdz.sh
+#./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -physiq $physiq > ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ 2>&1
+./install_lmdz.sh -SCM -unstable -debug -d $resolution -r $REV -netcdf /u/lmdz/Netcdf/lmdz-cq_gcc_8.3.0/ -rad oldrad -parallel mpi_omp  -physiq $physiq \
+		   > ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$ 2>&1
+#
+# menage: si ca a marche on efface le repertoire dans /tmp/lmdz
+#
+grep 'Everything is cool' ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$
+RET=$?
+# checking 1D results
+cd LMDZ*${REV}*/1D/EXEC/6AL79/
+listecas="ARMCU/REF RICO/SHORT SANDU/REF"
+((ret1d=0))
+for cas in $listecas ; do
+    ((ret1d=$ret1d*10))
+    gunzip -dc "$cas"/listing.gz |grep -i cool
+    retcas=$?
+    ((ret1d=$ret1d+$retcas))
+done
+# checking isotope compilation
+cd $TMP_D
+cd LMDZ*${REV}*/modipsl/modeles/LMDZ/
+./makelmdz_fcm -debug -arch local -j 8 -rad rrtm -d $resolution -v false -p lmdiso -isotopes true -isoverif true gcm  > ./compile_iso.out 2>&1
+ls bin/*iso*
+retiso=$?
+
+if [ ${RET} -eq 0 ] && [ ${ret1d} -eq 0 ] && [ ${retiso} -eq 0 ] ; then
+  echo "Everything is cool for revision ${REV}" >> ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$
+  echo "Cleaning up /tmp/lmdz/test_rev_${REV}_$$" >> ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$
+  \rm -rf /tmp/lmdz/test_rev_${REV}_$$
+fi
+#
+# sorties retour nécessaires pour envoyer le message a la liste
+#
+echo "Sortie dans" ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$
+if [ ${RET} -eq 0 ] ; then
+    echo "Bench 3D ok"
+fi
+if [ ${ret1d} -eq 0 ] ; then
+    echo "Bench 1D ok"
+fi
+if [ ${retiso} -eq 0 ] ; then
+    echo "Compilation iso ok"
+fi
+
+#grep 'Everything is cool' ${TMP_OUT}/post-commit-lmdz-cq-${REV}_$$
+exit
