Index: /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.env
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.env	(revision 5034)
+++ /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.env	(revision 5035)
@@ -1,14 +1,18 @@
-# Compile and running environnement at Adastra
-set +e 
+#!/bin/bash
 module purge
-module load craype-x86-genoa
-module load craype-network-ofi
-module load libfabric/1.15.2.0
-module load PrgEnv-gnu/8.3.3
-module load cray-dsmml/0.2.2
-module load cray-libsci/23.02.1.1
-module load cray-mpich/8.1.21
-module load craype/2.7.19
-module load cray-hdf5-parallel/1.12.2.1
-module load cray-netcdf-hdf5parallel/4.9.0.1
-module load cray-fftw/3.3.10.3
+module load PrgEnv-gnu
+module load cray-hdf5-parallel
+module load netcdf-hdf5parallel/gnu/10.3
+
+# netcdf-hdf5parallel has weird naming conventions => hotfix...
+# Used in netcdf95 cmake compilation
+rm -rf netcdf-hdfparallel-hotfix
+mkdir -p netcdf-hdfparallel-hotfix
+cp -r /opt/cray/pe/netcdf-hdf5parallel/4.9.0.5/gnu/10.3/lib/pkgconfig/netcdf*_parallel.pc netcdf-hdfparallel-hotfix
+cd netcdf-hdfparallel-hotfix || exit 1
+mv netcdf-fortran_parallel.pc netcdf-fortran.pc
+PKG_CONFIG_PATH="$(readlink -f .):$PKG_CONFIG_PATH"
+# Another similar hotfix to find mpich.pc
+PKG_CONFIG_PATH="/opt/cray/pe/mpich/8.1.28/ofi/crayclang/16.0/lib/pkgconfig/:$PKG_CONFIG_PATH"
+export PKG_CONFIG_PATH
+cd - || exit 1
Index: /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.fcm
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.fcm	(revision 5034)
+++ /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.fcm	(revision 5035)
@@ -1,17 +1,35 @@
 %COMPILER            mpif90
+%CCOMPILER           mpicc  # xios
 %LINK                mpif90
+%FPP                 cpp
 %AR                  ar
-%ARFLAGS             rs
-%MAKE                gmake
-%FPP                 mpif90 -E
-%FPP_FLAGS           -P -traditional -I${FFTW_INC}
-%FPP_DEF             NC_DOUBLE FFT_FFTW
-%BASE_FFLAGS         -I${FFTW_INC} -march=znver1 -fcray-pointer -c -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fallow-argument-mismatch -fno-align-commons 
-%PROD_FFLAGS         -O3
-%DEV_FFLAGS          -g -O2
-%DEBUG_FFLAGS        
-%MPI_FFLAGS
-%OMP_FFLAGS          -fopenmp
-%BASE_LD             -L${FFTW_DIR} -lfftw3
-%MPI_LD
+%ARFLAGS             rU
+%MAKE                make
+%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
+# /!\ LD must be written in Makefile syntax
+%BASE_LD             -Wl,-rpath=$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib:$(shell 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
+%MPI_LD              -L$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib -lmpi
 %OMP_LD              -fopenmp
+%OMP_FFLAGS          -fopenmp -fcray-pointer
+
+%CPP                 cpp  # xios
+%FPP                 cpp -P  # xios
+%MAKE                make  # xios
+
+
Index: /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.path
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.path	(revision 5034)
+++ /LMDZ6/trunk/arch/arch-X64_ADASTRA-GNU.path	(revision 5035)
@@ -1,22 +1,21 @@
-NETCDF_INCDIR="-I ${NETCDF_DIR}/include"
-NETCDF_LIBDIR="-L ${NETCDF_DIR}/lib"
-NETCDF_LIB="-lnetcdf -lnetcdff"
+NETCDF_INCDIR="-I$(nf-config --includedir) -I$(nc-config --includedir)"
+# Ugly hack for orchidee <=2.0
+NETCDF_LIBDIR="-L${NETCDF_DIR}/lib" # for some reason on adastra `nf-config --flibs` is empty
+NETCDF_LIB="-lnetcdf -lnetcdff"  # same as above
+NETCDF95_INCDIR="-I$(pwd)/../../include"
+NETCDF95_LIBDIR="-L$(pwd)/../../lib"
+NETCDF95_LIB="-lnetcdf95"
 
-IOIPSL_INCDIR="-I$LMDGCM/../../lib -I$LMDGCM/../IOIPSL/inc"
-IOIPSL_LIBDIR="-L$LMDGCM/../../lib -L$LMDGCM/../IOIPSL/lib"
+# Exported
+IOIPSL_INCDIR="-I$(pwd)/../IOIPSL/inc -I$(pwd)/../IOIPSL/lib"
+IOIPSL_LIBDIR="-L$(pwd)/../IOIPSL/inc -L$(pwd)/../IOIPSL/lib"
 IOIPSL_LIB="-lioipsl"
 
-XIOS_INCDIR="-I$LMDGCM/../XIOS/inc"
-XIOS_LIBDIR="-L$LMDGCM/../XIOS/lib"
+# Exported
+XIOS_INCDIR="-I$(pwd)/../XIOS/inc"
+XIOS_LIBDIR="-L$(pwd)/../XIOS/lib"
 XIOS_LIB="-lxios -lstdc++"
 
-ORCH_INCDIR="-I$LMDGCM/../../lib"
-ORCH_LIBDIR="-L$LMDGCM/../../lib"
-
-OASIS_INCDIR="-I$LMDGCM/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$LMDGCM/../../oasis3-mct/BLD/lib"
-OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
-
-INCA_INCDIR="-I$LMDGCM/../INCA/build/inc"
-INCA_LIBDIR="-L$LMDGCM/../INCA/build/lib"
-INCA_LIB="-lchimie"
+# Exported
+ORCH_INCDIR="-I$(pwd)/../ORCHIDEE/inc -I$(pwd)/../ORCHIDEE/lib"
+ORCH_LIBDIR="-L$(pwd)/../ORCHIDEE/inc -L$(pwd)/../ORCHIDEE/lib"
Index: /LMDZ6/trunk/arch/arch-X64_JEANZAY.env
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_JEANZAY.env	(revision 5034)
+++ /LMDZ6/trunk/arch/arch-X64_JEANZAY.env	(revision 5035)
@@ -1,8 +1,14 @@
 module purge
-module load intel-all/19.0.4
+module load intel-compilers/19.0.4
+ module load intel-mkl/19.0.4
 module load hdf5/1.10.5-mpi
 module load netcdf/4.7.2-mpi
 module load netcdf-fortran/4.5.2-mpi
 module load netcdf95
+module load subversion/1.9.7
+module load cmake
 
-module load gcc/6.5.0
+export FC=mpiifort
+export CPP="icc -E"
+export CC=icc
+
Index: /LMDZ6/trunk/arch/arch-X64_JEANZAY.path
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_JEANZAY.path	(revision 5034)
+++ /LMDZ6/trunk/arch/arch-X64_JEANZAY.path	(revision 5035)
@@ -1,30 +1,21 @@
-# $Id$
-#NETCDF_LIBDIR="-L$NETCDFFORTRAN_LIBDIR -L$NETCDF_LIBDIR -lnetcdf -lnetcdff"
-#NETCDF_INCDIR=-I$NETCDFFORTRAN_INCDIR
-NETCDF_INCDIR=""
-NETCDF_LIBDIR=""
+NETCDF_INCDIR="-I$(nf-config --includedir) -I$(nc-config --includedir)"  # nc required for xios
+# Ugly hack for orchidee <=2.0
+NETCDF_LIBDIR="-L$(nf-config --flibs | sed -e "s/-L//")"
 NETCDF_LIB="-lnetcdff -lnetcdf"
+NETCDF95_INCDIR="-I$(pwd)/../../include"
+NETCDF95_LIBDIR="-L$(pwd)/../../lib"
+NETCDF95_LIB="-lnetcdf95"
 
-NETCDF95_INCDIR=-I$NETCDF95_ROOT/include/NetCDF95
-NETCDF95_LIBDIR=-L$NETCDF95_ROOT/lib
-NETCDF95_LIB=-lnetcdf95
-
-IOIPSL_INCDIR="-I$LMDGCM/../../lib -I$LMDGCM/../IOIPSL/inc"
-IOIPSL_LIBDIR="-L$LMDGCM/../../lib -L$LMDGCM/../IOIPSL/lib"
+# Exported
+IOIPSL_INCDIR="-I$(pwd)/../IOIPSL/inc -I$(pwd)/../IOIPSL/lib"
+IOIPSL_LIBDIR="-L$(pwd)/../IOIPSL/inc -L$(pwd)/../IOIPSL/lib"
 IOIPSL_LIB="-lioipsl"
 
-XIOS_INCDIR="-I$LMDGCM/../XIOS/inc"
-XIOS_LIBDIR="-L$LMDGCM/../XIOS/lib"
+# Exported
+XIOS_INCDIR="-I$(pwd)/../XIOS/inc"
+XIOS_LIBDIR="-L$(pwd)/../XIOS/lib"
 XIOS_LIB="-lxios -lstdc++"
 
-ORCH_INCDIR="-I$LMDGCM/../../lib"
-ORCH_LIBDIR="-L$LMDGCM/../../lib"
-ORCH_LIB=
-
-OASIS_INCDIR="-I$LMDGCM/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
-OASIS_LIBDIR="-L$LMDGCM/../../oasis3-mct/BLD/lib"
-OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
-
-INCA_INCDIR="-I$LMDGCM/../INCA/build/inc"
-INCA_LIBDIR="-L$LMDGCM/../INCA/build/lib"
-INCA_LIB="-lchimie"
+# Exported
+ORCH_INCDIR="-I$(pwd)/../ORCHIDEE/inc -I$(pwd)/../ORCHIDEE/lib"
+ORCH_LIBDIR="-L$(pwd)/../ORCHIDEE/inc -L$(pwd)/../ORCHIDEE/lib"
Index: /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.env
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.env	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.env	(revision 5035)
@@ -0,0 +1,8 @@
+module purge
+module load subversion/1.13.0
+module load gcc/11.2.0
+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
+module load netcdf95
Index: /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.fcm
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.fcm	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.fcm	(revision 5035)
@@ -0,0 +1,35 @@
+%COMPILER            mpif90
+%CCOMPILER           mpicc  # xios
+%LINK                mpif90
+%FPP                 cpp
+%AR                  ar
+%ARFLAGS             rU
+%MAKE                make
+%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
+# /!\ LD must be written in Makefile syntax
+%BASE_LD             -Wl,-rpath=$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib:$(shell 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
+%MPI_LD              -L$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib -lmpi
+%OMP_LD              -fopenmp
+%OMP_FFLAGS          -fopenmp -fcray-pointer
+
+%CPP                 cpp  # xios
+%FPP                 cpp -P  # xios
+%MAKE                make  # xios
+
+
Index: /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.path
===================================================================
--- /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.path	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-X64_MESOIPSL-GNU.path	(revision 5035)
@@ -0,0 +1,21 @@
+NETCDF_INCDIR="-I$(nf-config --includedir) -I$(nc-config --includedir)"  # nc required for xios
+# Ugly hack for orchidee <=2.0
+NETCDF_LIBDIR="-L$(nf-config --flibs | sed -e "s/-L//")"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+NETCDF95_INCDIR="-I$(pwd)/../../include"
+NETCDF95_LIBDIR="-L$(pwd)/../../lib"
+NETCDF95_LIB="-lnetcdf95"
+
+# Exported
+IOIPSL_INCDIR="-I$(pwd)/../IOIPSL/inc -I$(pwd)/../IOIPSL/lib"
+IOIPSL_LIBDIR="-L$(pwd)/../IOIPSL/inc -L$(pwd)/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
+
+# Exported
+XIOS_INCDIR="-I$(pwd)/../XIOS/inc"
+XIOS_LIBDIR="-L$(pwd)/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+# Exported
+ORCH_INCDIR="-I$(pwd)/../ORCHIDEE/inc -I$(pwd)/../ORCHIDEE/lib"
+ORCH_LIBDIR="-L$(pwd)/../ORCHIDEE/inc -L$(pwd)/../ORCHIDEE/lib"
Index: /LMDZ6/trunk/arch/arch-local-gfortran-parallel.env
===================================================================
--- /LMDZ6/trunk/arch/arch-local-gfortran-parallel.env	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-local-gfortran-parallel.env	(revision 5035)
@@ -0,0 +1,1 @@
+# empty
Index: /LMDZ6/trunk/arch/arch-local-gfortran-parallel.fcm
===================================================================
--- /LMDZ6/trunk/arch/arch-local-gfortran-parallel.fcm	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-local-gfortran-parallel.fcm	(revision 5035)
@@ -0,0 +1,35 @@
+%COMPILER            mpif90
+%CCOMPILER           mpicc  # xios
+%LINK                mpif90
+%FPP                 cpp
+%AR                  ar
+%ARFLAGS             rU
+%MAKE                make
+%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
+# /!\ LD must be written in Makefile syntax
+%BASE_LD             -Wl,-rpath=$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib:$(shell 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
+%MPI_LD              -L$(shell dirname $(shell readlink -f "$(shell which mpif90)"))/../lib -lmpi
+%OMP_LD              -fopenmp
+%OMP_FFLAGS          -fopenmp -fcray-pointer
+
+%CPP                 cpp  # xios
+%FPP                 cpp -P  # xios
+%MAKE                make  # xios
+
+
Index: /LMDZ6/trunk/arch/arch-local-gfortran-parallel.path
===================================================================
--- /LMDZ6/trunk/arch/arch-local-gfortran-parallel.path	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-local-gfortran-parallel.path	(revision 5035)
@@ -0,0 +1,21 @@
+NETCDF_INCDIR="-I$(nf-config --includedir) -I$(nc-config --includedir)"  # nc required for xios
+# Ugly hack for orchidee <=2.0
+NETCDF_LIBDIR="-L$(nf-config --flibs | sed -e "s/-L//")"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+NETCDF95_INCDIR="-I$(pwd)/../../include"
+NETCDF95_LIBDIR="-L$(pwd)/../../lib"
+NETCDF95_LIB="-lnetcdf95"
+
+# Exported
+IOIPSL_INCDIR="-I$(pwd)/../IOIPSL/inc -I$(pwd)/../IOIPSL/lib"
+IOIPSL_LIBDIR="-L$(pwd)/../IOIPSL/inc -L$(pwd)/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
+
+# Exported
+XIOS_INCDIR="-I$(pwd)/../XIOS/inc"
+XIOS_LIBDIR="-L$(pwd)/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+# Exported
+ORCH_INCDIR="-I$(pwd)/../ORCHIDEE/inc -I$(pwd)/../ORCHIDEE/lib"
+ORCH_LIBDIR="-L$(pwd)/../ORCHIDEE/inc -L$(pwd)/../ORCHIDEE/lib"
Index: /LMDZ6/trunk/arch/arch-local-gfortran.env
===================================================================
--- /LMDZ6/trunk/arch/arch-local-gfortran.env	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-local-gfortran.env	(revision 5035)
@@ -0,0 +1,1 @@
+# empty
Index: /LMDZ6/trunk/arch/arch-local-gfortran.fcm
===================================================================
--- /LMDZ6/trunk/arch/arch-local-gfortran.fcm	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-local-gfortran.fcm	(revision 5035)
@@ -0,0 +1,18 @@
+%COMPILER            gfortran
+%LINK                gfortran
+%FPP                 cpp
+%AR                  ar
+%ARFLAGS             rU
+%MAKE                make
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             NC_DOUBLE
+%BASE_FFLAGS         -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE
+%PROD_FFLAGS         -O3 -fallow-argument-mismatch
+%DEV_FFLAGS          -Wall -fbounds-check -fallow-argument-mismatch
+%DEBUG_FFLAGS        -g3 -Wall -fbounds-check -ffpe-trap=invalid,zero,overflow -O0 -fstack-protector-all -fbacktrace -finit-real=snan -fallow-argument-mismatch
+%MPI_FFLAGS
+%OMP_FFLAGS
+# /!\ LD must be written in Makefile syntax
+%BASE_LD             -Wl,-rpath=$(shell nf-config --prefix)/lib
+%MPI_LD
+%OMP_LD
Index: /LMDZ6/trunk/arch/arch-local-gfortran.path
===================================================================
--- /LMDZ6/trunk/arch/arch-local-gfortran.path	(revision 5035)
+++ /LMDZ6/trunk/arch/arch-local-gfortran.path	(revision 5035)
@@ -0,0 +1,21 @@
+NETCDF_INCDIR="-I$(nf-config --includedir) -I$(nc-config --includedir)"  # nc required for xios
+# Ugly hack for orchidee <=2.0
+NETCDF_LIBDIR="-L$(nf-config --flibs | sed -e "s/-L//")"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+NETCDF95_INCDIR="-I$(pwd)/../../include"
+NETCDF95_LIBDIR="-L$(pwd)/../../lib"
+NETCDF95_LIB="-lnetcdf95"
+
+# Exported
+IOIPSL_INCDIR="-I$(pwd)/../IOIPSL/inc -I$(pwd)/../IOIPSL/lib"
+IOIPSL_LIBDIR="-L$(pwd)/../IOIPSL/inc -L$(pwd)/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
+
+# Exported
+XIOS_INCDIR="-I$(pwd)/../XIOS/inc"
+XIOS_LIBDIR="-L$(pwd)/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+# Exported
+ORCH_INCDIR="-I$(pwd)/../ORCHIDEE/inc -I$(pwd)/../ORCHIDEE/lib"
+ORCH_LIBDIR="-L$(pwd)/../ORCHIDEE/inc -L$(pwd)/../ORCHIDEE/lib"
