Index: /BOL/script_install_amaury/arch_local/arch-local-gfortran-parallel.fcm
===================================================================
--- /BOL/script_install_amaury/arch_local/arch-local-gfortran-parallel.fcm	(revision 4892)
+++ /BOL/script_install_amaury/arch_local/arch-local-gfortran-parallel.fcm	(revision 4893)
@@ -1,3 +1,4 @@
 %COMPILER            mpif90
+%CCOMPILER           mpicc  # xios
 %LINK                mpif90
 %FPP                 cpp
@@ -7,12 +8,27 @@
 %FPP_FLAGS           -P -traditional
 %FPP_DEF             NC_DOUBLE
+
 %BASE_FFLAGS         -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE
+%BASE_CFLAGS         -w -std=c++11 -D__XIOS_EXCEPTION  # xios
+%BASE_LD             -Wl,-rpath=$(dirname $(readlink -f "$(which mpif90)"))/../lib:$(nf-config --prefix)/lib -lstdc++
+%BASE_INC            -D__NONE__  # xios
+
 %PROD_FFLAGS         -O3 -fallow-argument-mismatch
+%PROD_CFLAGS         -O3 -DBOOST_DISABLE_ASSERTS  # xios
+
 %DEV_FFLAGS          -Wall -fbounds-check -fallow-argument-mismatch
+%DEV_CFLAGS          -g -O2  # xios
+
 %DEBUG_FFLAGS        -g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan -fallow-argument-mismatch
+%DEBUG_CFLAGS        -g -DBZ_DEBUG # xios
+
 %MPI_FFLAGS          -fcray-pointer
-%OMP_FFLAGS          -fopenmp -fcray-pointer
-%BASE_LD             -Wl,-rpath=$(dirname $(readlink -f "$(which mpif90)"))/../lib:$(nf-config --prefix)/lib
 %MPI_LD              -L$(dirname $(readlink -f "$(which mpif90)"))/../lib -lmpi
 %OMP_LD              -fopenmp
+%OMP_FFLAGS          -fopenmp -fcray-pointer
 
+%CPP                 cpp  # xios
+%FPP                 cpp -P  # xios
+%MAKE                make  # xios
+
+
Index: /BOL/script_install_amaury/install_lmdz.sh
===================================================================
--- /BOL/script_install_amaury/install_lmdz.sh	(revision 4892)
+++ /BOL/script_install_amaury/install_lmdz.sh	(revision 4893)
@@ -79,4 +79,6 @@
     opt_cosp=""
 
+    make_j=8
+
     # Check if on a Mac
     if [[ $(uname) = "Darwin" ]]; then
@@ -140,4 +142,6 @@
 
         -arch_dir   where to find the arch files (default <$arch_dir>)
+
+        -make_j     number of processes to parallelize installations (default <$make_j>)
 
 ........fin
@@ -173,4 +177,5 @@
             "-arch_dir") arch_dir=$2; shift; shift;;
             "-veget") veget=$2; shift; shift;;
+            "-make_j") make_j=$2; shift; shift;;
             *)  bash install_lmdz.sh -h; exit 1
         esac
@@ -312,5 +317,5 @@
     # Copy arch to different components
     # TODO check that this doesn't error if the source and destination are the same
-    for dir in "IOIPSL" "ORCHIDEE" "LMDZ"; do
+    for dir in "IOIPSL" "ORCHIDEE" "LMDZ" "XIOS"; do
         \cp -f "$arch_dir/arch-$arch.fcm" "$MODEL/modipsl/modeles/$dir/arch"
         \cp -f "$arch_dir/arch-$arch.path" "$MODEL/modipsl/modeles/$dir/arch"
@@ -319,4 +324,8 @@
     # TODO TEMP compat w/ old orch version - make a proper case later
     sed -i'' -e "s/-I//" -e "s/-L//" "$MODEL/modipsl/modeles/ORCHIDEE/arch/arch-$arch.path"  # /!\ we only replace first occurence on purpose
+
+    # Adapt for XIOS, which uses different naming conventions
+    # TODO >:c ugly fdefault-real-8 fix
+    sed -i'' -e "s/%COMPILER/%FCOMPILER/" -e "s/%LINK/%LINKER/" -e "s/-fdefault-real-8//" "$MODEL/modipsl/modeles/XIOS/arch/arch-$arch.fcm"
 }
 
@@ -425,5 +434,5 @@
     if [[ $with_xios = 1 ]]; then
         cd "$MODEL/modipsl/modeles"
-        xioslog="$(pwd)/xios.log"
+        xioslog="$(pwd)/XIOS/xios.log"
         echo "##########################################################"
         echo "Compiling XIOS (log $xioslog) $(date)"
@@ -445,5 +454,5 @@
 
         cd XIOS
-        if ! ./make_xios --arch "$arch" --job 8 --arch_path "$arch_dir" > "$xioslog" 2>&1; then
+        if ! ./make_xios --arch "$arch" --job 8 > "$xioslog" 2>&1; then
             echo "XIOS compilation failed, exiting"; exit 1
         fi
@@ -451,4 +460,7 @@
         echo "Compiled XIOS $(date)"
     fi
+
+    XIOS_LIBDIR_="$MODEL/modipsl/modeles/XIOS/lib"
+    XIOS_INCDIR_="$MODEL/modipsl/modeles/XIOS/inc"
 }
 
@@ -458,8 +470,6 @@
     elif [[ $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 'ORCHIDEE version must be >=4465, exiting'
@@ -510,5 +520,5 @@
         local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCHPATH=$ORCHPATH"
         if [[ $parallel = "none" ]]; then
-            echo "$varenv ./makeorchidee_fcm $xios_orchid $opt_orc -parallel none -arch $arch -j 8" > compile.sh
+            echo "$varenv ./makeorchidee_fcm $xios_orchid $opt_orc -parallel none -arch $arch -j $make_j" > compile.sh
         else
             if [[ ! -d src_parallel ]]; then
@@ -516,6 +526,6 @@
             fi
             {
-                echo "$varenv ./makeorchidee_fcm -j 8 -clean $xios_orchid $opt_orc -parallel $parallel -arch $arch"
-                echo "$varenv ./makeorchidee_fcm -j 8 $xios_orchid $opt_orc -parallel $parallel -arch $arch"
+                echo "$varenv ./makeorchidee_fcm -j $make_j -clean $xios_orchid $opt_orc -parallel $parallel -arch $arch"
+                echo "$varenv ./makeorchidee_fcm -j $make_j $xios_orchid $opt_orc -parallel $parallel -arch $arch"
             } > compile.sh
         fi
@@ -576,6 +586,6 @@
 
     # Compile
-    local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCH_LIBDIR_=$ORCH_LIBDIR_ ORCHPATH=$ORCHPATH"
-    makelmdz="makelmdz_fcm $optim_debug -arch $arch -j 8"
+    local varenv="IOIPSL_LIBDIR_=$IOIPSL_LIBDIR_ IOIPSL_INCDIR_=$IOIPSL_INCDIR_ ORCH_LIBDIR_=$ORCH_LIBDIR_ ORCHPATH=$ORCHPATH XIOS_INCDIR_=$XIOS_INCDIR_ XIOS_LIBDIR_=$XIOS_LIBDIR_"
+    makelmdz="makelmdz_fcm $optim_debug -arch $arch -j $make_j"
     if [[ $parallel = "none" ]]; then
         echo "$varenv ./$makelmdz $opt_rad $opt_cosp -d ${grid_resolution} -v $veget_version gcm " > compile.sh
@@ -603,5 +613,5 @@
 
     if [[ $bench = "tuto" ]]; then
-        myget Training/tutorial.tar; tar xf tutorial.tar; cd TUTORIAL
+        myget "Training/tutorial.tar"; tar xf tutorial.tar; cd TUTORIAL
         ./init.sh
     elif [[ $bench = 1 ]]; then
@@ -810,5 +820,5 @@
 install_netcdf
 install_IOIPSL
-#install_XIOS  # TODO disabled for now, did not decide which flags/arch to use for compile
+install_XIOS
 compile_orchidee
 compile_lmdz
