Index: BOL/script_install_amaury/install_lmdz.sh
===================================================================
--- BOL/script_install_amaury/install_lmdz.sh	(revision 5187)
+++ BOL/script_install_amaury/install_lmdz.sh	(revision 5242)
@@ -87,4 +87,7 @@
     opt_makelmdz_xios=""
 
+    icolmdz=0
+    DYNAMICO_VERS=374a3c66
+
     rad="rrtm"
 
@@ -167,4 +170,6 @@
 
         -noclean    will only download necessary files (but no thorough check is made on the integrity of existing files), and will recompile everything (very quick if it's already been compiled before)
+
+        -icolmdz    to compile the icolmdz executable as well as the lonlat one
 
 ........fin
@@ -206,4 +211,5 @@
             "-jobcmd") jobcmd=$2; shift; shift;;
             "-noclean") clean_install=0; shift;;
+            "-icolmdz") icolmdz=1; shift;;
             *)  bash install_lmdz.sh -h; exit 1
         esac
@@ -286,4 +292,8 @@
     fi
 
+    ## if compiling icolmdz, XIOS must be set
+    if [[ $icolmdz = 1 && $with_xios = 0 ]]; then
+      echo "Error, you must set -xios to compile the icolmdz executable"; exit 1
+    fi
     ## if also compiling XIOS, parallel must be mpi_omp
     if [[ $with_xios = 1 && $parallel != "mpi_omp" ]]; then
@@ -354,4 +364,13 @@
 
         cd - &> /dev/null
+    ## checkout DYNAMICO and icosa interface in modipsl/modeles if needed
+       if [[ $icolmdz = 1 ]]; then
+         TMPLOCDIR=$(pwd)
+         cd "$MODEL/modipsl/modeles/"
+         getlog="$(pwd)/get.log"
+         git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git DYNAMICO ; cd DYNAMICO ; git checkout master; cd .. &>> get.log
+         svn checkout https://svn.lmd.jussieu.fr/LMDZ/ICOSA_LMDZ &>> get.log
+         cd "$TMPLOCDIR" &> /dev/null
+       fi
     fi
 }
@@ -631,4 +650,5 @@
     lmdzlog="$(pwd)/lmdz.log"
 
+
     if [[ -n $svn_lmdz ]]; then
         local curr_rev
@@ -696,4 +716,43 @@
     else
         echo "Compilation successful, the executable is $exe_name $(date)"
+    fi
+}
+
+function compile_icolmdzor {
+    if [[ $icolmdz = 1 ]]; then
+#      install_arch "DYNAMICO"
+      install_arch "ICOSA_LMDZ"
+
+      cd "$LMDZPATH"
+      local para_compile_opt="-parallel $parallel"; if [[ $parallel = "none" ]]; then para_compile_opt=""; fi
+
+      # LMDZ physics package library already available in LMDZ/config/lib directory
+      # Compile DYNAMICO
+      cd ../DYNAMICO
+      cd arch
+      wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-local-gfortran-parallel.env
+      wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-local-gfortran-parallel.fcm
+      wget http://lmdz.lmd.jussieu.fr/pub/src_archives/misc/arch/DYNAMICO/arch-local-gfortran-parallel.path
+      cd ..
+
+      dynamicolog="$(pwd)/dynamico.log"
+      echo "Compile DYNAMICO"
+      echo "$jobcmd ./make_icosa $optim_flag -arch $arch -job $make_j $para_compile_opt -external_ioipsl -with_xios" > compile.sh
+      chmod +x ./compile.sh
+      if ! ./compile.sh &> "$dynamicolog"; then
+        echo "STOP: DYNAMICO compilation failed, exiting"; exit 1
+      fi
+      echo "Finished DYNAMICO compilation $(date)"
+
+      # Compile icosa_lmdz
+      cd ../ICOSA_LMDZ
+      icosalog="$(pwd)/icosa.log"
+      echo "Compile interface ICOSA_LMDZ"
+      echo "$jobcmd ./make_icosa_lmdz -arch $arch -j $make_j -nodeps -p lmd $optim_flag $para_compile_opt -with_orchidee" > compile.sh
+      chmod +x ./compile.sh
+      if ! ./compile.sh &> "$icosalog"; then
+        echo "STOP: ICOSA_LMDZ compilation failed, exiting"; exit 1
+      fi
+      echo "Finished DYNAMICO compilation $(date)"
     fi
 }
@@ -956,2 +1015,3 @@
 compile_lmdz
 run_bench
+compile_icolmdzor
