Index: trunk/ARCH/arch-ifort_MESOIPSL.env
===================================================================
--- trunk/ARCH/arch-ifort_MESOIPSL.env	(revision 2815)
+++ trunk/ARCH/arch-ifort_MESOIPSL.env	(revision 2815)
@@ -0,0 +1,10 @@
+# Compile and running environnement for Spirit and Spiritx at IPSL ESPRI Mesocenter 
+# 
+module purge
+module load intel/2021.4.0
+module load intel-mkl/2020.4.304
+module load openmpi/4.0.7
+module load hdf5/1.10.7-mpi
+module load netcdf-fortran/4.5.3-mpi
+module load netcdf-c/4.7.4-mpi
+
Index: trunk/ARCH/arch-ifort_MESOIPSL.path
===================================================================
--- trunk/ARCH/arch-ifort_MESOIPSL.path	(revision 2815)
+++ trunk/ARCH/arch-ifort_MESOIPSL.path	(revision 2815)
@@ -0,0 +1,13 @@
+ROOT=$PWD
+
+NETCDF_INCDIR="$(nc-config --cflags) $(nc-config --fflags)"
+NETCDF_LIBDIR="$(nc-config --flibs)"
+NETCDF_LIB=""
+
+IOIPSL_INCDIR="-I$ROOT/../IOIPSL/inc"
+IOIPSL_LIBDIR="-L$ROOT/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
+
+XIOS_INCDIR="-I$ROOT/../XIOS/inc"
+XIOS_LIBDIR="-L$ROOT/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
Index: trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.env
===================================================================
--- trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.env	(revision 2815)
+++ trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.env	(revision 2815)
@@ -0,0 +1,10 @@
+# Compile and running environnement for Spirit and Spiritx at IPSL ESPRI Mesocenter 
+# 
+module purge
+module load intel/2021.4.0
+module load intel-mkl/2020.4.304
+module load openmpi/4.0.7
+module load hdf5/1.10.7-mpi
+module load netcdf-fortran/4.5.3-mpi
+module load netcdf-c/4.7.4-mpi
+
Index: trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm
===================================================================
--- trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm	(revision 2815)
+++ trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm	(revision 2815)
@@ -0,0 +1,19 @@
+%COMPILER            mpif90
+%LINK                mpif90
+%AR                  ar
+%ARFLAGS             rs
+%MAKE                make
+%FPP_FLAGS           -P -traditional
+%CPP_FLAGS           -P
+%FPP_DEF             NC_DOUBLE LAPACK FFT_MKL
+%BASE_FFLAGS         -integer-size 32 -real-size 64 -fp-model strict -auto -align all
+%PROD_FFLAGS         -O2 -ip
+%DEV_FFLAGS          -fp-model strict -p -g -O2 -traceback -fp-stack-check
+%DEBUG_FFLAGS        -fp-model strict -p -g -O0 -fpe-all=0 -traceback -fp-stack-check -ftrapuv -ftrapuv -check bounds,noarg_temp_created,pointers,stack,uninit -debug full -ftz -init=arrays,snan
+%C_COMPILER          gcc
+%C_OPTIM             -O3
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp 
+%BASE_LD             -i4 -r8 -auto -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread
+%MPI_LD
+%OMP_LD              -qopenmp 
Index: trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.path
===================================================================
--- trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.path	(revision 2815)
+++ trunk/LMDZ.COMMON/arch/arch-ifort_MESOIPSL.path	(revision 2815)
@@ -0,0 +1,13 @@
+ROOT=$PWD
+
+NETCDF_INCDIR="$(nc-config --cflags) $(nc-config --fflags)"
+NETCDF_LIBDIR="$(nc-config --flibs)"
+NETCDF_LIB=""
+
+IOIPSL_INCDIR="-I$ROOT/../IOIPSL/inc"
+IOIPSL_LIBDIR="-L$ROOT/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
+
+XIOS_INCDIR="-I$ROOT/../XIOS/inc"
+XIOS_LIBDIR="-L$ROOT/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
Index: trunk/LMDZ.COMMON/ioipsl/install_ioipsl_ifort_MESOIPSL.bash
===================================================================
--- trunk/LMDZ.COMMON/ioipsl/install_ioipsl_ifort_MESOIPSL.bash	(revision 2815)
+++ trunk/LMDZ.COMMON/ioipsl/install_ioipsl_ifort_MESOIPSL.bash	(revision 2815)
@@ -0,0 +1,65 @@
+#!/bin/bash
+# script to download and install the latest version of IOIPSL on Spirit
+#
+
+#0. Preliminary stuff
+
+if (( $# == 0 ))
+then
+  # default behavior: get latest version of IOIPSL
+  rev="HEAD"
+else
+  # but otherwise the first argument of the script can be the version to use
+  if (( $# == 1 ))
+  then
+    rev=$1
+  else
+    echo "Error, invalid script arguments"
+    echo "Usage:"
+    echo "$0 rev"
+    echo " where optional rev is the IOIPSL revision number"
+    exit
+  fi
+fi
+
+# cleanup possible previous attempt:
+\rm -rf ../../IOIPSL modipsl 
+
+# 1. Get IOIPSL 
+# move up at same level as LMDZ.COMMON , etc.
+cd ../..
+svn co --username icmc_users --password icmc2022 --non-interactive --revision $rev http://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/trunk IOIPSL
+
+# 2. Set correct settings: copy over arch.* files
+cd IOIPSL
+cp -f ../LMDZ.COMMON/arch/arch-ifort_MESOIPSL.env arch
+cp -f ../LMDZ.COMMON/arch/arch-ifort_MESOIPSL.path arch
+cp -f ../LMDZ.COMMON/arch/arch-ifort_MESOIPSL.fcm arch
+
+## 3. build ioipsl:
+./makeioipsl_fcm -arch ifort_MESOIPSL -job 8 > makeioipsl.out 2>&1
+
+## 4. Check if the library was indeed built:
+whereami=`pwd -P`
+if [[ -f lib/libioipsl.a ]] 
+  then
+  echo "OK: ioipsl library is in ${whereami}/lib"
+else
+  echo "Something went wrong... check messages in ${whereami}/makeioipsl.out"
+  exit
+fi
+
+## 5. Comply with old setup and make appropriate links
+cd ../LMDZ.COMMON/ioipsl
+mkdir modipsl 
+cd modipsl
+# lib + module files
+mkdir lib
+cd lib
+ln -s ../../../../IOIPSL/lib/libioipsl.a .
+ln -s ../../../../IOIPSL/inc/* .
+cd ..
+# rebuild utility
+mkdir bin
+cd bin
+ln -s ../../../../IOIPSL/bin/* .
