Index: BOL/LMDZ_Setup_amaury/lmdz_env.sh
===================================================================
--- BOL/LMDZ_Setup_amaury/lmdz_env.sh	(revision 4994)
+++ BOL/LMDZ_Setup_amaury/lmdz_env.sh	(revision 4995)
@@ -19,5 +19,4 @@
   case ${hostname:0:5} in
     jean-)
-      ARCH="X64_JEANZAY"
       module purge
       compilo=19.0.4 # available 2013.0, 2017.2
@@ -38,16 +37,13 @@
       #        alors $STORE, $WORK etc vont designer les espaces de "newproj")
       account=$(idrproj | grep active | awk '{ print $1}')
-      SUBMITCMD="sbatch -A $account@cpu "
-      RUNCMD="srun --label -n"
-      # Espaces suivants definis par defaut en fonction du groupe actif,
-      #  par exemple : SCRATCHD=$SCRATCH is /gpfsstore/rech/$groupe/$login
-                  #    * On peut aussi ne pas installer les scripts a la racine de STORE,
-                  #        mais dans STORED=$STORE/your_folder
-      SIMRUNBASEDIR="$SCRATCH/LMDZ_Setup"
-      LMDZD=$WORK
+      root_dir="$WORK/LMDZ_Setup";
+      ARCH="X64_JEANZAY"
+      SIMRUNBASEDIR="$SCRATCH/"
+      LMDZD="$root_dir/LMDZD"
+      LMDZ_INIT="$root_dir/LMDZ_Init"
       NB_MPI_MAX=2000
       NB_OMP_MAX=20
-      #LMDZ_Init sur le $STORE du $groupe
-      LMDZ_INIT=$STORE/LMDZ_Init
+      RUNCMD="srun --label -n"
+      SUBMITCMD="sbatch -A $account@cpu"
       ;;
     spiri)
Index: BOL/LMDZ_Setup_amaury/script_SIMU
===================================================================
--- BOL/LMDZ_Setup_amaury/script_SIMU	(revision 4994)
+++ BOL/LMDZ_Setup_amaury/script_SIMU	(revision 4995)
@@ -28,4 +28,5 @@
 #@ADS#SBATCH --ntasks=8
 #@ADS#SBATCH --cpus-per-task=8
+#@ADS#SBATCH --ntasks-per-node=8  # TODO check how to scale this
 #@ADS#SBATCH --hint=nomultithread
 #@ADS#SBATCH --time=00:30:00
Index: BOL/LMDZ_Setup_amaury/setup.sh
===================================================================
--- BOL/LMDZ_Setup_amaury/setup.sh	(revision 4994)
+++ BOL/LMDZ_Setup_amaury/setup.sh	(revision 4995)
@@ -226,7 +226,11 @@
   echo "Running install_lmdz_options.$$.sh"
   set -o pipefail
-  # TODO (wip) Run install_lmdz using $RUNCMD to 1) speed up 2) avoid issues related to being on the "right" platform for compilation
-  # gcm=$MODEL/$($RUNCMD $make_j bash install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
-    gcm=$MODEL/$(./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
+  # We launch using $RUNCMD, except if it's using mpirun (no srun equivalent for bash script) => if supported, the compilation runs in a cluster job
+  local install_cmd="$RUNCMD $make_j"
+  if [[ $(echo "$RUNCMD" | cut -c -6) = "mpirun" ]]; then
+     install_cmd=""
+  fi
+   gcm=$MODEL/$($install_cmd ./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
+#    gcm=$MODEL/$(./install_lmdz_options.$$.sh | tee /dev/tty | tail -n 1 | sed -n "s:.* executable is \(.*\.e\).*:\1:p")
   set +o pipefail
   mv install_lmdz.sh install_lmdz.$$.sh
@@ -310,5 +314,5 @@
   #---------------------------------------------------------------------
   sed -i'' -e 's/iflag_rrtm=.*.$/iflag_rrtm='"$iflag_rrtm"'/' -e 's/NSW=.*.$/NSW='"$NSW"'/' DEF/physiq.def
-  sed -i"" -e "s:directory_name.*$:directory_name=\"$MODEL/libf/phylmd/ecrad/ecrad_data\",:" DEF/namelist_ecrad
+  sed -i"" -e "s:directory_name.*$:directory_name=\"$MODEL/libf/phylmd/ecrad/data\",:" DEF/namelist_ecrad
 
   if [[ $phylmd = "lmdiso" ]]; then iflag_ice_thermo=0; else iflag_ice_thermo=1; fi
@@ -600,5 +604,5 @@
 #@JZ#SBATCH --error=Init%j.out      # Nom du fichier d'erreur (ici commun avec la sortie)
 #@JZ# To submit to dev queue; "time" (above) must be max 2h
-#@JZ# #SBATCH --qos=qos_cpu-dev
+#@JZ#TESTQ#SBATCH --qos=qos_cpu-dev
 #@SP#Spirit
 #@SP#SBATCH --job-name=Init
@@ -613,8 +617,11 @@
 #@ADS#SBATCH --ntasks=1
 #@ADS#SBATCH --cpus-per-task=1
+#@ADS#SBATCH --ntasks-per-node=8  # TODO check how to scale this
 #@ADS#SBATCH --hint=nomultithread
 #@ADS#SBATCH --time=00:10:00
 #@ADS#SBATCH --output=Init%j.out
 #@ADS#SBATCH --error=Init%j.out
+
+set -eu
 
 # ANCIEN MULTI STEP  case \${LOADL_STEP_NAME} in
