Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/AA_make
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/AA_make	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/AA_make	(revision 6473)
@@ -1,4 +1,8 @@
 #- $Id$
 
+
+submitdir=$(shell pwd)
+arch_path=${submitdir}/ARCH/
+sources_RH8_path=${submitdir}/SOURCES/REDHAT8
 
 all : 
@@ -53,12 +57,12 @@
 
 xios :
-	(cd  ../../modeles/XIOS ; ./make_xios  --arch ${FCM_ARCH} --job 8 ; cp bin/xios_server.exe ../../bin/. ; )
+	(cd  ../../modeles/XIOS ; cp ${sources_RH8_path}/XIOS/arch-${FCM_ARCH}.fcm arch/.;  ./make_xios  --arch_path ${arch_path}  --arch ${FCM_ARCH} --job 8 ; cp bin/xios_server.exe ../../bin/. ; )
 
 libioipsl : ../../modeles/IOIPSL/src
-	(cd ../../modeles/IOIPSL/src ; $(M_K) -f Makefile)
+	(ln -s ${arch_path}/arch-${FCM_ARCH}.env ${arch_path}/arch.env; . ${arch_path}/arch-${FCM_ARCH}.env; cd ../../modeles/IOIPSL/src ; $(M_K) -f Makefile)
 
 
 liborchidee : ../../modeles/ORCHIDEE/
-	(cd ../../modeles/ORCHIDEE/ ; ./makeorchidee_fcm  -parallel mpi_omp -prod -xios -arch $(FCM_ARCH) -j 8  -driver -xios2)
+	(. ${arch_path}/arch-${FCM_ARCH}.env; cd ../../modeles/ORCHIDEE/ ; cp ${sources_RH8_path}/ORCHIDEE/mod_orchidee_para.F90 src_parallel/.; ./makeorchidee_fcm  -parallel mpi_omp -prod -xios -arch $(FCM_ARCH) -j 8  -driver -xios2)
 
 nmhcaer96x95x39:
@@ -100,10 +104,10 @@
 
 inca: ../../modeles/INCA
-#	(cd ../../modeles/INCA; ./makeinca_fcm -chimie $(CHIMIE) -prod  -resol $(RESOL_INCA) -j 8 -arch $(FCM_ARCH); cp SIMULATIONS/$(CHIMIE)/inca.dat ../../bin/inca.dat ; )
-	(cd ../../modeles/INCA; ./makeinca_fcm -chimie $(CHIMIE) -prod -xios -parallel mpi_omp -resol $(RESOL_INCA) -j 8 -arch $(FCM_ARCH); cp SIMULATIONS/$(CHIMIE)/inca.dat ../../bin/inca.dat ; )
+#	(. ${arch_path}/arch-${FCM_ARCH}.env; cd ../../modeles/INCA; cp ${sources_RH8_path}/INCA/print_inca.F90 src/INCA_MOD/. ; ./makeinca_fcm -chimie $(CHIMIE) -prod  -resol $(RESOL_INCA) -j 8 -arch $(FCM_ARCH); cp SIMULATIONS/$(CHIMIE)/inca.dat ../../bin/inca.dat ; )
+	(. ${arch_path}/arch-${FCM_ARCH}.env; cd ../../modeles/INCA; cp ${sources_RH8_path}/INCA/print_inca.F90 src/INCA_MOD/. ; ./makeinca_fcm -chimie $(CHIMIE) -prod -xios -parallel mpi_omp -resol $(RESOL_INCA) -j 8 -arch $(FCM_ARCH); cp SIMULATIONS/$(CHIMIE)/inca.dat ../../bin/inca.dat ; )
 
 lmdz: ../../modeles/LMDZ
-#	(cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -prod -chimie INCA  -arch $(FCM_ARCH) -j 8 ce0l ; mv bin/ce0l_$(RESOL_LMDZ)_phylmd_seq_inca.e ../../bin/create_etat0_limit.e ; )
-	(cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -prod -rrtm true -chimie INCA -io xios  -mem -cosp false -v true -parallel mpi_omp -arch $(FCM_ARCH) -j 8  gcm ; mv bin/gcm_$(RESOL_LMDZ)_phylmd_para_mem_orch_inca.e ../../bin/gcm.e ; )
+#	(. ${arch_path}/arch-${FCM_ARCH}.env; cd ../../modeles/LMDZ; cp ${sources_RH8_path}/LMDZ/arch-${FCM_ARCH}.fcm arch/. ; ./makelmdz_fcm -d $(RESOL_LMDZ) -prod -chimie INCA  -arch $(FCM_ARCH) -j 8 ce0l ; mv bin/ce0l_$(RESOL_LMDZ)_phylmd_seq_inca.e ../../bin/create_etat0_limit.e ; )
+	(. ${arch_path}/arch-${FCM_ARCH}.env; cd ../../modeles/LMDZ; cp ${sources_RH8_path}/LMDZ/arch-${FCM_ARCH}.fcm arch/. ; ./makelmdz_fcm -d $(RESOL_LMDZ) -prod -rrtm true -chimie INCA -io xios  -mem -cosp false -v true -parallel mpi_omp -arch $(FCM_ARCH) -j 8  gcm ; mv bin/gcm_$(RESOL_LMDZ)_phylmd_para_mem_orch_inca.e ../../bin/gcm.e ; )
 
 
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch-X64_IRENE-AMD.env
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch-X64_IRENE-AMD.env	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch-X64_IRENE-AMD.env	(revision 6473)
@@ -0,0 +1,13 @@
+# Compile and running environement at Irene  
+
+set +e  
+module purge
+module load intel/20.0.0
+module load mpi/openmpi/4.1.4
+module load flavor/hdf5/parallel
+module load hdf5/1.12.2
+module load netcdf-fortran/4.5.3
+module load mkl/20.0.0
+module load feature/bridge/heterogenous_mpmd
+module load c++/gnu/8.3.0
+module load c/gnu/8.3.0
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch-X64_IRENE.env
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch-X64_IRENE.env	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch-X64_IRENE.env	(revision 6473)
@@ -0,0 +1,13 @@
+# Compile and running environement at Irene  
+
+set +e  
+module purge
+module load intel/20.0.0
+module load mpi/openmpi/4.1.4
+module load flavor/hdf5/parallel
+module load hdf5/1.12.2
+module load netcdf-fortran/4.5.3
+module load mkl/20.0.0
+module load feature/bridge/heterogenous_mpmd
+module load c++/gnu/8.3.0
+module load c/gnu/8.3.0
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch.env
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch.env	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/ARCH/arch.env	(revision 6473)
@@ -0,0 +1,1 @@
+link /ccc/scratch/cont003/gen0826/p24cozic/SVN/modipsl/config/LMDZORINCA_v6/ARCH//arch-X64_IRENE.env
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZ/CREATE_amip/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZ/CREATE_amip/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZ/CREATE_amip/config.card	(revision 6473)
@@ -8,4 +8,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=ELI-${RESOL_ATM_3D}
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/amip/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/amip/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/amip/config.card	(revision 6473)
@@ -6,4 +6,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=LMDZOR01
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/amip_nudge/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/amip_nudge/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/amip_nudge/config.card	(revision 6473)
@@ -6,4 +6,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=LMDZORnudge
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/clim_360d/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/clim_360d/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/clim_360d/config.card	(revision 6473)
@@ -6,4 +6,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=LMDZOR01
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/clim_pdControl/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/clim_pdControl/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZOR/clim_pdControl/config.card	(revision 6473)
@@ -6,4 +6,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=LMDZOR01
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER/config.card	(revision 6473)
@@ -11,4 +11,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 #D-- (<8 chars MAX for JobName)
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER_historical/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER_historical/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER_historical/config.card	(revision 6473)
@@ -6,4 +6,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=LOI6.01
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER_pdControl/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER_pdControl/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/AER_pdControl/config.card	(revision 6473)
@@ -6,4 +6,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=LOI6.01
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/CREATE_erai/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/CREATE_erai/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/CREATE_erai/config.card	(revision 6473)
@@ -8,4 +8,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 JobName=ELerai-${RESOL_ATM_3D}
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/DUSS/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/DUSS/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/DUSS/config.card	(revision 6473)
@@ -11,4 +11,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 #D-- (<8 chars MAX for JobName)
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/GES/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/GES/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/GES/config.card	(revision 6473)
@@ -11,4 +11,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 #D-- (<8 chars MAX for JobName)
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC/config.card	(revision 6473)
@@ -11,4 +11,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 #D-- (<8 chars MAX for JobName)
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC_AER/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC_AER/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC_AER/config.card	(revision 6473)
@@ -11,4 +11,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 #D-- (<8 chars MAX for JobName)
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC_AER_S/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC_AER_S/config.card	(revision 6333)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/EXPERIMENTS/LMDZORINCA/NMHC_AER_S/config.card	(revision 6473)
@@ -11,4 +11,5 @@
 #D-- UserChoices -
 [UserChoices]
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
 #============================
 #D-- (<8 chars MAX for JobName)
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/INCA/print_inca.F90
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/INCA/print_inca.F90	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/INCA/print_inca.F90	(revision 6473)
@@ -0,0 +1,119 @@
+!$Id: chem_mod.F90 104 2008-12-23 10:28:51Z acosce $
+!! =========================================================================
+!! INCA - INteraction with Chemistry and Aerosols
+!! 
+!! Copyright Laboratoire des Sciences du Climat et de l'Environnement (LSCE)
+!! 	     Unite mixte CEA-CNRS-UVSQ
+!! 
+!! Contributors to this INCA subroutine:
+!! 
+!! Anne Cozic, LSCE, anne.cozic@cea.fr
+!!
+!! This software is a computer program whose purpose is to simulate the 
+!! atmospheric gas phase and aerosol composition. The model is designed to be
+!! used within a transport model or a general circulation model. This version 
+!! of INCA was designed to be coupled to the LMDz GCM. LMDz-INCA accounts
+!! for emissions, transport (resolved and sub-grid scale), photochemical 
+!! transformations, and scavenging (dry deposition and washout) of chemical 
+!! species and aerosols interactively in the GCM. Several versions of the INCA
+!! model are currently used depending on the envisaged applications with the 
+!! chemistry-climate model. 
+!! 
+!! This software is governed by the CeCILL  license under French law and
+!! abiding by the rules of distribution of free software.  You can  use, 
+!! modify and/ or redistribute the software under the terms of the CeCILL
+!! license as circulated by CEA, CNRS and INRIA at the following URL
+!! "http://www.cecill.info". 
+!! 
+!! As a counterpart to the access to the source code and  rights to copy,
+!! modify and redistribute granted by the license, users are provided only
+!! with a limited warranty  and the software's author,  the holder of the
+!! economic rights,  and the successive licensors  have only  limited
+!! liability. 
+!! 
+!! In this respect, the user's attention is drawn to the risks associated
+!! with loading,  using,  modifying and/or developing or reproducing the
+!! software by the user in light of its specific status of free software,
+!! that may mean  that it is complicated to manipulate,  and  that  also
+!! therefore means  that it is reserved for developers  and  experienced
+!! professionals having in-depth computer knowledge. Users are therefore
+!! encouraged to load and test the software's suitability as regards their
+!! requirements in conditions enabling the security of their systems and/or 
+!! data to be ensured and,  more generally, to use and operate it in the 
+!! same conditions as regards security. 
+!! 
+!! The fact that you are presently reading this means that you have had
+!! knowledge of the CeCILL license and that you accept its terms.
+!! =========================================================================
+
+#include <inca_define.h>
+
+MODULE PRINT_INCA
+
+  IMPLICIT NONE
+  INTEGER, SAVE :: lunout
+!$OMP THREADPRIVATE(lunout)
+  INTEGER, SAVE :: outxml
+!$OMP THREADPRIVATE(outxml) 
+
+CONTAINS
+
+  SUBROUTINE INIT_PRINT_INCA()
+
+    USE MOD_INCA_MPI_DATA, ONLY : is_ok_mpi, mpi_rank
+    USE MOD_INCA_OMP_DATA, ONLY : is_ok_omp, omp_rank
+    USE mod_inca_mpi_data, ONLY : is_mpi_root
+
+    IMPLICIT NONE
+    CHARACTER(len=8) :: namefile
+    INTEGER :: ierr2
+    CHARACTER(len=255) :: fileout
+    CHARACTER(len=4)  :: num_mpi
+    CHARACTER(len=4)  :: num_omp
+    INTEGER,PARAMETER :: base_lunout=350
+    INTEGER           :: ierr
+
+
+    namefile='inca.out'
+   IF (is_ok_mpi) THEN
+       WRITE(num_mpi,'(I4.4)') mpi_rank
+    ENDIF
+    
+    IF (is_ok_omp) THEN
+       WRITE(num_omp,'(I4.4)') omp_rank
+    ENDIF
+
+    IF (is_ok_mpi .AND. is_ok_omp) THEN
+       fileout=TRIM(namefile)//'_'//num_mpi//'.'//num_omp
+       lunout=base_lunout+omp_rank
+    ELSE IF (is_ok_mpi .AND. (.NOT. is_ok_omp)) THEN
+       fileout=TRIM(namefile)//'_'//num_mpi
+       lunout=base_lunout
+    ELSE IF ((.NOT. is_ok_mpi) .AND. is_ok_omp) THEN
+       fileout=TRIM(namefile)//'_'//num_omp
+       lunout=base_lunout+omp_rank
+    ELSE
+       fileout=TRIM(namefile)
+       lunout=base_lunout
+    ENDIF
+!    open(UNIT=lunout,file=fileout, action='write',status='unknown', form='formatted', iostat=ierr2) 
+!    IF (ierr2 /= 0) THEN
+!       stop 'print_inca'
+!    endif
+    lunout=6
+
+    
+!$OMP MASTER
+    IF (is_mpi_root) THEN
+       outxml=base_lunout*10
+       open(UNIT=outxml,file='inca_IDxml.out', action='write',status='unknown', form='formatted', iostat=ierr2) 
+       IF (ierr2 /= 0) THEN
+          stop 'print_inca xml'
+       endif
+    endif
+    
+!$OMP END MASTER
+
+
+  END SUBROUTINE INIT_PRINT_INCA
+END MODULE PRINT_INCA
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/LMDZ/arch-X64_IRENE-AMD.fcm
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/LMDZ/arch-X64_IRENE-AMD.fcm	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/LMDZ/arch-X64_IRENE-AMD.fcm	(revision 6473)
@@ -0,0 +1,16 @@
+%COMPILER            mpif90
+%LINK                mpif90
+%AR                  ar
+%ARFLAGS             rs
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             NC_DOUBLE FFT_MKL
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I$(MKL_INCDIR) -I$(MKL_INCDIR)/intel64/lp64 
+%PROD_FFLAGS         -O3 -mavx2 -fp-model fast=2
+%DEV_FFLAGS          -fp-model strict -p -g -O2 -traceback -fp-stack-check
+%DEBUG_FFLAGS        -fp-model strict -p -g -traceback -fp-stack-check -ftrapuv
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp
+%BASE_LD             -i4 -r8 -auto $MKL_LDFLAGS 
+%MPI_LD
+%OMP_LD              -qopenmp
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/LMDZ/arch-X64_IRENE.fcm
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/LMDZ/arch-X64_IRENE.fcm	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/LMDZ/arch-X64_IRENE.fcm	(revision 6473)
@@ -0,0 +1,16 @@
+%COMPILER            mpif90
+%LINK                mpif90
+%AR                  ar
+%ARFLAGS             rs
+%MAKE                gmake
+%FPP_FLAGS           -P -traditional
+%FPP_DEF             NC_DOUBLE FFT_MKL
+%BASE_FFLAGS         -i4 -r8 -auto -align all -I$(MKL_INC_DIR) -I$(MKL_INC_DIR)/intel64/lp64 
+%PROD_FFLAGS         -O3 -axAVX,SSE4.2 -fp-model fast=2
+%DEV_FFLAGS          -fp-model strict -p -g -O2 -traceback -fp-stack-check
+%DEBUG_FFLAGS        -fp-model strict -p -g -traceback -fp-stack-check -ftrapuv
+%MPI_FFLAGS
+%OMP_FFLAGS          -qopenmp
+%BASE_LD             -i4 -r8 -auto $MKL_LDFLAGS 
+%MPI_LD
+%OMP_LD              -qopenmp
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/ORCHIDEE/mod_orchidee_para.F90
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/ORCHIDEE/mod_orchidee_para.F90	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/ORCHIDEE/mod_orchidee_para.F90	(revision 6473)
@@ -0,0 +1,308 @@
+! ==============================================================================================================================
+! MODULE   : mod_orchidee_para
+!
+! CONTACT      : orchidee-help _at_ listes.ipsl.fr
+!
+! LICENCE      : IPSL (2006)
+! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
+!
+!>\BRIEF      Initialization of MPI and OpenMP parallelization.
+!!
+!!\n DESCRIPTION  :  This module contains subroutines to be called for the initialization of MPI and OpenMP parallelization. 
+!!                   Note that some subroutines are called only for the offline case such as init_orchidee_para and 
+!!                   init_orchidee_data_para_driver.
+!!
+!! SVN              :
+!! $HeadURL: svn://forge.ipsl.jussieu.fr/orchidee/tags/ORCHIDEE_2_0/ORCHIDEE/src_parallel/mod_orchidee_para.F90 $
+!! $Date: 2017-10-18 11:15:06 +0200 (Wed, 18 Oct 2017) $
+!! $Revision: 4693 $
+!! \n
+!_ ================================================================================================================================
+MODULE mod_orchidee_para
+
+  USE mod_orchidee_para_var
+  USE mod_orchidee_mpi_data
+  USE mod_orchidee_omp_data
+  USE mod_orchidee_transfert_para
+    
+CONTAINS
+    
+  !!  =============================================================================================================================
+  !! SUBROUTINE:  Init_orchidee_para
+  !!
+  !>\BRIEF	 Initialization of MPI and OpenMP parallelization in offline case
+  !!
+  !! DESCRIPTION: First subroutine for initialization to be called for the initialization of the MPI and OpenMP parallelization
+  !!              in offline mode. This routine will call the successively the initialization for OMP then for MPI.
+  !!              We define in this routine the variable "is_root_prc = is_mpi_root AND is_omp_root".
+  !!
+  !! \n
+  !_ ============================================================================================================================== 
+  SUBROUTINE Init_orchidee_para(communicator)
+    IMPLICIT NONE
+    INTEGER,OPTIONAL,INTENT(in) :: communicator	
+
+    CALL Init_orchidee_omp
+
+
+    IF ( PRESENT(communicator) ) THEN
+       CALL Init_orchidee_mpi(communicator)
+    ELSE
+       CALL Init_orchidee_mpi
+    ENDIF
+
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+       is_root_prc=.TRUE.
+    ELSE
+       is_root_prc=.FALSE.
+    ENDIF
+  END SUBROUTINE Init_orchidee_para
+    
+  
+  !!  =============================================================================================================================
+  !! SUBROUTINE:  Init_orchidee_data_para_driver
+  !!
+  !>\BRIEF	 Initialization of variables related to the local domain decomposition called by the offline driver.
+  !!
+  !! DESCRIPTION: Initialization of variables related to the local domain decomposition.
+  !!              This subroutine is only called in offline mode by the driver. 
+  !!
+  !! \n
+  !_ ============================================================================================================================== 
+  SUBROUTINE Init_orchidee_data_para_driver(nbp,kindex_glo)
+
+    IMPLICIT NONE
+    INTEGER,INTENT(IN) :: nbp
+    INTEGER,INTENT(IN) :: kindex_glo(nbp)
+      
+    INTEGER :: first_point
+    INTEGER :: last_point
+    INTEGER :: nbp_loc
+    INTEGER :: nbp_loc_para(0:mpi_size-1)
+    INTEGER,ALLOCATABLE :: kindex_loc(:)
+    INTEGER :: offset
+    INTEGER :: i
+    
+      
+    last_point=0
+    
+    CALL read_load_balance(nbp,nbp_loc_para)    
+    
+    DO i=0,mpi_rank
+       nbp_loc=nbp_loc_para(i)
+       First_point=last_point+1
+       Last_point=last_point+nbp_loc
+    ENDDO
+    
+    ALLOCATE(kindex_loc(nbp_loc))
+    DO i=1,nbp_loc
+       kindex_loc(i)=kindex_glo(i+First_Point-1)
+    ENDDO
+    
+    IF (mpi_rank==0) THEN
+       offset=0
+    ELSE
+       offset=kindex_glo(First_point-1)-MOD(kindex_glo(First_point-1),iim_g)
+    ENDIF
+
+    kindex_loc(:)=kindex_loc(:)-offset
+
+    CALL Init_orchidee_data_para(nbp_loc,kindex_loc,offset,omp_size,omp_rank,MPI_COMM_ORCH)
+    CALL Set_stdout_file('out_orchidee')
+    CALL ipslnlf(new_number=numout)
+        
+  END SUBROUTINE Init_orchidee_data_para_driver
+    
+  
+  !!  =============================================================================================================================
+  !! SUBROUTINE:  Init_orchidee_data_para
+  !!
+  !>\BRIEF	 Initialization of MPI and OpenMP parallelization.
+  !!
+  !! DESCRIPTION: Initialization of MPI and OpenMP parallelization.
+  !!              This subroutine is called from both the offline driver and from the initialization routine for the coupled mode. 
+  !!              This routine will call the successively the initialization for omp and then for mpi.
+  !!              We define in this routine the variable "is_root_prc = is_mpi_root AND is_omp_root".
+  !!
+  !! \n
+  !_ ============================================================================================================================== 
+  SUBROUTINE Init_orchidee_data_para(nbp,kindex,arg_offset,arg_omp_size,arg_omp_rank,COMM)
+
+    IMPLICIT NONE
+    INTEGER,INTENT(IN)     :: nbp
+    INTEGER,INTENT(IN)     :: kindex(nbp)
+    INTEGER,INTENT(IN)     :: arg_offset
+    INTEGER,INTENT(IN)     :: arg_omp_size
+    INTEGER,INTENT(IN)     :: arg_omp_rank
+    INTEGER,INTENT(IN)     :: COMM
+    
+    INTEGER,SAVE              :: arg_nbp_mpi
+    INTEGER,ALLOCATABLE,SAVE  :: kindex_mpi(:)
+    
+    offset=arg_offset 
+    CALL init_orchidee_omp_data(arg_omp_size,arg_omp_rank,nbp,offset)
+    
+    IF (is_omp_root) THEN
+       arg_nbp_mpi=SUM(nbp_omp_para_nb(:))
+       ALLOCATE(kindex_mpi(arg_nbp_mpi))
+    ENDIF
+
+    CALL barrier2_omp()
+    kindex_mpi(nbp_omp_begin:nbp_omp_end)=kindex(:)+offset
+    CALL barrier2_omp()
+      
+    IF (is_omp_root) THEN      
+       kindex_mpi(:)=kindex_mpi(:)-offset
+       CALL init_orchidee_mpi_data(arg_nbp_mpi,kindex_mpi,offset,COMM)
+       nbp_glo=SUM(nbp_mpi_para(:))
+    ENDIF
+    CALL barrier2_omp()
+
+    nbp_loc=nbp
+
+    ! Define is_root_prc
+    ! Note that this is already done in init_orchidee_para for the offline case but it is done here again for the coupled case. 
+    IF (is_mpi_root .AND. is_omp_root) THEN
+       is_root_prc=.TRUE.
+    ELSE
+       is_root_prc=.FALSE.
+    ENDIF
+    
+    CALL Test_orchidee_para
+
+  END SUBROUTINE Init_orchidee_data_para
+    
+  !!  =============================================================================================================================
+  !! SUBROUTINE:  Set_stdout_file
+  !!
+  !>\BRIEF	 for each output file will give a unit number for the write function
+  !!
+  !! DESCRIPTION:	for each output file will give a unit number for the write function
+  !!
+  !! \n
+  !_ ============================================================================================================================== 
+  SUBROUTINE Set_stdout_file(filename)
+
+    IMPLICIT NONE
+
+    CHARACTER(len=*), INTENT(IN) :: filename
+    CHARACTER(len=255) :: fileout
+    CHARACTER(len=4)  :: num_mpi
+    CHARACTER(len=4)  :: num_omp
+    INTEGER,PARAMETER :: base_numout=100
+    INTEGER           :: ierr
+
+    IF (is_ok_mpi) THEN
+       WRITE(num_mpi,'(I4.4)') mpi_rank
+    ENDIF
+    
+    IF (is_ok_omp) THEN
+       WRITE(num_omp,'(I4.4)') omp_rank
+    ENDIF
+    
+     
+    IF (is_ok_mpi .AND. is_ok_omp) THEN
+       fileout=TRIM(filename)//'_'//num_mpi//'.'//num_omp
+       numout=base_numout+omp_rank
+    ELSE IF (is_ok_mpi .AND. (.NOT. is_ok_omp)) THEN
+       fileout=TRIM(filename)//'_'//num_mpi
+       numout=base_numout
+    ELSE IF ((.NOT. is_ok_mpi) .AND. is_ok_omp) THEN
+       fileout=TRIM(filename)//'_'//num_omp
+       numout=base_numout+omp_rank
+    ELSE
+       fileout=TRIM(filename)
+       numout=base_numout
+    ENDIF
+!!$OMP CRITICAL  
+!    WRITE(*,*) "Set_stdout_file (rank ",mpi_rank,omp_rank,"), id output :",numout
+!!$OMP END CRITICAL
+    
+!    OPEN(UNIT=numout,FILE=TRIM(fileout),ACTION='write',STATUS='unknown',FORM='formatted',IOSTAT=ierr) 
+!    IF (ierr /= 0) THEN
+!#ifdef CPP_PARA
+!       CALL MPI_FINALIZE(ierr)
+!#endif
+!       WRITE(*,*) "In Set_stdout_file : Erreur can't open file ", filename
+!       STOP 1
+!    ENDIF
+
+    numout=6
+
+    
+!!$OMP CRITICAL  
+!    WRITE(numout,*) "Set_stdout_file (rank ",mpi_rank,omp_rank,"), id output :",numout
+!!$OMP END CRITICAL
+
+    CALL Init_numout_omp(numout)
+
+  END SUBROUTINE Set_stdout_file
+      
+      
+  !!  =============================================================================================================================
+  !! SUBROUTINE:  Test_orchidee_para
+  !!
+  !>\BRIEF	 
+  !!
+  !! DESCRIPTION:	
+  !!
+  !! \n
+  !_ ============================================================================================================================== 
+  SUBROUTINE Test_orchidee_para
+
+    IMPLICIT NONE
+
+    INTEGER,PARAMETER :: dimsize=3
+    REAL :: Array(nbp_loc,dimsize)
+    REAL :: Array_glo(nbp_glo,dimsize)
+    REAL :: Array_glo_tmp(nbp_glo,dimsize)
+    REAL :: Array2D_loc(iim_g,jj_nb)
+    REAL :: Array2D_glo(iim_g,jjm_g)
+    REAL :: sum1,sum2,sum3
+    
+    INTEGER :: i,j
+    
+    DO j=1,dimsize
+       DO i=1,nbp_loc
+          Array(i,j)=10*j+omp_rank+i*1000
+       ENDDO
+    ENDDO
+      
+    CALL gather(Array,Array_glo)
+    CALL bcast(Array_glo)
+    CALL scatter(Array_glo,array)
+    CALL gather(array,array_glo_tmp)
+    CALL bcast(array_glo_tmp)    
+!    WRITE(*,*) "1) Test parallelism (rank ",mpi_rank,omp_rank,"), Sould be 0 :",SUM(array_glo-array_glo_tmp)
+
+    sum1=SUM(array)
+    CALL reduce_sum(sum1,sum2)
+    CALL bcast(sum2)
+    sum3=SUM(array_glo)
+!    WRITE(*,*) "2) Test parallelism (rank ",mpi_rank,omp_rank,"), Sould be 0 :",sum3-sum2
+    
+    IF (is_omp_root) THEN
+       DO j=1,jjm_g
+          DO i=1,iim_g
+             Array2D_glo(i,j)=(j-1)*iim_g+i
+          ENDDO
+       ENDDO
+        
+       array2D_loc(:,:)=0
+       CALL scatter2D_mpi(array2D_glo,array2D_loc)
+       array2D_glo(:,:)=0
+       CALL gather2D_mpi(array2D_loc,array2D_glo)
+       CALL bcast_mpi(array2D_glo)
+       sum1=SUM(array2D_glo)
+       sum2=SUM(array2D_loc)
+       CALL reduce_sum_mpi(sum2,sum3)
+       CALL bcast_mpi(sum3)
+       
+!       WRITE(*,*) "3) Test parallelism (rank ",mpi_rank,omp_rank,"), Sould be 0 :",sum3-sum1
+    ENDIF
+    CALL barrier2_omp()
+
+  END SUBROUTINE  Test_orchidee_para
+  
+END MODULE mod_orchidee_para
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/XIOS/arch-X64_IRENE-AMD.fcm
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/XIOS/arch-X64_IRENE-AMD.fcm	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/XIOS/arch-X64_IRENE-AMD.fcm	(revision 6473)
@@ -0,0 +1,26 @@
+################################################################################
+###################                Projet XIOS               ###################
+################################################################################
+
+%CCOMPILER      mpicc
+%FCOMPILER      mpif90
+%LINKER         mpif90  -nofor-main
+
+%BASE_CFLAGS    -std=gnu++98 -diag-disable 1125 -diag-disable 279 -D__XIOS_EXCEPTION
+%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
+#%DEV_CFLAGS     -g -traceback
+%DEV_CFLAGS     -g 
+%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
+
+%BASE_FFLAGS    -D__NONE__ 
+%PROD_FFLAGS    -O3
+#%DEV_FFLAGS     -g -traceback
+%DEV_FFLAGS     -g 
+%DEBUG_FFLAGS   -g -traceback
+
+%BASE_INC       -D__NONE__
+%BASE_LD        -lstdc++
+
+%CPP            mpicc -EP
+%FPP            cpp -P
+%MAKE           gmake
Index: CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/XIOS/arch-X64_IRENE.fcm
===================================================================
--- CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/XIOS/arch-X64_IRENE.fcm	(revision 6473)
+++ CONFIG/UNIFORM/v6/LMDZORINCA_v6.1.10/SOURCES/REDHAT8/XIOS/arch-X64_IRENE.fcm	(revision 6473)
@@ -0,0 +1,26 @@
+################################################################################
+###################                Projet XIOS               ###################
+################################################################################
+
+%CCOMPILER      mpicc
+%FCOMPILER      mpif90
+%LINKER         mpif90  -nofor-main
+
+%BASE_CFLAGS    -std=gnu++98 -diag-disable 1125 -diag-disable 279 -D__XIOS_EXCEPTION
+%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
+#%DEV_CFLAGS     -g -traceback
+%DEV_CFLAGS     -g 
+%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
+
+%BASE_FFLAGS    -D__NONE__ 
+%PROD_FFLAGS    -O3
+#%DEV_FFLAGS     -g -traceback
+%DEV_FFLAGS     -g 
+%DEBUG_FFLAGS   -g -traceback
+
+%BASE_INC       -D__NONE__
+%BASE_LD        -lstdc++
+
+%CPP            mpicc -EP
+%FPP            cpp -P
+%MAKE           gmake
