Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.bld_pp
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.bld_pp	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.bld_pp	(revision 6606)
@@ -0,0 +1,1 @@
+PP 1
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.bld_tool
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.bld_tool	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.bld_tool	(revision 6606)
@@ -0,0 +1,37 @@
+CFLAGS       
+SHELL        /bin/bash
+ARFLAGS      rs
+LD_OUTPUT    -o
+FC           mpif90
+CC           cc
+GENINTERFACE ECMWF
+REMOTE_SHELL remsh
+FC_OUTPUT    -o
+CPP_INCLUDE  -I
+FPP          mpif90 -E
+CC_INCLUDE   -I
+FFLAGS       -i4 -r8 -auto -align all -I/ccc/products/mkl-20.0.0/system/default/20.0.0/mkl/include -g -traceback -O3 -xAVX -qopenmp -I/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/inc -I/ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/include -I/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/include -I /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../DYNAMICO/inc -I/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../LMDZ/config/inc -I /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/inc
+AR           ar
+FC_INCLUDE   -I
+FC_DEFINE    -D
+LD_LIBSEARCH -L
+MAKEFLAGS    
+CC_DEFINE    -D
+CPP_DEFINE   -D
+INTERFACE    file
+FPPFLAGS     -P
+LD_LIBLINK   -l
+CC_COMPILE   -c
+MAKE         make
+MAKE_JOB     -j
+LDFLAGS      -i4 -r8 -auto -L/ccc/products/mkl-20.0.0/system/default/20.0.0/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm  -qopenmp -Wl,--start-group -L../lib -licosa_lmdz -L /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../DYNAMICO/lib -licosa -Wl,--end-group  -L /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../LMDZ/config/lib -llmdz  -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../ORCHIDEE/lib -lorchidee -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../INCA/build/lib -lchimie -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/lib -lxios -lstdc++ -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../IOIPSL/lib -lioipsl -L/ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib -L/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib -lnetcdf -lnetcdff
+FPP_INCLUDE  -I
+FPP_DEFINE   -D
+LD           mpif90
+FC_COMPILE   -c
+MIRROR       rsync
+FPPKEYS      CPP_NONE CPP_USING_MPI CPP_USING_OMP INCA CPP_USING_XIOS KEY_NONE CPP_NETCDF4
+CPP          cpp
+CPPFLAGS     -C
+CC_OUTPUT    -o
+MAKE_SILENT  -s
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.exe_dep
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.exe_dep	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/.exe_dep	(revision 6606)
@@ -0,0 +1,2 @@
+# EXE_DEP cache
+OBJECTS 
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/phys.pck_depend
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/phys.pck_depend	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/phys.pck_depend	(revision 6606)
@@ -0,0 +1,2 @@
+INTNAME interface_icosa_lmdz.f90::interface_icosa_lmdz_mod
+USE     interface_icosa_lmdz.f90::distrib_icosa_lmdz_mod
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/phys.pck_file
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/phys.pck_file	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/phys.pck_file	(revision 6606)
@@ -0,0 +1,1 @@
+/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/src/phylmd/interface_icosa_lmdz.F90 FPP::FPP9X::SOURCE::MODULE
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/src.pck_depend
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/src.pck_depend	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/src.pck_depend	(revision 6606)
@@ -0,0 +1,4 @@
+INTNAME icosa_lmdz.f90::icosa_lmdz
+INTNAME distrib_icosa_lmdz.f90::distrib_icosa_lmdz_mod
+INTNAME wrapper.f90::initialize_external_physics
+USE     wrapper.f90::interface_icosa_lmdz_mod
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/src.pck_file
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/src.pck_file	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/.cache/src.pck_file	(revision 6606)
@@ -0,0 +1,3 @@
+/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/src/wrapper.f90            FORTRAN::FORTRAN9X::SOURCE
+/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/src/icosa_lmdz.f90         FORTRAN::FORTRAN9X::SOURCE::PROGRAM
+/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/src/distrib_icosa_lmdz.f90 FORTRAN::FORTRAN9X::SOURCE::MODULE
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.env	(revision 6606)
@@ -0,0 +1,1 @@
+link /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/config/ICOLMDZORINCA_v7/ARCH/arch-X64_IRENE.env
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.fcm	(revision 6606)
@@ -0,0 +1,1 @@
+link arch/arch-X64_IRENE.fcm
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch.path	(revision 6606)
@@ -0,0 +1,1 @@
+link /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/config/ICOLMDZORINCA_v7/ARCH/arch-X64_IRENE.path
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.README
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.README	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.README	(revision 6606)
@@ -0,0 +1,16 @@
+# To setup environment variables on NCAR Bluefire SP6
+# Change your shell to bash : 
+# see http://www2.cisl.ucar.edu/docs/bluefire/getting-started
+# tab 'Shell and environment'
+# then put the following lines in your ~/.profile
+
+. /contrib/Modules/3.2.6/init/bash
+module load emacs
+module load netcdf
+module load svn-1.5
+
+export TERM=xterm
+export PATH=${HOME}/bin:/usr/local/bin/:$PATH
+
+# NB : The above PATH lets FCM find GNU make and GNU cpp
+# which are in /usr/local/bin. 
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            xlf
+%LINK                xlf
+%AR                  ar
+%MAKE                /usr/local/bin/gmake
+%FPP_FLAGS           
+%FPP_DEF             
+%BASE_FFLAGS         -qlanglvl=2003pure -u -qintsize=4 -qrealsize=8
+%PROD_FFLAGS         -O3
+%DEV_FFLAGS          -p -g -O3 -traceback -fp-stack-check -ftrapuv
+%DEBUG_FFLAGS        -p -g -traceback
+%MPI_FFLAGS
+%OMP_FFLAGS          
+%BASE_LD             -qintsize=4 -qrealsize=8
+%MPI_LD
+%OMP_LD
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-SP6_BLUEFIRE.path	(revision 6606)
@@ -0,0 +1,10 @@
+NETCDF_LIBDIR="-L$LIB_NETCDF -lnetcdff"
+NETCDF_INCDIR="-I$NETCDF/include"
+IOIPSL_INCDIR=$LMDGCM/../../lib
+IOIPSL_LIBDIR=$LMDGCM/../../lib
+ORCH_INCDIR=$LMDGCM/../../lib
+ORCH_LIBDIR=$LMDGCM/../../lib
+OASIS_INCDIR=$LMDGCM/../../prism/X64/build/lib/psmile.$couple
+OASIS_LIBDIR=$LMDGCM/../../prism/X64/lib
+INCA_LIBDIR=$LMDGCM/../INCA3/config/lib
+INCA_INCDIR=$LMDGCM/../INCA3/config/lib
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.env	(revision 6606)
@@ -0,0 +1,10 @@
+module purge
+
+module load intel/2016.4
+module load netcdf/mpi/4.3.3.1
+module load hdf5/mpi/1.8.14
+
+export NETCDF_INC_DIR=/smplocal/pub/NetCDF/4.3.3.1/mpi/include
+export NETCDF_LIB_DIR=/smplocal/pub/NetCDF/4.3.3.1/mpi/lib
+export HDF5_INC_DIR=/smplocal/pub/HDF5/1.8.14/par/include
+export HDF5_LIB_DIR=/smplocal/pub/HDF5/1.8.14/par/lib
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            mpiifort
+%LINK                mpiifort
+%FPP                 mpiifort -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -g -traceback -O3 -vec-report2
+%DEV_FFLAGS          -g -O1 -traceback
+%DEBUG_FFLAGS        -g  -check bounds -fp-model strict
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp -openmp-threadprivate=compat
+%BASE_LD             -i4 -r8 -auto -L${MKL_ROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
+%MPI_LD
+%OMP_LD              -openmp -openmp-threadprivate=compat
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_ADA.path	(revision 6606)
@@ -0,0 +1,23 @@
+NETCDF_INCDIR="-I $NETCDF_INC_DIR"
+NETCDF_LIBDIR="-L $NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_INC_DIR"
+HDF5_LIBDIR="-L $HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
+
+XIOS_INCDIR="-I$ROOT/../XIOS/inc"
+XIOS_LIBDIR="-L$ROOT/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+ORCHIDEE_INCDIR="-I$ROOT/../ORCHIDEE/inc"
+ORCHIDEE_LIBDIR="-L$ROOT/../ORCHIDEE/lib"
+ORCHIDEE_LIB="-lorchidee "
+
+IOIPSL_INCDIR="-I$ROOT/../IOIPSL/inc"
+IOIPSL_LIBDIR="-L$ROOT/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.env	(revision 6606)
@@ -0,0 +1,12 @@
+module unload netcdf
+module unload hdf5
+module load hdf5/1.8.12_parallel
+module load netcdf/4.3.3.1_hdf5_parallel
+module load vampir
+module load vampirtrace
+
+#export HDF5_INC_DIR=$WORKDIR/hdf5/include
+#export HDF5_LIB_DIR=$WORKDIR/hdf5/lib
+
+#export NETCDF_INC_DIR=$WORKDIR/netcdf4/include
+#export NETCDF_LIB_DIR=$WORKDIR/netcdf4/lib
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            mpif90 
+%LINK                mpif90 
+%FPP                 mpif90 -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -g -traceback -O3 -vec-report2 -xAVX
+%DEV_FFLAGS          -g -O1 -traceback
+%DEBUG_FFLAGS        -g -traceback -check bounds -fp-model strict
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp -openmp-threadprivate compat
+%BASE_LD             -i4 -r8 -auto $MKL_LIBS
+%MPI_LD
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE.path	(revision 6606)
@@ -0,0 +1,23 @@
+NETCDF_INCDIR="-I $NETCDF_INC_DIR"
+NETCDF_LIBDIR="-Wl,-rpath=$NETCDF_LIB_DIR -L$NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_INC_DIR"
+HDF5_LIBDIR="-Wl,-rpath=$HDF5_LIB_DIR -L$HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
+
+XIOS_INCDIR="-I$ROOT/../XIOS/inc"
+XIOS_LIBDIR="-L$ROOT/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+ORCHIDEE_INCDIR="-I$ROOT/../ORCHIDEE/inc"
+ORCHIDEE_LIBDIR="-L$ROOT/../ORCHIDEE/lib"
+ORCHIDEE_LIB="-lorchidee "
+
+IOIPSL_INCDIR="-I$ROOT/../IOIPSL/inc"
+IOIPSL_LIBDIR="-L$ROOT/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.env	(revision 6606)
@@ -0,0 +1,14 @@
+module unload netcdf
+module unload hdf5
+module load netcdf/4.2_hdf5_parallel
+module load  hdf5/1.8.9_parallel
+module unload vampir
+module unload vampirtrace
+module load vampir
+module load vampirtrace
+
+#export HDF5_INC_DIR=$WORKDIR/hdf5/include
+#export HDF5_LIB_DIR=$WORKDIR/hdf5/lib
+
+#export NETCDF_INC_DIR=$WORKDIR/netcdf4/include
+#export NETCDF_LIB_DIR=$WORKDIR/netcdf4/lib
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.fcm	(revision 6606)
@@ -0,0 +1,23 @@
+%COMPILER            vtf90 -vt:f90 "mpif90 -openmp -openmp-threadprivate compat -fno-instrument-functions " -vt:noopari -vt:inst manual -DVTRACE
+%LINK                vtf90 -vt:f90 "mpif90 -openmp -openmp-threadprivate compat -fno-instrument-functions" -vt:noopari -vt:inst manual -DVTRACE 
+%FPP                 vtf90 -vt:f90 "mpif90 -E  -fno-instrument-functions" -vt:noopari -vt:inst manual -DVTRACE
+#%COMPILER            vtf90 -vt:f90 "mpif90 " -vt:inst manual -DVTRACE
+#%LINK                vtf90 -vt:f90 "mpif90" -vt:inst manual -DVTRACE 
+#%FPP                 vtf90 -vt:f90 "mpif90 -E" -vt:inst manual -DVTRACE
+#%COMPILER           ifort
+#%LINK               ifort 
+#%FPP                ifort -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE VTRACE CPP_NETCDF4
+#%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -p -g -traceback -O3 -vec-report2 -xAVX 
+%DEV_FFLAGS          -g -O3 -traceback -fp-stack-check -ftrapuv
+%DEBUG_FFLAGS        -g  -fp-model strict -traceback -check bounds
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp
+%BASE_LD             -i4 -r8 -auto $MKL_LIBS
+%MPI_LD
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_CURIE_VAMPIR.path	(revision 6606)
@@ -0,0 +1,15 @@
+NETCDF_INCDIR="-I $NETCDF_INC_DIR"
+NETCDF_LIBDIR="-Wl,-rpath=$NETCDF_LIB_DIR -L$NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_INC_DIR"
+HDF5_LIBDIR="-Wl,-rpath=$HDF5_LIB_DIR -L$HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
+
+XIOS_INCDIR="-I$WORKDIR/XIOS_COMMIT_V1.7/inc"
+XIOS_LIBDIR="-L$WORKDIR/XIOS_COMMIT_V1.7/lib"
+XIOS_LIB="-lxios -lstdc++"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_HORUS.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_HORUS.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_HORUS.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            mpif90
+%LINK                mpif90
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -fdefault-real-8
+%PROD_FFLAGS         -O3 
+%DEV_FFLAGS          -p -g -O 
+%DEBUG_FFLAGS        -p -g  -fbacktrace -fbounds-check
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp
+%BASE_LD             -p 
+%OMP_LD              -openmp
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_HORUS.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_HORUS.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_HORUS.path	(revision 6606)
@@ -0,0 +1,3 @@
+NETCDF_LIBDIR='-L/usr/local/lib -lnetcdff'
+NETCDF_INCDIR=-I/usr/local/include
+
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE-AMD.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE-AMD.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE-AMD.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            mpif90 
+%LINK                mpif90 
+%FPP                 mpif90 -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -g -traceback -O3 -mavx2
+%DEV_FFLAGS          -g -O1 -traceback
+%DEBUG_FFLAGS        -g -traceback -check bounds -fp-model strict
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp
+%BASE_LD             -i4 -r8 -auto $MKL_LDFLAGS
+%MPI_LD
+%OMP_LD              -qopenmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            mpif90 
+%LINK                mpif90 
+%FPP                 mpif90 -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -g -traceback -O3 -xAVX
+%DEV_FFLAGS          -g -O1 -traceback
+%DEBUG_FFLAGS        -g -traceback -check bounds -fp-model strict
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp
+%BASE_LD             -i4 -r8 -auto $MKL_LDFLAGS
+%MPI_LD
+%OMP_LD              -qopenmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_IRENE.path	(revision 6606)
@@ -0,0 +1,40 @@
+NETCDF_INCDIR="-I$NETCDFC_INCDIR -I$NETCDFFORTRAN_INCDIR"
+NETCDF_LIBDIR="-L$NETCDFC_LIBDIR -L$NETCDFFORTRAN_LIBDIR"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+HDF5_INCDIR=""
+HDF5_LIBDIR=""
+HDF5_LIB=""
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+BOOST_INCDIR=""
+BOOST_LIBDIR=""
+BOOST_LIB=""
+
+BLITZ_INCDIR=""
+BLITZ_LIBDIR=""
+BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
+
+IOIPSL_INCDIR="-I$ROOT/../IOIPSL/inc"
+IOIPSL_LIBDIR="-L$ROOT/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
+
+XIOS_ROOTDIR="$PWD/../XIOS"
+XIOS_INCDIR="-I$ROOT/../XIOS/inc"
+XIOS_LIBDIR="-L$ROOT/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+ORCHIDEE_INCDIR="-I$ROOT/../ORCHIDEE/inc"
+ORCHIDEE_LIBDIR="-L$ROOT/../ORCHIDEE/lib"
+ORCHIDEE_LIB="-lorchidee"
+
+INCA_LIBDIR="-L$ROOT/../INCA/build/lib"
+INCA_INCDIR="-I$ROOT/../INCA/build/inc"
+INCA_LIB="-lchimie"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_JEANZAY.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_JEANZAY.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_JEANZAY.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            mpiifort 
+%LINK                mpiifort 
+%FPP                 mpiifort -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -fp-model strict
+%PROD_FFLAGS         -g -traceback -O3 -xHost -qopt-zmm-usage=high
+%DEV_FFLAGS          -g -O1 -traceback
+%DEBUG_FFLAGS        -g -traceback -check bounds
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp
+%BASE_LD             -i4 -r8 -auto -lmkl_intel_lp64 -lmkl_core -lmkl_sequential
+%MPI_LD
+%OMP_LD              -qopenmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.env	(revision 6606)
@@ -0,0 +1,4 @@
+module unload PrgEnv-pgi
+module load PrgEnv-intel
+
+module load netcdf
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            ftn 
+%LINK                ftn 
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -automatic -align all
+%PROD_FFLAGS         -O3
+%DEV_FFLAGS          -p -g -O3 -traceback -fp-stack-check -ftrapuv
+%DEBUG_FFLAGS        -p -g -traceback -check bounds
+%MPI_FFLAGS
+%OMP_FFLAGS          
+%BASE_LD              -i4 -r8 -automatic
+%MPI_LD
+%OMP_LD              
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_LYNX.path	(revision 6606)
@@ -0,0 +1,11 @@
+NETCDF_INCDIR="-I$CRAY_NETCDF_DIR/include"
+NETCDF_LIBDIR="-L$CRAY_NETCDF_DIR/lib"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR=""
+HDF5_LIBDIR=""
+HDF5_LIB=""
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.env	(revision 6606)
@@ -0,0 +1,10 @@
+#module unload netcdf
+#module unload hdf5
+#module load netcdf/3.6.3
+"module load hdf5
+
+export HDF5_INC_DIR=$WORKDIR/hdf5/include
+export HDF5_LIB_DIR=$WORKDIR/hdf5/lib
+
+export NETCDF_INC_DIR=/fs/local/apps/netcdf-4.1.3_intel/include 
+export NETCDF_LIB_DIR=/fs/local/apps/netcdf-4.1.3_intel/lib
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            ifort 
+%LINK                ifort 
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -automatic -align all
+%PROD_FFLAGS         -O3
+%DEV_FFLAGS          -p -g -O3 -traceback -fp-stack-check -ftrapuv
+%DEBUG_FFLAGS        -p -g -traceback -check bounds
+%MPI_FFLAGS
+%OMP_FFLAGS          
+%BASE_LD              -i4 -r8 -automatic
+%MPI_LD
+%OMP_LD              
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_MIRAGE.path	(revision 6606)
@@ -0,0 +1,11 @@
+NETCDF_INCDIR="-I/fs/local/apps/netcdf-4.1.3_intel/include"
+NETCDF_LIBDIR="-L/fs/local/apps/netcdf-4.1.3_intel/lib"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR=""
+HDF5_LIBDIR=""
+HDF5_LIB=""
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.env	(revision 6606)
@@ -0,0 +1,6 @@
+module unload netcdf hdf5 intempi openmpi intel
+
+module load intel/17.0
+module load intelmpi/2017.0.098
+module load hdf5/1.8.17
+module load netcdf/4.4.0_fortran-4.4.2
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.fcm	(revision 6606)
@@ -0,0 +1,17 @@
+%COMPILER            mpif90
+%LINK                mpif90
+%FPP                 mpif90 -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%CPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -i4 -r8 -auto -align all -fp-model strict
+%PROD_FFLAGS         -O2 -ip -xCORE-AVX2
+%DEV_FFLAGS          -p -g -O1 -fpe0 -traceback
+%DEBUG_FFLAGS        -p -g -O0 -fpe-all=0 -ftz -ftrapuv -fp-stack-check -check bounds,format,output_conversion,pointers,uninit -debug -traceback
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp -qopenmp-threadprivate compat
+%BASE_LD             -i4 -r8 -auto $MKL_LIBS
+%MPI_LD
+%OMP_LD              -qopenmp -qopenmp-threadprivate compat
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OCCIGEN.path	(revision 6606)
@@ -0,0 +1,24 @@
+ROOT=$PWD
+NETCDF_INCDIR="-I$NETCDFF_INCDIR -I$NETCDF_INC_DIR"
+NETCDF_LIBDIR="-L$NETCDFF_LIBDIR -L$NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_DIR/include"
+HDF5_LIBDIR="-L $HDF5_DIR/lib" 
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
+
+XIOS_INCDIR="-I$ROOT/../XIOS/inc"
+XIOS_LIBDIR="-L$ROOT/../XIOS/lib"
+XIOS_LIB="-lxios -lstdc++"
+
+ORCHIDEE_INCDIR="-I$ROOT/../ORCHIDEE/lib"
+ORCHIDEE_LIBDIR="-L$ROOT/../ORCHIDEE/lib"
+ORCHIDEE_LIB="-lorchidee "
+
+IOIPSL_INCDIR="-I$ROOT/../IOIPSL/inc"
+IOIPSL_LIBDIR="-L$ROOT/../IOIPSL/lib"
+IOIPSL_LIB="-lioipsl"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.README
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.README	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.README	(revision 6606)
@@ -0,0 +1,12 @@
+# MacPorts environment :
+# sudo port install gcc45
+# sudo port select gcc mp-gcc45
+# sudo port install netcdf-fortran +gcc45
+
+# for VTKMapper
+# sudo port install python27
+# sudo port select python python27
+# sudo port install vtk5 +python27
+# sudo port install hdf5-18 +gcc45
+# compile python->NetCDF interface netCDF4-0.9.3
+#      sudo python setup.py install
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            gfortran
+%LINK                gfortran
+%AR                  ar
+%MAKE                gmake
+%FPP                 gfortran -E
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -I /opt/local/include -fdefault-real-8 -ffree-line-length-none
+%PROD_FFLAGS         -O3 
+%DEV_FFLAGS          -p -g -O 
+%DEBUG_FFLAGS        -p -g  -fbacktrace -fbounds-check
+%MPI_FFLAGS
+%OMP_FFLAGS          
+%BASE_LD             -p -L/opt/local/lib  -lnetcdff -lnetcdf
+%OMP_LD              
+%OMP_LD              
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_OSX.path	(revision 6606)
@@ -0,0 +1,11 @@
+NETCDF_LIBDIR=
+NETCDF_INCDIR=
+IOIPSL_INCDIR=$LMDGCM/../IOIPSL/src/
+IOIPSL_LIBDIR=$LMDGCM/../IOIPSL/src/
+ORCH_INCDIR=/work/cont003/p86yann/ORCHIDEE_1_9_2_OMP_MEM/lib_cpl
+ORCH_LIBDIR=/work/cont003/p86yann/ORCHIDEE_1_9_2_OMP_MEM/lib_cpl
+OASIS_INCDIR=$LMDGCM/../../prism/IA64/build/lib/psmile.$couple
+OASIS_LIBDIR=$LMDGCM/../../prism/IA64/lib
+INCA_LIBDIR=$LMDGCM/../INCA3/config/lib
+INCA_INCDIR=$LMDGCM/../INCA3/config/lib
+
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.env	(revision 6606)
@@ -0,0 +1,10 @@
+module unload netcdf
+module unload hdf5
+module load netcdf/3.6.3
+module load hdf5
+
+#export HDF5_INC_DIR=$WORKDIR/hdf5/include
+#export HDF5_LIB_DIR=$WORKDIR/hdf5/lib
+
+#export NETCDF_INC_DIR=$WORKDIR/netcdf4/include
+#export NETCDF_LIB_DIR=$WORKDIR/netcdf4/lib
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            mpif90
+%LINK                mpif90
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE 
+%BASE_FFLAGS         -i4 -r8 -automatic -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -O3 -openmp
+%DEV_FFLAGS          -p -g -O3 -traceback -fp-stack-check -ftrapuv
+%DEBUG_FFLAGS        -p -g -traceback -check bounds
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp
+%BASE_LD             -openmp -i4 -r8 -automatic $MKL_LIBS
+%MPI_LD
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE.path	(revision 6606)
@@ -0,0 +1,11 @@
+NETCDF_INCDIR="-I $NETCDF_INC_DIR"
+NETCDF_LIBDIR="-L $NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_INC_DIR"
+HDF5_LIBDIR="-L $HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.env
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.env	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.env	(revision 6606)
@@ -0,0 +1,4 @@
+module unload netcdf
+module unload hdf5
+module load netcdf/3.6.3
+module load hdf5
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            ifort
+%LINK                ifort
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE 
+%BASE_FFLAGS         -i4 -r8 -automatic -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -O3 -openmp
+%DEV_FFLAGS          -p -g -O3 -traceback -fp-stack-check -ftrapuv
+%DEBUG_FFLAGS        -p -g -traceback -check bounds
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp
+%BASE_LD             -openmp -i4 -r8 -automatic $MKL_LIBS
+%MPI_LD
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-X64_TITANE_SEQ.path	(revision 6606)
@@ -0,0 +1,11 @@
+NETCDF_INCDIR="-I $NETCDF_INC_DIR"
+NETCDF_LIBDIR="-L $NETCDF_LIB_DIR"
+NETCDF_LIB="-lnetcdff -lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_INC_DIR"
+HDF5_LIBDIR="-L $HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz -lcurl"
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-ifort_CICLAD.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-ifort_CICLAD.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-ifort_CICLAD.fcm	(revision 6606)
@@ -0,0 +1,16 @@
+%COMPILER            mpif90 
+%LINK                mpif90 
+%FPP                 mpif90 -E
+%AR                  ar
+%MAKE                gmake
+%FPP_FLAGS           -P
+%FPP_DEF             KEY_NONE CPP_NETCDF4
+%BASE_FFLAGS         -fPIC -i4 -r8 -auto -align all -I${MKLROOT}/include
+%PROD_FFLAGS         -g -traceback -O3
+%DEV_FFLAGS          -g -O1 -traceback
+%DEBUG_FFLAGS        -g -traceback -check bounds -fp-model strict
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp -openmp-threadprivate compat
+%BASE_LD             -fPIC -i4 -r8 -auto -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm
+%MPI_LD
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skd.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skd.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skd.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            gfortran 
+%LINK                gfortran
+%AR                  ar
+%MAKE                make
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE
+%BASE_FFLAGS         -I/home/sarvesh/LMDZS/netcdf-4.0.1/include -fdefault-real-8
+%PROD_FFLAGS         -O3 
+%DEV_FFLAGS          -p -g -O 
+%DEBUG_FFLAGS        -p -g  -fbacktrace -fbounds-check
+%MPI_FFLAGS
+%OMP_FFLAGS          -openmp
+%BASE_LD             -p  -L/home/sarvesh/LMDZS/netcdf-4.0.1/lib  -lnetcdf  -lblas -llapack
+%MPI_LD             
+%OMP_LD              -openmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skd.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skd.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skd.path	(revision 6606)
@@ -0,0 +1,9 @@
+#NETCDF_LIBDIR='/usr/lib -lnetcdf'
+#NETCDF_INCDIR='/usr/include'
+NETCDF_LIBDIR="-L /home/sarvesh/LMDZS/netcdf-4.0.1/lib"
+NETCDF_INCDIR="-I /home/sarvesh/LMDZS/netcdf-4.0.1/include"
+NETCDF_LIB="-lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skdmpi.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skdmpi.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skdmpi.fcm	(revision 6606)
@@ -0,0 +1,15 @@
+%COMPILER            mpif90 
+%LINK                mpif90
+%AR                  ar
+%MAKE                make
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             KEY_NONE
+%BASE_FFLAGS         -I/home/sarvesh/LMDZS/netcdf-4.0.1/include -fdefault-real-8
+%PROD_FFLAGS         -O3 
+%DEV_FFLAGS          -p -g -O 
+%DEBUG_FFLAGS        -p -g  -fbacktrace -fbounds-check
+%MPI_FFLAGS
+%OMP_FFLAGS          -fopenmp
+%BASE_LD             -p  -L/home/sarvesh/LMDZS/netcdf-4.0.1/lib  -lnetcdf  -lblas -llapack
+%MPI_LD             
+%OMP_LD              -fopenmp
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skdmpi.path
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skdmpi.path	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/arch/arch-x86_skdmpi.path	(revision 6606)
@@ -0,0 +1,9 @@
+#NETCDF_LIBDIR='/usr/lib -lnetcdf'
+#NETCDF_INCDIR='/usr/include'
+NETCDF_LIBDIR="-L /home/sarvesh/LMDZS/netcdf-4.0.1/lib"
+NETCDF_INCDIR="-I /home/sarvesh/LMDZS/netcdf-4.0.1/include"
+NETCDF_LIB="-lnetcdf"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bin/fcm_env.ksh
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bin/fcm_env.ksh	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bin/fcm_env.ksh	(revision 6606)
@@ -0,0 +1,1 @@
+link /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/fcm_env.ksh
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld.cfg
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld.cfg	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld.cfg	(revision 6606)
@@ -0,0 +1,83 @@
+# ----------------------- FCM extract configuration file -----------------------
+cfg::type                           bld
+cfg::version                        1.0
+
+
+# ------------------------------------------------------------------------------
+# Build information
+# ------------------------------------------------------------------------------
+
+inc arch.fcm
+inc config.fcm
+
+%FFLAGS           %BASE_FFLAGS %COMPIL_FFLAGS
+
+dir::root            $PWD
+
+# Do not scan source tree subdirectories
+search_src           0
+
+# source code directories
+src::src	     src
+src::phys            src/%PHYS
+
+bld::lib icosa_lmdz
+bld::target libicosa_lmdz.a icosa_lmdz.exe
+bld::exe_dep             
+
+bld::tool::fc        %COMPILER
+bld::tool::ld        %LINK  
+bld::tool::ldflags   %LD_FLAGS -Wl,--start-group -L../lib -licosa_lmdz -L $PWD/../DYNAMICO/lib -licosa -Wl,--end-group  -L $PWD/../LMDZ/config/lib -llmdz  %LIB 
+bld::tool::fflags    %FFLAGS -I $PWD/../DYNAMICO/inc -I$PWD/../LMDZ/config/inc -I $PWD/../XIOS/inc 
+bld::tool::fppkeys   %CPP_KEY %FPP_DEF
+bld::tool::fpp       %FPP
+bld::tool::fppflags  %FPP_FLAGS
+
+# Pre-process code before analysing dependencies
+bld::pp              1
+
+# external dependencies to not track
+bld::excl_dep        use::netcdf
+bld::excl_dep        use::omp_lib
+bld::excl_dep        inc::mpif.h
+bld::excl_dep        use::xios
+bld::excl_dep        use::icosa_init_mod
+bld::excl_dep        use::mod_phys_lmdz_omp_data
+bld::excl_dep        use::mod_grid_phy_lmdz
+bld::excl_dep        use::field_mod
+bld::excl_dep        use::domain_mod
+bld::excl_dep        use::dimensions
+bld::excl_dep        use::icosa
+bld::excl_dep        use::disvert_mod
+bld::excl_dep        use::earth_const
+bld::excl_dep        use::mpi_mod
+bld::excl_dep        use::mpipara
+bld::excl_dep        use::transfert_mod
+bld::excl_dep        use::xios_mod
+bld::excl_dep        use::time_mod
+bld::excl_dep        use::mod_phys_lmdz_omp_data
+bld::excl_dep        use::mod_phys_lmdz_para
+bld::excl_dep        use::time_phylmdz_mod
+bld::excl_dep        use::pression_mod
+bld::excl_dep        use::exner_mod
+bld::excl_dep        use::theta2theta_rhodz_mod
+bld::excl_dep        use::geopotential_mod
+bld::excl_dep        use::wind_mod
+bld::excl_dep        use::omp_para
+bld::excl_dep        use::physics_external_mod
+bld::excl_dep        use::trace
+bld::excl_dep        use::physics_distribution_mod
+bld::excl_dep        use::geometry_mod
+bld::excl_dep        use::vertical_layers_mod
+bld::excl_dep        use::infotrac_phy
+bld::excl_dep        use::inifis_mod 
+bld::excl_dep        use::physiq_mod
+bld::excl_dep        use::phyaqua_mod
+bld::excl_dep        use::wxios
+bld::excl_dep        use::write_field_mod
+bld::excl_dep        use::checksum_mod
+bld::excl_dep        use::vorticity_mod
+bld::excl_dep        use::nudging_mod
+bld::excl_dep        use::phystokenc_mod
+
+bld::tool::SHELL   /bin/bash
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/Makefile
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/Makefile	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/Makefile	(revision 6606)
@@ -0,0 +1,158 @@
+# Automatic Makefile
+
+FCM_BLD_CFG = /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ
+FCM_BLD_TARGETS = libicosa_lmdz.a icosa_lmdz.exe
+
+export PERL5LIB := /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../DYNAMICO/tools/FCM/lib
+
+export FCM_ROOTDIR = /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ
+export FCM_ROOTPATH = $(FCM_ROOTDIR)
+
+export FCM_BINDIR = $(FCM_ROOTDIR)/bin
+export FCM_BLDDIR = $(FCM_ROOTDIR)/bld
+export FCM_CACHEDIR = $(FCM_ROOTDIR)/.cache
+export FCM_CFGDIR = $(FCM_ROOTDIR)/cfg
+export FCM_DONEDIR = $(FCM_ROOTDIR)/done
+export FCM_ETCDIR = $(FCM_ROOTDIR)/etc
+export FCM_FLAGSDIR = $(FCM_ROOTDIR)/flags
+export FCM_INCDIR = $(FCM_ROOTDIR)/inc
+export FCM_LIBDIR = $(FCM_ROOTDIR)/lib
+export FCM_OBJDIR = $(FCM_ROOTDIR)/obj
+export FCM_PPSRCDIR = $(FCM_ROOTDIR)/ppsrc
+export FCM_SRCDIR = $(FCM_ROOTDIR)/src
+export FCM_TMPDIR = $(FCM_ROOTDIR)/tmp
+
+export FCM_BINPATH = $(FCM_BINDIR)
+export FCM_BLDPATH = $(FCM_BLDDIR)
+export FCM_CACHEPATH = $(FCM_CACHEDIR)
+export FCM_CFGPATH = $(FCM_CFGDIR)
+export FCM_DONEPATH = $(FCM_DONEDIR)
+export FCM_ETCPATH = $(FCM_ETCDIR)
+export FCM_FLAGSPATH = $(FCM_FLAGSDIR)
+export FCM_INCPATH = $(FCM_INCDIR)
+export FCM_LIBPATH = $(FCM_LIBDIR)
+export FCM_OBJPATH = $(FCM_OBJDIR)
+export FCM_PPSRCPATH = $(FCM_PPSRCDIR)
+export FCM_SRCPATH = $(FCM_SRCDIR)
+export FCM_TMPPATH = $(FCM_TMPDIR)
+
+export AR = ar
+export ARFLAGS = rs
+export CC = cc
+export CC_COMPILE = -c
+export CC_DEFINE = -D
+export CC_INCLUDE = -I
+export CC_OUTPUT = -o
+export CFLAGS = 
+export FC = mpif90
+export FC_COMPILE = -c
+export FC_DEFINE = -D
+export FC_INCLUDE = -I
+export FC_OUTPUT = -o
+export FFLAGS = -i4 -r8 -auto -align all -I/ccc/products/mkl-20.0.0/system/default/20.0.0/mkl/include -g -traceback -O3 -xAVX -qopenmp -I/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/inc -I/ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/include -I/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/include -I /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../DYNAMICO/inc -I/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../LMDZ/config/inc -I /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/inc
+export FPPKEYS = CPP_NONE CPP_USING_MPI CPP_USING_OMP INCA CPP_USING_XIOS KEY_NONE CPP_NETCDF4
+export LD = mpif90
+export LDFLAGS = -i4 -r8 -auto -L/ccc/products/mkl-20.0.0/system/default/20.0.0/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm  -qopenmp -Wl,--start-group -L../lib -licosa_lmdz -L /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../DYNAMICO/lib -licosa -Wl,--end-group  -L /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../LMDZ/config/lib -llmdz  -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../ORCHIDEE/lib -lorchidee -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../INCA/build/lib -lchimie -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/lib -lxios -lstdc++ -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../IOIPSL/lib -lioipsl -L/ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib -L/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib -lnetcdf -lnetcdff
+export LD_LIBLINK = -l
+export LD_LIBSEARCH = -L
+export LD_OUTPUT = -o
+export SHELL = /bin/bash
+
+export FCM_VERBOSE ?= 1
+
+vpath % $(FCM_BINPATH)
+vpath %.bash $(FCM_BINPATH)
+vpath %.csh $(FCM_BINPATH)
+vpath %.ksh $(FCM_BINPATH)
+vpath %.pl $(FCM_BINPATH)
+vpath %.pm $(FCM_BINPATH)
+vpath %.pro $(FCM_BINPATH)
+vpath %.py $(FCM_BINPATH)
+vpath %.sh $(FCM_BINPATH)
+vpath %.tcl $(FCM_BINPATH)
+vpath %.exe $(FCM_BINPATH)
+vpath %.mk $(FCM_BLDPATH)
+vpath %.done $(FCM_DONEPATH)
+vpath %.etc $(FCM_DONEPATH)
+vpath %.idone $(FCM_DONEPATH)
+vpath %.flags $(FCM_FLAGSPATH)
+vpath %.h $(FCM_INCPATH)
+vpath %.h90 $(FCM_INCPATH)
+vpath %.inc $(FCM_INCPATH)
+vpath %.interface $(FCM_INCPATH)
+vpath %.a $(FCM_LIBPATH)
+vpath %.o $(FCM_OBJPATH)
+vpath %.dummy $(FCM_DONEDIR)
+
+.PHONY : all clean
+
+all : $(FCM_BLD_TARGETS)
+
+clean : 
+	rm -rf $(FCM_BINDIR) $(FCM_LIBDIR) $(FCM_OBJDIR) $(FCM_DONEDIR)
+	rm -f lib__*.a *.o
+
+$(FCM_DONEDIR)/FCM_CP.dummy :
+	touch $@
+
+OBJECTS__src = distrib_icosa_lmdz_mod.o initialize_external_physics.o
+
+libsrc.a : $(OBJECTS__src)
+	fcm_internal archive $@ $^
+
+OBJECTS__phys = interface_icosa_lmdz_mod.o
+
+libphys.a : $(OBJECTS__phys)
+	fcm_internal archive $@ $^
+
+export OBJECTS = $(OBJECTS__src) $(OBJECTS__phys)
+
+libicosa_lmdz.a : $(OBJECTS)
+	fcm_internal archive $@ $^
+
+FC.flags :
+	touch $(FCM_FLAGSDIR)/$@
+
+FFLAGS.flags : FC.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+FFLAGS__phys.flags FFLAGS__src.flags : FFLAGS.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+CC.flags :
+	touch $(FCM_FLAGSDIR)/$@
+
+CFLAGS.flags : CC.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+CFLAGS__phys.flags CFLAGS__src.flags : CFLAGS.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+LD.flags :
+	touch $(FCM_FLAGSDIR)/$@
+
+LD__phys.flags LD__src.flags : LD.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+LDFLAGS.flags :
+	touch $(FCM_FLAGSDIR)/$@
+
+LDFLAGS__phys.flags LDFLAGS__src.flags : LDFLAGS.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+FPPKEYS.flags :
+	touch $(FCM_FLAGSDIR)/$@
+
+FPPKEYS__phys.flags FPPKEYS__src.flags : FPPKEYS.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+CPPKEYS.flags :
+	touch $(FCM_FLAGSDIR)/$@
+
+CPPKEYS__phys.flags CPPKEYS__src.flags : CPPKEYS.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+include $(FCM_BLDDIR)/phys.mk
+include $(FCM_BLDDIR)/src.mk
+
+# EOF
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/phys.mk
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/phys.mk	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/phys.mk	(revision 6606)
@@ -0,0 +1,18 @@
+# Automatic Make rule for phys
+
+SRCDIR0__phys = /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/src/phylmd
+
+PPSRCDIR0__phys = /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/ppsrc/phys
+
+interface_icosa_lmdz_mod.o : $(PPSRCDIR0__phys)/interface_icosa_lmdz.f90 \
+          FFLAGS__phys__interface_icosa_lmdz.flags \
+          distrib_icosa_lmdz_mod.o
+	fcm_internal compile:F phys $< $@
+
+FFLAGS__phys__interface_icosa_lmdz.flags : FFLAGS__phys.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+interface_icosa_lmdz_mod.done : interface_icosa_lmdz_mod.o \
+          distrib_icosa_lmdz_mod.done
+	touch $(FCM_DONEDIR)/$@
+
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/src.mk
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/src.mk	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/bld/src.mk	(revision 6606)
@@ -0,0 +1,49 @@
+# Automatic Make rule for src
+
+SRCDIR0__src = /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/src
+
+
+initialize_external_physics.o : $(SRCDIR0__src)/wrapper.f90 \
+          FFLAGS__src__wrapper.flags \
+          interface_icosa_lmdz_mod.o
+	fcm_internal compile:F src $< $@
+
+FFLAGS__src__wrapper.flags : FFLAGS__src.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+initialize_external_physics.done : initialize_external_physics.o \
+          interface_icosa_lmdz_mod.done
+	touch $(FCM_DONEDIR)/$@
+
+wrapper.interface : \
+          interface_icosa_lmdz_mod.o
+
+icosa_lmdz.o : $(SRCDIR0__src)/icosa_lmdz.f90 \
+          FFLAGS__src__icosa_lmdz.flags
+	fcm_internal compile:F src $< $@
+
+FFLAGS__src__icosa_lmdz.flags : FFLAGS__src.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+icosa_lmdz.exe : icosa_lmdz.o \
+          LD__src__icosa_lmdz.flags \
+          LDFLAGS__src__icosa_lmdz.flags \
+          $(OBJECTS)
+	fcm_internal load src $< $@
+
+LD__src__icosa_lmdz.flags : LD__src.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+LDFLAGS__src__icosa_lmdz.flags : LDFLAGS__src.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+distrib_icosa_lmdz_mod.o : $(SRCDIR0__src)/distrib_icosa_lmdz.f90 \
+          FFLAGS__src__distrib_icosa_lmdz.flags
+	fcm_internal compile:F src $< $@
+
+FFLAGS__src__distrib_icosa_lmdz.flags : FFLAGS__src.flags
+	touch $(FCM_FLAGSDIR)/$@
+
+distrib_icosa_lmdz_mod.done : distrib_icosa_lmdz_mod.o
+	touch $(FCM_DONEDIR)/$@
+
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/build
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/build	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/build	(revision 6606)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+export PATH=$PWD/../ICOSAGCM/tools/FCM/bin:$PATH
+fcm build  $*
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/clean
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/clean	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/clean	(revision 6606)
@@ -0,0 +1,12 @@
+rm -rf ./obj
+rm -rf ./done
+rm -rf ./inc
+rm -rf ./flags
+rm -rf ./ppsrc
+rm -rf ./bld
+rm -rf ./etc
+rm -rf ./lib
+rm -rf ./bin
+rm -rf ./.cache
+
+
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/compile
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/compile	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/compile	(revision 6606)
@@ -0,0 +1,1 @@
+make_icosa_lmdz -prod -parallel mpi_omp -p lmd -rrtm true -with_xios -arch X64_IRENE -arch_path ../ARCH -job 32 
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/config.fcm
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/config.fcm	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/config.fcm	(revision 6606)
@@ -0,0 +1,5 @@
+%COMPIL_FFLAGS %PROD_FFLAGS %OMP_FFLAGS -I/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/inc -I/ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/include -I/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/include
+%LD_FLAGS %BASE_LD %OMP_LD
+%CPP_KEY CPP_NONE CPP_USING_MPI CPP_USING_OMP INCA CPP_USING_XIOS
+%PHYS phylmd
+%LIB  -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../ORCHIDEE/lib -lorchidee -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../INCA/build/lib -lchimie -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../XIOS/lib -lxios -lstdc++ -L/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/../IOIPSL/lib -lioipsl -L/ccc/products/netcdf-c-4.7.4/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib -L/ccc/products/netcdf-fortran-4.5.3/intel--20.0.0__openmpi--4.0.1/hdf5__parallel/lib -lnetcdf -lnetcdff  
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/icosa_lmdz
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/icosa_lmdz	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/icosa_lmdz	(revision 6606)
@@ -0,0 +1,2 @@
+INC $HERE/libsrc.cfg
+INC $HERE/libphys.cfg
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/libphys.cfg
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/libphys.cfg	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/libphys.cfg	(revision 6606)
@@ -0,0 +1,1 @@
+EXCL_DEP OBJ::interface_icosa_lmdz
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/libsrc.cfg
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/libsrc.cfg	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/etc/libsrc.cfg	(revision 6606)
@@ -0,0 +1,3 @@
+EXCL_DEP USE::distrib_icosa_lmdz
+EXCL_DEP INTERFACE::wrapper.interface
+EXCL_DEP OBJ::wrapper
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/fcm_env.ksh
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/fcm_env.ksh	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/fcm_env.ksh	(revision 6606)
@@ -0,0 +1,3 @@
+#!/usr/bin/ksh
+export PATH=/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/bin:$PATH
+export FCM_ETCDIR=/ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/modeles/ICOSA_LMDZ/etc
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/inc/wrapper.interface
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/inc/wrapper.interface	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/inc/wrapper.interface	(revision 6606)
@@ -0,0 +1,8 @@
+INTERFACE
+SUBROUTINE initialize_external_physics
+END SUBROUTINE initialize_external_physics
+END INTERFACE
+INTERFACE
+SUBROUTINE external_physics
+END SUBROUTINE external_physics
+END INTERFACE
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/make_icosa_lmdz
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/make_icosa_lmdz	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/make_icosa_lmdz	(revision 6606)
@@ -0,0 +1,254 @@
+#!/bin/bash
+#set -x
+
+# Use FCM from DYNAMICO
+export PATH=$PWD/../DYNAMICO/tools/FCM/bin:$PATH
+export ROOT=$PWD
+
+echo $0 $* > rebuild_all
+chmod a+x rebuild_all
+
+compil_mode_defined="FALSE"
+compil_mode="prod"
+
+job=1
+full_defined="FALSE"
+with_xios_defined="TRUE"
+with_orchidee_defined="FALSE"
+with_inca_defined="FALSE"
+with_oasis_defined="FALSE"
+arch_defined="FALSE"
+parallel_defined="FALSE"
+arch_path="../ARCH"
+arch_default_path="arch"
+parallel="none"
+phys="none"
+build_deps="TRUE"
+CPP_KEY="CPP_NONE" 
+ICOSA_LIB=""
+rrtm="false"
+
+while (($# > 0))
+  do
+  case $1 in
+      "-h") cat <<fin
+Usage :
+makegcm [options] -m arch -p phys  exec
+[-h]                       : help
+[-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug .
+[-nodeps]                  : do not build dependencies (XIOS, IOIPSL, LMDZ, DYNAMICO must be compiled already)
+ -arch nom_arch            : nom de l\'architecture cible
+ -p phys                   : physics package (e.g. std , venus , ...)
+[-p_opt "options"]         : additional options for physics package
+fin
+	  exit;;
+
+      "-p")
+          phys=$2 ; shift ; shift ;;
+      
+      "-p_opt")
+          phys_opt=$2 ; shift ; shift ;;
+
+      "-rrtm")
+          rrtm=$2 ; shift ; shift ;;
+         
+      "-prod")
+	  compil_mode="prod" ; shift ;;
+
+      "-dev")
+	  compil_mode="dev" ; shift ;;
+
+      "-debug")
+	  compil_mode="debug" ; shift ;;
+
+      "-arch")
+	  arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
+ 
+      "-arch_path")
+	  arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
+
+      "-parallel")
+	  parallel=$2 ; parallel_defined="TRUE"; shift ; shift ;;
+
+      "-job")
+	  job=$2 ; shift ; shift;;
+
+      "-full")
+	  full_defined="TRUE" ; shift ;;
+
+      "-nodeps")
+	  build_deps="FALSE" ; shift ;;
+
+      "-with_xios")
+	  with_xios_defined="TRUE" ; shift ;;
+
+      "-with_orchidee")
+	  with_orchidee_defined="TRUE" ; shift ;;
+
+      "-with_inca")
+	  with_inca_defined="TRUE" ; shift ;;
+
+      "-with_oasis")
+      with_oasis_defined="TRUE" ; shift ;;
+
+
+      *)
+	  code="$1" ; shift ;;
+  esac
+done
+
+rm -f .void_file
+echo > .void_file
+rm -rf .void_dir
+mkdir .void_dir
+
+if [[ "$arch_defined" == "TRUE" ]]
+then
+  rm -f arch.path
+  rm -f arch.fcm
+  rm -f arch.env
+
+  if test -f $arch_path/arch-${arch}.path
+  then
+    ln -s $arch_path/arch-${arch}.path arch.path
+  elif test -f $arch_default_path/arch-${arch}.path
+  then
+    ln -s $arch_default_path/arch-${arch}.path arch.path
+  fi
+        
+  if test -f $arch_path/arch-${arch}.fcm
+  then
+    ln -s $arch_path/arch-${arch}.fcm arch.fcm
+  elif test -f $arch_default_path/arch-${arch}.fcm
+  then
+    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
+  fi
+
+  if test -f $arch_path/arch-${arch}.env
+  then
+    ln -s $arch_path/arch-${arch}.env arch.env
+  elif test -f $arch_default_path/arch-${arch}.env
+  then
+    ln -s $arch_default_path/arch-${arch}.env arch.env
+  else
+    ln -s .void_file arch.env
+  fi
+  source arch.env
+  source arch.path
+else
+  echo "Please define a target architecture"
+  exit 1
+fi
+
+LD_FLAGS="%BASE_LD"
+
+if [[ "$compil_mode" == "prod" ]]
+then
+  COMPIL_FFLAGS="%PROD_FFLAGS"
+elif [[ "$compil_mode" == "dev" ]]
+then
+  COMPIL_FFLAGS="%DEV_FFLAGS"
+elif [[ "$compil_mode" == "debug" ]]
+then
+  COMPIL_FFLAGS="%DEBUG_FFLAGS"
+fi
+
+if [[ "$parallel" == "mpi" ]]
+then
+  CPP_KEY="$CPP_KEY CPP_USING_MPI"
+elif [[ "$parallel" == "omp" ]]
+then
+  CPP_KEY="$CPP_KEY CPP_USING_OMP"
+  COMPIL_FFLAGS="$COMPIL_FFLAGS %OMP_FFLAGS"
+  LD_FLAGS="$LD_FLAGS %OMP_LD"
+elif [[ "$parallel" == "mpi_omp" ]]
+then
+  CPP_KEY="$CPP_KEY CPP_USING_MPI CPP_USING_OMP"
+  COMPIL_FFLAGS="$COMPIL_FFLAGS %OMP_FFLAGS"
+  LD_FLAGS="$LD_FLAGS %OMP_LD"
+elif [[ "$parallel" == "none" ]]
+then
+  parallel="none"
+else 
+  echo "-parallel value $parallel is invalid, only permited <none>, <mpi>, <omp> or <mpi_omp>"
+  exit 1
+fi
+
+if [[ "$with_orchidee_defined" == "TRUE" ]]
+then
+  ICOSA_LIB="$ICOSA_LIB $ORCHIDEE_LIBDIR $ORCHIDEE_LIB"
+fi  
+
+if [[ "$with_inca_defined" == "TRUE" ]]
+then
+  CPP_KEY="$CPP_KEY INCA"
+  ICOSA_LIB="$ICOSA_LIB $INCA_LIBDIR $INCA_LIB"
+fi 
+
+if [[ "$with_oasis_defined" == "TRUE" ]]
+then
+  ICOSA_LIB="$ICOSA_LIB $OASIS_LIBDIR $OASIS_LIB"
+fi
+
+
+if [[ "$with_xios_defined" == "TRUE" ]]
+then
+  CPP_KEY="$CPP_KEY CPP_USING_XIOS"
+  COMPIL_FFLAGS="$COMPIL_FFLAGS $XIOS_INCDIR"
+  ICOSA_LIB="$ICOSA_LIB $XIOS_LIBDIR $XIOS_LIB"
+fi  
+
+ICOSA_LIB="$ICOSA_LIB $IOIPSL_LIBDIR $IOIPSL_LIB $NETCDF_LIBDIR $NETCDF_LIB $HDF5_LIBDIR $HDF5_LIB"
+
+rm bin/*
+
+if [[ "$full_defined" == "TRUE" ]]
+then
+  full_flag="-full"
+  full_flag2="--full"
+else 
+  full_flag=""
+  full_flag2=""
+fi
+
+rm -f config.fcm
+
+echo "%COMPIL_FFLAGS $COMPIL_FFLAGS $NETCDF_INCDIR" >> config.fcm
+echo "%LD_FLAGS $LD_FLAGS" >> config.fcm
+echo "%CPP_KEY $CPP_KEY" >> config.fcm
+echo "%PHYS phy$phys" >> config.fcm
+echo "%LIB $ICOSA_LIB">> config.fcm
+
+if [[ "$build_deps" == "TRUE" ]]
+then
+
+    cd ../IOIPSL
+    ./makeioipsl_fcm -$compil_mode -parallel -arch $arch -arch_path $arch_path -j $job $full_flag  || exit 1
+    cd -
+
+    cd ../XIOS
+    ./make_xios --$compil_mode --arch $arch --arch_path $arch_path --job $job $full_flag2 || exit 1
+    cd -
+
+    if [[ "$with_orchidee_defined" == "TRUE" ]]
+    then
+	cd ../ORCHIDEE
+	./makeorchidee_fcm -$compil_mode -parallel $parallel -xios2 -arch $arch -arch_path $arch_path -j $job $full_flag  || exit 1
+	cd -
+    fi
+
+    cd ../LMDZ
+    lmdz_veget="false"
+    if [[ "$with_orchidee_defined" == "TRUE" ]]
+    then
+	lmdz_veget="orchidee2.0 -cpp ORCHIDEE_NOZ0H"
+    fi
+    ./makelmdz_fcm -p $phys $phys_opt -rrtm $rrtm -$compil_mode -mem -parallel $parallel -libphy -io xios -v $lmdz_veget -arch $arch -arch_path $arch_path -j $job $full_flag || exit 1
+    cd -
+
+    cd ../DYNAMICO
+    ./make_icosa -$compil_mode -parallel $parallel -external_ioipsl -with_xios -arch $arch -arch_path $arch_path -job $job $full_flag || exit 1
+    cd -
+fi
+
+./build --job $job $full_flag2
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/ppsrc/phys/interface_icosa_lmdz.f90
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/ppsrc/phys/interface_icosa_lmdz.f90	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/ppsrc/phys/interface_icosa_lmdz.f90	(revision 6606)
@@ -0,0 +1,1157 @@
+MODULE interface_icosa_lmdz_mod
+
+  USE field_mod, ONLY: t_field
+  USE transfert_mod, ONLY: t_message 
+  
+ 
+  TYPE(t_message),SAVE :: req_u, req_z
+  TYPE(t_message),SAVE :: req_dps0, req_dulon0, req_dulat0, req_dTemp0, req_dq0
+
+  TYPE(t_field),POINTER,SAVE :: f_p(:) 
+  TYPE(t_field),POINTER,SAVE :: f_pks(:)  
+  TYPE(t_field),POINTER,SAVE :: f_pk(:)  
+  TYPE(t_field),POINTER,SAVE :: f_p_layer(:)    
+  TYPE(t_field),POINTER,SAVE :: f_theta(:)   
+  TYPE(t_field),POINTER,SAVE :: f_phi(:)   
+  TYPE(t_field),POINTER,SAVE :: f_Temp(:)    
+  TYPE(t_field),POINTER,SAVE :: f_ulon(:)    
+  TYPE(t_field),POINTER,SAVE :: f_ulat(:)   
+  TYPE(t_field),POINTER,SAVE :: f_vort(:)   
+  TYPE(t_field),POINTER,SAVE :: f_vortc(:)   
+  TYPE(t_field),POINTER,SAVE :: f_dulon(:)
+  TYPE(t_field),POINTER,SAVE :: f_dulat(:)
+  TYPE(t_field),POINTER,SAVE :: f_dTemp(:)
+  TYPE(t_field),POINTER,SAVE :: f_dq(:)
+  TYPE(t_field),POINTER,SAVE :: f_dps(:)
+  TYPE(t_field),POINTER,SAVE :: f_duc(:)
+  TYPE(t_field),POINTER,SAVE :: f_bounds_lon(:)
+  TYPE(t_field),POINTER,SAVE :: f_bounds_lat(:)
+
+  INTEGER :: start_clock
+  INTEGER :: stop_clock
+  INTEGER :: count_clock=0
+  
+  INTEGER,SAVE :: nbp_phys
+  INTEGER,SAVE :: nbp_phys_glo
+
+
+CONTAINS
+
+  SUBROUTINE initialize_physics
+  USE distrib_icosa_lmdz_mod, ONLY : init_distrib_icosa_lmdz, transfer_icosa_to_lmdz
+! from dynamico
+  USE domain_mod
+  USE dimensions
+  USE mpi_mod
+  USE mpipara
+  USE disvert_mod
+  USE xios_mod
+  USE time_mod , init_time_icosa=> init_time 
+  USE transfert_mod
+  USE nudging_mod, ONLY : lam_halo_scheme
+  
+! from LMDZ
+  USE mod_grid_phy_lmdz, ONLY : unstructured
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE transfert_mod
+  USE physics_distribution_mod, ONLY : init_physics_distribution
+   
+  
+  IMPLICIT NONE
+  INTEGER  :: ind,i,j,ij,pos,h
+  REAL(rstd),POINTER :: bounds_lon(:,:)
+  REAL(rstd),POINTER :: bounds_lat(:,:)
+  
+  REAL(rstd),ALLOCATABLE :: latfi(:)
+  REAL(rstd),ALLOCATABLE :: lonfi(:)
+  REAL(rstd),ALLOCATABLE :: airefi(:)
+  REAL(rstd),ALLOCATABLE :: bounds_latfi(:,:)
+  REAL(rstd),ALLOCATABLE :: bounds_lonfi(:,:)
+  LOGICAL   ,ALLOCATABLE :: outside(:,:)
+  LOGICAL   ,ALLOCATABLE :: outside_tmp(:,:)
+  LOGICAL   ,POINTER     :: out(:,:)
+!  REAL(rstd) :: pseudoalt(llm)
+
+  INTEGER :: nbp_phys, nbp_phys_glo
+  
+!$OMP PARALLEL
+    CALL allocate_field(f_bounds_lon,field_t,type_real,6)
+    CALL allocate_field(f_bounds_lat,field_t,type_real,6)
+    CALL allocate_field(f_p,field_t,type_real,llm+1,name="p_in")
+    CALL allocate_field(f_pks,field_t,type_real)
+    CALL allocate_field(f_pk,field_t,type_real,llm)
+    CALL allocate_field(f_p_layer,field_t,type_real,llm,name="p_layer_in")
+    CALL allocate_field(f_theta,field_t,type_real,llm)
+    CALL allocate_field(f_phi,field_t,type_real,llm,name="phi_in")
+    CALL allocate_field(f_Temp,field_t,type_real,llm,name="Temp_in")
+    CALL allocate_field(f_ulon,field_t,type_real,llm,name="ulon_in")
+    CALL allocate_field(f_ulat,field_t,type_real,llm,name="ulat_in")
+    CALL allocate_field(f_vort,field_z,type_real,llm,name="vort_in")
+    CALL allocate_field(f_vortc,field_t,type_real,llm,name="vortc_in")
+    CALL allocate_field(f_dulon,field_t,type_real,llm,name="dulon_out")
+    CALL allocate_field(f_dulat,field_t,type_real,llm,name="dulat_out")
+    CALL allocate_field(f_dTemp,field_t,type_real,llm,name="dTemp_out")
+    CALL allocate_field(f_dq,field_t,type_real,llm,nqtot,name="dq_out")
+    CALL allocate_field(f_dps,field_t,type_real,name="dps_out")
+    CALL allocate_field(f_duc,field_t,type_real,3,llm)    
+
+    CALL init_message(f_dps,req_i0,req_dps0)
+    CALL init_message(f_dulon,req_i0,req_dulon0)
+    CALL init_message(f_dulat,req_i0,req_dulat0)
+    CALL init_message(f_dTemp,req_i0,req_dTemp0)
+    CALL init_message(f_dq,req_i0,req_dq0)
+!$OMP END PARALLEL
+
+    nbp_phys=0
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+
+      ALLOCATE(outside(ii_begin:ii_end,jj_begin:jj_end)) ! for limited area : don't take cells arround the border
+      ALLOCATE(outside_tmp(ii_begin-1:ii_end+1,jj_begin-1:jj_end+1)) ! for limited area : don't take cells arround the border
+      out=>domain(ind)%outside
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          outside(i,j)=  out(i+1,j)     .OR. & ! right
+                         out(i,j+1    ) .OR. & ! rup
+                         out(i-1  ,j+1) .OR. & ! lup
+                         out(i-1  ,j)   .OR. & !left
+                         out(i    ,j-1) .OR. & !ldown
+                         out(i+1,j-1)          !rdown
+        ENDDO
+      ENDDO
+
+      outside_tmp=.FALSE.
+      outside_tmp(ii_begin:ii_end,jj_begin:jj_end)=outside
+      
+      DO h=1,lam_halo_scheme-1 ! do not compute physic on limited area halo
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+              outside(i,j) = outside_tmp(i,j)       .OR. &
+                             outside_tmp(i+1,j)     .OR. & ! right
+                             outside_tmp(i,j+1    ) .OR. & ! rup
+                             outside_tmp(i-1  ,j+1) .OR. & ! lup
+                             outside_tmp(i-1  ,j)   .OR. & !left
+                             outside_tmp(i    ,j-1) .OR. & !ldown
+                             outside_tmp(i+1,j-1)          !rdown
+           ENDDO
+        ENDDO
+        outside_tmp(ii_begin:ii_end,jj_begin:jj_end)=outside
+      ENDDO
+      
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          IF (domain(ind)%own(i,j) .AND. .NOT.outside(i,j)) nbp_phys=nbp_phys+1
+        ENDDO
+      ENDDO
+      DEALLOCATE(outside)
+      DEALLOCATE(outside_tmp)
+    ENDDO
+    
+
+!initialize LMDZ5 physic mpi decomposition
+    CALL MPI_ALLREDUCE(nbp_phys,nbp_phys_glo,1,MPI_INTEGER,MPI_SUM,comm_icosa,ierr)
+    CALL init_physics_distribution(unstructured, 6, nbp_phys, 1, nbp_phys_glo, llm, comm_icosa)
+    
+    DO ind=1,ndomain
+        CALL swap_dimensions(ind)
+        CALL swap_geometry(ind)
+        bounds_lon=f_bounds_lon(ind)
+        bounds_lat=f_bounds_lat(ind)
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            CALL xyz2lonlat(xyz_v(ij+z_rup,:), bounds_lon(ij,1), bounds_lat(ij,1))
+            CALL xyz2lonlat(xyz_v(ij+z_up,:), bounds_lon(ij,2), bounds_lat(ij,2))
+            CALL xyz2lonlat(xyz_v(ij+z_lup,:), bounds_lon(ij,3), bounds_lat(ij,3))
+            CALL xyz2lonlat(xyz_v(ij+z_ldown,:), bounds_lon(ij,4), bounds_lat(ij,4))
+            CALL xyz2lonlat(xyz_v(ij+z_down,:), bounds_lon(ij,5), bounds_lat(ij,5))
+            CALL xyz2lonlat(xyz_v(ij+z_rdown,:), bounds_lon(ij,6), bounds_lat(ij,6))
+         ENDDO
+       ENDDO            
+    ENDDO
+          
+!$OMP PARALLEL
+    CALL initialize_physics_omp
+!$OMP END PARALLEL
+
+    CALL xios_set_context    
+
+
+     
+
+  END SUBROUTINE initialize_physics
+
+
+  SUBROUTINE initialize_physics_omp
+  USE distrib_icosa_lmdz_mod, ONLY : init_distrib_icosa_lmdz, transfer_icosa_to_lmdz
+! from dynamico
+  USE domain_mod
+  USE dimensions
+  USE mpi_mod
+  USE mpipara
+  USE disvert_mod
+  USE earth_const, ONLY: scale_height
+  USE xios_mod
+  USE time_mod , init_time_icosa=> init_time 
+  USE omp_para
+
+! from LMDZ
+  USE mod_grid_phy_lmdz, ONLY : unstructured, klon_glo
+  USE mod_phys_lmdz_para, ONLY: klon_omp, reduce_min_lmdz => reduce_min , gather_lmdz => gather , bcast_lmdz => bcast
+  USE time_phylmdz_mod, ONLY: init_time_lmdz => init_time
+  USE transfert_mod
+!  USE physics_distribution_mod, ONLY : init_physics_distribution
+  USE geometry_mod, ONLY : init_geometry
+  USE vertical_layers_mod, ONLY : init_vertical_layers
+  USE infotrac_phy, ONLY : init_infotrac_phy
+  USE inifis_mod, ONLY : inifis 
+!  USE phyaqua_mod, ONLY : iniaqua
+
+
+  
+  IMPLICIT NONE
+
+
+
+  INTEGER  :: ind,i,j,k,ij,pos
+  REAL(rstd),POINTER :: bounds_lon(:,:)
+  REAL(rstd),POINTER :: bounds_lat(:,:)
+  
+  REAL(rstd),ALLOCATABLE :: latfi(:)
+  REAL(rstd),ALLOCATABLE :: lonfi(:)
+  REAL(rstd),ALLOCATABLE :: airefi(:)
+  REAL(rstd),ALLOCATABLE :: bounds_latfi(:,:)
+  REAL(rstd),ALLOCATABLE :: bounds_lonfi(:,:)
+  REAL(rstd),ALLOCATABLE :: ind_cell_glo_r(:)
+  INTEGER,   ALLOCATABLE :: ind_cell_glo(:)
+  INTEGER,   ALLOCATABLE :: ind_cell_glo_tot(:)
+  INTEGER,   ALLOCATABLE :: cell_glo_tot(:)
+  INTEGER :: ncell_glo_tot
+
+  REAL(rstd) :: pseudoalt(llm)
+  REAL(rstd) :: aps(llm)
+  REAL(rstd) :: bps(llm)
+  REAL(rstd) :: scaleheight
+
+  INTEGER :: run_length  
+  REAL :: day_length ! length of a day (s) ! SAVEd to be OpenMP shared <--- NO!!!!
+  INTEGER :: annee_ref  
+  INTEGER :: day_ref    
+  INTEGER :: day_ini    
+  REAL    :: start_time 
+  REAL    :: physics_timestep    
+
+! Tracer stuff (SAVEd when needed to be OpenMP shared)
+  INTEGER :: nq
+  INTEGER                       :: nqo, nbtr, nbtr_inca
+  CHARACTER(len=4)              :: type_trac
+  CHARACTER(len=20),ALLOCATABLE :: tname(:)    ! tracer short name for restart and diagnostics
+  CHARACTER(len=23),ALLOCATABLE :: ttext(:)     ! tracer long name for diagnostics
+  INTEGER,ALLOCATABLE           :: niadv(:)    ! equivalent dyn / physique
+  INTEGER,ALLOCATABLE           :: conv_flg(:) ! conv_flg(it)=0 : convection desactivated for tracer number it
+  INTEGER,ALLOCATABLE           :: pbl_flg(:)  ! pbl_flg(it)=0  : boundary layer diffusion desactivaded for tracer number it
+  CHARACTER(len=8),ALLOCATABLE  :: solsym(:)  ! tracer name from inca
+! Isotopes
+  INTEGER,ALLOCATABLE :: nqfils(:)
+  INTEGER,ALLOCATABLE :: nqdesc(:)
+  INTEGER :: nqdesc_tot
+  INTEGER,ALLOCATABLE :: iqfils(:,:)
+  INTEGER,ALLOCATABLE :: iqpere(:)
+  LOGICAL :: ok_isotopes
+  LOGICAL :: ok_iso_verif
+  LOGICAL :: ok_isotrac
+  LOGICAL :: ok_init_iso
+  INTEGER :: niso_possibles
+  REAL,ALLOCATABLE :: tnat(:)
+  REAL,ALLOCATABLE :: alpha_ideal(:)
+  LOGICAL,ALLOCATABLE :: use_iso(:)
+  INTEGER,ALLOCATABLE :: iqiso(:,:)
+  INTEGER,ALLOCATABLE :: iso_num(:)
+  INTEGER,ALLOCATABLE :: iso_indnum(:)
+  INTEGER,ALLOCATABLE :: zone_num(:)
+  INTEGER,ALLOCATABLE :: phase_num(:)
+  INTEGER,ALLOCATABLE :: indnum_fn_num(:)
+  INTEGER,ALLOCATABLE :: index_trac(:,:)
+  INTEGER :: niso
+  INTEGER :: ntraceurs_zone
+  INTEGER :: ntraciso
+
+  TYPE(t_field),POINTER,SAVE    :: f_ind_cell_glo(:)
+  
+  INTEGER :: iflag_phys    
+
+  INTEGER, ALLOCATABLE, DIMENSION(:) :: hadv_inca  ! index of horizontal trasport schema
+  INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv_inca  ! index of vertical trasport schema
+! LLORET
+  LOGICAL :: offline
+
+    CALL init_distrib_icosa_lmdz
+    
+    ALLOCATE(latfi(klon_omp))
+    ALLOCATE(lonfi(klon_omp))
+    ALLOCATE(airefi(klon_omp))
+    ALLOCATE(bounds_latfi(klon_omp,6))
+    ALLOCATE(bounds_lonfi(klon_omp,6))
+    ALLOCATE(ind_cell_glo_r(klon_omp))
+    ALLOCATE(ind_cell_glo(klon_omp))
+
+    CALL transfer_icosa_to_lmdz(geom%lat_i,latfi)
+    CALL transfer_icosa_to_lmdz(geom%lon_i,lonfi)
+    CALL transfer_icosa_to_lmdz(f_bounds_lat,bounds_latfi)
+    CALL transfer_icosa_to_lmdz(f_bounds_lon,bounds_lonfi)
+    CALL transfer_icosa_to_lmdz(geom%Ai,airefi)
+
+    CALL allocate_field(f_ind_cell_glo,field_t,type_real)
+    
+    DO ind=1,ndomain
+      IF (.NOT. assigned_domain(ind)  .OR. .NOT. is_omp_level_master ) CYCLE
+      CALL swap_dimensions(ind)
+      CALL swap_geometry(ind)
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          f_ind_cell_glo(ind)%rval2d(ij)=domain(ind)%assign_cell_glo(i,j)
+        ENDDO
+      ENDDO
+    ENDDO
+
+     
+   CALL transfer_icosa_to_lmdz(f_ind_cell_glo,ind_cell_glo_r)
+   CALL deallocate_field(f_ind_cell_glo)
+   ind_cell_glo=INT(ind_cell_glo_r)
+   DEALLOCATE(ind_cell_glo_r)   
+   
+    
+   CALL reduce_min_lmdz(MINVAL(-ind_cell_glo),ncell_glo_tot) ! reduce_max does not exist in lmdz, use reduce_min
+   CALL bcast_lmdz(ncell_glo_tot)
+   ncell_glo_tot=-ncell_glo_tot
+   ALLOCATE(cell_glo_tot(0:ncell_glo_tot))
+   ALLOCATE(ind_cell_glo_tot(klon_glo))
+   CALL gather_lmdz(ind_cell_glo,ind_cell_glo_tot)
+   CALL bcast_lmdz(ind_cell_glo_tot)
+   
+   cell_glo_tot=-1
+   DO i=1,klon_glo
+     cell_glo_tot(ind_cell_glo_tot(i))= 0
+   ENDDO
+   
+   pos=0
+   DO i=0,ncell_glo_tot
+     IF (cell_glo_tot(i)/=-1) THEN
+       cell_glo_tot(i) = pos
+       pos=pos + 1
+     ENDIF
+   ENDDO
+
+   DO i=1,klon_omp
+     ind_cell_glo(i)=cell_glo_tot(ind_cell_glo(i))
+   ENDDO  
+
+   ind_cell_glo = ind_cell_glo + 1 ! lmdz expect global indices begining to 1 not 0
+ 
+   
+!   CALL MPI_ALLGATHER(ncell,1,MPI_INTEGER,ncell_mpi,1,MPI_INTEGER,comm_icosa,ierr)
+!
+!   displ(0)=0
+!   DO i=1,mpi_size-1
+!     displ(i)=displ(i-1)+ncell_mpi(i-1)
+!   ENDDO
+!
+!   ALLOCATE(ind_glo_tot(ncell_tot))
+!   ALLOCATE(cell_glo_tot(0:ncell_glo_tot-1))
+!
+!   cell_glo_tot(:)= -1
+!   CALL MPI_ALLGATHERV(ind_glo, ncell, MPI_INTEGER, ind_glo_tot, ncell_mpi, displ, MPI_INTEGER, comm_icosa,ierr)
+!
+!   DO i=1,ncell_tot
+!     cell_glo_tot(ind_glo_tot(i))= 0
+!   ENDDO
+!
+!   ncell_glo=0
+!   DO i=0,ncell_glo_tot-1
+!     IF (cell_glo_tot(i)/=-1) THEN
+!       cell_glo_tot(i) = ncell_glo
+!       ncell_glo=ncell_glo + 1
+!     ENDIF
+!   ENDDO
+!
+!   DO i=1,ncell
+!     ind_glo(i)=cell_glo_tot(ind_glo(i))
+!   ENDDO
+
+              
+    CALL init_geometry(klon_omp,lonfi, latfi, bounds_lonfi, bounds_latfi, airefi, ind_cell_glo)
+
+    scaleheight=scale_height/1000. ! Atmospheric scale height (km)
+    aps(1:llm)=0.5*(ap(1:llm)+ap(2:llm+1))
+    bps(1:llm)=0.5*(bp(1:llm)+bp(2:llm+1))
+    pseudoalt(:)=-scaleheight*log(presnivs(:)/preff)
+    CALL init_vertical_layers(llm,preff,scaleheight,ap,bp,aps,bps,presnivs,pseudoalt)
+
+
+! Initialize tracer names, numbers, etc. for physics
+!Config  Key  = type_trac
+!Config  Desc = Choix de couplage avec model de chimie 1 ou REPROBUS
+!Config  Def  = lmdz
+!Config  Help =
+!Config         'lmdz' = pas de couplage, pur LMDZ
+!Config         'inca' = model de chime 1
+!Config         'repr' = model de chime REPROBUS
+     type_trac = 'lmdz'
+     CALL getin('type_trac',type_trac)
+
+! allocate some of the tracer arrays
+    ALLOCATE(tname(nqtot))
+    ALLOCATE(ttext(nqtot))
+    ALLOCATE(niadv(nqtot))
+
+! read "traceur.def" file to know tracer names (and figure out nqo and nbtr)
+
+    IF (type_trac .eq. "lmdz") THEN 
+       IF (is_mpi_root) THEN
+!$OMP MASTER
+          OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr)
+          IF (ierr==0) THEN
+             READ(42,*) nq ! should be the same as nqtot
+             IF (nq /= nqtot) THEN
+                WRITE(*,*) "Error: number of tracers in tracer.def should match nqtot!"
+                WRITE(*,*) "       will just use nqtot=",nqtot," tracers"
+             ENDIF
+             DO i=1,nqtot
+                READ(42,*) j,k,tname(i)
+             ENDDO
+             CLOSE(42)
+          ENDIF
+! figure out how many water tracers are present
+          nqo=0
+          DO i=1,nqtot
+             IF (INDEX(tname(i),"H2O")==1) THEN
+                nqo=nqo+1
+             ENDIF
+          ENDDO
+          nbtr=nqtot-nqo
+!$OMP END MASTER
+       ENDIF
+ 
+    ELSE IF (type_trac .eq. "inca" ) THEN 
+
+       IF (is_mpi_root) THEN
+!$OMP MASTER
+! figure out how many water tracers are present
+          OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr)
+          IF (ierr==0) THEN
+             READ(42,*) nq ! nombre de traceurs d'eau 2 ou 3
+             DO i=1,nq
+                READ(42,*) j,k,tname(i)
+             ENDDO
+             CLOSE(42)
+          ENDIF
+! figure out how many others tracers are present
+
+          CALL  Init_chem_trac()
+
+          
+          IF ((nq + nbtr) .NE. nqtot) THEN
+             WRITE(*,*) "Error: number of tracers in tracer.def and inca should match nqtot!"
+             WRITE(*,*) "       will just use nqtot=",nqtot," tracers and not ", nq , " + ", nbtr 
+          ENDIF
+          
+          nqo = nq
+!$OMP END MASTER
+
+       ENDIF
+
+    ENDIF
+
+
+    CALL bcast(nqo)
+    CALL bcast(nbtr)
+    IF (type_trac .EQ. "lmdz") THEN 
+       DO i=1,nqtot
+          CALL bcast(tname(i))
+       ENDDO
+    ELSE IF (type_trac .EQ. "inca") THEN 
+       DO i=1,nqo
+          CALL bcast(tname(i))
+       ENDDO
+    ENDIF
+
+    ALLOCATE(conv_flg(nbtr))
+    ALLOCATE(pbl_flg(nbtr))
+    ALLOCATE(solsym(nbtr))
+    ALLOCATE(hadv_inca(nbtr))
+    ALLOCATE(vadv_inca(nbtr)) 
+    
+    conv_flg(:) = 1 ! convection activated for all tracers
+    pbl_flg(:)  = 1 ! boundary layer activated for all tracers
+! tracer long names:
+    ttext(1)=trim(tname(1))//"VLH" !'H2OvVLH'
+    DO i=2,nqtot
+      ttext(i)=trim(tname(1))//"VL1"
+    ENDDO
+
+    IF (type_trac .EQ. "lmdz") THEN 
+       solsym(1:nbtr)=tname(nqo+1:nqtot)
+    ELSE IF (type_trac .EQ. "inca") THEN 
+       CALL init_chem_transport()
+    ENDIF
+
+
+    DO i=1,nqtot
+      niadv(i)=i
+    ENDDO
+
+! isotopes
+    ALLOCATE(nqfils(nqtot)) ; nqfils(:)=0
+    ALLOCATE(nqdesc(nqtot)) ; nqdesc(:)=0
+    nqdesc_tot=0
+    ALLOCATE(iqfils(nqtot,nqtot)) ; iqfils(:,:)=0
+    ALLOCATE(iqpere(nqtot)) ; iqpere(:)=0
+    ok_isotopes=.false.
+    ok_iso_verif=.false.
+    ok_isotrac=.false.
+    ok_init_iso=.false.
+    niso_possibles=5
+    niso=0
+    ntraceurs_zone=0
+    ntraciso=0
+    ALLOCATE(tnat(niso_possibles)) ; tnat(:)=0
+    ALLOCATE(alpha_ideal(niso_possibles)) ; alpha_ideal(:)=0
+    ALLOCATE(use_iso(niso_possibles)) ; use_iso(:)=.false.
+    ALLOCATE(iqiso(ntraciso,nqo)) ; iqiso(:,:)=0
+    ALLOCATE(iso_num(nqtot)) ; iso_num(:)=0
+    ALLOCATE(iso_indnum(nqtot)) ; iso_indnum(:)=0
+    ALLOCATE(zone_num(nqtot)) ; zone_num(:)=0
+    ALLOCATE(phase_num(nqtot)) ; phase_num(:)=0
+    ALLOCATE(indnum_fn_num(niso_possibles)) ; indnum_fn_num(:)=0
+    ALLOCATE(index_trac(ntraceurs_zone,niso)) ; index_trac(:,:)=0
+        
+    CALL init_infotrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,&
+                           niadv,conv_flg,pbl_flg,solsym, &
+                           nqfils,nqdesc,nqdesc_tot,iqfils,iqpere, &
+                           ok_isotopes,ok_iso_verif,ok_isotrac, &
+                           ok_init_iso,niso_possibles,tnat, &
+                           alpha_ideal,use_iso,iqiso,iso_num, &
+                           iso_indnum,zone_num,phase_num, &
+                           indnum_fn_num,index_trac, &
+                           niso,ntraceurs_zone,ntraciso)
+
+! Initialize physical constant
+    day_length=86400
+    CALL getin('day_length',day_length)
+    CALL inifis(day_length,radius,g,kappa*cpp,cpp)
+ 
+
+    
+! init time
+    annee_ref=2015
+    CALL getin("anneeref",annee_ref)
+    
+    day_ref=1
+    CALL getin("dayref",day_ref)
+    
+    physics_timestep=dt*itau_physics
+    run_length=itaumax*dt
+    ndays=NINT(run_length/day_length)
+    
+    day_ini=INT(itau0*dt/day_length)+day_ref
+    start_time= itau0*dt/day_length-INT(itau0*dt/day_length)
+
+    CALL init_time_lmdz(annee_ref, day_ref, day_ini, start_time, int(ndays), physics_timestep)
+
+!  Additional initializations for aquaplanets
+!    CALL getin("iflag_phys",iflag_phys)
+!    IF (iflag_phys>=100) THEN
+!      CALL iniaqua(klon_omp, iflag_phys)
+!    END IF
+
+  
+
+
+    CONTAINS 
+
+      SUBROUTINE init_chem_trac() 
+        IMPLICIT NONE
+
+        CALL  Init_chem_inca_trac(nbtr)
+
+      END SUBROUTINE init_chem_trac
+
+      SUBROUTINE init_chem_transport()
+
+        IMPLICIT NONE
+
+        CALL init_transport(solsym, conv_flg,pbl_flg, hadv_inca, vadv_inca)
+
+      END SUBROUTINE init_chem_transport
+
+
+
+
+
+
+  END SUBROUTINE  initialize_physics_omp 
+  
+  
+
+
+  SUBROUTINE physics
+  USE icosa
+  USE time_mod
+  USE disvert_mod
+  USE transfert_mod
+  USE mpipara
+  USE xios_mod
+  USE wxios
+  USE trace
+  USE distrib_icosa_lmdz_mod, ONLY : transfer_icosa_to_lmdz, transfer_lmdz_to_icosa
+  USE physics_external_mod, ONLY : it, f_phis, f_ps, f_theta_rhodz, f_u, f_wflux, f_q 
+  USE write_field_mod
+  USE checksum_mod
+  USE vorticity_mod
+
+! from LMDZ
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE geometry_mod, ONLY : cell_area
+  USE physiq_mod, ONLY: physiq
+  IMPLICIT NONE
+  
+    REAL(rstd),POINTER :: phis(:)
+    REAL(rstd),POINTER :: ps(:)
+    REAL(rstd),POINTER :: theta_rhodz(:,:,:)
+    REAL(rstd),POINTER :: u(:,:)
+    REAL(rstd),POINTER :: wflux(:,:)
+    REAL(rstd),POINTER :: q(:,:,:)
+    REAL(rstd),POINTER :: p(:,:)
+    REAL(rstd),POINTER :: pks(:)
+    REAL(rstd),POINTER :: pk(:,:)
+    REAL(rstd),POINTER :: p_layer(:,:)
+    REAL(rstd),POINTER :: theta(:,:)
+    REAL(rstd),POINTER :: phi(:,:)
+    REAL(rstd),POINTER :: Temp(:,:)
+    REAL(rstd),POINTER :: ulon(:,:)
+    REAL(rstd),POINTER :: ulat(:,:)
+    REAL(rstd),POINTER :: vort(:,:)
+    REAL(rstd),POINTER :: vortc(:,:)
+    REAL(rstd),POINTER :: dulon(:,:)
+    REAL(rstd),POINTER :: dulat(:,:)
+    REAL(rstd),POINTER :: dTemp(:,:)
+    REAL(rstd),POINTER :: dq(:,:,:)
+    REAL(rstd),POINTER :: dps(:)
+    REAL(rstd),POINTER :: duc(:,:,:)
+
+
+    INTEGER :: ind,l
+    
+    REAL(rstd),ALLOCATABLE,SAVE :: ps_phy(:)
+!$OMP THREADPRIVATE(ps_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: p_phy(:,:)
+!$OMP THREADPRIVATE(p_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: p_layer_phy(:,:)
+!$OMP THREADPRIVATE(p_layer_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: Temp_phy(:,:)
+!$OMP THREADPRIVATE(Temp_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: phis_phy(:)
+!$OMP THREADPRIVATE(phis_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: phi_phy(:,:)
+!$OMP THREADPRIVATE(phi_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: ulon_phy(:,:)
+!$OMP THREADPRIVATE(ulon_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: ulat_phy(:,:)
+!$OMP THREADPRIVATE(ulat_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: rot_phy(:,:)
+!$OMP THREADPRIVATE(rot_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: q_phy(:,:,:)
+!$OMP THREADPRIVATE(q_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: wflux_phy(:,:)
+!$OMP THREADPRIVATE(wflux_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dulon_phy(:,:)
+!$OMP THREADPRIVATE(dulon_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dulat_phy(:,:)
+!$OMP THREADPRIVATE(dulat_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dTemp_phy(:,:)
+!$OMP THREADPRIVATE(dTemp_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dq_phy(:,:,:)
+!$OMP THREADPRIVATE(dq_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dps_phy(:)
+!$OMP THREADPRIVATE(dps_phy)
+    REAL(rstd)   :: dtphy 
+    LOGICAL      :: debut
+    LOGICAL      :: lafin
+    LOGICAL,SAVE :: first=.TRUE.
+!$OMP THREADPRIVATE(first)
+
+    
+    IF(first) THEN 
+      debut=.TRUE.
+    ELSE 
+      debut=.FALSE.
+    ENDIF
+
+
+    IF(it-itau0>=itaumax) THEN 
+      lafin=.TRUE.
+    ELSE 
+      lafin=.FALSE.
+    ENDIF
+
+    IF (first) THEN
+      first=.FALSE.
+      CALL init_message(f_u,req_e1_vect,req_u)
+      CALL init_message(f_vort,req_z1_scal,req_z)
+      ALLOCATE(ps_phy(klon_omp))
+      ALLOCATE(p_phy(klon_omp,llm+1))
+      ALLOCATE(p_layer_phy(klon_omp,llm))
+      ALLOCATE(Temp_phy(klon_omp,llm))
+      ALLOCATE(phis_phy(klon_omp))
+      ALLOCATE(phi_phy(klon_omp,llm))
+      ALLOCATE(ulon_phy(klon_omp,llm))
+      ALLOCATE(ulat_phy(klon_omp,llm))
+      ALLOCATE(rot_phy(klon_omp,llm))
+      ALLOCATE(q_phy(klon_omp,llm,nqtot))
+      ALLOCATE(wflux_phy(klon_omp,llm))
+      ALLOCATE(dulon_phy(klon_omp,llm))
+      ALLOCATE(dulat_phy(klon_omp,llm))
+      ALLOCATE(dTemp_phy(klon_omp,llm))
+      ALLOCATE(dq_phy(klon_omp,llm,nqtot))
+      ALLOCATE(dps_phy(klon_omp))
+!$OMP BARRIER
+    ENDIF
+
+
+!$OMP MASTER
+!    CALL update_calendar(it)
+!$OMP END MASTER
+!$OMP BARRIER
+    dtphy=itau_physics*dt
+    
+    
+    
+    CALL transfert_message(f_u,req_u)
+    DO ind=1,ndomain
+      IF (assigned_domain(ind)) THEN
+        CALL swap_dimensions(ind)
+        CALL swap_geometry(ind)
+        u=f_u(ind)
+        vort=f_vort(ind)
+        CALL compute_vorticity(u,vort)
+      ENDIF
+    ENDDO
+
+    CALL transfert_message(f_vort,req_z)
+
+    
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      IF (assigned_domain(ind)) THEN
+        CALL swap_geometry(ind)
+      
+        phis=f_phis(ind)
+        ps=f_ps(ind)
+        theta_rhodz=f_theta_rhodz(ind)
+        u=f_u(ind)
+        q=f_q(ind)
+        wflux=f_wflux(ind)
+        p=f_p(ind)
+        pks=f_pks(ind)
+        pk=f_pk(ind)
+        p_layer=f_p_layer(ind)
+        theta=f_theta(ind)
+        phi=f_phi(ind)
+        Temp=f_Temp(ind)
+        ulon=f_ulon(ind)
+        ulat=f_ulat(ind)
+        vort=f_vort(ind)
+        vortc=f_vortc(ind)
+            
+        CALL grid_icosa_to_physics
+
+      ENDIF
+    ENDDO
+   
+!$OMP BARRIER
+!$OMP MASTER
+    CALL SYSTEM_CLOCK(start_clock)
+!$OMP END MASTER
+    CALL trace_start("physic")
+!    CALL trace_off()
+
+
+!    CALL writeField("p_in",f_p)
+!    CALL writeField("p_layer_in",f_p_layer)
+!    CALL writeField("phi_in",f_phi)
+!    CALL writeField("phis_in",f_phis)
+!    CALL writeField("ulon_in",f_ulon)
+!    CALL writeField("ulat_in",f_ulat)
+!    CALL writeField("Temp_in",f_Temp)
+!    CALL writeField("q_in",f_q)
+!    CALL writeField("wflux_in",f_wflux)
+!     CALL writeField("vortc",f_vortc)
+
+!    CALL checksum(f_p)
+!    CALL checksum(f_p_layer)
+!    CALL checksum(f_phi)
+!    CALL checksum(f_phis)
+!    CALL checksum(f_ulon)
+!    CALL checksum(f_ulat)
+!    CALL checksum(f_Temp)
+!    CALL checksum(f_q)
+!    CALL checksum(f_wflux)
+
+    CALL transfer_icosa_to_lmdz(f_p      , p_phy)
+    CALL transfer_icosa_to_lmdz(f_p_layer, p_layer_phy)
+    CALL transfer_icosa_to_lmdz(f_phi    , phi_phy)
+    CALL transfer_icosa_to_lmdz(f_phis   , phis_phy )
+    CALL transfer_icosa_to_lmdz(f_ulon   , ulon_phy )
+    CALL transfer_icosa_to_lmdz(f_ulat   , ulat_phy)
+    CALL transfer_icosa_to_lmdz(f_vortc   , rot_phy)
+    CALL transfer_icosa_to_lmdz(f_Temp   , Temp_phy)
+    CALL transfer_icosa_to_lmdz(f_q      , q_phy)
+    CALL transfer_icosa_to_lmdz(f_wflux  , wflux_phy)
+
+    DO l=1,llm
+      wflux_phy(:,l) = - wflux_phy(:,l)*cell_area(:)
+      phi_phy(:,l)=phi_phy(:,l)-phis_phy(:)
+    ENDDO
+    
+    CALL wxios_set_context()
+ 
+! Ehouarn: rot_phy() not implemented!! Set it to zero for now
+!    rot_phy(:,:)=0
+    CALL physiq(klon_omp, llm, debut, lafin, dtphy, &
+                p_phy, p_layer_phy, phi_phy, phis_phy, presnivs, &
+                ulon_phy, ulat_phy, rot_phy, Temp_phy, q_phy, wflux_phy, &
+                dulon_phy, dulat_phy, dTemp_phy, dq_phy, dps_phy)
+    
+    CALL transfer_lmdz_to_icosa(dulon_phy, f_dulon )
+    CALL transfer_lmdz_to_icosa(dulat_phy, f_dulat )
+    CALL transfer_lmdz_to_icosa(dTemp_phy, f_dTemp )
+    CALL transfer_lmdz_to_icosa(dq_phy   , f_dq )
+    CALL transfer_lmdz_to_icosa(dps_phy  , f_dps )
+ 
+!    CALL writeField("dulon_out",f_dulon)
+!    CALL writeField("dulat_out",f_dulat)
+!    CALL writeField("dTemp_out",f_dTemp)
+!    CALL writeField("dq_out",f_dq)
+!    CALL writeField("dps_out",f_dps)
+
+!    CALL checksum(f_dulon)
+!    CALL checksum(f_dulat)
+!    CALL checksum(f_dTemp)
+!    CALL checksum(f_dq)
+!    CALL checksum(f_dps)
+    
+    CALL send_message(f_dps,req_dps0)
+    CALL send_message(f_dulon,req_dulon0)
+    CALL send_message(f_dulat,req_dulat0)
+    CALL send_message(f_dTemp,req_dTemp0)
+    CALL send_message(f_dq,req_dq0)
+
+    CALL wait_message(req_dps0)
+    CALL wait_message(req_dulon0)
+    CALL wait_message(req_dulat0)
+    CALL wait_message(req_dTemp0)
+    CALL wait_message(req_dq0)
+
+
+!    CALL trace_on()
+    CALL trace_end("physic")
+!$OMP MASTER
+    CALL SYSTEM_CLOCK(stop_clock)
+    count_clock=count_clock+stop_clock-start_clock
+!$OMP END MASTER
+
+!$OMP BARRIER
+
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      IF (assigned_domain(ind)) THEN
+        CALL swap_geometry(ind)
+
+        theta_rhodz=f_theta_rhodz(ind)
+        u=f_u(ind)
+        q=f_q(ind)
+        ps=f_ps(ind)
+        dulon=f_dulon(ind)
+        dulat=f_dulat(ind)
+        Temp=f_temp(ind)
+        dTemp=f_dTemp(ind)
+        dq=f_dq(ind)
+        dps=f_dps(ind)
+        duc=f_duc(ind)
+        p=f_p(ind)
+        pks=f_pks(ind)
+        pk=f_pk(ind)
+      
+        CALL grid_physics_to_icosa
+      ENDIF
+    ENDDO
+
+!$OMP BARRIER
+    CALL xios_set_context    
+   
+ 
+  CONTAINS
+
+    SUBROUTINE grid_icosa_to_physics
+    USE pression_mod
+    USE exner_mod
+    USE theta2theta_rhodz_mod
+    USE geopotential_mod
+    USE wind_mod
+    USE omp_para
+    IMPLICIT NONE
+    
+    REAL(rstd) :: uc(3)
+    INTEGER :: i,j,ij,l
+
+! compute pression
+
+      DO    l    = ll_begin,ll_endp1
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            p(ij,l) = ap(l) + bp(l) * ps(ij)
+          ENDDO
+        ENDDO
+      ENDDO
+
+!$OMP BARRIER
+
+! compute exner
+       
+       IF (is_omp_first_level) THEN
+         DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+               ij=(j-1)*iim+i
+               pks(ij) = cpp * ( ps(ij)/preff ) ** kappa
+            ENDDO
+         ENDDO
+       ENDIF
+
+! 3D : pk
+       DO l = ll_begin,ll_end
+          DO j=jj_begin,jj_end
+             DO i=ii_begin,ii_end
+                ij=(j-1)*iim+i
+                pk(ij,l) = cpp * ((.5/preff)*(p(ij,l)+p(ij,l+1))) ** kappa
+             ENDDO
+          ENDDO
+       ENDDO
+
+!$OMP BARRIER
+
+!   compute theta, temperature and pression at layer
+    DO    l    = ll_begin, ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          theta(ij,l) = theta_rhodz(ij,l,1) / ((p(ij,l)-p(ij,l+1))/g)
+          Temp(ij,l) = theta(ij,l) * pk(ij,l) / cpp
+          p_layer(ij,l)=preff*(pk(ij,l)/cpp)**(1./kappa) 
+        ENDDO
+      ENDDO
+    ENDDO
+
+
+!!! Compute geopotential
+       
+! for first layer
+  IF (is_omp_first_level) THEN
+    DO j=jj_begin,jj_end
+      DO i=ii_begin,ii_end
+        ij=(j-1)*iim+i
+        phi( ij,1 ) = phis( ij ) + theta(ij,1) * ( pks(ij) - pk(ij,1) )
+      ENDDO
+    ENDDO
+  ENDIF
+!!-> implicit flush on phi(:,1)
+
+!$OMP BARRIER
+          
+! for other layers
+  DO l = ll_beginp1, ll_end
+    DO j=jj_begin,jj_end
+      DO i=ii_begin,ii_end
+        ij=(j-1)*iim+i
+        phi(ij,l) =  0.5 * ( theta(ij,l)  + theta(ij,l-1) )  & 
+                         * (  pk(ij,l-1) -  pk(ij,l)    )
+      ENDDO
+    ENDDO
+  ENDDO       
+
+!$OMP BARRIER
+
+
+  IF (is_omp_first_level) THEN
+    DO l = 2, llm
+      DO j=jj_begin,jj_end
+! ---> Bug compilo intel ici en openmp
+! ---> Couper la boucle
+       IF (j==jj_end+1) PRINT*,"this message must not be printed"
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          phi(ij,l) = phi(ij,l)+ phi(ij,l-1)
+        ENDDO
+      ENDDO
+    ENDDO
+! --> IMPLICIT FLUSH on phi --> non
+  ENDIF 
+
+! compute wind centered lon lat compound
+    DO l=ll_begin,ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          uc(:)=1/Ai(ij)*                                                                                                &
+                        ( ne(ij,right)*u(ij+u_right,l)*le(ij+u_right)*((xyz_v(ij+z_rdown,:)+xyz_v(ij+z_rup,:))/2-centroid(ij,:))  &
+                         + ne(ij,rup)*u(ij+u_rup,l)*le(ij+u_rup)*((xyz_v(ij+z_rup,:)+xyz_v(ij+z_up,:))/2-centroid(ij,:))          &
+                         + ne(ij,lup)*u(ij+u_lup,l)*le(ij+u_lup)*((xyz_v(ij+z_up,:)+xyz_v(ij+z_lup,:))/2-centroid(ij,:))          &
+                         + ne(ij,left)*u(ij+u_left,l)*le(ij+u_left)*((xyz_v(ij+z_lup,:)+xyz_v(ij+z_ldown,:))/2-centroid(ij,:))    &
+                         + ne(ij,ldown)*u(ij+u_ldown,l)*le(ij+u_ldown)*((xyz_v(ij+z_ldown,:)+xyz_v(ij+z_down,:))/2-centroid(ij,:))&
+                         + ne(ij,rdown)*u(ij+u_rdown,l)*le(ij+u_rdown)*((xyz_v(ij+z_down,:)+xyz_v(ij+z_rdown,:))/2-centroid(ij,:)))
+          ulon(ij,l)=sum(uc(:)*elon_i(ij,:))
+          ulat(ij,l)=sum(uc(:)*elat_i(ij,:)) 
+        ENDDO
+      ENDDO
+    ENDDO
+
+
+! compute centered vorticity
+   
+    DO l=ll_begin,ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          vortc(ij,l) =  Riv(ij,vup)    * vort(ij+z_up,l)    + & 
+                         Riv(ij,vlup)  * vort(ij+z_lup,l)   + & 
+                         Riv(ij,vldown)* vort(ij+z_ldown,l) + & 
+                         Riv(ij,vdown) * vort(ij+z_down,l)  + & 
+                         Riv(ij,vrdown)* vort(ij+z_rdown,l) + & 
+                         Riv(ij,vrup)  * vort(ij+z_rup,l) 
+      ENDDO
+    ENDDO
+  ENDDO
+
+
+
+!$OMP BARRIER
+    END SUBROUTINE grid_icosa_to_physics
+
+
+    SUBROUTINE grid_physics_to_icosa
+    USE theta2theta_rhodz_mod
+    USE omp_para
+    IMPLICIT NONE
+      INTEGER :: i,j,ij,l,iq
+          
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            duc(ij,:,l)=dulon(ij,l)*elon_i(ij,:)+dulat(ij,l)*elat_i(ij,:)
+          ENDDO
+        ENDDO
+      ENDDO
+
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            u(ij+u_right,l) = u(ij+u_right,l) + dtphy * sum( 0.5*(duc(ij,:,l) + duc(ij+t_right,:,l))*ep_e(ij+u_right,:) )
+            u(ij+u_lup,l) = u(ij+u_lup,l) + dtphy * sum( 0.5*(duc(ij,:,l) + duc(ij+t_lup,:,l))*ep_e(ij+u_lup,:) )
+            u(ij+u_ldown,l) = u(ij+u_ldown,l) + dtphy*sum( 0.5*(duc(ij,:,l) + duc(ij+t_ldown,:,l))*ep_e(ij+u_ldown,:) )
+          ENDDO
+        ENDDO
+      ENDDO          
+
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            Temp(ij,l)=Temp(ij,l)+ dtphy * dTemp(ij,l)
+          ENDDO
+        ENDDO
+      ENDDO          
+      
+      DO iq=1,nqtot
+        DO l=ll_begin,ll_end
+          DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+              ij=(j-1)*iim+i
+              q(ij,l,iq)=q(ij,l,iq)+ dtphy * dq(ij,l,iq)
+            ENDDO
+          ENDDO
+        ENDDO 
+      ENDDO
+
+!$OMP BARRIER
+      
+     IF (is_omp_first_level) THEN
+       DO j=jj_begin,jj_end
+         DO i=ii_begin,ii_end
+           ij=(j-1)*iim+i
+           ps(ij)=ps(ij)+ dtphy * dps(ij)
+          ENDDO
+       ENDDO
+     ENDIF
+
+!     CALL compute_temperature2theta_rhodz(ps,Temp,theta_rhodz,0)
+
+! compute pression
+!$OMP BARRIER
+      DO    l    = ll_begin,ll_endp1
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            p(ij,l) = ap(l) + bp(l) * ps(ij)
+          ENDDO
+        ENDDO
+      ENDDO
+
+!$OMP BARRIER
+
+! compute exner
+       
+       IF (is_omp_first_level) THEN
+         DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+               ij=(j-1)*iim+i
+               pks(ij) = cpp * ( ps(ij)/preff ) ** kappa
+            ENDDO
+         ENDDO
+       ENDIF
+
+! 3D : pk
+       DO l = ll_begin,ll_end
+          DO j=jj_begin,jj_end
+             DO i=ii_begin,ii_end
+                ij=(j-1)*iim+i
+                pk(ij,l) = cpp * ((.5/preff)*(p(ij,l)+p(ij,l+1))) ** kappa
+             ENDDO
+          ENDDO
+       ENDDO
+
+!$OMP BARRIER
+
+!   compute theta, temperature and pression at layer
+    DO    l    = ll_begin, ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          theta_rhodz(ij,l,1) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / (pk(ij,l) / cpp )
+        ENDDO
+      ENDDO
+    ENDDO
+    
+    END SUBROUTINE grid_physics_to_icosa
+
+
+
+  END SUBROUTINE physics
+
+
+
+
+
+END MODULE interface_icosa_lmdz_mod
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/rebuild_all
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/rebuild_all	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/rebuild_all	(revision 6606)
@@ -0,0 +1,1 @@
+./make_icosa_lmdz -nodeps -p lmd -prod -parallel mpi_omp -with_orchidee -with_inca -arch X64_IRENE -arch_path /ccc/work/cont003/gen2201/lloretzo/NUDGE_ICOLMDOZORINCA_V7_PROD/modipsl/config/ICOLMDZORINCA_v7/ARCH -job 8
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/distrib_icosa_lmdz.f90
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/distrib_icosa_lmdz.f90	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/distrib_icosa_lmdz.f90	(revision 6606)
@@ -0,0 +1,276 @@
+MODULE distrib_icosa_lmdz_mod
+  
+  TYPE t_distrib_physic
+    INTEGER,POINTER :: index(:)    ! list of index used for thread entering in lmdz physic
+    INTEGER         :: nindex      ! number of index used
+    INTEGER         :: domain_ind  ! index of the related domain
+  END TYPE t_distrib_physic
+  
+  INTEGER, SAVE :: ndomain_distrib    ! number of domain needed for thread data
+!$OMP THREADPRIVATE(ndomain_distrib)
+
+  TYPE(t_distrib_physic),ALLOCATABLE, SAVE :: distrib_physic(:) 
+!$OMP THREADPRIVATE(distrib_physic)  
+
+
+  INTERFACE transfer_icosa_to_lmdz
+    MODULE PROCEDURE transfer_icosa_to_lmdz1d,transfer_icosa_to_lmdz2d,transfer_icosa_to_lmdz3d
+  END INTERFACE transfer_icosa_to_lmdz
+
+  INTERFACE transfer_lmdz_to_icosa
+    MODULE PROCEDURE transfer_lmdz1d_to_icosa,transfer_lmdz2d_to_icosa,transfer_lmdz3d_to_icosa
+  END INTERFACE transfer_lmdz_to_icosa
+      
+CONTAINS
+
+
+  SUBROUTINE init_distrib_icosa_lmdz
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp_begin, klon_omp_end
+  USE domain_mod
+  USE dimensions
+  USE nudging_mod, ONLY : lam_halo_scheme
+  IMPLICIT NONE
+    INTEGER :: pos,pos_tmp,nindex
+    INTEGER :: ind, i,j,ij,h
+    LOGICAL,ALLOCATABLE :: outside(:,:)
+    LOGICAL,ALLOCATABLE :: outside_tmp(:,:)
+    LOGICAL,POINTER :: out(:,:)
+    ALLOCATE(distrib_physic(ndomain))
+   
+    ndomain_distrib=0 
+    pos=0
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      ALLOCATE(outside(ii_begin:ii_end,jj_begin:jj_end)) ! for limited area
+      ALLOCATE(outside_tmp(ii_begin-1:ii_end+1,jj_begin-1:jj_end+1)) ! for limited area
+      out=>domain(ind)%outside
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          outside(i,j)=  out(i+1,j)     .OR. & ! right
+                         out(i,j+1    ) .OR. & ! rup
+                         out(i-1  ,j+1) .OR. & ! lup
+                         out(i-1  ,j)   .OR. & !left
+                         out(i    ,j-1) .OR. & !ldown
+                         out(i+1,j-1)          !rdown    
+        ENDDO
+      ENDDO
+      outside_tmp=.FALSE.
+      outside_tmp(ii_begin:ii_end,jj_begin:jj_end)=outside
+      
+      DO h=1,lam_halo_scheme-1 ! do not compute physic on limited area halo
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+              outside(i,j) = outside_tmp(i,j)       .OR. &
+                             outside_tmp(i+1,j)     .OR. & ! right
+                             outside_tmp(i,j+1    ) .OR. & ! rup
+                             outside_tmp(i-1  ,j+1) .OR. & ! lup
+                             outside_tmp(i-1  ,j)   .OR. & !left
+                             outside_tmp(i    ,j-1) .OR. & !ldown
+                             outside_tmp(i+1,j-1)          !rdown
+          ENDDO
+        ENDDO
+        outside_tmp(ii_begin:ii_end,jj_begin:jj_end)=outside
+      ENDDO
+      
+      
+! first guess to determine number of indices for this domain
+      pos_tmp=pos
+      nindex=0
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          IF (domain(ind)%own(i,j) .AND. .NOT. outside(i,j)) THEN 
+            pos_tmp=pos_tmp+1
+            IF (pos_tmp >= klon_omp_begin .AND. pos_tmp <= klon_omp_end) nindex=nindex+1
+          ENDIF
+        ENDDO
+      ENDDO
+
+! fill the index array
+
+      IF (nindex>0) THEN
+        ndomain_distrib=ndomain_distrib+1
+        ALLOCATE(distrib_physic(ndomain_distrib)%index(nindex))
+        distrib_physic(ndomain_distrib)%nindex=nindex
+        distrib_physic(ndomain_distrib)%domain_ind=ind
+        
+        nindex=0
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            IF (domain(ind)%own(i,j) .AND. .NOT. outside(i,j)) THEN
+              pos=pos+1
+              IF (pos >= klon_omp_begin .AND. pos <= klon_omp_end) THEN
+                nindex=nindex+1
+                distrib_physic(ndomain_distrib)%index(nindex)=ij
+              ENDIF
+            ENDIF
+          ENDDO
+        ENDDO
+      ELSE
+        pos=pos_tmp
+      ENDIF
+    
+      DEALLOCATE(outside)
+      DEALLOCATE(outside_tmp)
+    ENDDO
+       
+  END SUBROUTINE init_distrib_icosa_lmdz
+                  
+  SUBROUTINE transfer_icosa_to_lmdz1d(f_field_icosa, field_lmdz)
+  USE field_mod
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: f_field_icosa(:)
+    REAL(rstd)         :: field_lmdz(:)
+    REAL(rstd),POINTER :: field_icosa(:)
+    INTEGER         :: pos, nindex,ind,i
+    INTEGER,POINTER :: index(:)
+    
+!$OMP BARRIER
+    pos=0
+    DO ind=1,ndomain_distrib
+      field_icosa=f_field_icosa(distrib_physic(ind)%domain_ind)
+      index=>distrib_physic(ind)%index
+      nindex=distrib_physic(ind)%nindex
+      DO i=1,nindex
+        pos=pos+1
+        field_lmdz(pos)=field_icosa(index(i))
+      ENDDO
+    ENDDO
+    
+  END SUBROUTINE  transfer_icosa_to_lmdz1d
+  
+  SUBROUTINE transfer_icosa_to_lmdz2d(f_field_icosa, field_lmdz)
+  USE field_mod
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: f_field_icosa(:)
+    REAL(rstd)         :: field_lmdz(:,:)
+
+    REAL(rstd),POINTER :: field_icosa(:,:)
+    INTEGER         :: pos, nindex,ind,i
+    INTEGER,POINTER :: index(:)
+    INTEGER :: l
+    
+!$OMP BARRIER
+    DO l=1,size(field_lmdz,2)  
+      pos=0
+      DO ind=1,ndomain_distrib
+        field_icosa=f_field_icosa(distrib_physic(ind)%domain_ind)
+        index=>distrib_physic(ind)%index
+        nindex=distrib_physic(ind)%nindex
+        DO i=1,nindex
+          pos=pos+1
+          field_lmdz(pos,l)=field_icosa(index(i),l)
+        ENDDO
+      ENDDO
+    ENDDO
+    
+  END SUBROUTINE  transfer_icosa_to_lmdz2d
+
+
+    
+  SUBROUTINE transfer_icosa_to_lmdz3d(f_field_icosa, field_lmdz)
+  USE field_mod
+  IMPLICIT NONE
+    TYPE(t_field),POINTER :: f_field_icosa(:)
+    REAL(rstd)         :: field_lmdz(:,:,:)
+    REAL(rstd),POINTER :: field_icosa(:,:,:)
+    INTEGER         :: pos, nindex,ind,i
+    INTEGER,POINTER :: index(:)
+    INTEGER :: l,q
+
+!$OMP BARRIER
+    DO q=1,size(field_lmdz,3)  
+      DO l=1,size(field_lmdz,2)  
+        pos=0
+        DO ind=1,ndomain_distrib
+          field_icosa=f_field_icosa(distrib_physic(ind)%domain_ind)
+          index=>distrib_physic(ind)%index
+          nindex=distrib_physic(ind)%nindex
+          DO i=1,nindex
+            pos=pos+1
+            field_lmdz(pos,l,q)=field_icosa(index(i),l,q)
+          ENDDO
+        ENDDO
+      ENDDO
+    ENDDO
+    
+  END SUBROUTINE  transfer_icosa_to_lmdz3d
+      
+  SUBROUTINE transfer_lmdz1d_to_icosa(field_lmdz,f_field_icosa)
+  USE field_mod
+  IMPLICIT NONE
+    REAL(rstd)         :: field_lmdz(:)
+    TYPE(t_field),POINTER :: f_field_icosa(:)
+    REAL(rstd),POINTER :: field_icosa(:)
+    INTEGER         :: pos, nindex,ind,i
+    INTEGER,POINTER :: index(:)
+    
+!$OMP BARRIER
+    pos=0
+    DO ind=1,ndomain_distrib
+      field_icosa=f_field_icosa(distrib_physic(ind)%domain_ind)
+      index=>distrib_physic(ind)%index
+      nindex=distrib_physic(ind)%nindex
+      DO i=1,nindex
+        pos=pos+1
+        field_icosa(index(i))=field_lmdz(pos)
+      ENDDO
+    ENDDO
+  END SUBROUTINE  transfer_lmdz1d_to_icosa
+
+  SUBROUTINE transfer_lmdz2d_to_icosa(field_lmdz,f_field_icosa)
+  USE field_mod
+  IMPLICIT NONE
+    REAL(rstd)         :: field_lmdz(:,:)
+    TYPE(t_field),POINTER :: f_field_icosa(:)
+    REAL(rstd),POINTER :: field_icosa(:,:)
+    INTEGER         :: pos, nindex,ind,i
+    INTEGER,POINTER :: index(:)
+    INTEGER :: l
+    
+!$OMP BARRIER
+    DO l=1,size(field_lmdz,2)  
+      pos=0
+      DO ind=1,ndomain_distrib
+        field_icosa=f_field_icosa(distrib_physic(ind)%domain_ind)
+        index=>distrib_physic(ind)%index
+        nindex=distrib_physic(ind)%nindex
+        DO i=1,nindex
+          pos=pos+1
+          field_icosa(index(i),l)=field_lmdz(pos,l)
+        ENDDO
+      ENDDO
+    ENDDO
+  
+  END SUBROUTINE transfer_lmdz2d_to_icosa    
+
+
+  SUBROUTINE transfer_lmdz3d_to_icosa(field_lmdz,f_field_icosa)
+  USE field_mod
+  IMPLICIT NONE
+    REAL(rstd)         :: field_lmdz(:,:,:)
+    TYPE(t_field),POINTER :: f_field_icosa(:)
+    REAL(rstd),POINTER :: field_icosa(:,:,:)
+    INTEGER         :: pos, nindex,ind,i
+    INTEGER,POINTER :: index(:)
+    INTEGER :: l,q
+    
+!$OMP BARRIER
+    DO q=1,size(field_lmdz,3)  
+      DO l=1,size(field_lmdz,2)  
+        pos=0
+        DO ind=1,ndomain_distrib
+          field_icosa=f_field_icosa(distrib_physic(ind)%domain_ind)
+          index=>distrib_physic(ind)%index
+          nindex=distrib_physic(ind)%nindex
+          DO i=1,nindex
+            pos=pos+1
+            field_icosa(index(i),l,q)=field_lmdz(pos,l,q)
+          ENDDO
+        ENDDO
+      ENDDO
+    ENDDO
+  
+  END SUBROUTINE transfer_lmdz3d_to_icosa    
+
+END MODULE distrib_icosa_lmdz_mod
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/icosa_lmdz.f90
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/icosa_lmdz.f90	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/icosa_lmdz.f90	(revision 6606)
@@ -0,0 +1,6 @@
+PROGRAM icosa_lmdz
+  USE icosa_init_mod
+
+  CALL icosa_init
+
+END PROGRAM icosa_lmdz
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/phydev/interface_icosa_lmdz.f90
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/phydev/interface_icosa_lmdz.f90	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/phydev/interface_icosa_lmdz.f90	(revision 6606)
@@ -0,0 +1,779 @@
+MODULE interface_icosa_lmdz_mod
+
+  USE field_mod, ONLY: t_field
+  USE transfert_mod, ONLY: t_message 
+  
+ 
+  TYPE(t_message),SAVE :: req_u
+  TYPE(t_message),SAVE :: req_dps0, req_dulon0, req_dulat0, req_dTemp0, req_dq0
+
+  TYPE(t_field),POINTER,SAVE :: f_p(:) 
+  TYPE(t_field),POINTER,SAVE :: f_pks(:)  
+  TYPE(t_field),POINTER,SAVE :: f_pk(:)  
+  TYPE(t_field),POINTER,SAVE :: f_p_layer(:)    
+  TYPE(t_field),POINTER,SAVE :: f_theta(:)   
+  TYPE(t_field),POINTER,SAVE :: f_phi(:)   
+  TYPE(t_field),POINTER,SAVE :: f_Temp(:)    
+  TYPE(t_field),POINTER,SAVE :: f_ulon(:)    
+  TYPE(t_field),POINTER,SAVE :: f_ulat(:)   
+  TYPE(t_field),POINTER,SAVE :: f_dulon(:)
+  TYPE(t_field),POINTER,SAVE :: f_dulat(:)
+  TYPE(t_field),POINTER,SAVE :: f_dTemp(:)
+  TYPE(t_field),POINTER,SAVE :: f_dq(:)
+  TYPE(t_field),POINTER,SAVE :: f_dps(:)
+  TYPE(t_field),POINTER,SAVE :: f_duc(:)
+  TYPE(t_field),POINTER,SAVE :: f_bounds_lon(:)
+  TYPE(t_field),POINTER,SAVE :: f_bounds_lat(:)
+
+  INTEGER :: start_clock
+  INTEGER :: stop_clock
+  INTEGER :: count_clock=0
+  
+  REAL :: day_length
+
+  
+  INTEGER,SAVE :: nbp_phys
+  INTEGER,SAVE :: nbp_phys_glo
+
+
+CONTAINS
+
+  SUBROUTINE initialize_physics
+  USE distrib_icosa_lmdz_mod, ONLY : init_distrib_icosa_lmdz, transfer_icosa_to_lmdz
+! from dynamico
+  USE domain_mod
+  USE dimensions
+  USE mpi_mod
+  USE mpipara
+  USE disvert_mod
+  USE xios_mod
+  USE transfert_mod
+  
+! from LMDZ
+  USE mod_grid_phy_lmdz, ONLY : unstructured
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE transfert_mod
+  USE physics_distribution_mod, ONLY : init_physics_distribution
+   
+  
+  IMPLICIT NONE
+  INTEGER  :: ind,i,j,ij,pos
+  REAL(rstd),POINTER :: bounds_lon(:,:)
+  REAL(rstd),POINTER :: bounds_lat(:,:)
+  
+  REAL(rstd),ALLOCATABLE :: latfi(:)
+  REAL(rstd),ALLOCATABLE :: lonfi(:)
+  REAL(rstd),ALLOCATABLE :: airefi(:)
+  REAL(rstd),ALLOCATABLE :: bounds_latfi(:,:)
+  REAL(rstd),ALLOCATABLE :: bounds_lonfi(:,:)
+
+  INTEGER :: nbp_phys, nbp_phys_glo
+  
+!$OMP PARALLEL
+    CALL allocate_field(f_bounds_lon,field_t,type_real,6)
+    CALL allocate_field(f_bounds_lat,field_t,type_real,6)
+    CALL allocate_field(f_p,field_t,type_real,llm+1,name="p_in")
+    CALL allocate_field(f_pks,field_t,type_real)
+    CALL allocate_field(f_pk,field_t,type_real,llm)
+    CALL allocate_field(f_p_layer,field_t,type_real,llm,name="p_layer_in")
+    CALL allocate_field(f_theta,field_t,type_real,llm)
+    CALL allocate_field(f_phi,field_t,type_real,llm,name="phi_in")
+    CALL allocate_field(f_Temp,field_t,type_real,llm,name="Temp_in")
+    CALL allocate_field(f_ulon,field_t,type_real,llm,name="ulon_in")
+    CALL allocate_field(f_ulat,field_t,type_real,llm,name="ulat_in")
+    CALL allocate_field(f_dulon,field_t,type_real,llm,name="dulon_out")
+    CALL allocate_field(f_dulat,field_t,type_real,llm,name="dulat_out")
+    CALL allocate_field(f_dTemp,field_t,type_real,llm,name="dTemp_out")
+    CALL allocate_field(f_dq,field_t,type_real,llm,nqtot,name="dq_out")
+    CALL allocate_field(f_dps,field_t,type_real,name="dps_out")
+    CALL allocate_field(f_duc,field_t,type_real,3,llm)    
+
+    CALL init_message(f_dps,req_i0,req_dps0)
+    CALL init_message(f_dulon,req_i0,req_dulon0)
+    CALL init_message(f_dulat,req_i0,req_dulat0)
+    CALL init_message(f_dTemp,req_i0,req_dTemp0)
+    CALL init_message(f_dq,req_i0,req_dq0)
+!$OMP END PARALLEL    
+
+    nbp_phys=0
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          IF (domain(ind)%own(i,j)) nbp_phys=nbp_phys+1
+        ENDDO
+      ENDDO
+    ENDDO
+    
+
+!initialize LMDZ5 physic mpi decomposition
+    CALL MPI_ALLREDUCE(nbp_phys,nbp_phys_glo,1,MPI_INTEGER,MPI_SUM,comm_icosa,ierr)
+    CALL init_physics_distribution(unstructured, 6, nbp_phys, 1, nbp_phys_glo, llm, comm_icosa)
+    
+    DO ind=1,ndomain
+        CALL swap_dimensions(ind)
+        CALL swap_geometry(ind)
+        bounds_lon=f_bounds_lon(ind)
+        bounds_lat=f_bounds_lat(ind)
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            CALL xyz2lonlat(xyz_v(ij+z_rup,:), bounds_lon(ij,1), bounds_lat(ij,1))
+            CALL xyz2lonlat(xyz_v(ij+z_up,:), bounds_lon(ij,2), bounds_lat(ij,2))
+            CALL xyz2lonlat(xyz_v(ij+z_lup,:), bounds_lon(ij,3), bounds_lat(ij,3))
+            CALL xyz2lonlat(xyz_v(ij+z_ldown,:), bounds_lon(ij,4), bounds_lat(ij,4))
+            CALL xyz2lonlat(xyz_v(ij+z_down,:), bounds_lon(ij,5), bounds_lat(ij,5))
+            CALL xyz2lonlat(xyz_v(ij+z_rdown,:), bounds_lon(ij,6), bounds_lat(ij,6))
+         ENDDO
+       ENDDO            
+    ENDDO
+          
+!$OMP PARALLEL
+    CALL initialize_physics_omp
+!$OMP END PARALLEL            
+
+    CALL xios_set_context    
+
+
+     
+
+  END SUBROUTINE initialize_physics
+
+
+  SUBROUTINE initialize_physics_omp
+  USE distrib_icosa_lmdz_mod, ONLY : init_distrib_icosa_lmdz, transfer_icosa_to_lmdz
+! from dynamico
+  USE domain_mod
+  USE dimensions
+  USE mpi_mod
+  USE mpipara
+  USE disvert_mod
+  USE earth_const, ONLY: scale_height
+  USE xios_mod
+  USE time_mod , init_time_icosa=> init_time 
+  USE omp_para
+
+! from LMDZ
+  USE mod_grid_phy_lmdz, ONLY : unstructured
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE transfert_mod
+  USE geometry_mod, ONLY : init_geometry
+  USE vertical_layers_mod, ONLY : init_vertical_layers
+  USE infotrac_phy, ONLY : init_infotrac_phy
+  USE inifis_mod, ONLY : inifis 
+  USE phyaqua_mod, ONLY : iniaqua 
+   
+  
+  IMPLICIT NONE
+
+
+
+  INTEGER  :: ind,i,j,ij,pos
+  REAL(rstd),POINTER :: bounds_lon(:,:)
+  REAL(rstd),POINTER :: bounds_lat(:,:)
+  
+  REAL(rstd),ALLOCATABLE :: latfi(:)
+  REAL(rstd),ALLOCATABLE :: lonfi(:)
+  REAL(rstd),ALLOCATABLE :: airefi(:)
+  REAL(rstd),ALLOCATABLE :: bounds_latfi(:,:)
+  REAL(rstd),ALLOCATABLE :: bounds_lonfi(:,:)
+  REAL(rstd),ALLOCATABLE :: ind_cell_glo(:)
+
+  REAL(rstd) :: pseudoalt(llm)
+  REAL(rstd) :: aps(llm)
+  REAL(rstd) :: bps(llm)
+  REAL(rstd) :: scaleheight
+
+  CHARACTER(len=4)              :: type_trac
+
+  TYPE(t_field),POINTER,SAVE    :: f_ind_cell_glo(:)
+  
+  INTEGER :: iflag_phys    
+
+    CALL init_distrib_icosa_lmdz
+    
+    ALLOCATE(latfi(klon_omp))
+    ALLOCATE(lonfi(klon_omp))
+    ALLOCATE(airefi(klon_omp))
+    ALLOCATE(bounds_latfi(klon_omp,6))
+    ALLOCATE(bounds_lonfi(klon_omp,6))
+    ALLOCATE(ind_cell_glo(klon_omp))
+
+    CALL transfer_icosa_to_lmdz(geom%lat_i,latfi)
+    CALL transfer_icosa_to_lmdz(geom%lon_i,lonfi)
+    CALL transfer_icosa_to_lmdz(f_bounds_lat,bounds_latfi)
+    CALL transfer_icosa_to_lmdz(f_bounds_lon,bounds_lonfi)
+    CALL transfer_icosa_to_lmdz(geom%Ai,airefi)
+
+    CALL allocate_field(f_ind_cell_glo,field_t,type_real)
+    
+    DO ind=1,ndomain
+      IF (.NOT. assigned_domain(ind)  .OR. .NOT. is_omp_level_master ) CYCLE
+      CALL swap_dimensions(ind)
+      CALL swap_geometry(ind)
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          f_ind_cell_glo(ind)%rval2d(ij)=domain(ind)%assign_cell_glo(i,j)
+        ENDDO
+      ENDDO
+    ENDDO
+
+!$OMP BARRIER
+      
+    CALL transfer_icosa_to_lmdz(f_ind_cell_glo,ind_cell_glo)
+    CALL deallocate_field(f_ind_cell_glo)
+      
+              
+    CALL init_geometry(klon_omp,lonfi, latfi, bounds_lonfi, bounds_latfi, airefi, INT(ind_cell_glo))
+
+    scaleheight=scale_height/1000. ! Atmospheric scale height (km)
+    aps(1:llm)=0.5*(ap(1:llm)+ap(2:llm+1))
+    bps(1:llm)=0.5*(bp(1:llm)+bp(2:llm+1))
+    pseudoalt(:)=-scaleheight*log(presnivs(:)/preff)
+    CALL init_vertical_layers(llm,preff,scaleheight,ap,bp,aps,bps,presnivs,pseudoalt)
+
+
+    ! Initialize physical constant
+    CALL inifis(radius,g,kappa*cpp,cpp)
+ 
+    ! Initialize tracer names, numbers, etc. for physics
+
+    !Config  Key  = type_trac
+    !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
+    !Config  Def  = lmdz
+    !Config  Help = 
+    !Config         'lmdz' = pas de couplage, pur LMDZ
+    !Config         'inca' = model de chime INCA 
+    !Config         'repr' = model de chime REPROBUS
+    type_trac = 'lmdz'
+    CALL getin('type_trac',type_trac)
+        
+    CALL init_infotrac_phy(nqtot,type_trac)
+
+!  Additional initializations for aquaplanets
+    CALL getin("iflag_phys",iflag_phys)
+    IF (iflag_phys>=100) THEN
+      CALL iniaqua(klon_omp, iflag_phys)
+    END IF
+
+  
+  END SUBROUTINE  initialize_physics_omp 
+  
+  
+
+
+  SUBROUTINE physics
+  USE icosa
+  USE time_mod
+  USE disvert_mod
+  USE transfert_mod
+  USE mpipara
+  USE xios_mod
+  USE wxios
+  USE trace
+  USE distrib_icosa_lmdz_mod, ONLY : transfer_icosa_to_lmdz, transfer_lmdz_to_icosa
+  USE physics_external_mod, ONLY : it, f_phis, f_ps, f_theta_rhodz, f_u, f_wflux, f_q 
+  USE write_field_mod
+  USE checksum_mod
+! from LMDZ
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE geometry_mod, ONLY : cell_area
+  USE physiq_mod, ONLY: physiq
+  IMPLICIT NONE
+  
+    REAL(rstd),POINTER :: phis(:)
+    REAL(rstd),POINTER :: ps(:)
+    REAL(rstd),POINTER :: theta_rhodz(:,:,:)
+    REAL(rstd),POINTER :: u(:,:)
+    REAL(rstd),POINTER :: wflux(:,:)
+    REAL(rstd),POINTER :: q(:,:,:)
+    REAL(rstd),POINTER :: p(:,:)
+    REAL(rstd),POINTER :: pks(:)
+    REAL(rstd),POINTER :: pk(:,:)
+    REAL(rstd),POINTER :: p_layer(:,:)
+    REAL(rstd),POINTER :: theta(:,:)
+    REAL(rstd),POINTER :: phi(:,:)
+    REAL(rstd),POINTER :: Temp(:,:)
+    REAL(rstd),POINTER :: ulon(:,:)
+    REAL(rstd),POINTER :: ulat(:,:)
+    REAL(rstd),POINTER :: dulon(:,:)
+    REAL(rstd),POINTER :: dulat(:,:)
+    REAL(rstd),POINTER :: dTemp(:,:)
+    REAL(rstd),POINTER :: dq(:,:,:)
+    REAL(rstd),POINTER :: dps(:)
+    REAL(rstd),POINTER :: duc(:,:,:)
+
+
+    INTEGER :: ind,l
+    
+    REAL(rstd),ALLOCATABLE,SAVE :: ps_phy(:)
+!$OMP THREADPRIVATE(ps_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: p_phy(:,:)
+!$OMP THREADPRIVATE(p_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: p_layer_phy(:,:)
+!$OMP THREADPRIVATE(p_layer_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: Temp_phy(:,:)
+!$OMP THREADPRIVATE(Temp_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: phis_phy(:)
+!$OMP THREADPRIVATE(phis_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: phi_phy(:,:)
+!$OMP THREADPRIVATE(phi_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: ulon_phy(:,:)
+!$OMP THREADPRIVATE(ulon_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: ulat_phy(:,:)
+!$OMP THREADPRIVATE(ulat_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: q_phy(:,:,:)
+!$OMP THREADPRIVATE(q_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: wflux_phy(:,:)
+!$OMP THREADPRIVATE(wflux_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dulon_phy(:,:)
+!$OMP THREADPRIVATE(dulon_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dulat_phy(:,:)
+!$OMP THREADPRIVATE(dulat_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dTemp_phy(:,:)
+!$OMP THREADPRIVATE(dTemp_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dq_phy(:,:,:)
+!$OMP THREADPRIVATE(dq_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dps_phy(:)
+!$OMP THREADPRIVATE(dps_phy)
+    REAL(rstd)   :: dtphy 
+    LOGICAL      :: debut
+    LOGICAL      :: lafin
+    LOGICAL,SAVE :: first=.TRUE.
+!$OMP THREADPRIVATE(first)
+
+    
+    IF(first) THEN 
+      debut=.TRUE.
+    ELSE 
+      debut=.FALSE.
+    ENDIF
+
+
+    IF(it-itau0>=itaumax) THEN 
+      lafin=.TRUE.
+    ELSE 
+      lafin=.FALSE.
+    ENDIF
+
+    IF (first) THEN
+      first=.FALSE.
+      CALL init_message(f_u,req_e1_vect,req_u)
+      ALLOCATE(ps_phy(klon_omp))
+      ALLOCATE(p_phy(klon_omp,llm+1))
+      ALLOCATE(p_layer_phy(klon_omp,llm))
+      ALLOCATE(Temp_phy(klon_omp,llm))
+      ALLOCATE(phis_phy(klon_omp))
+      ALLOCATE(phi_phy(klon_omp,llm))
+      ALLOCATE(ulon_phy(klon_omp,llm))
+      ALLOCATE(ulat_phy(klon_omp,llm))
+      ALLOCATE(q_phy(klon_omp,llm,nqtot))
+      ALLOCATE(wflux_phy(klon_omp,llm))
+      ALLOCATE(dulon_phy(klon_omp,llm))
+      ALLOCATE(dulat_phy(klon_omp,llm))
+      ALLOCATE(dTemp_phy(klon_omp,llm))
+      ALLOCATE(dq_phy(klon_omp,llm,nqtot))
+      ALLOCATE(dps_phy(klon_omp))
+!$OMP BARRIER
+    ENDIF
+
+
+!$OMP MASTER        
+!    CALL update_calendar(it)
+!$OMP END MASTER
+!$OMP BARRIER
+    dtphy=itau_physics*dt
+    
+    
+    
+    CALL transfert_message(f_u,req_u)
+    
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      IF (assigned_domain(ind)) THEN
+        CALL swap_geometry(ind)
+      
+        phis=f_phis(ind)
+        ps=f_ps(ind)
+        theta_rhodz=f_theta_rhodz(ind)
+        u=f_u(ind)
+        q=f_q(ind)
+        wflux=f_wflux(ind)
+        p=f_p(ind)
+        pks=f_pks(ind)
+        pk=f_pk(ind)
+        p_layer=f_p_layer(ind)
+        theta=f_theta(ind)
+        phi=f_phi(ind)
+        Temp=f_Temp(ind)
+        ulon=f_ulon(ind)
+        ulat=f_ulat(ind)
+            
+        CALL grid_icosa_to_physics
+
+      ENDIF
+    ENDDO
+   
+!$OMP BARRIER
+!$OMP MASTER
+    CALL SYSTEM_CLOCK(start_clock)
+!$OMP END MASTER
+    CALL trace_start("physic")
+!    CALL trace_off()
+
+
+!    CALL writeField("p_in",f_p)
+!    CALL writeField("p_layer_in",f_p_layer)
+!    CALL writeField("phi_in",f_phi)
+!    CALL writeField("phis_in",f_phis)
+!    CALL writeField("ulon_in",f_ulon)
+!    CALL writeField("ulat_in",f_ulat)
+!    CALL writeField("Temp_in",f_Temp)
+!    CALL writeField("q_in",f_q)
+!    CALL writeField("wflux_in",f_wflux)
+
+!    CALL checksum(f_p)
+!    CALL checksum(f_p_layer)
+!    CALL checksum(f_phi)
+!    CALL checksum(f_phis)
+!    CALL checksum(f_ulon)
+!    CALL checksum(f_ulat)
+!    CALL checksum(f_Temp)
+!    CALL checksum(f_q)
+!    CALL checksum(f_wflux)
+
+    CALL transfer_icosa_to_lmdz(f_p      , p_phy)
+    CALL transfer_icosa_to_lmdz(f_p_layer, p_layer_phy)
+    CALL transfer_icosa_to_lmdz(f_phi    , phi_phy)
+    CALL transfer_icosa_to_lmdz(f_phis   , phis_phy )
+    CALL transfer_icosa_to_lmdz(f_ulon   , ulon_phy )
+    CALL transfer_icosa_to_lmdz(f_ulat   , ulat_phy)
+    CALL transfer_icosa_to_lmdz(f_Temp   , Temp_phy)
+    CALL transfer_icosa_to_lmdz(f_q      , q_phy)
+    CALL transfer_icosa_to_lmdz(f_wflux  , wflux_phy)
+
+    DO l=1,llm
+      wflux_phy(:,l)=wflux_phy(:,l)*cell_area(:)
+      phi_phy(:,l)=phi_phy(:,l)-phis_phy(:)
+    ENDDO
+    
+    CALL wxios_set_context()
+ 
+    CALL physiq(klon_omp, llm, debut, lafin, dtphy, &
+                p_phy, p_layer_phy, phi_phy, phis_phy, presnivs, &
+                ulon_phy, ulat_phy, Temp_phy, q_phy, wflux_phy, &
+                dulon_phy, dulat_phy, dTemp_phy, dq_phy, dps_phy)
+    
+    CALL transfer_lmdz_to_icosa(dulon_phy, f_dulon )
+    CALL transfer_lmdz_to_icosa(dulat_phy, f_dulat )
+    CALL transfer_lmdz_to_icosa(dTemp_phy, f_dTemp )
+    CALL transfer_lmdz_to_icosa(dq_phy   , f_dq )
+    CALL transfer_lmdz_to_icosa(dps_phy  , f_dps )
+ 
+!    CALL writeField("dulon_out",f_dulon)
+!    CALL writeField("dulat_out",f_dulat)
+!    CALL writeField("dTemp_out",f_dTemp)
+!    CALL writeField("dq_out",f_dq)
+!    CALL writeField("dps_out",f_dps)
+
+!    CALL checksum(f_dulon)
+!    CALL checksum(f_dulat)
+!    CALL checksum(f_dTemp)
+!    CALL checksum(f_dq)
+!    CALL checksum(f_dps)
+    
+    CALL send_message(f_dps,req_dps0)
+    CALL send_message(f_dulon,req_dulon0)
+    CALL send_message(f_dulat,req_dulat0)
+    CALL send_message(f_dTemp,req_dTemp0)
+    CALL send_message(f_dq,req_dq0)
+
+    CALL wait_message(req_dps0)
+    CALL wait_message(req_dulon0)
+    CALL wait_message(req_dulat0)
+    CALL wait_message(req_dTemp0)
+    CALL wait_message(req_dq0)
+
+
+!    CALL trace_on()
+    CALL trace_end("physic")
+!$OMP MASTER
+    CALL SYSTEM_CLOCK(stop_clock)
+    count_clock=count_clock+stop_clock-start_clock
+!$OMP END MASTER
+
+!$OMP BARRIER                       
+
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      IF (assigned_domain(ind)) THEN
+        CALL swap_geometry(ind)
+
+        theta_rhodz=f_theta_rhodz(ind)
+        u=f_u(ind)
+        q=f_q(ind)
+        ps=f_ps(ind)
+        dulon=f_dulon(ind)
+        dulat=f_dulat(ind)
+        Temp=f_temp(ind)
+        dTemp=f_dTemp(ind)
+        dq=f_dq(ind)
+        dps=f_dps(ind)
+        duc=f_duc(ind)
+        p=f_p(ind)
+        pks=f_pks(ind)
+        pk=f_pk(ind)
+      
+        CALL grid_physics_to_icosa
+      ENDIF
+    ENDDO
+
+!$OMP BARRIER
+    CALL xios_set_context    
+   
+ 
+  CONTAINS
+
+    SUBROUTINE grid_icosa_to_physics
+    USE pression_mod
+    USE exner_mod
+    USE theta2theta_rhodz_mod
+    USE geopotential_mod
+    USE wind_mod
+    USE omp_para
+    IMPLICIT NONE
+    
+    REAL(rstd) :: uc(3)
+    INTEGER :: i,j,ij,l
+    
+
+! compute pression
+
+      DO    l    = ll_begin,ll_endp1
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            p(ij,l) = ap(l) + bp(l) * ps(ij)
+          ENDDO
+        ENDDO
+      ENDDO
+
+!$OMP BARRIER
+
+! compute exner
+       
+       IF (is_omp_first_level) THEN
+         DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+               ij=(j-1)*iim+i
+               pks(ij) = cpp * ( ps(ij)/preff ) ** kappa
+            ENDDO
+         ENDDO
+       ENDIF
+
+       ! 3D : pk
+       DO l = ll_begin,ll_end
+          DO j=jj_begin,jj_end
+             DO i=ii_begin,ii_end
+                ij=(j-1)*iim+i
+                pk(ij,l) = cpp * ((.5/preff)*(p(ij,l)+p(ij,l+1))) ** kappa
+             ENDDO
+          ENDDO
+       ENDDO
+
+!$OMP BARRIER
+
+!   compute theta, temperature and pression at layer
+    DO    l    = ll_begin, ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          theta(ij,l) = theta_rhodz(ij,l,1) / ((p(ij,l)-p(ij,l+1))/g)
+          Temp(ij,l) = theta(ij,l) * pk(ij,l) / cpp
+          p_layer(ij,l)=preff*(pk(ij,l)/cpp)**(1./kappa) 
+        ENDDO
+      ENDDO
+    ENDDO
+
+
+!!! Compute geopotential
+       
+  ! for first layer
+  IF (is_omp_first_level) THEN
+    DO j=jj_begin,jj_end
+      DO i=ii_begin,ii_end
+        ij=(j-1)*iim+i
+        phi( ij,1 ) = phis( ij ) + theta(ij,1) * ( pks(ij) - pk(ij,1) )
+      ENDDO
+    ENDDO
+  ENDIF
+!!-> implicit flush on phi(:,1)
+          
+  ! for other layers
+  DO l = ll_beginp1, ll_end
+    DO j=jj_begin,jj_end
+      DO i=ii_begin,ii_end
+        ij=(j-1)*iim+i
+        phi(ij,l) =  0.5 * ( theta(ij,l)  + theta(ij,l-1) )  & 
+                         * (  pk(ij,l-1) -  pk(ij,l)    )
+      ENDDO
+    ENDDO
+  ENDDO       
+
+!$OMP BARRIER
+
+
+  IF (is_omp_first_level) THEN
+    DO l = 2, llm
+      DO j=jj_begin,jj_end
+! ---> Bug compilo intel ici en openmp
+! ---> Couper la boucle
+       IF (j==jj_end+1) PRINT*,"this message must not be printed"
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          phi(ij,l) = phi(ij,l)+ phi(ij,l-1)
+        ENDDO
+      ENDDO
+    ENDDO
+! --> IMPLICIT FLUSH on phi --> non 
+  ENDIF 
+
+! compute wind centered lon lat compound
+    DO l=ll_begin,ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          uc(:)=1/Ai(ij)*                                                                                                &
+                        ( ne(ij,right)*u(ij+u_right,l)*le(ij+u_right)*((xyz_v(ij+z_rdown,:)+xyz_v(ij+z_rup,:))/2-centroid(ij,:))  &
+                         + ne(ij,rup)*u(ij+u_rup,l)*le(ij+u_rup)*((xyz_v(ij+z_rup,:)+xyz_v(ij+z_up,:))/2-centroid(ij,:))          &
+                         + ne(ij,lup)*u(ij+u_lup,l)*le(ij+u_lup)*((xyz_v(ij+z_up,:)+xyz_v(ij+z_lup,:))/2-centroid(ij,:))          &
+                         + ne(ij,left)*u(ij+u_left,l)*le(ij+u_left)*((xyz_v(ij+z_lup,:)+xyz_v(ij+z_ldown,:))/2-centroid(ij,:))    &
+                         + ne(ij,ldown)*u(ij+u_ldown,l)*le(ij+u_ldown)*((xyz_v(ij+z_ldown,:)+xyz_v(ij+z_down,:))/2-centroid(ij,:))&
+                         + ne(ij,rdown)*u(ij+u_rdown,l)*le(ij+u_rdown)*((xyz_v(ij+z_down,:)+xyz_v(ij+z_rdown,:))/2-centroid(ij,:)))
+          ulon(ij,l)=sum(uc(:)*elon_i(ij,:))
+          ulat(ij,l)=sum(uc(:)*elat_i(ij,:)) 
+        ENDDO
+      ENDDO
+    ENDDO
+
+!$OMP BARRIER
+    END SUBROUTINE grid_icosa_to_physics
+
+
+    SUBROUTINE grid_physics_to_icosa
+    USE theta2theta_rhodz_mod
+    USE omp_para
+    IMPLICIT NONE
+      INTEGER :: i,j,ij,l,iq
+          
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            duc(ij,:,l)=dulon(ij,l)*elon_i(ij,:)+dulat(ij,l)*elat_i(ij,:)
+          ENDDO
+        ENDDO
+      ENDDO
+
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            u(ij+u_right,l) = u(ij+u_right,l) + dtphy * sum( 0.5*(duc(ij,:,l) + duc(ij+t_right,:,l))*ep_e(ij+u_right,:) )
+            u(ij+u_lup,l) = u(ij+u_lup,l) + dtphy * sum( 0.5*(duc(ij,:,l) + duc(ij+t_lup,:,l))*ep_e(ij+u_lup,:) )
+            u(ij+u_ldown,l) = u(ij+u_ldown,l) + dtphy*sum( 0.5*(duc(ij,:,l) + duc(ij+t_ldown,:,l))*ep_e(ij+u_ldown,:) )
+          ENDDO
+        ENDDO
+      ENDDO          
+
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            Temp(ij,l)=Temp(ij,l)+ dtphy * dTemp(ij,l)
+          ENDDO
+        ENDDO
+      ENDDO          
+      
+      DO iq=1,nqtot
+        DO l=ll_begin,ll_end
+          DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+              ij=(j-1)*iim+i
+              q(ij,l,iq)=q(ij,l,iq)+ dtphy * dq(ij,l,iq)
+            ENDDO
+          ENDDO
+        ENDDO 
+      ENDDO
+
+!$OMP BARRIER
+      
+     IF (is_omp_first_level) THEN
+       DO j=jj_begin,jj_end
+         DO i=ii_begin,ii_end
+           ij=(j-1)*iim+i
+           ps(ij)=ps(ij)+ dtphy * dps(ij)
+          ENDDO
+       ENDDO
+     ENDIF
+
+!     CALL compute_temperature2theta_rhodz(ps,Temp,theta_rhodz,0)
+
+! compute pression
+!$OMP BARRIER
+      DO    l    = ll_begin,ll_endp1
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            p(ij,l) = ap(l) + bp(l) * ps(ij)
+          ENDDO
+        ENDDO
+      ENDDO
+
+!$OMP BARRIER
+
+! compute exner
+       
+       IF (is_omp_first_level) THEN
+         DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+               ij=(j-1)*iim+i
+               pks(ij) = cpp * ( ps(ij)/preff ) ** kappa
+            ENDDO
+         ENDDO
+       ENDIF
+
+       ! 3D : pk
+       DO l = ll_begin,ll_end
+          DO j=jj_begin,jj_end
+             DO i=ii_begin,ii_end
+                ij=(j-1)*iim+i
+                pk(ij,l) = cpp * ((.5/preff)*(p(ij,l)+p(ij,l+1))) ** kappa
+             ENDDO
+          ENDDO
+       ENDDO
+
+!$OMP BARRIER
+
+!   compute theta, temperature and pression at layer
+    DO    l    = ll_begin, ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          theta_rhodz(ij,l,1) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / (pk(ij,l) / cpp )
+        ENDDO
+      ENDDO
+    ENDDO
+    
+    END SUBROUTINE grid_physics_to_icosa
+
+
+
+  END SUBROUTINE physics
+
+
+
+
+
+END MODULE interface_icosa_lmdz_mod
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/phylmd/interface_icosa_lmdz.F90
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/phylmd/interface_icosa_lmdz.F90	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/phylmd/interface_icosa_lmdz.F90	(revision 6606)
@@ -0,0 +1,1171 @@
+MODULE interface_icosa_lmdz_mod
+
+  USE field_mod, ONLY: t_field
+  USE transfert_mod, ONLY: t_message 
+  
+ 
+  TYPE(t_message),SAVE :: req_u, req_z
+  TYPE(t_message),SAVE :: req_dps0, req_dulon0, req_dulat0, req_dTemp0, req_dq0
+
+  TYPE(t_field),POINTER,SAVE :: f_p(:) 
+  TYPE(t_field),POINTER,SAVE :: f_pks(:)  
+  TYPE(t_field),POINTER,SAVE :: f_pk(:)  
+  TYPE(t_field),POINTER,SAVE :: f_p_layer(:)    
+  TYPE(t_field),POINTER,SAVE :: f_theta(:)   
+  TYPE(t_field),POINTER,SAVE :: f_phi(:)   
+  TYPE(t_field),POINTER,SAVE :: f_Temp(:)    
+  TYPE(t_field),POINTER,SAVE :: f_ulon(:)    
+  TYPE(t_field),POINTER,SAVE :: f_ulat(:)   
+  TYPE(t_field),POINTER,SAVE :: f_vort(:)   
+  TYPE(t_field),POINTER,SAVE :: f_vortc(:)   
+  TYPE(t_field),POINTER,SAVE :: f_dulon(:)
+  TYPE(t_field),POINTER,SAVE :: f_dulat(:)
+  TYPE(t_field),POINTER,SAVE :: f_dTemp(:)
+  TYPE(t_field),POINTER,SAVE :: f_dq(:)
+  TYPE(t_field),POINTER,SAVE :: f_dps(:)
+  TYPE(t_field),POINTER,SAVE :: f_duc(:)
+  TYPE(t_field),POINTER,SAVE :: f_bounds_lon(:)
+  TYPE(t_field),POINTER,SAVE :: f_bounds_lat(:)
+
+  INTEGER :: start_clock
+  INTEGER :: stop_clock
+  INTEGER :: count_clock=0
+  
+  INTEGER,SAVE :: nbp_phys
+  INTEGER,SAVE :: nbp_phys_glo
+
+
+CONTAINS
+
+  SUBROUTINE initialize_physics
+  USE distrib_icosa_lmdz_mod, ONLY : init_distrib_icosa_lmdz, transfer_icosa_to_lmdz
+! from dynamico
+  USE domain_mod
+  USE dimensions
+  USE mpi_mod
+  USE mpipara
+  USE disvert_mod
+  USE xios_mod
+  USE time_mod , init_time_icosa=> init_time 
+  USE transfert_mod
+  USE nudging_mod, ONLY : lam_halo_scheme
+  
+! from LMDZ
+  USE mod_grid_phy_lmdz, ONLY : unstructured
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE transfert_mod
+  USE physics_distribution_mod, ONLY : init_physics_distribution
+   
+  
+  IMPLICIT NONE
+  INTEGER  :: ind,i,j,ij,pos,h
+  REAL(rstd),POINTER :: bounds_lon(:,:)
+  REAL(rstd),POINTER :: bounds_lat(:,:)
+  
+  REAL(rstd),ALLOCATABLE :: latfi(:)
+  REAL(rstd),ALLOCATABLE :: lonfi(:)
+  REAL(rstd),ALLOCATABLE :: airefi(:)
+  REAL(rstd),ALLOCATABLE :: bounds_latfi(:,:)
+  REAL(rstd),ALLOCATABLE :: bounds_lonfi(:,:)
+  LOGICAL   ,ALLOCATABLE :: outside(:,:)
+  LOGICAL   ,ALLOCATABLE :: outside_tmp(:,:)
+  LOGICAL   ,POINTER     :: out(:,:)
+!  REAL(rstd) :: pseudoalt(llm)
+
+  INTEGER :: nbp_phys, nbp_phys_glo
+  
+!$OMP PARALLEL
+    CALL allocate_field(f_bounds_lon,field_t,type_real,6)
+    CALL allocate_field(f_bounds_lat,field_t,type_real,6)
+    CALL allocate_field(f_p,field_t,type_real,llm+1,name="p_in")
+    CALL allocate_field(f_pks,field_t,type_real)
+    CALL allocate_field(f_pk,field_t,type_real,llm)
+    CALL allocate_field(f_p_layer,field_t,type_real,llm,name="p_layer_in")
+    CALL allocate_field(f_theta,field_t,type_real,llm)
+    CALL allocate_field(f_phi,field_t,type_real,llm,name="phi_in")
+    CALL allocate_field(f_Temp,field_t,type_real,llm,name="Temp_in")
+    CALL allocate_field(f_ulon,field_t,type_real,llm,name="ulon_in")
+    CALL allocate_field(f_ulat,field_t,type_real,llm,name="ulat_in")
+    CALL allocate_field(f_vort,field_z,type_real,llm,name="vort_in")
+    CALL allocate_field(f_vortc,field_t,type_real,llm,name="vortc_in")
+    CALL allocate_field(f_dulon,field_t,type_real,llm,name="dulon_out")
+    CALL allocate_field(f_dulat,field_t,type_real,llm,name="dulat_out")
+    CALL allocate_field(f_dTemp,field_t,type_real,llm,name="dTemp_out")
+    CALL allocate_field(f_dq,field_t,type_real,llm,nqtot,name="dq_out")
+    CALL allocate_field(f_dps,field_t,type_real,name="dps_out")
+    CALL allocate_field(f_duc,field_t,type_real,3,llm)    
+
+    CALL init_message(f_dps,req_i0,req_dps0)
+    CALL init_message(f_dulon,req_i0,req_dulon0)
+    CALL init_message(f_dulat,req_i0,req_dulat0)
+    CALL init_message(f_dTemp,req_i0,req_dTemp0)
+    CALL init_message(f_dq,req_i0,req_dq0)
+!$OMP END PARALLEL    
+
+    nbp_phys=0
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+
+      ALLOCATE(outside(ii_begin:ii_end,jj_begin:jj_end)) ! for limited area : don't take cells arround the border
+      ALLOCATE(outside_tmp(ii_begin-1:ii_end+1,jj_begin-1:jj_end+1)) ! for limited area : don't take cells arround the border
+      out=>domain(ind)%outside
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          outside(i,j)=  out(i+1,j)     .OR. & ! right
+                         out(i,j+1    ) .OR. & ! rup
+                         out(i-1  ,j+1) .OR. & ! lup
+                         out(i-1  ,j)   .OR. & !left
+                         out(i    ,j-1) .OR. & !ldown
+                         out(i+1,j-1)          !rdown    
+        ENDDO
+      ENDDO
+
+      outside_tmp=.FALSE.
+      outside_tmp(ii_begin:ii_end,jj_begin:jj_end)=outside
+      
+      DO h=1,lam_halo_scheme-1 ! do not compute physic on limited area halo
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+              outside(i,j) = outside_tmp(i,j)       .OR. &
+                             outside_tmp(i+1,j)     .OR. & ! right
+                             outside_tmp(i,j+1    ) .OR. & ! rup
+                             outside_tmp(i-1  ,j+1) .OR. & ! lup
+                             outside_tmp(i-1  ,j)   .OR. & !left
+                             outside_tmp(i    ,j-1) .OR. & !ldown
+                             outside_tmp(i+1,j-1)          !rdown
+           ENDDO
+        ENDDO
+        outside_tmp(ii_begin:ii_end,jj_begin:jj_end)=outside
+      ENDDO
+      
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          IF (domain(ind)%own(i,j) .AND. .NOT.outside(i,j)) nbp_phys=nbp_phys+1
+        ENDDO
+      ENDDO
+      DEALLOCATE(outside)
+      DEALLOCATE(outside_tmp)
+    ENDDO
+    
+
+!initialize LMDZ5 physic mpi decomposition
+    CALL MPI_ALLREDUCE(nbp_phys,nbp_phys_glo,1,MPI_INTEGER,MPI_SUM,comm_icosa,ierr)
+    CALL init_physics_distribution(unstructured, 6, nbp_phys, 1, nbp_phys_glo, llm, comm_icosa)
+    
+    DO ind=1,ndomain
+        CALL swap_dimensions(ind)
+        CALL swap_geometry(ind)
+        bounds_lon=f_bounds_lon(ind)
+        bounds_lat=f_bounds_lat(ind)
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            CALL xyz2lonlat(xyz_v(ij+z_rup,:), bounds_lon(ij,1), bounds_lat(ij,1))
+            CALL xyz2lonlat(xyz_v(ij+z_up,:), bounds_lon(ij,2), bounds_lat(ij,2))
+            CALL xyz2lonlat(xyz_v(ij+z_lup,:), bounds_lon(ij,3), bounds_lat(ij,3))
+            CALL xyz2lonlat(xyz_v(ij+z_ldown,:), bounds_lon(ij,4), bounds_lat(ij,4))
+            CALL xyz2lonlat(xyz_v(ij+z_down,:), bounds_lon(ij,5), bounds_lat(ij,5))
+            CALL xyz2lonlat(xyz_v(ij+z_rdown,:), bounds_lon(ij,6), bounds_lat(ij,6))
+         ENDDO
+       ENDDO            
+    ENDDO
+          
+!$OMP PARALLEL
+    CALL initialize_physics_omp
+!$OMP END PARALLEL            
+
+    CALL xios_set_context    
+
+
+     
+
+  END SUBROUTINE initialize_physics
+
+
+  SUBROUTINE initialize_physics_omp
+  USE distrib_icosa_lmdz_mod, ONLY : init_distrib_icosa_lmdz, transfer_icosa_to_lmdz
+! from dynamico
+  USE domain_mod
+  USE dimensions
+  USE mpi_mod
+  USE mpipara
+  USE disvert_mod
+  USE earth_const, ONLY: scale_height
+  USE xios_mod
+  USE time_mod , init_time_icosa=> init_time 
+  USE omp_para
+
+! from LMDZ
+  USE mod_grid_phy_lmdz, ONLY : unstructured, klon_glo
+  USE mod_phys_lmdz_para, ONLY: klon_omp, reduce_min_lmdz => reduce_min , gather_lmdz => gather , bcast_lmdz => bcast
+  USE time_phylmdz_mod, ONLY: init_time_lmdz => init_time
+  USE transfert_mod
+!  USE physics_distribution_mod, ONLY : init_physics_distribution
+  USE geometry_mod, ONLY : init_geometry
+  USE vertical_layers_mod, ONLY : init_vertical_layers
+  USE infotrac_phy, ONLY : init_infotrac_phy
+  USE inifis_mod, ONLY : inifis 
+!  USE phyaqua_mod, ONLY : iniaqua 
+
+
+  
+  IMPLICIT NONE
+
+
+
+  INTEGER  :: ind,i,j,k,ij,pos
+  REAL(rstd),POINTER :: bounds_lon(:,:)
+  REAL(rstd),POINTER :: bounds_lat(:,:)
+  
+  REAL(rstd),ALLOCATABLE :: latfi(:)
+  REAL(rstd),ALLOCATABLE :: lonfi(:)
+  REAL(rstd),ALLOCATABLE :: airefi(:)
+  REAL(rstd),ALLOCATABLE :: bounds_latfi(:,:)
+  REAL(rstd),ALLOCATABLE :: bounds_lonfi(:,:)
+  REAL(rstd),ALLOCATABLE :: ind_cell_glo_r(:)
+  INTEGER,   ALLOCATABLE :: ind_cell_glo(:)
+  INTEGER,   ALLOCATABLE :: ind_cell_glo_tot(:)
+  INTEGER,   ALLOCATABLE :: cell_glo_tot(:)
+  INTEGER :: ncell_glo_tot
+
+  REAL(rstd) :: pseudoalt(llm)
+  REAL(rstd) :: aps(llm)
+  REAL(rstd) :: bps(llm)
+  REAL(rstd) :: scaleheight
+
+  INTEGER :: run_length  
+  REAL :: day_length ! length of a day (s) ! SAVEd to be OpenMP shared <--- NO!!!!
+  INTEGER :: annee_ref  
+  INTEGER :: day_ref    
+  INTEGER :: day_ini    
+  REAL    :: start_time 
+  REAL    :: physics_timestep    
+
+  ! Tracer stuff (SAVEd when needed to be OpenMP shared)
+  INTEGER :: nq
+  INTEGER                       :: nqo, nbtr, nbtr_inca
+  CHARACTER(len=4)              :: type_trac
+  CHARACTER(len=20),ALLOCATABLE :: tname(:)    ! tracer short name for restart and diagnostics
+  CHARACTER(len=23),ALLOCATABLE :: ttext(:)     ! tracer long name for diagnostics
+  INTEGER,ALLOCATABLE           :: niadv(:)    ! equivalent dyn / physique
+  INTEGER,ALLOCATABLE           :: conv_flg(:) ! conv_flg(it)=0 : convection desactivated for tracer number it 
+  INTEGER,ALLOCATABLE           :: pbl_flg(:)  ! pbl_flg(it)=0  : boundary layer diffusion desactivaded for tracer number it 
+  CHARACTER(len=8),ALLOCATABLE  :: solsym(:)  ! tracer name from inca
+  ! Isotopes
+  INTEGER,ALLOCATABLE :: nqfils(:)
+  INTEGER,ALLOCATABLE :: nqdesc(:)
+  INTEGER :: nqdesc_tot
+  INTEGER,ALLOCATABLE :: iqfils(:,:)
+  INTEGER,ALLOCATABLE :: iqpere(:)
+  LOGICAL :: ok_isotopes
+  LOGICAL :: ok_iso_verif
+  LOGICAL :: ok_isotrac
+  LOGICAL :: ok_init_iso
+  INTEGER :: niso_possibles
+  REAL,ALLOCATABLE :: tnat(:)
+  REAL,ALLOCATABLE :: alpha_ideal(:)
+  LOGICAL,ALLOCATABLE :: use_iso(:)
+  INTEGER,ALLOCATABLE :: iqiso(:,:)
+  INTEGER,ALLOCATABLE :: iso_num(:)
+  INTEGER,ALLOCATABLE :: iso_indnum(:)
+  INTEGER,ALLOCATABLE :: zone_num(:)
+  INTEGER,ALLOCATABLE :: phase_num(:)
+  INTEGER,ALLOCATABLE :: indnum_fn_num(:)
+  INTEGER,ALLOCATABLE :: index_trac(:,:)
+  INTEGER :: niso
+  INTEGER :: ntraceurs_zone
+  INTEGER :: ntraciso
+
+  TYPE(t_field),POINTER,SAVE    :: f_ind_cell_glo(:)
+  
+  INTEGER :: iflag_phys    
+
+  INTEGER, ALLOCATABLE, DIMENSION(:) :: hadv_inca  ! index of horizontal trasport schema
+  INTEGER, ALLOCATABLE, DIMENSION(:) :: vadv_inca  ! index of vertical trasport schema
+! LLORET
+  LOGICAL :: offline
+
+    CALL init_distrib_icosa_lmdz
+    
+    ALLOCATE(latfi(klon_omp))
+    ALLOCATE(lonfi(klon_omp))
+    ALLOCATE(airefi(klon_omp))
+    ALLOCATE(bounds_latfi(klon_omp,6))
+    ALLOCATE(bounds_lonfi(klon_omp,6))
+    ALLOCATE(ind_cell_glo_r(klon_omp))
+    ALLOCATE(ind_cell_glo(klon_omp))
+
+    CALL transfer_icosa_to_lmdz(geom%lat_i,latfi)
+    CALL transfer_icosa_to_lmdz(geom%lon_i,lonfi)
+    CALL transfer_icosa_to_lmdz(f_bounds_lat,bounds_latfi)
+    CALL transfer_icosa_to_lmdz(f_bounds_lon,bounds_lonfi)
+    CALL transfer_icosa_to_lmdz(geom%Ai,airefi)
+
+    CALL allocate_field(f_ind_cell_glo,field_t,type_real)
+    
+    DO ind=1,ndomain
+      IF (.NOT. assigned_domain(ind)  .OR. .NOT. is_omp_level_master ) CYCLE
+      CALL swap_dimensions(ind)
+      CALL swap_geometry(ind)
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          f_ind_cell_glo(ind)%rval2d(ij)=domain(ind)%assign_cell_glo(i,j)
+        ENDDO
+      ENDDO
+    ENDDO
+
+     
+   CALL transfer_icosa_to_lmdz(f_ind_cell_glo,ind_cell_glo_r)
+   CALL deallocate_field(f_ind_cell_glo)
+   ind_cell_glo=INT(ind_cell_glo_r)
+   DEALLOCATE(ind_cell_glo_r)   
+   
+    
+   CALL reduce_min_lmdz(MINVAL(-ind_cell_glo),ncell_glo_tot) ! reduce_max does not exist in lmdz, use reduce_min
+   CALL bcast_lmdz(ncell_glo_tot)
+   ncell_glo_tot=-ncell_glo_tot
+   ALLOCATE(cell_glo_tot(0:ncell_glo_tot))
+   ALLOCATE(ind_cell_glo_tot(klon_glo))
+   CALL gather_lmdz(ind_cell_glo,ind_cell_glo_tot)
+   CALL bcast_lmdz(ind_cell_glo_tot)
+   
+   cell_glo_tot=-1
+   DO i=1,klon_glo
+     cell_glo_tot(ind_cell_glo_tot(i))= 0
+   ENDDO
+   
+   pos=0
+   DO i=0,ncell_glo_tot
+     IF (cell_glo_tot(i)/=-1) THEN
+       cell_glo_tot(i) = pos
+       pos=pos + 1
+     ENDIF
+   ENDDO
+
+   DO i=1,klon_omp
+     ind_cell_glo(i)=cell_glo_tot(ind_cell_glo(i))
+   ENDDO  
+
+   ind_cell_glo = ind_cell_glo + 1 ! lmdz expect global indices begining to 1 not 0
+ 
+   
+!   CALL MPI_ALLGATHER(ncell,1,MPI_INTEGER,ncell_mpi,1,MPI_INTEGER,comm_icosa,ierr)
+!
+!   displ(0)=0
+!   DO i=1,mpi_size-1
+!     displ(i)=displ(i-1)+ncell_mpi(i-1)
+!   ENDDO
+!   
+!   ALLOCATE(ind_glo_tot(ncell_tot))
+!   ALLOCATE(cell_glo_tot(0:ncell_glo_tot-1))
+!   
+!   cell_glo_tot(:)= -1
+!   CALL MPI_ALLGATHERV(ind_glo, ncell, MPI_INTEGER, ind_glo_tot, ncell_mpi, displ, MPI_INTEGER, comm_icosa,ierr)
+!   
+!   DO i=1,ncell_tot
+!     cell_glo_tot(ind_glo_tot(i))= 0
+!   ENDDO
+! 
+!   ncell_glo=0
+!   DO i=0,ncell_glo_tot-1
+!     IF (cell_glo_tot(i)/=-1) THEN
+!       cell_glo_tot(i) = ncell_glo
+!       ncell_glo=ncell_glo + 1
+!     ENDIF
+!   ENDDO
+!
+!   DO i=1,ncell
+!     ind_glo(i)=cell_glo_tot(ind_glo(i))
+!   ENDDO  
+
+              
+    CALL init_geometry(klon_omp,lonfi, latfi, bounds_lonfi, bounds_latfi, airefi, ind_cell_glo)
+
+    scaleheight=scale_height/1000. ! Atmospheric scale height (km)
+    aps(1:llm)=0.5*(ap(1:llm)+ap(2:llm+1))
+    bps(1:llm)=0.5*(bp(1:llm)+bp(2:llm+1))
+    pseudoalt(:)=-scaleheight*log(presnivs(:)/preff)
+    CALL init_vertical_layers(llm,preff,scaleheight,ap,bp,aps,bps,presnivs,pseudoalt)
+
+
+    ! Initialize tracer names, numbers, etc. for physics
+    !Config  Key  = type_trac
+    !Config  Desc = Choix de couplage avec model de chimie INCA ou REPROBUS
+    !Config  Def  = lmdz
+    !Config  Help = 
+    !Config         'lmdz' = pas de couplage, pur LMDZ
+    !Config         'inca' = model de chime INCA 
+    !Config         'repr' = model de chime REPROBUS
+     type_trac = 'lmdz'
+     CALL getin('type_trac',type_trac)
+
+! allocate some of the tracer arrays
+    ALLOCATE(tname(nqtot))
+    ALLOCATE(ttext(nqtot))
+    ALLOCATE(niadv(nqtot))
+
+! read "traceur.def" file to know tracer names (and figure out nqo and nbtr)
+
+    IF (type_trac .eq. "lmdz") THEN 
+       IF (is_mpi_root) THEN
+  !$OMP MASTER
+          OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr)
+          IF (ierr==0) THEN
+             READ(42,*) nq ! should be the same as nqtot
+             IF (nq /= nqtot) THEN
+                WRITE(*,*) "Error: number of tracers in tracer.def should match nqtot!"
+                WRITE(*,*) "       will just use nqtot=",nqtot," tracers"
+             ENDIF
+             DO i=1,nqtot
+                READ(42,*) j,k,tname(i)
+             ENDDO
+             CLOSE(42)
+          ENDIF
+          ! figure out how many water tracers are present
+          nqo=0
+          DO i=1,nqtot
+             IF (INDEX(tname(i),"H2O")==1) THEN
+                nqo=nqo+1
+             ENDIF
+          ENDDO
+          nbtr=nqtot-nqo
+   !$OMP END MASTER
+       ENDIF
+ 
+    ELSE IF (type_trac .eq. "inca" ) THEN 
+
+       IF (is_mpi_root) THEN
+  !$OMP MASTER
+          ! figure out how many water tracers are present
+          OPEN(unit=42,file="traceur.def",form="formatted",status="old",iostat=ierr)
+          IF (ierr==0) THEN
+             READ(42,*) nq ! nombre de traceurs d'eau 2 ou 3
+             DO i=1,nq
+                READ(42,*) j,k,tname(i)
+             ENDDO
+             CLOSE(42)
+          ENDIF
+          ! figure out how many others tracers are present
+
+          CALL  Init_chem_trac()
+
+          
+          IF ((nq + nbtr) .NE. nqtot) THEN
+             WRITE(*,*) "Error: number of tracers in tracer.def and inca should match nqtot!"
+             WRITE(*,*) "       will just use nqtot=",nqtot," tracers and not ", nq , " + ", nbtr 
+          ENDIF
+          
+          nqo = nq
+   !$OMP END MASTER
+
+       ENDIF
+
+    ENDIF
+
+
+    CALL bcast(nqo)
+    CALL bcast(nbtr)
+    IF (type_trac .EQ. "lmdz") THEN 
+       DO i=1,nqtot
+          CALL bcast(tname(i))
+       ENDDO
+    ELSE IF (type_trac .EQ. "inca") THEN 
+       DO i=1,nqo
+          CALL bcast(tname(i))
+       ENDDO
+    ENDIF
+
+    ALLOCATE(conv_flg(nbtr))
+    ALLOCATE(pbl_flg(nbtr))
+    ALLOCATE(solsym(nbtr))
+    ALLOCATE(hadv_inca(nbtr))
+    ALLOCATE(vadv_inca(nbtr)) 
+    
+    conv_flg(:) = 1 ! convection activated for all tracers
+    pbl_flg(:)  = 1 ! boundary layer activated for all tracers
+    ! tracer long names:
+    ttext(1)=trim(tname(1))//"VLH" !'H2OvVLH'
+    DO i=2,nqtot
+      ttext(i)=trim(tname(1))//"VL1"
+    ENDDO
+
+    IF (type_trac .EQ. "lmdz") THEN 
+       solsym(1:nbtr)=tname(nqo+1:nqtot)
+    ELSE IF (type_trac .EQ. "inca") THEN 
+       CALL init_chem_transport()
+    ENDIF
+
+
+    DO i=1,nqtot
+      niadv(i)=i
+    ENDDO
+
+    ! isotopes
+    ALLOCATE(nqfils(nqtot)) ; nqfils(:)=0
+    ALLOCATE(nqdesc(nqtot)) ; nqdesc(:)=0
+    nqdesc_tot=0
+    ALLOCATE(iqfils(nqtot,nqtot)) ; iqfils(:,:)=0
+    ALLOCATE(iqpere(nqtot)) ; iqpere(:)=0
+    ok_isotopes=.false.
+    ok_iso_verif=.false.
+    ok_isotrac=.false.
+    ok_init_iso=.false.
+    niso_possibles=5
+    niso=0
+    ntraceurs_zone=0
+    ntraciso=0
+    ALLOCATE(tnat(niso_possibles)) ; tnat(:)=0
+    ALLOCATE(alpha_ideal(niso_possibles)) ; alpha_ideal(:)=0
+    ALLOCATE(use_iso(niso_possibles)) ; use_iso(:)=.false.
+    ALLOCATE(iqiso(ntraciso,nqo)) ; iqiso(:,:)=0
+    ALLOCATE(iso_num(nqtot)) ; iso_num(:)=0
+    ALLOCATE(iso_indnum(nqtot)) ; iso_indnum(:)=0
+    ALLOCATE(zone_num(nqtot)) ; zone_num(:)=0
+    ALLOCATE(phase_num(nqtot)) ; phase_num(:)=0
+    ALLOCATE(indnum_fn_num(niso_possibles)) ; indnum_fn_num(:)=0
+    ALLOCATE(index_trac(ntraceurs_zone,niso)) ; index_trac(:,:)=0
+        
+    CALL init_infotrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,&
+                           niadv,conv_flg,pbl_flg,solsym, &
+                           nqfils,nqdesc,nqdesc_tot,iqfils,iqpere, &
+                           ok_isotopes,ok_iso_verif,ok_isotrac, &
+                           ok_init_iso,niso_possibles,tnat, &
+                           alpha_ideal,use_iso,iqiso,iso_num, &
+                           iso_indnum,zone_num,phase_num, &
+                           indnum_fn_num,index_trac, &
+                           niso,ntraceurs_zone,ntraciso)
+
+   ! Initialize physical constant
+    day_length=86400
+    CALL getin('day_length',day_length)
+    CALL inifis(day_length,radius,g,kappa*cpp,cpp)
+ 
+
+    
+  ! init time
+    annee_ref=2015
+    CALL getin("anneeref",annee_ref)
+    
+    day_ref=1
+    CALL getin("dayref",day_ref)
+    
+    physics_timestep=dt*itau_physics
+    run_length=itaumax*dt
+    ndays=NINT(run_length/day_length)
+    
+    day_ini=INT(itau0*dt/day_length)+day_ref
+    start_time= itau0*dt/day_length-INT(itau0*dt/day_length)
+
+    CALL init_time_lmdz(annee_ref, day_ref, day_ini, start_time, int(ndays), physics_timestep)
+
+!  Additional initializations for aquaplanets
+!    CALL getin("iflag_phys",iflag_phys)
+!    IF (iflag_phys>=100) THEN
+!      CALL iniaqua(klon_omp, iflag_phys)
+!    END IF
+
+  
+
+#ifdef INCA
+    CONTAINS 
+
+      SUBROUTINE init_chem_trac() 
+        IMPLICIT NONE
+
+        CALL  Init_chem_inca_trac(nbtr)
+
+      END SUBROUTINE init_chem_trac
+
+      SUBROUTINE init_chem_transport()
+
+        IMPLICIT NONE
+
+        CALL init_transport(solsym, conv_flg,pbl_flg, hadv_inca, vadv_inca)
+
+      END SUBROUTINE init_chem_transport
+
+
+#else 
+    CONTAINS 
+      SUBROUTINE init_chem_trac() 
+        IMPLICIT NONE
+
+      END SUBROUTINE init_chem_trac
+
+      SUBROUTINE init_chem_transport()
+
+        IMPLICIT NONE
+
+      END SUBROUTINE init_chem_transport
+
+
+#endif
+
+
+
+  END SUBROUTINE  initialize_physics_omp 
+  
+  
+
+
+  SUBROUTINE physics
+  USE icosa
+  USE time_mod
+  USE disvert_mod
+  USE transfert_mod
+  USE mpipara
+  USE xios_mod
+  USE wxios
+  USE trace
+  USE distrib_icosa_lmdz_mod, ONLY : transfer_icosa_to_lmdz, transfer_lmdz_to_icosa
+  USE physics_external_mod, ONLY : it, f_phis, f_ps, f_theta_rhodz, f_u, f_wflux, f_q 
+  USE write_field_mod
+  USE checksum_mod
+  USE vorticity_mod
+
+! from LMDZ
+  USE mod_phys_lmdz_omp_data, ONLY: klon_omp
+  USE geometry_mod, ONLY : cell_area
+  USE physiq_mod, ONLY: physiq
+  IMPLICIT NONE
+  
+    REAL(rstd),POINTER :: phis(:)
+    REAL(rstd),POINTER :: ps(:)
+    REAL(rstd),POINTER :: theta_rhodz(:,:,:)
+    REAL(rstd),POINTER :: u(:,:)
+    REAL(rstd),POINTER :: wflux(:,:)
+    REAL(rstd),POINTER :: q(:,:,:)
+    REAL(rstd),POINTER :: p(:,:)
+    REAL(rstd),POINTER :: pks(:)
+    REAL(rstd),POINTER :: pk(:,:)
+    REAL(rstd),POINTER :: p_layer(:,:)
+    REAL(rstd),POINTER :: theta(:,:)
+    REAL(rstd),POINTER :: phi(:,:)
+    REAL(rstd),POINTER :: Temp(:,:)
+    REAL(rstd),POINTER :: ulon(:,:)
+    REAL(rstd),POINTER :: ulat(:,:)
+    REAL(rstd),POINTER :: vort(:,:)
+    REAL(rstd),POINTER :: vortc(:,:)
+    REAL(rstd),POINTER :: dulon(:,:)
+    REAL(rstd),POINTER :: dulat(:,:)
+    REAL(rstd),POINTER :: dTemp(:,:)
+    REAL(rstd),POINTER :: dq(:,:,:)
+    REAL(rstd),POINTER :: dps(:)
+    REAL(rstd),POINTER :: duc(:,:,:)
+
+
+    INTEGER :: ind,l
+    
+    REAL(rstd),ALLOCATABLE,SAVE :: ps_phy(:)
+!$OMP THREADPRIVATE(ps_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: p_phy(:,:)
+!$OMP THREADPRIVATE(p_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: p_layer_phy(:,:)
+!$OMP THREADPRIVATE(p_layer_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: Temp_phy(:,:)
+!$OMP THREADPRIVATE(Temp_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: phis_phy(:)
+!$OMP THREADPRIVATE(phis_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: phi_phy(:,:)
+!$OMP THREADPRIVATE(phi_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: ulon_phy(:,:)
+!$OMP THREADPRIVATE(ulon_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: ulat_phy(:,:)
+!$OMP THREADPRIVATE(ulat_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: rot_phy(:,:)
+!$OMP THREADPRIVATE(rot_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: q_phy(:,:,:)
+!$OMP THREADPRIVATE(q_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: wflux_phy(:,:)
+!$OMP THREADPRIVATE(wflux_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dulon_phy(:,:)
+!$OMP THREADPRIVATE(dulon_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dulat_phy(:,:)
+!$OMP THREADPRIVATE(dulat_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dTemp_phy(:,:)
+!$OMP THREADPRIVATE(dTemp_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dq_phy(:,:,:)
+!$OMP THREADPRIVATE(dq_phy)
+    REAL(rstd),ALLOCATABLE,SAVE :: dps_phy(:)
+!$OMP THREADPRIVATE(dps_phy)
+    REAL(rstd)   :: dtphy 
+    LOGICAL      :: debut
+    LOGICAL      :: lafin
+    LOGICAL,SAVE :: first=.TRUE.
+!$OMP THREADPRIVATE(first)
+
+    
+    IF(first) THEN 
+      debut=.TRUE.
+    ELSE 
+      debut=.FALSE.
+    ENDIF
+
+
+    IF(it-itau0>=itaumax) THEN 
+      lafin=.TRUE.
+    ELSE 
+      lafin=.FALSE.
+    ENDIF
+
+    IF (first) THEN
+      first=.FALSE.
+      CALL init_message(f_u,req_e1_vect,req_u)
+      CALL init_message(f_vort,req_z1_scal,req_z)
+      ALLOCATE(ps_phy(klon_omp))
+      ALLOCATE(p_phy(klon_omp,llm+1))
+      ALLOCATE(p_layer_phy(klon_omp,llm))
+      ALLOCATE(Temp_phy(klon_omp,llm))
+      ALLOCATE(phis_phy(klon_omp))
+      ALLOCATE(phi_phy(klon_omp,llm))
+      ALLOCATE(ulon_phy(klon_omp,llm))
+      ALLOCATE(ulat_phy(klon_omp,llm))
+      ALLOCATE(rot_phy(klon_omp,llm))
+      ALLOCATE(q_phy(klon_omp,llm,nqtot))
+      ALLOCATE(wflux_phy(klon_omp,llm))
+      ALLOCATE(dulon_phy(klon_omp,llm))
+      ALLOCATE(dulat_phy(klon_omp,llm))
+      ALLOCATE(dTemp_phy(klon_omp,llm))
+      ALLOCATE(dq_phy(klon_omp,llm,nqtot))
+      ALLOCATE(dps_phy(klon_omp))
+!$OMP BARRIER
+    ENDIF
+
+
+!$OMP MASTER        
+!    CALL update_calendar(it)
+!$OMP END MASTER
+!$OMP BARRIER
+    dtphy=itau_physics*dt
+    
+    
+    
+    CALL transfert_message(f_u,req_u)
+    DO ind=1,ndomain
+      IF (assigned_domain(ind)) THEN
+        CALL swap_dimensions(ind)
+        CALL swap_geometry(ind)
+        u=f_u(ind)
+        vort=f_vort(ind)
+        CALL compute_vorticity(u,vort)
+      ENDIF
+    ENDDO
+
+    CALL transfert_message(f_vort,req_z)
+
+    
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      IF (assigned_domain(ind)) THEN
+        CALL swap_geometry(ind)
+      
+        phis=f_phis(ind)
+        ps=f_ps(ind)
+        theta_rhodz=f_theta_rhodz(ind)
+        u=f_u(ind)
+        q=f_q(ind)
+        wflux=f_wflux(ind)
+        p=f_p(ind)
+        pks=f_pks(ind)
+        pk=f_pk(ind)
+        p_layer=f_p_layer(ind)
+        theta=f_theta(ind)
+        phi=f_phi(ind)
+        Temp=f_Temp(ind)
+        ulon=f_ulon(ind)
+        ulat=f_ulat(ind)
+        vort=f_vort(ind)
+        vortc=f_vortc(ind)
+            
+        CALL grid_icosa_to_physics
+
+      ENDIF
+    ENDDO
+   
+!$OMP BARRIER
+!$OMP MASTER
+    CALL SYSTEM_CLOCK(start_clock)
+!$OMP END MASTER
+    CALL trace_start("physic")
+!    CALL trace_off()
+
+
+!    CALL writeField("p_in",f_p)
+!    CALL writeField("p_layer_in",f_p_layer)
+!    CALL writeField("phi_in",f_phi)
+!    CALL writeField("phis_in",f_phis)
+!    CALL writeField("ulon_in",f_ulon)
+!    CALL writeField("ulat_in",f_ulat)
+!    CALL writeField("Temp_in",f_Temp)
+!    CALL writeField("q_in",f_q)
+!    CALL writeField("wflux_in",f_wflux)
+!     CALL writeField("vortc",f_vortc)
+
+!    CALL checksum(f_p)
+!    CALL checksum(f_p_layer)
+!    CALL checksum(f_phi)
+!    CALL checksum(f_phis)
+!    CALL checksum(f_ulon)
+!    CALL checksum(f_ulat)
+!    CALL checksum(f_Temp)
+!    CALL checksum(f_q)
+!    CALL checksum(f_wflux)
+
+    CALL transfer_icosa_to_lmdz(f_p      , p_phy)
+    CALL transfer_icosa_to_lmdz(f_p_layer, p_layer_phy)
+    CALL transfer_icosa_to_lmdz(f_phi    , phi_phy)
+    CALL transfer_icosa_to_lmdz(f_phis   , phis_phy )
+    CALL transfer_icosa_to_lmdz(f_ulon   , ulon_phy )
+    CALL transfer_icosa_to_lmdz(f_ulat   , ulat_phy)
+    CALL transfer_icosa_to_lmdz(f_vortc   , rot_phy)
+    CALL transfer_icosa_to_lmdz(f_Temp   , Temp_phy)
+    CALL transfer_icosa_to_lmdz(f_q      , q_phy)
+    CALL transfer_icosa_to_lmdz(f_wflux  , wflux_phy)
+
+    DO l=1,llm
+      wflux_phy(:,l) = - wflux_phy(:,l)*cell_area(:)
+      phi_phy(:,l)=phi_phy(:,l)-phis_phy(:)
+    ENDDO
+    
+    CALL wxios_set_context()
+ 
+    ! Ehouarn: rot_phy() not implemented!! Set it to zero for now
+!    rot_phy(:,:)=0
+    CALL physiq(klon_omp, llm, debut, lafin, dtphy, &
+                p_phy, p_layer_phy, phi_phy, phis_phy, presnivs, &
+                ulon_phy, ulat_phy, rot_phy, Temp_phy, q_phy, wflux_phy, &
+                dulon_phy, dulat_phy, dTemp_phy, dq_phy, dps_phy)
+    
+    CALL transfer_lmdz_to_icosa(dulon_phy, f_dulon )
+    CALL transfer_lmdz_to_icosa(dulat_phy, f_dulat )
+    CALL transfer_lmdz_to_icosa(dTemp_phy, f_dTemp )
+    CALL transfer_lmdz_to_icosa(dq_phy   , f_dq )
+    CALL transfer_lmdz_to_icosa(dps_phy  , f_dps )
+ 
+!    CALL writeField("dulon_out",f_dulon)
+!    CALL writeField("dulat_out",f_dulat)
+!    CALL writeField("dTemp_out",f_dTemp)
+!    CALL writeField("dq_out",f_dq)
+!    CALL writeField("dps_out",f_dps)
+
+!    CALL checksum(f_dulon)
+!    CALL checksum(f_dulat)
+!    CALL checksum(f_dTemp)
+!    CALL checksum(f_dq)
+!    CALL checksum(f_dps)
+    
+    CALL send_message(f_dps,req_dps0)
+    CALL send_message(f_dulon,req_dulon0)
+    CALL send_message(f_dulat,req_dulat0)
+    CALL send_message(f_dTemp,req_dTemp0)
+    CALL send_message(f_dq,req_dq0)
+
+    CALL wait_message(req_dps0)
+    CALL wait_message(req_dulon0)
+    CALL wait_message(req_dulat0)
+    CALL wait_message(req_dTemp0)
+    CALL wait_message(req_dq0)
+
+
+!    CALL trace_on()
+    CALL trace_end("physic")
+!$OMP MASTER
+    CALL SYSTEM_CLOCK(stop_clock)
+    count_clock=count_clock+stop_clock-start_clock
+!$OMP END MASTER
+
+!$OMP BARRIER                       
+
+    DO ind=1,ndomain
+      CALL swap_dimensions(ind)
+      IF (assigned_domain(ind)) THEN
+        CALL swap_geometry(ind)
+
+        theta_rhodz=f_theta_rhodz(ind)
+        u=f_u(ind)
+        q=f_q(ind)
+        ps=f_ps(ind)
+        dulon=f_dulon(ind)
+        dulat=f_dulat(ind)
+        Temp=f_temp(ind)
+        dTemp=f_dTemp(ind)
+        dq=f_dq(ind)
+        dps=f_dps(ind)
+        duc=f_duc(ind)
+        p=f_p(ind)
+        pks=f_pks(ind)
+        pk=f_pk(ind)
+      
+        CALL grid_physics_to_icosa
+      ENDIF
+    ENDDO
+
+!$OMP BARRIER
+    CALL xios_set_context    
+   
+ 
+  CONTAINS
+
+    SUBROUTINE grid_icosa_to_physics
+    USE pression_mod
+    USE exner_mod
+    USE theta2theta_rhodz_mod
+    USE geopotential_mod
+    USE wind_mod
+    USE omp_para
+    IMPLICIT NONE
+    
+    REAL(rstd) :: uc(3)
+    INTEGER :: i,j,ij,l
+
+! compute pression
+
+      DO    l    = ll_begin,ll_endp1
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            p(ij,l) = ap(l) + bp(l) * ps(ij)
+          ENDDO
+        ENDDO
+      ENDDO
+
+!$OMP BARRIER
+
+! compute exner
+       
+       IF (is_omp_first_level) THEN
+         DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+               ij=(j-1)*iim+i
+               pks(ij) = cpp * ( ps(ij)/preff ) ** kappa
+            ENDDO
+         ENDDO
+       ENDIF
+
+       ! 3D : pk
+       DO l = ll_begin,ll_end
+          DO j=jj_begin,jj_end
+             DO i=ii_begin,ii_end
+                ij=(j-1)*iim+i
+                pk(ij,l) = cpp * ((.5/preff)*(p(ij,l)+p(ij,l+1))) ** kappa
+             ENDDO
+          ENDDO
+       ENDDO
+
+!$OMP BARRIER
+
+!   compute theta, temperature and pression at layer
+    DO    l    = ll_begin, ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          theta(ij,l) = theta_rhodz(ij,l,1) / ((p(ij,l)-p(ij,l+1))/g)
+          Temp(ij,l) = theta(ij,l) * pk(ij,l) / cpp
+          p_layer(ij,l)=preff*(pk(ij,l)/cpp)**(1./kappa) 
+        ENDDO
+      ENDDO
+    ENDDO
+
+
+!!! Compute geopotential
+       
+  ! for first layer
+  IF (is_omp_first_level) THEN
+    DO j=jj_begin,jj_end
+      DO i=ii_begin,ii_end
+        ij=(j-1)*iim+i
+        phi( ij,1 ) = phis( ij ) + theta(ij,1) * ( pks(ij) - pk(ij,1) )
+      ENDDO
+    ENDDO
+  ENDIF
+!!-> implicit flush on phi(:,1)
+
+!$OMP BARRIER
+          
+  ! for other layers
+  DO l = ll_beginp1, ll_end
+    DO j=jj_begin,jj_end
+      DO i=ii_begin,ii_end
+        ij=(j-1)*iim+i
+        phi(ij,l) =  0.5 * ( theta(ij,l)  + theta(ij,l-1) )  & 
+                         * (  pk(ij,l-1) -  pk(ij,l)    )
+      ENDDO
+    ENDDO
+  ENDDO       
+
+!$OMP BARRIER
+
+
+  IF (is_omp_first_level) THEN
+    DO l = 2, llm
+      DO j=jj_begin,jj_end
+! ---> Bug compilo intel ici en openmp
+! ---> Couper la boucle
+       IF (j==jj_end+1) PRINT*,"this message must not be printed"
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          phi(ij,l) = phi(ij,l)+ phi(ij,l-1)
+        ENDDO
+      ENDDO
+    ENDDO
+! --> IMPLICIT FLUSH on phi --> non 
+  ENDIF 
+
+! compute wind centered lon lat compound
+    DO l=ll_begin,ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          uc(:)=1/Ai(ij)*                                                                                                &
+                        ( ne(ij,right)*u(ij+u_right,l)*le(ij+u_right)*((xyz_v(ij+z_rdown,:)+xyz_v(ij+z_rup,:))/2-centroid(ij,:))  &
+                         + ne(ij,rup)*u(ij+u_rup,l)*le(ij+u_rup)*((xyz_v(ij+z_rup,:)+xyz_v(ij+z_up,:))/2-centroid(ij,:))          &
+                         + ne(ij,lup)*u(ij+u_lup,l)*le(ij+u_lup)*((xyz_v(ij+z_up,:)+xyz_v(ij+z_lup,:))/2-centroid(ij,:))          &
+                         + ne(ij,left)*u(ij+u_left,l)*le(ij+u_left)*((xyz_v(ij+z_lup,:)+xyz_v(ij+z_ldown,:))/2-centroid(ij,:))    &
+                         + ne(ij,ldown)*u(ij+u_ldown,l)*le(ij+u_ldown)*((xyz_v(ij+z_ldown,:)+xyz_v(ij+z_down,:))/2-centroid(ij,:))&
+                         + ne(ij,rdown)*u(ij+u_rdown,l)*le(ij+u_rdown)*((xyz_v(ij+z_down,:)+xyz_v(ij+z_rdown,:))/2-centroid(ij,:)))
+          ulon(ij,l)=sum(uc(:)*elon_i(ij,:))
+          ulat(ij,l)=sum(uc(:)*elat_i(ij,:)) 
+        ENDDO
+      ENDDO
+    ENDDO
+
+
+! compute centered vorticity
+   
+    DO l=ll_begin,ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          vortc(ij,l) =  Riv(ij,vup)    * vort(ij+z_up,l)    + & 
+                         Riv(ij,vlup)  * vort(ij+z_lup,l)   + & 
+                         Riv(ij,vldown)* vort(ij+z_ldown,l) + & 
+                         Riv(ij,vdown) * vort(ij+z_down,l)  + & 
+                         Riv(ij,vrdown)* vort(ij+z_rdown,l) + & 
+                         Riv(ij,vrup)  * vort(ij+z_rup,l) 
+      ENDDO
+    ENDDO
+  ENDDO
+
+
+
+!$OMP BARRIER
+    END SUBROUTINE grid_icosa_to_physics
+
+
+    SUBROUTINE grid_physics_to_icosa
+    USE theta2theta_rhodz_mod
+    USE omp_para
+    IMPLICIT NONE
+      INTEGER :: i,j,ij,l,iq
+          
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            duc(ij,:,l)=dulon(ij,l)*elon_i(ij,:)+dulat(ij,l)*elat_i(ij,:)
+          ENDDO
+        ENDDO
+      ENDDO
+
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            u(ij+u_right,l) = u(ij+u_right,l) + dtphy * sum( 0.5*(duc(ij,:,l) + duc(ij+t_right,:,l))*ep_e(ij+u_right,:) )
+            u(ij+u_lup,l) = u(ij+u_lup,l) + dtphy * sum( 0.5*(duc(ij,:,l) + duc(ij+t_lup,:,l))*ep_e(ij+u_lup,:) )
+            u(ij+u_ldown,l) = u(ij+u_ldown,l) + dtphy*sum( 0.5*(duc(ij,:,l) + duc(ij+t_ldown,:,l))*ep_e(ij+u_ldown,:) )
+          ENDDO
+        ENDDO
+      ENDDO          
+
+      DO l=ll_begin,ll_end
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            Temp(ij,l)=Temp(ij,l)+ dtphy * dTemp(ij,l)
+          ENDDO
+        ENDDO
+      ENDDO          
+      
+      DO iq=1,nqtot
+        DO l=ll_begin,ll_end
+          DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+              ij=(j-1)*iim+i
+              q(ij,l,iq)=q(ij,l,iq)+ dtphy * dq(ij,l,iq)
+            ENDDO
+          ENDDO
+        ENDDO 
+      ENDDO
+
+!$OMP BARRIER
+      
+     IF (is_omp_first_level) THEN
+       DO j=jj_begin,jj_end
+         DO i=ii_begin,ii_end
+           ij=(j-1)*iim+i
+           ps(ij)=ps(ij)+ dtphy * dps(ij)
+          ENDDO
+       ENDDO
+     ENDIF
+
+!     CALL compute_temperature2theta_rhodz(ps,Temp,theta_rhodz,0)
+
+! compute pression
+!$OMP BARRIER
+      DO    l    = ll_begin,ll_endp1
+        DO j=jj_begin,jj_end
+          DO i=ii_begin,ii_end
+            ij=(j-1)*iim+i
+            p(ij,l) = ap(l) + bp(l) * ps(ij)
+          ENDDO
+        ENDDO
+      ENDDO
+
+!$OMP BARRIER
+
+! compute exner
+       
+       IF (is_omp_first_level) THEN
+         DO j=jj_begin,jj_end
+            DO i=ii_begin,ii_end
+               ij=(j-1)*iim+i
+               pks(ij) = cpp * ( ps(ij)/preff ) ** kappa
+            ENDDO
+         ENDDO
+       ENDIF
+
+       ! 3D : pk
+       DO l = ll_begin,ll_end
+          DO j=jj_begin,jj_end
+             DO i=ii_begin,ii_end
+                ij=(j-1)*iim+i
+                pk(ij,l) = cpp * ((.5/preff)*(p(ij,l)+p(ij,l+1))) ** kappa
+             ENDDO
+          ENDDO
+       ENDDO
+
+!$OMP BARRIER
+
+!   compute theta, temperature and pression at layer
+    DO    l    = ll_begin, ll_end
+      DO j=jj_begin,jj_end
+        DO i=ii_begin,ii_end
+          ij=(j-1)*iim+i
+          theta_rhodz(ij,l,1) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / (pk(ij,l) / cpp )
+        ENDDO
+      ENDDO
+    ENDDO
+    
+    END SUBROUTINE grid_physics_to_icosa
+
+
+
+  END SUBROUTINE physics
+
+
+
+
+
+END MODULE interface_icosa_lmdz_mod
Index: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/wrapper.f90
===================================================================
--- CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/wrapper.f90	(revision 6606)
+++ CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/ICOSA_LMDZ/src/wrapper.f90	(revision 6606)
@@ -0,0 +1,16 @@
+SUBROUTINE initialize_external_physics
+  USE interface_icosa_lmdz_mod, ONLY: initialize_physics
+  IMPLICIT NONE
+  
+    CALL initialize_physics  
+
+END SUBROUTINE initialize_external_physics
+
+
+SUBROUTINE external_physics
+  USE interface_icosa_lmdz_mod, ONLY: physics
+  IMPLICIT NONE
+  
+  CALL physics
+
+END SUBROUTINE external_physics
