Index: trunk/LMDZ.COMMON/arch/arch-X64_MESU.fcm
===================================================================
--- trunk/LMDZ.COMMON/arch/arch-X64_MESU.fcm	(revision 1627)
+++ trunk/LMDZ.COMMON/arch/arch-X64_MESU.fcm	(revision 1628)
@@ -4,11 +4,11 @@
 %MAKE                gmake
 %FPP_FLAGS           -P -traditional
-%FPP_DEF             NC_DOUBLE LAPACK BLAS FFT_MKL
-%BASE_FFLAGS         -integer-size 32 -real-size 64 -fp-model strict -align all -mcmodel=large -auto -ip
+%FPP_DEF             NC_DOUBLE LAPACK BLAS SGEMV=DGEMV SGEMM=DGEMM FFT_MKL
+%BASE_FFLAGS         -integer-size 32 -real-size 64 -fp-model strict -align all -mcmodel=medium -auto -ip
 %PROD_FFLAGS         -O2 
 %DEV_FFLAGS          -p -g -O1 -fpe0 -traceback
-%DEBUG_FFLAGS        -p -g -O0 -fpe-all=0 -traceback -ftrapuv -fp-stack-check -check bounds,format,output_conversion,pointers,uninit -debug
+%DEBUG_FFLAGS        -p -g -O0 -fpe0 -ftrapuv -fp-stack-check -check bounds,format,output_conversion,pointers,uninit -debug -traceback
 %MPI_FFLAGS
-%OMP_FFLAGS          -openmp 
+%OMP_FFLAGS          -openmp -openmp-threadprivate compat
 %BASE_LD             -shared-intel -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm
 %MPI_LD              -lmpi
Index: trunk/LMDZ.COMMON/arch/arch-X64_MESU.path
===================================================================
--- trunk/LMDZ.COMMON/arch/arch-X64_MESU.path	(revision 1627)
+++ trunk/LMDZ.COMMON/arch/arch-X64_MESU.path	(revision 1628)
@@ -1,6 +1,6 @@
-NETCDF_LIBDIR="${NETCDF_LDFLAGS:--L/work/millour/NETCDF/netcdf-4.0.1/lib -lnetcdf}"
-NETCDF_INCDIR="${NETCDF_FFLAGS:--I/work/millour/NETCDF/netcdf-4.0.1/include}"
-IOIPSL_INCDIR=/work/millour/IOIPSL/modipsl/lib
-IOIPSL_LIBDIR=/work/millour/IOIPSL/modipsl/lib
+NETCDF_LIBDIR="-L${NETCDF_FORT_ROOT}/lib -lnetcdff"
+NETCDF_INCDIR="-I${NETCDF_FORT_ROOT}/include"
+IOIPSL_INCDIR=$LMDGCM/ioipsl/modipsl/lib
+IOIPSL_LIBDIR=$LMDGCM/ioipsl/modipsl/lib
 XIOS_INCDIR=$LMDGCM/../XIOS/inc
 XIOS_LIBDIR=$LMDGCM/../XIOS/lib
Index: trunk/LMDZ.COMMON/ioipsl/install_ioipsl_mesu.bash
===================================================================
--- trunk/LMDZ.COMMON/ioipsl/install_ioipsl_mesu.bash	(revision 1628)
+++ trunk/LMDZ.COMMON/ioipsl/install_ioipsl_mesu.bash	(revision 1628)
@@ -0,0 +1,62 @@
+#!/bin/bash
+# script to download and install the latest version of IOIPSL on mesu
+#
+
+#0. Preliminary stuff 
+module purge
+module load intel-compilers-16/16.0.2.181
+module load intel-cmkl-16/16.0.2
+module load mpt/2.11
+module load netcdf/4.3.0
+
+whereami=`pwd -P`
+
+# 1. Get IOIPSL (via modipsl)
+svn co http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl
+cd modipsl/util
+
+./model IOIPSL_PLUS
+
+# 2. Set correct settings:
+# add a "mesu" configuration to AA_make.gdef
+echo "#-Q- mesu  #- Global definitions for Idataplex (mesu) at UPMC, ifort" >> AA_make.gdef
+echo "#-Q- mesu  M_K = make" >> AA_make.gdef
+echo "#-Q- mesu  P_C = cpp" >> AA_make.gdef
+echo '#-Q- mesu  P_O = -P -C $(P_P)' >> AA_make.gdef
+echo "#-Q- mesu  F_C = ifort -mcmodel=medium -shared-intel -c" >> AA_make.gdef
+echo "#-Q- mesu  #-D- MD    F_D = -g" >> AA_make.gdef
+echo "#-Q- mesu  #-D- MN    F_D =" >> AA_make.gdef
+echo "#-Q- mesu  #-P- I4R4  F_P = -integer-size 32" >> AA_make.gdef
+echo "#-Q- mesu  #-P- I4R8  F_P = -integer-size 32 -real-size 64" >> AA_make.gdef
+echo "#-Q- mesu  #-P- I8R8  F_P = -integer-size 64 -real-size 64" >> AA_make.gdef
+echo '#-Q- mesu  F_O = -O $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR)' >> AA_make.gdef
+echo "#-Q- mesu  F_L = ifort" >> AA_make.gdef
+echo "#-Q- mesu  M_M = 0" >> AA_make.gdef
+echo "#-Q- mesu  L_X = 0" >> AA_make.gdef
+echo "#-Q- mesu  L_O =" >> AA_make.gdef
+echo "#-Q- mesu  A_C = ar -r" >> AA_make.gdef
+echo "#-Q- mesu  A_G = ar -x" >> AA_make.gdef
+echo "#-Q- mesu  C_C = icc -c" >> AA_make.gdef
+echo "#-Q- mesu  C_O =" >> AA_make.gdef
+echo "#-Q- mesu  C_L = icc" >> AA_make.gdef
+echo "#-Q- mesu  #-" >> AA_make.gdef
+echo "#-Q- mesu  NCDF_INC = ${NETCDF_FORT_ROOT}/include" >> AA_make.gdef
+echo "#-Q- mesu  NCDF_LIB = -L${NETCDF_FORT_ROOT}/lib -lnetcdff" >> AA_make.gdef
+echo "#-Q- mesu  #-" >> AA_make.gdef
+
+# set default working precision for IOIPSL:
+./ins_make -t mesu -p I4R8
+
+## 3. build ioipsl:
+cd ../modeles/IOIPSL/src
+make
+## Compile the rebuild tool:
+cd ../tools
+make
+
+if [[ -f ${whereami}/modipsl/lib/libioipsl.a ]] 
+  then
+  echo "OK: ioipsl library is in ${whereami}/modipsl/lib"
+else
+  echo "Something went wrong..."
+fi
