Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/AA_make
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/AA_make	(revision 4898)
+++ 	(revision )
@@ -1,120 +1,0 @@
-#- $Id$
-#-
-#- AA_make for LMDZOR_v6 configuration
-#- Default resolution is LMD144142-L79
-#- The resolution can be changed by using one of the targets here below with capital letters
-#- For example : 
-#-    gmake LMD9695-L39
-
-all : 
-	if [ -s ./.resol ] ; then $(M_K) `head -1 .resol |cut -c 8-` ; else $(M_K) LMD144142-L79 ; fi
-
-LMD5655 : libioipsl xios liborchidee lmdz56x55x19 verif	
-	echo "noORCAxLMD5655" >.resol
-	echo "RESOL_ATM_3D=56x55x19" >>.resol
-
-LMD9671 : libioipsl xios liborchidee lmdz96x71x19 verif	
-	echo "noORCAxLMD9671" >.resol
-	echo "RESOL_ATM_3D=96x71x19" >>.resol
-
-LMD9695 : libioipsl xios liborchidee lmdz96x95x19 verif
-	echo "noORCAxLMD9695" >.resol
-	echo "RESOL_ATM_3D=96x95x19" >>.resol
-
-LMD9695-L39 : libioipsl xios liborchidee lmdz96x95x39 verif
-	echo "noORCAxLMD9695-L39" >.resol
-	echo "RESOL_ATM_3D=96x95x39" >>.resol
-
-LMD9695-L79 : libioipsl xios liborchidee lmdz96x95x79 verif
-	echo "noORCAxLMD9695-L79" >.resol
-	echo "RESOL_ATM_3D=96x95x79" >>.resol
-
-LMD128118-L39 : libioipsl xios liborchidee lmdz128x118x39 verif
-	echo "noORCAxLMD128118-L39" >.resol
-	echo "RESOL_ATM_3D=128x118x39" >>.resol
-
-LMD144142 : libioipsl xios liborchidee lmdz144x142x19 verif
-	echo "noORCAxLMD144142" >.resol
-	echo "RESOL_ATM_3D=144x142x19" >>.resol
-
-LMD144142-L39 : libioipsl xios liborchidee lmdz144x142x39 verif
-	echo "noORCAxLMD144142-L39" >.resol
-	echo "RESOL_ATM_3D=144x142x39" >>.resol
-
-LMD144142-L59 : libioipsl xios liborchidee lmdz144x142x59 verif
-	echo "noORCAxLMD144142-L59" >.resol
-	echo "RESOL_ATM_3D=144x142x59" >>.resol
-
-LMD144142-L79 : libioipsl xios liborchidee lmdz144x142x79 verif
-	echo "noORCAxLMD144142-L79" >.resol
-	echo "RESOL_ATM_3D=144x142x79" >>.resol
-
-LMD512360-L79 : libioipsl xios liborchidee lmdz512x360x79 verif
-	echo "noORCAxLMD512360-L79" >.resol
-	echo "RESOL_ATM_3D=512x360x79" >>.resol
-
-
-xios :
-	(cd  ../../modeles/XIOS ; ./make_xios  \
-#-Q- ifort_CICLAD --netcdf_lib netcdf4_seq \
-#-Q- gfortran_CICLAD --netcdf_lib netcdf4_seq \
---prod --arch ${FCM_ARCH} --job 4 ; cp bin/xios_server.exe ../../bin/. ; )
-
-
-libioipsl : ../../modeles/IOIPSL/src
-	(cd ../../modeles/IOIPSL/src ; $(M_K) -f Makefile)
-
-
-liborchidee : ../../modeles/ORCHIDEE/
-	(cd ../../modeles/ORCHIDEE/ ; ./makeorchidee_fcm -prod -parallel mpi_omp -arch $(FCM_ARCH) -j 8 -xios2 -driver)
-
-
-lmdz56x55x19:
-	$(M_K) lmdz RESOL_LMDZ=56x55x19
-
-lmdz96x71x19:
-	$(M_K) lmdz RESOL_LMDZ=96x71x19
-
-lmdz96x95x19:
-	$(M_K) lmdz RESOL_LMDZ=96x95x19
-
-lmdz96x95x39:
-	$(M_K) lmdz RESOL_LMDZ=96x95x39
-
-lmdz96x95x79:
-	$(M_K) lmdz RESOL_LMDZ=96x95x79
-
-lmdz128x118x39:
-	$(M_K) lmdz RESOL_LMDZ=128x118x39
-
-lmdz144x142x19:
-	$(M_K) lmdz RESOL_LMDZ=144x142x19
-
-lmdz144x142x39:
-	$(M_K) lmdz RESOL_LMDZ=144x142x39
-
-lmdz144x142x59:
-	$(M_K) lmdz RESOL_LMDZ=144x142x59
-
-lmdz144x142x79:
-	$(M_K) lmdz RESOL_LMDZ=144x142x79
-
-lmdz512x360x79:
-	$(M_K) lmdz RESOL_LMDZ=512x360x79
-
-lmdz: ../../modeles/LMDZ
-	(cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -prod -arch $(FCM_ARCH) -j 8 ce0l ; mv bin/ce0l_$(RESOL_LMDZ)_phylmd_seq.e ../../bin/create_etat0_limit.e ; )
-	(cd ../../modeles/LMDZ; ./makelmdz_fcm -d $(RESOL_LMDZ) -prod -mem -cosp true -v orchidee2.0 -parallel mpi_omp -arch $(FCM_ARCH) -j 8 -io xios -rrtm true gcm ; mv bin/gcm_$(RESOL_LMDZ)_phylmd_para_mem_orch.e ../../bin/gcm.e ; )
-
-
-verif: ../../bin
-	ls -lrt ../../bin
-
-clean :
-	(rm -rf $(LIBDIR)/* ; rm -rf ../../modeles/LMDZ/libo/* ../../modeles/LMDZ/.lock ; )
-	(cd ../../modeles/IOIPSL/src ; ${M_K} clean ; )
-	(cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -clean ; )
-	(rm -rf ../../modeles/XIOS/bin/ ../../modeles/XIOS/inc ../../modeles/XIOS/obj ../../modeles/XIOS/lib ; )
-	(rm -rf $(BINDIR)/gcm.e ; rm -rf $(BINDIR)/create_etat0_limit.e ; )
-
-
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/AA_make.ldef
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/AA_make.ldef	(revision 4898)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#- $Id$
-#---------------------------------------------------------------------
-#- Initialisations for LMDZOR_v6 configuration
-#---------------------------------------------------------------------
-SHELL = /bin/sh
-#---------------------------------------------------------------------
-LIBDIR = ../../lib
-BINDIR = ../../bin
-MODDIR = $(LIBDIR)
-#---------------------------------------------------------------------
-#-
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-X64_IRENE.env
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-X64_IRENE.env	(revision 4936)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-X64_IRENE.env	(revision 4936)
@@ -0,0 +1,19 @@
+# Compile and running environnemnet at Irene Skylake 
+
+# Allow error messages related to purge
+set +e
+module purge
+#set -e
+
+module load intel/17.0.6.256
+module load mpi/openmpi/2.0.4
+module load flavor/hdf5/parallel
+module load netcdf-fortran/4.4.4
+module load mkl/17.0.6.256
+module load hdf5/1.8.20
+module load feature/bridge/heterogenous_mpmd
+module load nco
+module load cdo
+module load c++/gnu/7.3.0
+module load c/gnu/7.3.0
+
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-X64_JEANZAY.env
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-X64_JEANZAY.env	(revision 4936)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-X64_JEANZAY.env	(revision 4936)
@@ -0,0 +1,8 @@
+# Compile and running environnemnet at Jean-Zay 
+module purge
+module load gcc/6.5.0
+module load intel-all/19.0.4 
+module load hdf5/1.10.5-mpi
+module load netcdf/4.7.2-mpi
+module load netcdf-fortran/4.5.2-mpi
+
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-ifort_CICLAD.env
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-ifort_CICLAD.env	(revision 4936)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/ARCH/arch-ifort_CICLAD.env	(revision 4936)
@@ -0,0 +1,10 @@
+# Compile and running environnemnet for ciclad and climserv at IPSL
+
+module purge
+module load gnu/4.9.3
+module load intel/15.0.6.233
+module load openmpi/1.6.5-ifort
+module load hdf5/1.8.18-parallel-ifort
+module load netcdf4/4.4.1.1-parallel-ifort
+export NETCDF_HOME=/opt/netcdf4/4.4.1.1-parallel/ifort
+
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/CREATE_amip/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/CREATE_amip/config.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/CREATE_amip/config.card	(revision 4936)
@@ -29,4 +29,15 @@
 #============================
 PeriodNb=50
+#============================
+#-- Source following file with module settings, only if it exists
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
+#============================
+#-- ResolAtm indicates the atmospheric resolution
+#   This variable is used in the executable name 
+ResolAtm=144x142x79
+#============================
+# OptMode indicates the optimization mode choosen during compilation
+# This variable is used in the executable name
+OptMode=prod
 
 #========================================================================
@@ -40,5 +51,5 @@
 [Executable]
 #D- For each component: Real name of executable, Name of executable in the run directory 
-ATM= (create_etat0_limit.e, create_etat0_limit.e, 1MPI)
+ATM= (ce0l_${ResolAtm}_${OptMode}.e, ce0l.e, 1MPI)
 
 #========================================================================
@@ -58,6 +69,4 @@
 #D-- ATM -
 [ATM]
-#
-WriteFrequency="1Y"
 # If config_Restarts_OverRule == 'n' all params are read
 Restart= n
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/CREATE_clim_360d/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/CREATE_clim_360d/config.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/CREATE_clim_360d/config.card	(revision 4936)
@@ -29,4 +29,16 @@
 #-- Compression level for netcdf output files
 CompressionLevel=2
+#============================
+#-- Source following file with module settings, only if it exists
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
+#============================
+#-- ResolAtm indicates the atmospheric resolution
+#   This variable is used in the executable name 
+ResolAtm=144x142x79
+#============================
+# OptMode indicates the optimization mode choosen during compilation
+# This variable is used in the executable name
+OptMode=prod
+
 #========================================================================
 #D-- ListOfComponents -
@@ -39,5 +51,5 @@
 [Executable]
 #D- For each component: Real name of executable, Name of executable in the run directory 
-ATM= (create_etat0_limit.e, create_etat0_limit.e, 1MPI)
+ATM= (ce0l_${ResolAtm}_${OptMode}.e, ce0l.e, 1MPI)
 
 #========================================================================
@@ -57,6 +69,4 @@
 #D-- ATM -
 [ATM]
-#
-WriteFrequency="1Y"
 # If config_Restarts_OverRule == 'n' all params are read
 Restart= n
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/COMP/lmdz.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/COMP/lmdz.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/COMP/lmdz.card	(revision 4936)
@@ -37,23 +37,29 @@
 ByPass_hgardfou_mats=n
 
-# Set OutLevel to choose the level of output for LMDZ
-# OutLevel=low/medium/high
-OutLevel=low
-
-# Set COSP activation and output frequency (monthly, daily, HF) = y/n
-LMDZ_COSP_OK=y
-LMDZ_COSP_monthly=n
-LMDZ_COSP_daily=n
-LMDZ_COSP_hf=n
-
-# Set NMC output frequency (monthly, daily, HF) = y/n
-LMDZ_NMC_monthly=n
-LMDZ_NMC_daily=n
-LMDZ_NMC_hf=n
-
 # Nugding : ok_guide=y/n
 # If ok_guide=y, add nudging files(u.nc, v.nc, hur.nc,...) in BoundaryFiles section below.
 ok_guide=n
 
+# Specify which output file to activate and at which output_level
+# Use an integer to specify the output level or NONE if to deactivate the file
+# output_level_filename=1     : activate the corresponding file with low output level
+# output_level_filename=10    : activate the corresponding file with high output level
+# output_level_filename=NONE  : the file will not be written
+output_level_histmth = 5
+output_level_histday = NONE
+output_level_histhf  = NONE
+output_level_histmthNMC = NONE
+output_level_histdayNMC = NONE
+output_level_histhfNMC  = NONE
+output_level_histstrataer = NONE
+output_level_histdaystrataer = NONE
+output_level_histstn      = NONE
+
+# Activate COSP in config.def and set corresponding output files
+LMDZ_COSP_OK=y
+output_level_histmthCOSP = NONE
+output_level_histdayCOSP = NONE
+output_level_histhfCOSP  = NONE
+
 [InitialStateFiles]
 List=	(${R_IN}/ATM/START/eORCA1.2xLMD${RESOL_ATM_XY}/start_eORCA1.2xLMD${RESOL_ATM_3D}_o2a_v3.nc, start.nc),\
@@ -62,8 +68,11 @@
 [BoundaryFiles]
 List=()
-ListNonDel= (${R_IN}/ATM/LIMIT/AMIP.v20180427/interpol/${RESOL_ATM_XY}_eORCA1.2_360d/limit_1979_2008_clim.nc, limit.nc),\
-            (${R_IN}/ATM/AEROSOLS/CMIP6/v1/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/aerosols1850_from_inca.nc,   aerosols.nat.nc),\
+#
+# With CMIP6 aerosols version 1
+# With 3D ozone
+ListNonDel= (${R_IN}/ATM/AEROSOLS/CMIP6/v1/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/aerosols1850_from_inca.nc,   aerosols.nat.nc),\
             (${R_IN}/ATM/AEROSOLS/CMIP6/v1/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/aerosols1995_from_inca.nc,   aerosols1980.nc),\
             (${R_IN}/ATM/OZONE/UReading/historical.v20160711.v2/interpol/${RESOL_ATM_XY}/climoz_LMDZ_1979_2008_clim.nc, climoz_LMDZ.nc),\
+            (${R_IN}/ATM/LIMIT/AMIP.v20180427/interpol/${RESOL_ATM_XY}_eORCA1.2_360d/limit_1979_2008_clim.nc, limit.nc),\
             (${R_IN}/ATM/SOLAR/CMIP6/v3.1corr/Control/solarforcing_v3.1_pdControl_ave_6bands_360days.nc, solarforcing.nc),\
             (${R_IN}/ATM/STRATAERO/CMIP6/v3/${RESOL_ATM_XY}/L${RESOL_ATM_Z}/taulwstrat.2D.ave.nc, taulwstrat.2D.nc),\
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/COMP/xios.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/COMP/xios.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/COMP/xios.card	(revision 4936)
@@ -21,5 +21,5 @@
 
 [OutputText]
-List=   (xios_client_*)
+List=   (xios_client_*,out_xios.x.err.*, out_xios.x.out.*)
 
 [OutputFiles]
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/config.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZ/clim_360d/config.card	(revision 4936)
@@ -29,4 +29,16 @@
 #-- Compression level for netcdf output files
 CompressionLevel=2
+#============================
+#-- Source following file with module settings, only if it exists
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
+#============================
+#-- ResolAtm indicates the atmospheric resolution
+#   This variable is used in the executable name 
+ResolAtm=144x142x79
+#============================
+# OptMode indicates the optimization mode choosen during compilation
+# This variable is used in the executable name
+OptMode=prod
+
 #========================================================================
 #D-- ListOfComponents -
@@ -35,13 +47,14 @@
 ATM= (lmdz, LMDZ)
 IOS= (xios, XIOS)
+#========================================================================
 
-#========================================================================
 #D-- Executable -
 [Executable]
-#D- For each component: Real name of executable, Name of executable in the run directory 
-#D- Here is set 47MPI*8OMP which is suitable for resolution 144x142x79
+#D- For each component: First argument is the executable name as in bin folder.
+#D  ResolAtm and OptMode are set in UserChoices section.
+#D- Here is set 71MPI*8OMP which is suitable for resolution 144x142x79
 #D- Change to 31MPI*4OMP for resolution 96x95x39
-ATM= (gcm.e, lmdz.x, 71MPI, 8OMP)
-IOS= (xios_server.exe, xios.x, 1MPI)
+ATM= (gcm_${ResolAtm}_${OptMode}.e, lmdz.x, 71MPI, 8OMP)
+IOS= (xios_server_${OptMode}.exe, xios.x, 1MPI)
 
 #========================================================================
@@ -63,5 +76,4 @@
 #D-- ATM -
 [ATM]
-WriteFrequency="1M"
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -76,5 +88,4 @@
 #D-- IOS -
 [IOS]
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/COMP/lmdz.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/COMP/lmdz.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/COMP/lmdz.card	(revision 4936)
@@ -37,22 +37,28 @@
 ByPass_hgardfou_mats=n
 
-# Set OutLevel to choose the level of output for LMDZ
-# OutLevel=low/medium/high
-OutLevel=low
-
-# Set COSP activation and output frequency (monthly, daily, HF) = y/n
-LMDZ_COSP_OK=y
-LMDZ_COSP_monthly=n
-LMDZ_COSP_daily=n
-LMDZ_COSP_hf=n
-
-# Set NMC output frequency (monthly, daily, HF) = y/n
-LMDZ_NMC_monthly=n
-LMDZ_NMC_daily=n
-LMDZ_NMC_hf=n
-
 # Nugding : ok_guide=y/n
 # If ok_guide=y, add nudging files(u.nc, v.nc, hur.nc,...) in BoundaryFiles section below.
 ok_guide=n
+
+# Specify which output file to activate and at which output_level
+# Use an integer to specify the output level or NONE if to deactivate the file
+# output_level_filename=1     : activate the corresponding file with low output level
+# output_level_filename=10    : activate the corresponding file with high output level
+# output_level_filename=NONE  : the file will not be written
+output_level_histmth = 5
+output_level_histday = NONE
+output_level_histhf  = NONE
+output_level_histmthNMC = NONE
+output_level_histdayNMC = NONE
+output_level_histhfNMC  = NONE
+output_level_histstrataer = NONE
+output_level_histdaystrataer = NONE
+output_level_histstn      = NONE
+
+# Activate COSP in config.def and set corresponding output files
+LMDZ_COSP_OK=y
+output_level_histmthCOSP = NONE
+output_level_histdayCOSP = NONE
+output_level_histhfCOSP  = NONE
 
 [InitialStateFiles]
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/COMP/orchidee.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/COMP/orchidee.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/COMP/orchidee.card	(revision 4936)
@@ -53,5 +53,5 @@
 
 [OutputText]
-List=   (out_orchidee, orchidee.def, used_orchidee.def, iodef.xml, context_orchidee.xml, context_input_orchidee.xml, field_def_orchidee.xml, file_def_orchidee.xml, river_desc.nc)
+List=   (out_orchidee*, orchidee.def, used_orchidee.def, iodef.xml, context_orchidee.xml, context_input_orchidee.xml, field_def_orchidee.xml, file_def_orchidee.xml, river_desc.nc)
 
 [OutputFiles]
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/config.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/amip/config.card	(revision 4936)
@@ -29,4 +29,16 @@
 #-- Compression level for netcdf output files
 CompressionLevel=2
+#============================
+#-- Source following file with module settings, only if it exists
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
+#============================
+#-- ResolAtm indicates the atmospheric resolution
+#   This variable is used in the executable name 
+ResolAtm=144x142x79
+#============================
+# OptMode indicates the optimization mode choosen during compilation
+# This variable is used in the executable name
+OptMode=prod
+
 #========================================================================
 #D-- ListOfComponents -
@@ -41,11 +53,12 @@
 #D-- Executable -
 [Executable]
-#D- For each component: Real name of executable, Name of executable in the run directory 
-#D- Here is set 47MPI*8OMP which is suitable for resolution 144x142x79
+#D- For each component: First argument is the executable name as in bin folder.
+#D  ResolAtm and OptMode are set in UserChoices section.
+#D- Here is set 71MPI*8OMP which is suitable for resolution 144x142x79
 #D- Change to 31MPI*4OMP for resolution 96x95x39
-ATM= (gcm.e, lmdz.x, 71MPI, 8OMP)
+ATM= (gcm_${ResolAtm}_${OptMode}.e, lmdz.x, 71MPI, 8OMP)
 SRF= ("", "")
 SBG= ("", "")
-IOS= (xios_server.exe, xios.x, 1MPI)
+IOS= (xios_server_${OptMode}.exe, xios.x, 1MPI)
 
 #========================================================================
@@ -67,5 +80,4 @@
 #D-- ATM -
 [ATM]
-WriteFrequency="1M"
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -80,7 +92,4 @@
 #D-- SRF -
 [SRF]
-# WriteFrequency is not used any more for ORCHIDEE 
-# Output files are now managed in orchidee.card 
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -95,7 +104,4 @@
 #D-- SBG - STOMATE
 [SBG]
-# WriteFrequency is not used any more for ORCHIDEE 
-# Output files are now managed in stomate.card 
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -110,5 +116,4 @@
 #D-- IOS -
 [IOS]
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/clim_pdControl/COMP/lmdz.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/clim_pdControl/COMP/lmdz.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/clim_pdControl/COMP/lmdz.card	(revision 4936)
@@ -37,22 +37,28 @@
 ByPass_hgardfou_mats=n
 
-# Set OutLevel to choose the level of output for LMDZ
-# OutLevel=low/medium/high
-OutLevel=low
-
-# Set COSP activation and output frequency (monthly, daily, HF) = y/n
-LMDZ_COSP_OK=y
-LMDZ_COSP_monthly=n
-LMDZ_COSP_daily=n
-LMDZ_COSP_hf=n
-
-# Set NMC output frequency (monthly, daily, HF) = y/n
-LMDZ_NMC_monthly=n
-LMDZ_NMC_daily=n
-LMDZ_NMC_hf=n
-
 # Nugding : ok_guide=y/n
 # If ok_guide=y, add nudging files(u.nc, v.nc, hur.nc,...) in BoundaryFiles section below.
 ok_guide=n
+
+# Specify which output file to activate and at which output_level
+# Use an integer to specify the output level or NONE if to deactivate the file
+# output_level_filename=1     : activate the corresponding file with low output level
+# output_level_filename=10    : activate the corresponding file with high output level
+# output_level_filename=NONE  : the file will not be written
+output_level_histmth = 5
+output_level_histday = NONE
+output_level_histhf  = NONE
+output_level_histmthNMC = NONE
+output_level_histdayNMC = NONE
+output_level_histhfNMC  = NONE
+output_level_histstrataer = NONE
+output_level_histdaystrataer = NONE
+output_level_histstn      = NONE
+
+# Activate COSP in config.def and set corresponding output files
+LMDZ_COSP_OK=y
+output_level_histmthCOSP = NONE
+output_level_histdayCOSP = NONE
+output_level_histhfCOSP  = NONE
 
 [InitialStateFiles]
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/clim_pdControl/config.card
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/clim_pdControl/config.card	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/EXPERIMENTS/LMDZOR/clim_pdControl/config.card	(revision 4936)
@@ -29,5 +29,15 @@
 #-- Compression level for netcdf output files
 CompressionLevel=2
-
+#============================
+#-- Source following file with module settings, only if it exists
+EnvFile=${SUBMIT_DIR}/../ARCH/arch.env
+#============================
+#-- ResolAtm indicates the atmospheric resolution
+#   This variable is used in the executable name 
+ResolAtm=144x142x79
+#============================
+# OptMode indicates the optimization mode choosen during compilation
+# This variable is used in the executable name
+OptMode=prod
 
 #========================================================================
@@ -43,11 +53,12 @@
 #D-- Executable -
 [Executable]
-#D- For each component: Real name of executable, Name of executable in the run directory 
-#D- Here is set 47MPI*8OMP which is suitable for resolution 144x142x79
+#D- For each component: First argument is the executable name as in bin folder.
+#D  ResolAtm and OptMode are set in UserChoices section.
+#D- Here is set 71MPI*8OMP which is suitable for resolution 144x142x79
 #D- Change to 31MPI*4OMP for resolution 96x95x39
-ATM= (gcm.e, lmdz.x, 71MPI, 8OMP)
+ATM= (gcm_${ResolAtm}_${OptMode}.e, lmdz.x, 71MPI, 8OMP)
 SRF= ("", "")
 SBG= ("", "")
-IOS= (xios_server.exe, xios.x, 1MPI)
+IOS= (xios_server_${OptMode}.exe, xios.x, 1MPI)
 
 #========================================================================
@@ -69,5 +80,4 @@
 #D-- ATM -
 [ATM]
-WriteFrequency="1M"
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -82,7 +92,4 @@
 #D-- SRF -
 [SRF]
-# WriteFrequency is not used any more for ORCHIDEE 
-# Output files are now managed in orchidee.card 
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -97,7 +104,4 @@
 #D-- SBG - STOMATE
 [SBG]
-# WriteFrequency is not used any more for ORCHIDEE 
-# Output files are now managed in stomate.card 
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
@@ -112,5 +116,4 @@
 #D-- IOS -
 [IOS]
-WriteFrequency=""
 # If config_Restarts_OverRule == 'n' next 4 params are read
 Restart= n
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/lmdz.driver
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/lmdz.driver	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/lmdz.driver	(revision 4936)
@@ -5,7 +5,17 @@
     IGCM_debug_PushStack "ATM_Initialize"
 
-    RESOL_ATM=$( echo $RESOL | awk "-Fx" '{print $2}' | awk "-F-" '{print $1}')
-
-    [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x39
+    # Read the resolution from the variables ResolAtm set in config.card UserChoices section or from .resol file
+    if [ X$ResolAtm != X ] ; then
+	# ResolAtm is set in config.card
+	RESOL_ATM_3D=${ResolAtm}
+    elif [ -f ${SUBMIT_DIR}/../.resol ] ; then
+	# ResolAtm was not set in config.card, try to read .resol file
+	eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x39
+    else
+	IGCM_debug_Exit "ResolAtm is not set in config.card and the .resol file does not exist."
+	IGCM_debug_Verif_Exit
+    fi
+    
+    IGCM_debug_Print 1 "The atomsopheric resolution is ${RESOL_ATM_3D} " 
 
     RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' )
@@ -13,4 +23,5 @@
     RESOL_ATM_Y=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $2}' )
     RESOL_ATM_XY="${RESOL_ATM_X}x${RESOL_ATM_Y}"
+    RESOL_ATM=LMD${RESOL_ATM_X}${RESOL_ATM_Y}
 
     ##- LMDZ physics version
@@ -37,99 +48,4 @@
     ConfType=${lmdz_UserChoices_ConfType}
 
-    ##- LMDZ output level, to be set in lmdz.card
-    if [ X${lmdz_UserChoices_OutLevel} = X ] ; then
-	# OutLevel is not set. Take default value low.
-	OutLevel=low
-    else
-	OutLevel=${lmdz_UserChoices_OutLevel}
-    fi
-
-    ##-- Output frequency purpose ....
-    ##--  Initialisation  ....
-    ok_mensuel=.FALSE.
-    ok_journe=.FALSE.
-    ok_hf=.FALSE.
-    ok_hf3h=.FALSE.
-    ok_hf3hm=.FALSE.
-    ok_stn=.FALSE.
-
-
-    case ${config_UserChoices_PeriodLength} in
-	1Y|1y|1M|1m) ok_mensuel=.TRUE. ;;
-	5D|5d|1D|1d) ok_journe=.TRUE. ;;
-    esac
-
-    for frequency in ${config_ATM_WriteFrequency} ; do
-	case ${frequency} in
-	    1M|1m) ok_mensuel=.TRUE. ;;
-	esac
-	case ${frequency} in
-	    5D|5d|1D|1d) ok_journe=.TRUE. ;;
-	esac
-	case ${frequency} in
-	    HF|hf) ok_hf=.TRUE. ;;
-	esac
-	case ${frequency} in 
-	    HF3h|hf3h) ok_hf3h=.TRUE. ;;
-	esac
-	case ${frequency} in 
-	    HF3hm|hf3hm) ok_hf3hm=.TRUE. ;;
-	esac
-	case ${frequency} in
-	    STN|stn) ok_stn=.TRUE. ;;
-	esac
-    done
-
-
-##  Read LMDZ_COSP_OK in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_COSP_OK} = Xy ] ; then
-	##  LMDZ_COSP_OK=y, now read all other COSP variables
-	##  Read LMDZ_COSP_monthly in lmdz.card
-	if [ X${lmdz_UserChoices_LMDZ_COSP_monthly} = Xy ] ; then
-	    LMDZ_COSP_monthly=.TRUE.
-	else
-	    LMDZ_COSP_monthly=.FALSE.
-	fi
-        ##  Read LMDZ_COSP_daily in lmdz.card
-	if [ X${lmdz_UserChoices_LMDZ_COSP_daily} = Xy ] ; then
-	    LMDZ_COSP_daily=.TRUE.
-	else
-	    LMDZ_COSP_daily=.FALSE.
-	fi
-        ##  Read LMDZ_COSP_hf in lmdz.card
-	if [ X${lmdz_UserChoices_LMDZ_COSP_hf} = Xy ] ; then
-	    LMDZ_COSP_hf=.TRUE.
-	else
-	    LMDZ_COSP_hf=.FALSE.
-	fi
-    else
-	# LMDZ_COSP_OK=n : All cosp output are deactivated
-	LMDZ_COSP_monthly=.FALSE.
-	LMDZ_COSP_daily=.FALSE.
-	LMDZ_COSP_hf=.FALSE.
-    fi	
-
-    ##  Read LMDZ_NMC_monthly in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_NMC_monthly} = Xy ] ; then
-	LMDZ_NMC_monthly=.TRUE.
-    else
-	LMDZ_NMC_monthly=.FALSE.
-    fi
-    
-    ## Read LMDZ_NMC_daily in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_NMC_daily} = Xy ] ; then
-	LMDZ_NMC_daily=.TRUE.
-    else
-	LMDZ_NMC_daily=.FALSE.
-    fi
-    
-    ## Read LMDZ_NMC_hf in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_NMC_hf} = Xy ] ; then
-	LMDZ_NMC_hf=.TRUE.
-    else
-	LMDZ_NMC_hf=.FALSE.
-    fi
-    
-
     IGCM_debug_PopStack "ATM_Initialize"
 }
@@ -276,58 +192,117 @@
     IGCM_comp_modifyDefFile nonblocker config.def t_coupl   ${LMDZ_t_coupl} 
 
-    ##-- Add special treatement for CARBON CYCLE
-    if [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"control" ] || [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"historical" ] ; then
-	ATM_Carbon_Update
-    fi
-
-
-    ##-- Set LMDZ_COSP_daily1979=y in section UserChoices in lmdz.card to activate 
-    ##   COSP daily output for years 1979 and later (mandatory for historical CMIP5 run).
-    if ([ X"${lmdz_UserChoices_LMDZ_COSP_daily1979}" = X"y" ] &&  [ ${year} -ge 1979 ]) ; then
-	LMDZ_COSP_daily=.TRUE.
-    fi
-
-    ## Modifiy 
-    IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled ${ok_mensuel}
-    
-    IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled ${ok_journe}
-    
-    if [ X${OutLevel} = Xlow ] || [ X${OutLevel} = Xmedium ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 2
-    else
-	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 5
-    fi
-    
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled ${ok_hf}
-    
-    if [ X${OutLevel} = Xlow ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 5
-    elif [ X${OutLevel} = Xmedium ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 6
-    elif [ X${OutLevel} = Xhigh ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 7
-    fi
-    	
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhf3h_lmdz.xml histhf3h enabled ${ok_hf3h}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhf3hm_lmdz.xml histhf3hm enabled ${ok_hf3hm}
-
-    IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled ${ok_stn}
-
-    IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled ${LMDZ_NMC_monthly}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled ${LMDZ_NMC_daily}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled ${LMDZ_NMC_hf}
-    
-    IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled ${LMDZ_COSP_monthly}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled ${LMDZ_COSP_daily}
-    IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled ${LMDZ_COSP_hf}
-
-    # Activate the histstrataer output files only for configuration with interactive stratospheric aerosols 
-    # done by setting the key word LMDZ_strataero=y in lmdz.card
-    if [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then
-	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled .TRUE.
-    IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled .TRUE.
-    else
-	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled .FALSE.
-    IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled .FALSE.
+
+
+    ## Activate diagnostic output files and set output_level for each file
+
+    # histmth
+    if [ X${lmdz_UserChoices_output_level_histmth} = X ] || [ X${lmdz_UserChoices_output_level_histmth} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmth_lmdz.xml histmth output_level ${lmdz_UserChoices_output_level_histmth} 
+    fi
+
+    # histday
+    if [ X${lmdz_UserChoices_output_level_histday} = X ] || [ X${lmdz_UserChoices_output_level_histday} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histday_lmdz.xml histday output_level ${lmdz_UserChoices_output_level_histday} 
+    fi
+
+    # histhf
+    if [ X${lmdz_UserChoices_output_level_histhf} = X ] || [ X${lmdz_UserChoices_output_level_histhf} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhf_lmdz.xml histhf output_level ${lmdz_UserChoices_output_level_histhf} 
+    fi
+
+    # histmthNMC
+    if [ X${lmdz_UserChoices_output_level_histmthNMC} = X ] || [ X${lmdz_UserChoices_output_level_histmthNMC} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthNMC_lmdz.xml histmthNMC output_level ${lmdz_UserChoices_output_level_histmthNMC} 
+    fi
+
+    # histdayNMC
+    if [ X${lmdz_UserChoices_output_level_histdayNMC} = X ] || [ X${lmdz_UserChoices_output_level_histdayNMC} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayNMC_lmdz.xml histdayNMC output_level ${lmdz_UserChoices_output_level_histdayNMC} 
+    fi
+
+    # histhfNMC
+    if [ X${lmdz_UserChoices_output_level_histhfNMC} = X ] || [ X${lmdz_UserChoices_output_level_histhfNMC} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfNMC_lmdz.xml histhfNMC output_level ${lmdz_UserChoices_output_level_histhfNMC} 
+    fi
+
+    # histstrataer
+    if [ X${lmdz_UserChoices_output_level_histstrataer} = X ] || [ X${lmdz_UserChoices_output_level_histstrataer} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstrataer_lmdz.xml histstrataer output_level ${lmdz_UserChoices_output_level_histstrataer} 
+    fi
+
+    # histdaystrataer
+    if [ X${lmdz_UserChoices_output_level_histdaystrataer} = X ] || [ X${lmdz_UserChoices_output_level_histdaystrataer} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdaystrataer_lmdz.xml histdaystrataer output_level ${lmdz_UserChoices_output_level_histstrataer}
+    fi
+
+    # histstn
+    if [ X${lmdz_UserChoices_output_level_histstn} = X ] || [ X${lmdz_UserChoices_output_level_histstn} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histstn_lmdz.xml histstn output_level ${lmdz_UserChoices_output_level_histstn} 
+    fi
+
+
+    # histmthCOSP
+    if [ X${lmdz_UserChoices_output_level_histmthCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histmthCOSP} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histmthCOSP_lmdz.xml histmthCOSP output_level ${lmdz_UserChoices_output_level_histmthCOSP} 
+    fi
+
+
+    # histdayCOSP
+    if [ X${lmdz_UserChoices_output_level_histdayCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histdayCOSP} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histdayCOSP_lmdz.xml histdayCOSP output_level ${lmdz_UserChoices_output_level_histdayCOSP} 
+    fi
+
+
+    # histhfCOSP
+    if [ X${lmdz_UserChoices_output_level_histhfCOSP} = X ] || [ X${lmdz_UserChoices_output_level_histhfCOSP} = XNONE ] ; then
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled FALSE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP output_level 0
+    else
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP enabled TRUE
+	IGCM_comp_modifyXmlFile nonblocker file_def_histhfCOSP_lmdz.xml histhfCOSP output_level ${lmdz_UserChoices_output_level_histhfCOSP} 
     fi
 
@@ -393,27 +368,34 @@
 
     if [ X${config_ListOfComponents_CHM} = Xinca ] ; then
-    echo "Activate coupling to INCA, set type_trac=inca in run.def"
-    IGCM_comp_modifyDefFile blocker run.def type_trac inca
+	echo "Activate coupling to INCA, set type_trac=inca in run.def"
+	IGCM_comp_modifyDefFile blocker run.def type_trac inca
+	IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1  
     elif [ X${config_ListOfComponents_CHM} = Xreprobus ] ; then
-    echo "Activate coupling to REPROBUS, set type_trac=repr in run.def"
-    IGCM_comp_modifyDefFile blocker run.def type_trac repr
+	echo "Activate coupling to REPROBUS, set type_trac=repr in run.def"
+	IGCM_comp_modifyDefFile blocker run.def type_trac repr
         IGCM_comp_modifyDefFile blocker run.def config_inca none
+	IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1  
+    elif [ X${config_UserChoices_ConfigType} = XESMCO2 ] ; then 
+	echo "ESM config, set type_trac=co2i in run.def"
+	IGCM_comp_modifyDefFile blocker run.def type_trac co2i
+        IGCM_comp_modifyDefFile blocker run.def config_inca none
+	IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1  
     elif [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then
         echo "No coupling to chemistry model but it is a LMDZ STRATAER configuration, set type_trac=coag in run.def"
         IGCM_comp_modifyDefFile blocker run.def type_trac coag
         IGCM_comp_modifyDefFile blocker run.def config_inca none
-    else
-    echo "No coupling to chemistry model, set type_trac=lmdz in run.def"
-    IGCM_comp_modifyDefFile blocker run.def type_trac lmdz
+	IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 1  
+    else
+	echo "No coupling to chemistry model, set type_trac=lmdz in run.def"
+	IGCM_comp_modifyDefFile blocker run.def type_trac lmdz
         IGCM_comp_modifyDefFile blocker run.def config_inca none
-    fi
-
-    # run.def : Activate the call to phytrac 
-    if [ ! X${lmdz_UserChoices_iflag_phytrac} = X ]; then 
-	IGCM_comp_modifyDefFile nonblocker run.def iflag_phytrac ${lmdz_UserChoices_iflag_phytrac}
-    elif [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then
-    IGCM_comp_modifyDefFile nonblocker run.def iflag_phytrac 1
-    else
-	IGCM_comp_modifyDefFile nonblocker run.def iflag_phytrac 0
+	IGCM_comp_modifyDefFile blocker run.def iflag_phytrac 0
+    fi
+
+    # run.def : Activate the new calving 
+    if [ ! X${lmdz_UserChoices_cpl_old_calving} = X ]; then 
+	IGCM_comp_modifyDefFile nonblocker run.def cpl_old_calving ${lmdz_UserChoices_cpl_old_calving}
+    else
+	IGCM_comp_modifyDefFile nonblocker run.def cpl_old_calving y
     fi 
 
@@ -423,4 +405,11 @@
     else
 	IGCM_comp_modifyDefFile nonblocker physiq.def ok_bug_cv_trac  n
+    fi 
+
+    # config.def : Activate aerosol strato 
+    if [ ! X${lmdz_UserChoices_flag_aerosol_strat} = X ]; then 
+	IGCM_comp_modifyDefFile nonblocker config.def flag_aerosol_strat ${lmdz_UserChoices_flag_aerosol_strat}
+    else
+	IGCM_comp_modifyDefFile nonblocker config.def flag_aerosol_strat DEFAULT
     fi 
 
@@ -491,20 +480,26 @@
     fi 
 
-    # config.def : Modify parameter ok_volcan if it is set in lmdz.card
-    if [ ! X${lmdz_UserChoices_ok_volcan} = X ]; then
-    IGCM_comp_modifyDefFile nonblocker config.def ok_volcan ${lmdz_UserChoices_ok_volcan}
-    else
-    # Take default value set in config.def
-    IGCM_comp_modifyDefFile nonblocker config.def ok_volcan DEFAULT
-    fi
-
-    # config.def : set ok_volcan to y if we are in the strataero config
-    if [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then
-    IGCM_comp_modifyDefFile nonblocker config.def ok_volcan y
-    else
-    IGCM_comp_modifyDefFile nonblocker config.def ok_volcan DEFAULT
-    fi
-
+    if [ X${config_UserChoices_ConfigType} = XESMCO2 ] ; then
+	# Set carbon cycle parameters according to parmeters in lmdz.card 
+	IGCM_comp_modifyDefFile blocker config.def level_coupling_esm 2 
+	IGCM_comp_modifyDefFile blocker config.def carbon_cycle_cpl ${lmdz_UserChoices_carbon_cycle_cpl} 
+	IGCM_comp_modifyDefFile blocker config.def carbon_cycle_tr ${lmdz_UserChoices_carbon_cycle_tr}
+	IGCM_comp_modifyDefFile blocker config.def carbon_cycle_rad ${lmdz_UserChoices_carbon_cycle_rad}
+    else
+	# Take default value set in config.def
+	IGCM_comp_modifyDefFile nonblocker config.def level_coupling_esm DEFAULT
+	IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_cpl DEFAULT 
+	IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_tr DEFAULT
+	IGCM_comp_modifyDefFile nonblocker config.def carbon_cycle_rad DEFAULT
+    fi
+
+    # config.def : Modify parameter ok_volcan if ok_volcan=y or LMDZ_strataero=y in lmdz.card
     # Note: ok_volcan is a flag allowing a double-call with/without natural forcing (instead of with/without anthro forcing).
+    if [ ! X${lmdz_UserChoices_ok_volcan} = X ] || [ X${lmdz_UserChoices_LMDZ_strataero} = Xy ] ; then
+	IGCM_comp_modifyDefFile nonblocker config.def ok_volcan ${lmdz_UserChoices_ok_volcan}
+    else
+	# Take default value set in config.def
+	IGCM_comp_modifyDefFile nonblocker config.def ok_volcan DEFAULT
+    fi
 
     # physiq.def : Modify parameter tau_gl if it is set in lmdz.card
@@ -581,10 +576,9 @@
     fi
 
-    #Compression level (if CompressionLevel is not empty)
+    # Compression level (if CompressionLevel is not empty)
     if [ ! "X${config_UserChoices_CompressionLevel}" = "X" ] ; then
     echo "NetCDF output files compression level is " ${config_UserChoices_CompressionLevel}
     listfile=$(ls file_def*lmdz.xml)
-    for file in ${listfile}
-    do
+    for file in ${listfile} ; do
         sed -i -e "s/\(compression_level=\"\)[^\"]*\(\"\)/\1${config_UserChoices_CompressionLevel}\2/" ${file}
     done
@@ -600,148 +594,7 @@
     IGCM_debug_PushStack "ATM_Finalize"
 
-    # Add special treatement for CARBON CYCLE
-    if [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"control" ] || [ X"${lmdz_UserChoices_CARBON_CYCLE}" = X"historical" ] ; then
-	ATM_Carbon_Finalize
-    fi
-
-    echo FINALIZE ATM !
+    IGCM_debug_Print 1 "FINALIZE ATM !"
 
     IGCM_debug_PopStack "ATM_Finalize"
 }
 
-
-
-function ATM_Carbon_Update
-{
-    # This fuction will be called only if CARBON_CYCLE is set to control or historical in lmdz.card
-
-    IGCM_debug_PushStack "ATM_Carbon_Update"
-
-    typeset InitPeriodCo2 InitDateBeginCo2 InitDateEndCo2
-    typeset CO2SBG CO2MBG CO2LU CO2_ppm CO2_ppm_prec fCO2_ff
-    typeset PathCO2log 
-    typeset PreviousLinelog LastPeriodDateBegin LastPeriodDateEnd LastDatesPeriod LastPREFIX
-    
-    if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"n" ] ) ; then
-        ##--Initialization of fluxes to an undefined value at the first run
-	UndefinedValueCo2=-9999
-	InitPeriodCo2=0
-	InitDateBeginCo2=${UndefinedValueCo2}
-	InitYearCo2=$(( ${year} - 1 )) 
-	InitDateEndCo2=${InitYearCo2}1231
-	fCO2_ff=${UndefinedValueCo2} 
-	CO2SBG=${UndefinedValueCo2}
-	CO2LU=${UndefinedValueCo2}
-	CO2MBG=${UndefinedValueCo2}
-	CO2_ppm_prec=${UndefinedValueCo2}
-        # Get the initial value of atmosp. pco2 
-	CO2_ppm=${lmdz_UserChoices_co2_init}
-	
-	IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log
-	IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log
-	
-        # Save CO2 values in ExeCpuLog variable contents 5 fields
-	echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" |   \
-	    gawk '{printf("  %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \
-                              $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log
-	
-        # Get the path where the log file co2.log is
-	PathCO2log=${SUBMIT_DIR} 
-        # Get Previous line in co2.log
-	PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log )
-	
-    else
-	
-	# NEW parameter in config.card (even for Overule all restarts, you must modify the line after this comment ):
-        # !! NEW for Carbone cycle !! Path where to find old co2.log file for restart CO2.
-	#SubmitRestartPath=
-	if ( ${FirstInitialize} && [ X"${config_ATM_Restart}" = X"y" ] ) ; then
-	    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/config.card ATM SubmitRestartPath
-	    PathCO2log=${config_ATM_SubmitRestartPath}
-	    Date_r=$( IGCM_date_ConvertFormatToGregorian ${config_ATM_RestartDate} )
-	    PreviousLinelog=$( grep ${Date_r} ${PathCO2log}/co2.log )
-	    
-	    IGCM_sys_Cp ${SUBMIT_DIR}/co2.log.init ${SUBMIT_DIR}/co2.log
-	    IGCM_sys_Chmod u+w ${SUBMIT_DIR}/co2.log
-	    
-            # Save Last Line of control in new co2.log file
-	    InitPeriodCo2=0   
-	    InitDateBeginCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $2}' )
-	    InitDateEndCo2=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $3}' )
-	    fCO2_ff=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $6}' )
-	    CO2SBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $8}' )
-	    CO2LU=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $9}' )
-	    CO2MBG=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $7}' )
-	    CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $5}' )
-	    CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )
-	    
-	    echo "${InitPeriodCo2} ${InitDateBeginCo2} ${InitDateEndCo2} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" |   \
-		gawk '{printf("  %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \
-                              $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log
-	else
-           # Get restart line in co2.log
-	    PathCO2log=${SUBMIT_DIR}
-	    PreviousLinelog=$( tail -1 ${PathCO2log}/co2.log )
-           # Get the value of atmosp. pco2 in co2.log
-	    CO2_ppm=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )
-	fi
-	
-    fi
-    
-    if [ ${lmdz_UserChoices_CARBON_CYCLE} = historical ] ; then
-	# Modify co2_ppm in config.def only for historical run
-	# If not historical run, keep co2_ppm value set earlier by IGCM_comp_modifyDefFile
-	IGCM_comp_modifyDefFile force config.def co2_ppm     ${CO2_ppm}
-    fi
-    IGCM_debug_PopStack "ATM_Carbon_Update"
-}
-
-
-function ATM_Carbon_Finalize
-{
-    # This fuction will be called only if CARBON_CYCLE is set to control or historical in lmdz.card
-
-    IGCM_debug_PushStack "ATM_Carbon_Finalize"
-
-    typeset CO2SBG_3V CO2SBG CO2MBG CO2SRF CO2LU CO2_ppm CO2_ppm_prec fCO2_ff
-    
-	# Fossil fuel emission
-    if [ ${lmdz_UserChoices_CARBON_CYCLE} = control ] ; then
-            # For Control, no fossil fuel emission :
-	fCO2_ff=0
-	echo "Fossil Fuel for control run  :" ${fCO2_ff}
-    else
-            # For historical, get the fossile fuel file :
-	fCO2_ff=$( gawk "{if (match(\$0,\"${year}\ *${month}\")) {print \$3}}" ${SUBMIT_DIR}/PARAM/CMIP5_gridcar_CO2_emissions_fossil_fuel_Andres_1751-2007_monthly_SC.txt )
-	echo "Fossil Fuel for historical run  :" ${fCO2_ff}
-    fi
-    
-        # Get the value of ocean carbon flux
-    CO2MBG=$( ${SUBMIT_DIR}/COMP/lmdz_analyse_pisces_out.awk ocean.output )
-    CO2MBG=$( echo ${CO2MBG} | sed -e "s/ *//" )
-    echo "Ocean carbon flux  :" ${CO2MBG}
-    
-        # Get the value of land fluxes
-    set +A CO2SBG_3V -- $( ${SUBMIT_DIR}/COMP/lmdz_analyse_stomate_out.awk out_orchidee_0000 )
-    CO2SRF=$( echo ${CO2SBG_3V[0]} | sed -e "s/ *//" )
-    CO2LU=$( echo ${CO2SBG_3V[1]} | sed -e "s/ *//" )
-    CO2SBG=$( echo ${CO2SBG_3V[2]} | sed -e "s/ *//" )
-    echo "Land carbon flux (NEP)         :" ${CO2SRF}
-    echo "LU flux          (FLUC)        :" ${CO2LU}
-    echo "Total Land carbon flux (NBP)   :" ${CO2SBG}
-    
-        # Previous CO2
-    CO2_ppm_prec=$( echo "${PreviousLinelog[*]}" | gawk -F '|' '{gsub(" ",""); print $4}' )
-    echo "Previous CO2  :" ${CO2_ppm_prec}
-    
-        # Formula
-    CO2_ppm=$( echo "${CO2_ppm_prec} + (${fCO2_ff} + ${CO2MBG} + ${CO2SBG}) / 2.12" | bc -l )
-    echo "New CO2  :" ${CO2_ppm}
-    
-        # Save CO2 values in ExeCpuLog variable contents 5 fields
-    echo "${CumulPeriod} ${PeriodDateBegin} ${PeriodDateEnd} ${CO2_ppm} ${CO2_ppm_prec} ${fCO2_ff} ${CO2MBG} ${CO2SBG} ${CO2LU}" |   \
-	gawk '{printf("  %11d | %15s | %15s | %22.15g | %20.15g | %11.8g | %11.8g | %12.8g | %12.8g \n", \
-                           $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/co2.log
-    
-    IGCM_debug_PopStack "ATM_Carbon_Finalize"
-}
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/orchidee.driver
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/orchidee.driver	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/orchidee.driver	(revision 4936)
@@ -169,10 +169,9 @@
     fi
 
-    #Compression level (if CompressionLevel is not empty)
+    # Compression level (if CompressionLevel is not empty)
     if [ ! "X${config_UserChoices_CompressionLevel}" = "X" ] ; then
 	echo "NetCDF output files compression level is " ${config_UserChoices_CompressionLevel}
     	listfile=$(ls file_def*orchidee.xml)
-    	for file in ${listfile}
-    	do
+    	for file in ${listfile} ; do
 	    sed -i -e "s/\(compression_level=\"\)[^\"]*\(\"\)/\1${config_UserChoices_CompressionLevel}\2/" ${file}
     	done
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/xios.driver
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/xios.driver	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/DRIVER/xios.driver	(revision 4936)
@@ -20,6 +20,6 @@
 
 # Activate 2nd server level for CMIP6 type experiments (CMIP6 workflow)
-    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then
-    IGCM_comp_modifyXmlFile force iodef.xml using_server2 NONE true
+    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] || [ X"$( echo ${config_UserChoices_ExpType} | grep MR025 )" != "X" ] ; then
+       IGCM_comp_modifyXmlFile force iodef.xml using_server2 NONE true
     fi
 
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_actuel
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_actuel	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_actuel	(revision 4936)
@@ -1,2 +1,11 @@
+## level_coupling_esm : 0(pas d'echange de carbone), 2 (change entre LMDZ/CPL/NEMO et LMDZ/ORCHIDEE)
+level_coupling_esm=  _AUTO_: DEFAULT = 0
+## carbon_cycle_cpl: couplage des flux de carbone ATM/OCE, ATM/SRF
+carbon_cycle_cpl=_AUTO_ : DEFAULT=n
+## carbon_cycle_tr: transport atmospherique de CO2 dans LMDZ
+carbon_cycle_tr=_AUTO_ : DEFAULT=n
+## carbon_cycle_rad: utilisation de traceur CO2 dans le code radiatif
+carbon_cycle_rad=_AUTO_ : DEFAULT=n
+
 ##  Cycle diurne  ou non                 
 iflag_cycle_diurne=1
@@ -72,7 +81,7 @@
 # 
 # Aerosols stratospheriques utilises par defaut 
-flag_aerosol_strat=2
-# Flag to yield double call with/without natural forcing (instead of with/without anthropic)
-ok_volcan=_AUTO_: DEFAULT = n
+flag_aerosol_strat=_AUTO_ : DEFAULT=2
+# Diag VolMIP to get volcanic aerosols effects instead of tropospheric ones
+ok_volcan=n
 #
 # COSP
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_annuel
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_annuel	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_annuel	(revision 4936)
@@ -1,2 +1,11 @@
+# level_coupling_esm : 0(pas d'echange de carbone), 2 (change entre LMDZ/CPL/NEMO et LMDZ/ORCHIDEE)
+level_coupling_esm=  _AUTO_: DEFAULT = 0
+## carbon_cycle_cpl: couplage des flux de carbone ATM/OCE, ATM/SRF
+carbon_cycle_cpl=_AUTO_ : DEFAULT=n
+## carbon_cycle_tr: transport atmospherique de CO2 dans LMDZ
+carbon_cycle_tr=_AUTO_ : DEFAULT=n
+## carbon_cycle_rad: utilisation de traceur CO2 dans le code radiatif
+carbon_cycle_rad=_AUTO_ : DEFAULT=n
+
 ##  Cycle diurne  ou non                 
 iflag_cycle_diurne=1
@@ -73,7 +82,7 @@
 # 
 # Aerosols stratospheriques utilises par defaut 
-flag_aerosol_strat=2
-# Flag to yield double call with/without natural forcing (instead of with/without anthropic)
-ok_volcan=_AUTO_: DEFAULT = n
+flag_aerosol_strat=_AUTO_ : DEFAULT=2
+# Diag VolMIP to get volcanic aerosols effects instead of tropospheric ones
+ok_volcan=n
 #
 # COSP
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_preind
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_preind	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/config.def_preind	(revision 4936)
@@ -1,2 +1,11 @@
+## level_coupling_esm : 0(pas d'echange de carbone), 2 (change entre LMDZ/CPL/NEMO et LMDZ/ORCHIDEE)
+level_coupling_esm=  _AUTO_: DEFAULT = 0
+## carbon_cycle_cpl: couplage des flux de carbone ATM/OCE, ATM/SRF
+carbon_cycle_cpl=_AUTO_ : DEFAULT=n
+## carbon_cycle_tr: transport atmospherique de CO2 dans LMDZ
+carbon_cycle_tr=_AUTO_ : DEFAULT=n
+## carbon_cycle_rad: utilisation de traceur CO2 dans le code radiatif
+carbon_cycle_rad=_AUTO_ : DEFAULT=n
+
 ##  Cycle diurne  ou non                 
 iflag_cycle_diurne=1
@@ -73,8 +82,7 @@
 # Aerosols stratospheriques utilises par defaut 
 #
-flag_aerosol_strat=2
-# Flag to yield double call with/without natural forcing (instead of with/without anthropic)
-ok_volcan=_AUTO_: DEFAULT = n
-#
+flag_aerosol_strat=_AUTO_ : DEFAULT=2
+# Diag VolMIP to get volcanic aerosols effects instead of tropospheric ones
+ok_volcan=n
 #
 # COSP
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/iodef.xml
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/iodef.xml	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/iodef.xml	(revision 4936)
@@ -34,4 +34,5 @@
       <variable id="activate_non_distributed_transformation" type="bool">true</variable>
       <variable id="recv_field_timeout" type="double">3000.0</variable>
+      <variable id="call_oasis_enddef" type="bool">true</variable>
     </variable_definition>
 
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/run.def
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/run.def	(revision 4898)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/GENERAL/PARAM/run.def	(revision 4936)
@@ -55,4 +55,6 @@
 no_ter_antartique=y
 ### Do not call phytrac to speed things up
-iflag_phytrac=_AUTO_: DEFAULT = 0
+iflag_phytrac=_AUTOBLOCKER_: DEFAULT = 0
+### cpl_old_calving : use n for DYNAMICO and new coupling weight(MR025)
+cpl_old_calving = _AUTO_
 
Index: CONFIG/UNIFORM/v6/LMDZOR_v6.3/compile_lmdzor.sh
===================================================================
--- CONFIG/UNIFORM/v6/LMDZOR_v6.3/compile_lmdzor.sh	(revision 4936)
+++ CONFIG/UNIFORM/v6/LMDZOR_v6.3/compile_lmdzor.sh	(revision 4936)
@@ -0,0 +1,293 @@
+#!/bin/bash
+#set -vx
+# Default options
+#
+#
+#
+date
+#### 1  Set up the compiling options
+#### Define some directories
+submitdir=$( pwd )
+modipsl=$submitdir/../..
+arch_path=$submitdir/ARCH 
+
+#### Set default options 
+# Optimization mode
+# optmode=prod/dev/debug
+optmode=prod
+# Resolution of LMDZ in regular mode
+resol_atm=144x142x79
+# Also compile ce0l subprogram to LMDZ (y/n)
+ce0l=y
+
+# fcm_arch
+fcm_arch=default
+# Default values to be overritten
+parallel=mpi_omp
+export fcm_arch parallel xios
+full_flag=""
+full_xios=""
+full_lmdz=""
+full_orch=""
+
+# Default netcdf_lib is used for XIOS but can be change by argument
+netcdf_lib=""
+
+# Output text file for compilation of each component
+datestr=`LC_ALL=C date +"%Y%m%dT%H%M"`
+outfile=$submitdir/out_compile_lmdzor.$datestr
+echo > $outfile
+echo; echo "Text output from compilation will be stored in file out_compile_lmdzor.$datestr"; echo 
+
+#### Read arguments 
+# Loop over all arguments to modify default set up
+while (($# > 0)) ; do
+    case $1 in
+	"-h") cat <<end_help
+########################################################################
+# Usage of the script compile_lmdzor.sh
+#
+########################################################################
+
+./compile_config [Options] 
+
+Options: -full, -resol_atm, -debug, -dev, -prod(default)
+
+Example 1: Default compilation of LMDZ-ORCHIDEE with XIOS and IOIPSL
+./compile_lmdzor.sh
+
+Example 2: Compile in debug mode
+./compile_lmdzor.sh -debug
+
+Example 3: Default compilation with full recompilation of all components
+./compile_lmdzor.sh -full
+
+Example 4: Compilation of LMDZ in regular lat-lon for other dimensions (default: 144x142x79) 
+The dimension can be changed to any other 3d dimension.
+./compile_lmdzor.sh -resol_atm 96x95x79
+
+end_help
+exit;;
+	"-parallel") 	    parallel=$2 ; shift ; shift ;; 
+	"-arch")	    fcm_arch="$2" ; shift ; shift ;;
+	"-xios") 	    xios="$2" ; shift ; shift ;;
+	"-debug")	    optmode=debug ; shift ;;
+	"-dev") 	    optmode=dev ; shift ;;
+	"-prod")	    optmode=prod ; shift ;;
+	"-resol_atm")	    resol_atm=$2 ; shift ; shift ;;
+	"CE0L")             ce0l=y ; shift ;;
+	"-full")            full_flag="-full"; full_xios="--full" ; full_lmdz="-full" ; full_orch="-full" ; shift ;;
+	"-full_xios")       full_xios="--full" ; shift ;;  # Note only full_xios is using double dash: --full
+	"-full_lmdz")       full_lmdz="-full"  ; shift ;;
+	"-full_orch")       full_orch="-full"  ; shift ;;
+	"-netcdf_lib_seq")  netcdf_lib="--netcdf_lib netcdf4_seq"; shift ;;
+	*)	            echo "unknown option "$1" , exiting..." ; exit 
+    esac
+done
+
+echo "Following options are set in current compiling:" >> $outfile 
+echo "   resol_atm=${resol_atm}" >> $outfile 
+echo "   ce0l=${ce0l}" >> $outfile 
+echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch " >> $outfile 
+echo "   full_flag=$full_flag, full_xios=$full_xios, full_lmdz=$full_lmdz, full_orch=$full_orch" >> $outfile 
+echo >> $outfile
+
+### Read host dependent default values
+### These variables will not be changed if they were set as argument
+###./host.sh $host
+# Later : Following lines should be set in host.sh file
+# begin host.sh
+if [ $fcm_arch == default ] ; then
+    # Find out current host and source specific paths and commands for the host
+    case $( hostname -s ) in
+	jean-zay*)
+	    fcm_arch=X64_JEANZAY;;
+	irene*)
+	    fcm_arch=X64_IRENE;;
+	asterix*|obelix*)
+	    fcm_arch=ifort_LSCE;;
+	ciclad*|climserv*)
+	    fcm_arch=ifort_CICLAD;;
+	*)
+	    echo Current host is not known. You must use option -arch to specify which architecuture files to use.
+	    echo Exit now.
+	    exit
+    esac
+fi
+
+# Set a link to arch.env if arch-${fcm_arch}.env file exist for current fcm_arch.
+# The link arch.env is also set in config.card and will be used by libIGCM to ensure the same running environnement.
+if [ -f ARCH/arch-${fcm_arch}.env ] ; then
+    echo >> $outfile
+    echo "The file ARCH/arch-${fcm_arch}.env will now be sourced with modules needed for compilation for all components."
+    echo "Note that this new environement might be kept after compilation." 
+    echo "If this is the case, source again your personal environment after compilation. "
+    echo " Personal module list before sourcing of ARCH/arch.env file:"    >> $outfile  
+    module list   >> $outfile 2>&1 
+
+    # Make a link to this file, to be used also in config.card
+    rm -f ARCH/arch.env
+    ln -s arch-${fcm_arch}.env ARCH/arch.env
+
+    # Source the file
+    source ARCH/arch.env   >> $outfile 2>&1 
+    echo >> $outfile 
+    echo " New module list after sourcing of ARCH/arch.env file:"    >> $outfile  
+    module list   >> $outfile 2>&1 
+fi
+
+#### 2 Do the compilation 
+## 2.1 Compile ioipsl
+cd $modipsl/modeles/IOIPSL
+echo; echo "NOW COMPILE IOIPSL"
+echo >> $outfile ; echo " NOW COMPILE IOIPSL"   >> $outfile 
+
+# Check if compilation with fcm is included in IOIPSL
+if [ ! -f makeioipsl_fcm ] ; then
+  echo "The file makeiopsl_fcm do not exist. Probably this is not the right version of IOIPSL."
+  echo "Version of IOIPSL with fcm compilation is needed to compile with this script. Stop now."
+  exit
+fi
+
+echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 
+     ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag   >> $outfile 2>&1
+# Test if compiling succeded 
+if [[ $? != 0 ]] ; then 
+    echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP"
+    exit
+fi
+
+## 2.2 Compile xios
+cd $modipsl/modeles/XIOS
+echo; echo "NOW COMPILE XIOS"
+echo >> $outfile ; echo " NOW COMPILE XIOS"   >> $outfile 
+echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 
+     ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path ${netcdf_lib} --job 4 $full_xios   >> $outfile 2>&1
+# Test if compiling succeded 
+if [[ $? != 0 ]] ; then 
+    echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP"
+    exit
+fi
+# Move executables to modipsl/bin
+if [ -f $modipsl/modeles/XIOS/bin/xios_server.exe ] ; then 
+    mv $modipsl/modeles/XIOS/bin/xios_server.exe $modipsl/bin/xios_server_${optmode}.exe
+else
+    echo "THERE IS A PROBLEM IN XIOS COMPILATION EXECUTABLE MISSING - STOP"
+    exit
+fi
+
+
+## 2.3 Compile orchidee
+cd $modipsl/modeles/ORCHIDEE
+echo; echo "NOW COMPILE ORCHIDEE"
+echo >> $outfile ; echo " NOW COMPILE ORCHIDEE"   >> $outfile 
+
+echo 	./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch -driver   >> $outfile 
+        ./makeorchidee_fcm -j 8 -xios -parallel $parallel -$optmode -arch ${fcm_arch} -arch_path $arch_path $full_orch -driver    >> $outfile 2>&1
+# Test if compiling finished
+if [[ $? != 0 ]] ; then
+    echo "THERE IS A PROBLEM IN ORCHIDEE COMPILATION - STOP"
+    exit
+fi
+
+# Rename executables to contain $optmode
+if [ -f $modipsl/bin/orchidee_ol ] ; then mv $modipsl/bin/orchidee_ol  $modipsl/bin/orchidee_ol_${optmode} ; fi
+if [ -f $modipsl/bin/orchideedriver ] ; then mv $modipsl/bin/orchideedriver  $modipsl/bin/orchideedriver_${optmode} ; fi
+
+
+## 2.4 Compile LMDZ for regular latlon configuration
+cd $modipsl/modeles/LMDZ
+# Compile LMDZ regular lat-lon executable
+echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"
+echo >> $outfile ; echo " NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm}"   >> $outfile 
+
+# Check if the compilation of LMDZ was previsouly interupted prematured. 
+# In that case, the files dimension.h and .lock exist. If the files exist, they are here removed to avoid makelmdz_fcm 
+# to ask question and wait for interactivly answer from the user.
+if [ -f libf/grid/dimensions.h ] || [ -f .lock ] ; then
+  echo >> $outfile
+  echo " WARNING!! The file LMDZ/libf/grid/dimension.h and/or the LMDZ/.lock exist. "   >> $outfile
+  echo "           This means that the compilation is either currently on going in another terminal was previous interupted before the end."   >> $outfile
+  echo "           The files dimension.h and .lock will now be removed. "   >> $outfile
+  echo >> $outfile
+  rm -f libf/grid/dimensions.h
+  rm -f .lock
+fi
+
+echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 
+./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz gcm    >> $outfile 2>&1
+# Test if compiling finished
+if [[ $? != 0 ]] ; then
+    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
+    exit
+fi
+
+# Move executables to modipsl/bin folder
+echo >> $outfile
+echo "Move gcm.e executable to modipsl/bin" >> $outfile
+echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
+ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
+echo >> $outfile
+
+# Find executable suffix
+if [ $parallel == seq ] || [ $parallel == none ] ; then
+    suffix=_${resol_atm}_phylmd_seq_orch.e
+else
+    suffix=_${resol_atm}_phylmd_para_mem_orch.e
+fi
+echo gcm suffix = $suffix
+
+if [ -f $modipsl/modeles/LMDZ/bin/gcm${suffix} ] ;  then 
+    mv $modipsl/modeles/LMDZ/bin/gcm${suffix} $modipsl/bin/gcm_${resol_atm}_${optmode}.e
+else
+    echo "ERROR gcm${suffix} executable does not exist." 
+    echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP"
+    exit
+fi  
+
+
+# Compile ce0l initialization program for LMDZ regular lat-lon exectuable
+if [ $ce0l == y ] ; then
+    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"
+    echo >> $outfile ; echo " NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm}"   >> $outfile 
+    
+    echo ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 
+    ./makelmdz_fcm -d ${resol_atm} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_lmdz ce0l    >> $outfile 2>&1
+    # Test if compiling finished
+    if [[ $? != 0 ]] ; then
+	echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi
+
+    
+    # Move executables to modipsl/bin folder
+    echo >> $outfile
+    echo "Move ce0l.e executable to modipsl/bin" >> $outfile
+    echo ls -lrt $modipsl/modeles/LMDZ/bin   >> $outfile
+    ls -lrt $modipsl/modeles/LMDZ/bin  >> $outfile
+    echo >> $outfile
+    echo ce0l suffix = $suffix
+
+    if [ -f $modipsl/modeles/LMDZ/bin/ce0l${suffix} ] ;  then 
+	mv $modipsl/modeles/LMDZ/bin/ce0l${suffix} $modipsl/bin/ce0l_${resol_atm}_${optmode}.e
+    else
+	echo "ERROR ce0l${suffix} executable does not exist." 
+	echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP"
+	exit
+    fi  
+fi
+
+
+echo >>$outfile ; echo "ALL COMPILING FINISHED" >> $outfile
+echo ls -lrt modipsl/bin >> $outfile
+ls -lrt $modipsl/bin >> $outfile
+
+echo; echo "ALL COMPILING FINISHED" ; echo
+echo "Executables are found in modipsl/bin"
+echo "Check that executable names correspond with the name set in config.card before launching the job"
+echo ls -lrt modipsl/bin
+ls -lrt $modipsl/bin
+
+date
+
+exit
