Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_scheme.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_scheme.F90	(revision 4573)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_scheme.F90	(revision 4646)
@@ -80,17 +80,8 @@
 USE PARKIND1 , ONLY : JPIM, JPRB
 USE YOMHOOK  , ONLY : LHOOK, DR_HOOK
-! AI ATTENTION module propre a ifs commentes
-!USE YOERAD   , ONLY : YRERAD
-USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, rad_config, &
-!USE RADIATION_SETUP, ONLY : &
-     &  NWEIGHT_UV,  IBAND_UV,  WEIGHT_UV, &
-     &  NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &
-     &  ITYPE_TROP_BG_AER,  TROP_BG_AER_MASS_EXT, &
-     &  ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, ISolverSpartacus
+USE RADIATION_SETUP
 ! Commentes : jour, date de la simulation 
-!USE YOMRIP0  , ONLY : NINDAT
-!USE YOMCT3   , ONLY : NSTEP
-!USE YOMRIP   , ONLY : YRRIP
 USE YOMCST   , ONLY : RSIGMA ! Stefan-Boltzmann constant
+USE radiation_config, ONLY : config_type,ISolverSpartacus
 
 ! Modules from radiation library
@@ -142,7 +133,4 @@
 !REAL(KIND=JPRB),   INTENT(IN) :: PLAND_SEA_MASK(KLON) 
 
-! *** Variables on full levels
-!REAL(KIND=JPRB),   INTENT(IN) :: PPRESSURE(KLON,KLEV)    ! (Pa)
-!REAL(KIND=JPRB),   INTENT(IN) :: PTEMPERATURE(KLON,KLEV) ! (K)
 ! *** Variables on half levels
 REAL(KIND=JPRB),   INTENT(IN) :: PPRESSURE_H(KLON,KLEV+1)    ! (Pa)
@@ -201,15 +189,4 @@
 REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_UP_CLEAR(KLON,KLEV+1)
 
-! *** Surface flux components (W m-2)
-! AI ATTENTION
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_SW_DN_SURF(KLON) 
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_DN_SURF(KLON) 
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_SW_DN_CLEAR_SURF(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_DN_CLEAR_SURF(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_SW_UP_SURF(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_UP_SURF(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_SW_UP_CLEAR_SURF(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_UP_CLEAR_SURF(KLON)
-
 ! Direct component of surface flux into horizontal plane
 REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_DIR(KLON)
@@ -222,12 +199,4 @@
 REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_PAR(KLON)
 REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_PAR_CLEAR(KLON)
-
-! *** Other single-level diagnostics
-! Top-of-atmosphere incident solar flux (W m-2)
-! AI ATTENTION
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_SW_DN_TOA(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_SW_UP_TOA(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_DN_TOA(KLON)
-!REAL(KIND=JPRB),  INTENT(OUT) :: PFLUX_LW_UP_TOA(KLON)
 
 ! Diagnosed longwave surface emissivity across the whole spectrum
@@ -250,5 +219,6 @@
 ! LOCAL VARIABLES
 ! AI ATTENTION
-!type(config_type)         :: rad_config
+type(config_type),save         :: rad_config
+type(driver_config_type),save  :: driver_config
 TYPE(single_level_type)   :: single_level
 TYPE(thermodynamics_type) :: thermodynamics
@@ -272,15 +242,4 @@
 !REAL(KIND=JPRB)           :: ZDECORR_LEN_RATIO = 0.5_jprb
 
-!AI mai 2023
-! A mettre dans namelist
-!real(jprb) :: high_inv_effective_size
-!real(jprb) :: middle_inv_effective_size
-!real(jprb) :: low_inv_effective_size
-
-!real(jprb) :: cloud_inhom_separation_factor
-!real(jprb) :: cloud_separation_scale_surface
-!real(jprb) :: cloud_separation_scale_toa
-!real(jprb) :: cloud_separation_scale_power
-
 ! The surface net longwave flux if the surface was a black body, used
 ! to compute the effective broadband surface emissivity
@@ -301,8 +260,4 @@
 INTEGER, PARAMETER :: NAERMACC = 1
 
-! AI ATTENTION
-! A mettre dans namelist
-!real(jprb), parameter    :: frac_std = 0.75
-
 ! Name of file names specified on command line
 character(len=512) :: file_name
@@ -310,96 +265,18 @@
 logical :: loutput=.true.
 logical :: lprint_input=.false.
-logical :: lprint_config=.false.
+logical :: lprint_config=.true.
 logical, save :: debut_ecrad=.true.
 !$OMP THREADPRIVATE(debut_ecrad)
-
-type(driver_config_type) :: driver_config
-! Import time functions for iseed calculation
-! AI ATTENTION propre a ifs
-!#include "fcttim.func.h"
-!#include "liquid_effective_radius.intfb.h"
-!#include "ice_effective_radius.intfb.h"
-!#include "cloud_overlap_decorr_len.intfb.h"
-!#include "satur.intfb.h"
-
-! Verifier les inputs
-print*,'=============== dans radiation_scheme : ==================='
-if (lprint_input) then
-  print*,'********** Verification des entrees *************'
-  print*,'KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW =', &
-        KIDIA, KFDIA, KLON, KLEV, KAEROSOL, NSW
-  print*,'IDAY, TIME =', IDAY, TIME
-  print*,'PSOLAR_IRRADIANCE =', PSOLAR_IRRADIANCE
-  print*,'PMU0 =', PMU0
-  print*,'PTEMPERATURE_SKIN =',PTEMPERATURE_SKIN
-  print*,'PEMIS, PEMIS_WINDOW =', PEMIS, PEMIS_WINDOW
-  print*,'PGELAM, PGEMU =', PGELAM, PGEMU
-  print*,'PPRESSURE_H =', PPRESSURE_H
-  print*,'PTEMPERATURE_H =', PTEMPERATURE_H
-  print*,'PQ =', PQ
-  print*,'PQSAT=',PQSAT
-  print*,'PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, PCCL4 =', &
-        PCO2, PCH4, PN2O, PNO2, PCFC11, PCFC12, PHCFC22, PCCL4
-  print*,'PO3 =',PO3
-  print*,'PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW =', &
-        PCLOUD_FRAC, PQ_LIQUID, PQ_ICE, PQ_SNOW
-  print*,'ZRE_LIQUID_UM, ZRE_ICE_UM =', &
-        ZRE_LIQUID_UM, ZRE_ICE_UM
-  print*,'PAEROSOL_OLD, PAEROSOL =', PAEROSOL_OLD, PAEROSOL
-endif
+integer, save :: itap_ecrad=1
 
 IF (LHOOK) CALL DR_HOOK('RADIATION_SCHEME',0,ZHOOK_HANDLE)
 print*,'Entree dans radiation_scheme'
 
+! A.I juillet 2023 : 
+! Initialisation dans radiation_setup au 1er passage dans Ecrad
 !$OMP MASTER
 if (debut_ecrad) then
 ! AI appel radiation_setup
-call SETUP_RADIATION_SCHEME(loutput)
-! Read "radiation_driver" namelist into radiation driver config type
-  file_name="namelist_ecrad"
-call driver_config%read(file_name)
-
-if (rad_config%i_solver_sw == ISolverSPARTACUS &
-      & .or.   rad_config%i_solver_lw == ISolverSPARTACUS) then
-       print*,'Solveur SW: ', rad_config%i_solver_sw
-       print*,'Solveur LW: ', rad_config%i_solver_lw
-   if (driver_config%ok_effective_size) then
-       print*,'low_inv_effective_size = ',driver_config%low_inv_effective_size
-       print*,'middle_inv_effective_size = ',driver_config%middle_inv_effective_size
-       print*,'high_inv_effective_size = ',driver_config%high_inv_effective_size
-   else if (driver_config%ok_separation) then   
-       print*,'cloud_separation_scale_surface =',driver_config%cloud_separation_scale_surface
-       print*,'cloud_separation_scale_toa =',driver_config%cloud_separation_scale_toa
-       print*,'cloud_separation_scale_power =',driver_config%cloud_separation_scale_power
-       print*,'cloud_inhom_separation_factor =',driver_config%cloud_inhom_separation_factor
-   endif   
-endif   
-
- if (lprint_config) then
-  print*,'************* Parametres de configuration  ********************'
-  print*,'rad_config%iverbosesetup = ',rad_config%iverbosesetup 
-  print*,'rad_config%iverbose = ',rad_config%iverbose
-  print*,'rad_config%directory_name =', rad_config%directory_name
-  print*,'rad_config%do_lw_derivatives =',rad_config%do_lw_derivatives
-  print*,'rad_config%do_surface_sw_spectral_flux =', &
-        rad_config%do_surface_sw_spectral_flux
-  print*,'rad_config%do_setup_ifsrrtm =', rad_config%do_setup_ifsrrtm
-  print*,'rad_config%i_liq_model =',rad_config%i_liq_model
-  print*,'rad_config%i_ice_model =',rad_config%i_ice_model
-  print*,'rad_config%i_overlap_scheme =', rad_config%i_overlap_scheme
-  print*,'rad_config%use_aerosols = ', rad_config%use_aerosols
-  print*,'rad_config%n_aerosol_types = ', rad_config%n_aerosol_types
-  print*,'rad_config%i_solver_lw =',rad_config%i_solver_lw
-  print*,'rad_config%i_solver_sw =',rad_config%i_solver_sw
-  print*,'rad_config%do_3d_effects =', rad_config%do_3d_effects
-  print*,'rad_config%do_sw_delta_scaling_with_gases =', &
-       rad_config%do_sw_delta_scaling_with_gases
-  print*,'rad_config%do_lw_aerosol_scattering =', &
-       rad_config%do_lw_aerosol_scattering
-  print*,'rad_config%i_albedo_from_band_sw = ', &
-       rad_config%i_albedo_from_band_sw
-  print*,'n_bands_lw =', rad_config%n_bands_lw
-  print*,'rad_config%i_emiss_from_band_lw =', rad_config%i_emiss_from_band_lw
- endif
+ call SETUP_RADIATION_SCHEME(loutput,rad_config,driver_config)
  debut_ecrad=.false. 
 endif 
@@ -408,7 +285,83 @@
 ! Fin partie initialisation et configuration 
 
-! AI : allocation des tableaux pour chaque partie (thermo, ...)
-!      passage des champs LMDZ aux structures Ecrad
-!      calculs Ecrad
+!AI juillet 2023 : verif des param de config :
+if (lprint_config) then
+   print*,'Parametres de configuration de ecrad, etape ',itap_ecrad     
+   print*,'do_sw, do_lw, do_sw_direct, do_3d_effects = ', &
+           rad_config%do_sw, rad_config%do_lw, rad_config%do_sw_direct, rad_config%do_3d_effects
+   print*,'do_lw_side_emissivity, do_clear, do_save_radiative_properties = ', &
+           rad_config%do_lw_side_emissivity, rad_config%do_clear, rad_config%do_save_radiative_properties
+!   print*,'sw_entrapment_name, sw_encroachment_name = ', &
+!           rad_config%sw_entrapment_name, rad_config%sw_encroachment_name
+   print*,'do_3d_lw_multilayer_effects, do_fu_lw_ice_optics_bug = ', &
+           rad_config%do_3d_lw_multilayer_effects, rad_config%do_fu_lw_ice_optics_bug
+   print*,'do_save_spectral_flux, do_save_gpoint_flux = ', &
+           rad_config%do_save_spectral_flux, rad_config%do_save_gpoint_flux
+   print*,'do_surface_sw_spectral_flux, do_lw_derivatives = ', &
+           rad_config%do_surface_sw_spectral_flux, rad_config%do_lw_derivatives
+   print*,'do_lw_aerosol_scattering, do_lw_cloud_scattering = ', &
+           rad_config%do_lw_aerosol_scattering, rad_config%do_lw_cloud_scattering
+   print*, 'nregions, i_gas_model = ', &
+           rad_config%nregions, rad_config%i_gas_model 
+!   print*, 'ice_optics_override_file_name, liq_optics_override_file_name = ', &
+!           rad_config%ice_optics_override_file_name, rad_config%liq_optics_override_file_name
+!   print*, 'aerosol_optics_override_file_name, cloud_pdf_override_file_name = ', &
+!           rad_config%aerosol_optics_override_file_name, rad_config%cloud_pdf_override_file_name
+!   print*, 'gas_optics_sw_override_file_name, gas_optics_lw_override_file_name = ', &
+!           rad_config%gas_optics_sw_override_file_name, rad_config%gas_optics_lw_override_file_name
+   print*, 'i_liq_model, i_ice_model, max_3d_transfer_rate = ', &
+           rad_config%i_liq_model, rad_config%i_ice_model, rad_config%max_3d_transfer_rate
+   print*, 'min_cloud_effective_size, overhang_factor = ', &
+           rad_config%min_cloud_effective_size, rad_config%overhang_factor
+   print*, 'use_canopy_full_spectrum_sw, use_canopy_full_spectrum_lw = ', &
+           rad_config%use_canopy_full_spectrum_sw, rad_config%use_canopy_full_spectrum_lw
+   print*, 'do_canopy_fluxes_sw, do_canopy_fluxes_lw = ', &
+           rad_config%do_canopy_fluxes_sw, rad_config%do_canopy_fluxes_lw
+   print*, 'do_canopy_gases_sw, do_canopy_gases_lw = ', &
+           rad_config%do_canopy_gases_sw, rad_config%do_canopy_gases_lw 
+   print*, 'use_general_cloud_optics, use_general_aerosol_optics = ', &
+           rad_config%use_general_cloud_optics, rad_config%use_general_aerosol_optics
+   print*, 'do_sw_delta_scaling_with_gases, i_overlap_scheme = ', &
+           rad_config%do_sw_delta_scaling_with_gases, rad_config%i_overlap_scheme
+   print*, 'i_solver_sw, i_solver_sw, use_beta_overlap, use_vectorizable_generator = ', &
+           rad_config%i_solver_sw, rad_config%i_solver_lw, &
+           rad_config%use_beta_overlap, rad_config%use_vectorizable_generator
+   print*, 'use_expm_everywhere, iverbose, iverbosesetup = ', &
+           rad_config%use_expm_everywhere, rad_config%iverbose, rad_config%iverbosesetup
+   print*, 'cloud_inhom_decorr_scaling, cloud_fraction_threshold = ', &
+           rad_config%cloud_inhom_decorr_scaling, rad_config%cloud_fraction_threshold
+   print*, 'clear_to_thick_fraction, max_gas_od_3d, max_cloud_od = ', &
+           rad_config%clear_to_thick_fraction, rad_config%max_gas_od_3d, rad_config%max_cloud_od
+   print*, 'cloud_mixing_ratio_threshold, overhead_sun_factor =', &
+           rad_config%cloud_mixing_ratio_threshold, rad_config%overhead_sun_factor
+   print*, 'n_aerosol_types, i_aerosol_type_map, use_aerosols = ', &
+           rad_config%n_aerosol_types, rad_config%i_aerosol_type_map, rad_config%use_aerosols
+   print*, 'mono_lw_wavelength, mono_lw_total_od, mono_sw_total_od = ', &
+           rad_config%mono_lw_wavelength, rad_config%mono_lw_total_od,rad_config% mono_sw_total_od
+   print*, 'mono_lw_single_scattering_albedo, mono_sw_single_scattering_albedo = ', &
+           rad_config%mono_lw_single_scattering_albedo, rad_config%mono_sw_single_scattering_albedo
+   print*, 'mono_lw_asymmetry_factor, mono_sw_asymmetry_factor = ', &
+           rad_config%mono_lw_asymmetry_factor, rad_config%mono_sw_asymmetry_factor
+   print*, 'i_cloud_pdf_shape = ', & 
+           rad_config%i_cloud_pdf_shape
+!           cloud_type_name, use_thick_cloud_spectral_averaging = ', &
+!           rad_config%i_cloud_pdf_shape, rad_config%cloud_type_name, &
+!           rad_config%use_thick_cloud_spectral_averaging
+   print*, 'do_nearest_spectral_sw_albedo, do_nearest_spectral_lw_emiss = ', &
+           rad_config%do_nearest_spectral_sw_albedo, rad_config%do_nearest_spectral_lw_emiss
+   print*, 'sw_albedo_wavelength_bound, lw_emiss_wavelength_bound = ', &
+           rad_config%sw_albedo_wavelength_bound, rad_config%lw_emiss_wavelength_bound
+   print*, 'i_sw_albedo_index, i_lw_emiss_index = ', &
+           rad_config%i_sw_albedo_index, rad_config%i_lw_emiss_index
+   print*, 'do_cloud_aerosol_per_lw_g_point = ', &
+           rad_config%do_cloud_aerosol_per_lw_g_point
+   print*, 'do_cloud_aerosol_per_sw_g_point, do_weighted_surface_mapping = ', &
+           rad_config%do_cloud_aerosol_per_sw_g_point, rad_config%do_weighted_surface_mapping
+   print*, 'n_bands_sw, n_bands_lw, n_g_sw, n_g_lw = ', &
+           rad_config%n_bands_sw, rad_config%n_bands_lw, rad_config%n_g_sw, rad_config%n_g_lw
+
+           itap_ecrad=itap_ecrad+1
+endif           
+
 ! AI ATTENTION
 ! Allocate memory in radiation objects
Index: LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_setup.F90
===================================================================
--- LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_setup.F90	(revision 4573)
+++ LMDZ6/branches/LMDZ_ECRad/libf/phylmd/ecrad/radiation_setup.F90	(revision 4646)
@@ -2,28 +2,4 @@
 
 ! RADIATION_SETUP - Setting up modular radiation scheme
-!
-! (C) Copyright 2015- ECMWF.
-!
-! This software is licensed under the terms of the Apache Licence Version 2.0
-! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-!
-! In applying this licence, ECMWF does not waive the privileges and immunities
-! granted to it by virtue of its status as an intergovernmental organisation
-! nor does it submit to any jurisdiction.
-!
-! PURPOSE
-! -------
-!   The modular radiation scheme is contained in a separate
-!   library. SETUP_RADIATION_SCHEME in this module sets up a small
-!   number of global variables needed to store the information for it.
-!
-!   Lower case is used for variables and types taken from the
-!   radiation library
-!
-! INTERFACE
-! ---------
-!   SETUP_RADIATION_SCHEME is called from SUECRAD.  The radiation
-!   scheme is actually run using the RADIATION_SCHEME routine (not in
-!   this module).
 !
 ! AUTHOR
@@ -34,19 +10,12 @@
 ! MODIFICATIONS
 ! -------------
+!   Abderrahmane Idelkadi LMD, juillet 2023
 !
 !-----------------------------------------------------------------------
 
   USE PARKIND1,         ONLY : JPRB
-  USE radiation_config, ONLY : config_type, &
-       &                       ISolverMcICA, ISolverSpartacus, &
-       &                       ILiquidModelSlingo, ILiquidModelSOCRATES, &
-       &                       IIceModelFu, IIceModelBaran, &
-       &                       IOverlapExponentialRandom
 
   IMPLICIT NONE
 
-  ! Store configuration information for the radiation scheme in a
-  ! global variable
-  type(config_type) :: rad_config
 
   ! Ultraviolet weightings
@@ -77,28 +46,23 @@
 ! AI At the end of the routine, the parameters are read in namelist
 !    
-  SUBROUTINE SETUP_RADIATION_SCHEME(LOUTPUT)
+  SUBROUTINE SETUP_RADIATION_SCHEME(LOUTPUT,rad_config,driver_config)
 
+    USE radiation_config, ONLY : config_type, &
+        &                       ISolverMcICA, ISolverSpartacus, &
+        &                       ILiquidModelSlingo, ILiquidModelSOCRATES, &
+        &                       IIceModelFu, IIceModelBaran, &
+        &                       IOverlapExponentialRandom
+    USE mod_phys_lmdz_para
+      
     USE YOMHOOK,  ONLY : LHOOK, DR_HOOK
-! AI (propre a IFS)    
-!    USE YOMLUN,   ONLY : NULNAM, NULOUT, NULERR
     USE YOMLUN,   ONLY : NULOUT, NULERR
     USE YOESRTWN, ONLY : NMPSRTM
-! AI ATTENTION (propre a IFS)
-!    USE YOERAD,   ONLY : YRERAD
 
     USE radiation_interface,      ONLY : setup_radiation
-!    USE radiation_aerosol_optics, ONLY : dry_aerosol_sw_mass_extinction
-
-! AI (propre a IFS)    
-!#include "posname.intfb.h"
+    USE setup_config_from_lmdz,   ONLY : driver_config_type
 
     ! Whether or not to provide information on the radiation scheme
     ! configuration
     LOGICAL, INTENT(IN), OPTIONAL :: LOUTPUT
-
-    ! Verbosity of configuration information 0=none, 1=warning,
-    ! 2=info, 3=progress, 4=detailed, 5=debug
-    INTEGER :: IVERBOSESETUP
-    INTEGER :: ISTAT
 
     REAL(KIND=JPRB) :: ZHOOK_HANDLE
@@ -107,4 +71,9 @@
 
     logical :: lprint_setp=.TRUE.
+
+    ! Store configuration information for the radiation scheme in a
+    ! global variable
+    type(config_type) :: rad_config
+    type(driver_config_type) :: driver_config
 
     IF (LHOOK) CALL DR_HOOK('RADIATION_SETUP:SETUP_RADIATION_SCHEME',0,ZHOOK_HANDLE)
@@ -116,155 +85,8 @@
     print*,'********** Dans radiation_setup *****************'
 
-    IVERBOSESETUP = 4 ! Provide plenty of information
-    IF (PRESENT(LOUTPUT)) THEN
-      IF (.NOT. LOUTPUT) THEN
-        IVERBOSESETUP = 1 ! Warnings and errors only
-      ENDIF
-    ENDIF
-    rad_config%iverbosesetup = IVERBOSESETUP
-    if (lprint_setp) then
-      print*,'Dans radiation_setup '
-      print*,'rad_config%iverbosesetup =', rad_config%iverbosesetup
-    endif
-
-    IF (IVERBOSESETUP > 1) THEN
-      WRITE(NULOUT,'(a)') '-------------------------------------------------------------------------------'
-      WRITE(NULOUT,'(a)') 'RADIATION_SETUP'
-    ENDIF
-
-    ! Normal operation of the radiation scheme displays only errors
-    ! and warnings
-    rad_config%iverbose = 5
-    if (lprint_setp) then
-      print*,'rad_config%iverbose =', rad_config%iverbose
-    endif
-    ! For the time being, ensure a valid default directory name
-    rad_config%directory_name = 'data'
-    if (lprint_setp) then
-      print*,'rad_config%directory_name =', rad_config%directory_name
-    endif
-
-    ! Do we do Hogan and Bozzo (2014) approximate longwave updates?
-! AI ATTENTION (ifs : )
-     ! AI (propre a IFS)
-!    rad_config%do_lw_derivatives = YRERAD%LAPPROXLWUPDATE
-    rad_config%do_lw_derivatives = .false.
-    if (lprint_setp) then
-      print*,'rad_config%do_lw_derivatives =', rad_config%do_lw_derivatives    
-    endif
-
-    ! Surface spectral fluxes are needed for spectral shortwave albedo
-    ! calculation
-! AI ATTENTION test (ifs : T)
-!    rad_config%do_save_spectral_flux = .FALSE.
-    rad_config%do_surface_sw_spectral_flux = .TRUE.
-    if (lprint_setp) then
-      print*,'rad_config%do_surface_sw_spectral_flux =', &
-            rad_config%do_surface_sw_spectral_flux
-    endif
-
-    ! *** SETUP GAS OPTICS ***
-
-! routine below does not have to (ifs : F)
-    print*,'i_gas_model =',rad_config%i_gas_model
-    rad_config%do_setup_ifsrrtm = .TRUE.
-    if (lprint_setp) then
-      print*,'rad_config%do_setup_ifsrrtm =', rad_config%do_setup_ifsrrtm
-    endif
-
-    ! *** SETUP CLOUD OPTICS ***
-
-    ! Setup liquid optics
-! AI ATTENTION
-! Choix offline : liquid_model_name = "SOCRATES"
-      rad_config%i_liq_model = ILiquidModelSOCRATES
-      if (lprint_setp) then
-        print*,'rad_config%i_liq_model =',rad_config%i_liq_model
-      endif
-
-    ! Setup ice optics
-! Choix offline : ice_model_name    = "Fu-IFS"
-      rad_config%i_ice_model = IIceModelFu
-      if (lprint_setp) then
-        print*,'rad_config%i_ice_model =', rad_config%i_ice_model
-      endif
-
-! AI (propre a IFS)      
-    ! For consistency with earlier versions of the IFS radiation
-    ! scheme, we perform shortwave delta-Eddington scaling *after* the
-    ! merge of the cloud, aerosol and gas optical properties.  Set
-    ! this to "false" to do the scaling on the cloud and aerosol
-    ! properties separately before merging with gases. Note that this
-    ! is not compatible with the SPARTACUS solver.
-    rad_config%do_sw_delta_scaling_with_gases = .FALSE.
-    if (lprint_setp) then
-      print*,'rad_config%do_sw_delta_scaling_with_gases =', &
-            rad_config%do_sw_delta_scaling_with_gases
-    endif
-
-! AI (propre a IFS)    
-    ! Use Exponential-Exponential cloud overlap to match original IFS
-    ! implementation of Raisanen cloud generator
-    rad_config%i_overlap_scheme = IOverlapExponentialRandom
-    if (lprint_setp) then
-      print*,'rad_config%i_overlap_scheme =', rad_config%i_overlap_scheme
-    endif
-
-    ! *** SETUP AEROSOLS ***
-! AI ATTENTION 
-!    rad_config%use_aerosols = .TRUE. !(ifs)
-    rad_config%use_aerosols = .FALSE.
-    if (lprint_setp) then
-      print*,'rad_config%use_aerosols =', rad_config%use_aerosols
-    endif
-
-! *** SETUP SOLVER ***
-
-    ! 3D effects are off by default (ifs)
-    rad_config%do_3d_effects = .TRUE.
-    if (lprint_setp) then
-      print*,'rad_config%do_3d_effects=', rad_config%do_3d_effects
-    endif
-
-    ! Select longwave solver
-! AI ATTENTION
-      rad_config%i_solver_lw = ISolverSpartacus
-      if (lprint_setp) then
-        print*,'rad_config%i_solver_lw =', rad_config%i_solver_lw
-      endif
-
-      rad_config%i_solver_sw = ISolverSpartacus
-      if (lprint_setp) then
-        print*,'rad_config%i_solver_sw =', rad_config%i_solver_sw
-      endif
-
-    ! SPARTACUS solver requires delta scaling to be done separately
-    ! for clouds & aerosols
-    IF (rad_config%i_solver_sw == ISolverSpartacus) THEN
-      rad_config%do_sw_delta_scaling_with_gases = .FALSE.
-    ENDIF
-
-    ! Do we represent longwave scattering?
-    rad_config%do_lw_cloud_scattering = .TRUE.
-    rad_config%do_lw_aerosol_scattering = .TRUE.
-    if (lprint_setp) then
-      print*,'rad_config%do_lw_cloud_scattering =', &
-           rad_config%do_lw_cloud_scattering
-      print*,'rad_config%do_lw_aerosol_scattering =', &
-           rad_config%do_lw_aerosol_scattering
-    endif
-
-    ! *** IMPLEMENT SETTINGS ***
-
-    ! For advanced configuration, the configuration data for the
-    ! "radiation" project can specified directly in the namelist.
-    ! However, the variable naming convention is not consistent with
-    ! the rest of the IFS.  For basic configuration there are specific
-    ! variables in the NAERAD namelist available in the YRERAD
-    ! structure.
-
 ! AI ATTENTION (parameters read in namelist file)
     file_name="namelist_ecrad"
     call rad_config%read(file_name=file_name)
+    call driver_config%read(file_name)
 
     ! Use configuration data to set-up radiation scheme, including
@@ -313,24 +135,4 @@
    rad_config%aerosol_optics_override_file_name = 'aerosol_optics_lmdz.nc'
 
-!    IF (YRERAD%NAERMACC > 0) THEN
-      ! With the MACC aerosol climatology we need to add in the
-      ! background aerosol afterwards using the Tegen arrays.  In this
-      ! case we first configure the background aerosol mass-extinction
-      ! coefficient at 550 nm, which corresponds to the 10th RRTMG
-      ! shortwave band.
-!      TROP_BG_AER_MASS_EXT  = dry_aerosol_sw_mass_extinction(rad_config, &
-!           &                                   ITYPE_TROP_BG_AER, 10)
-!      STRAT_BG_AER_MASS_EXT = dry_aerosol_sw_mass_extinction(rad_config, &
-!           &                                   ITYPE_STRAT_BG_AER, 10)
-      
-!      WRITE(NULOUT,'(a,i0)') 'Tropospheric bacground uses aerosol type ', &
-!           &                 ITYPE_TROP_BG_AER
-!      WRITE(NULOUT,'(a,i0)') 'Stratospheric bacground uses aerosol type ', &
-!           &                 ITYPE_STRAT_BG_AER
-!    ENDIF     
-      
-    IF (IVERBOSESETUP > 1) THEN
-      WRITE(NULOUT,'(a)') '-------------------------------------------------------------------------------'
-    ENDIF
 
     IF (LHOOK) CALL DR_HOOK('RADIATION_SETUP:SETUP_RADIATION_SCHEME',1,ZHOOK_HANDLE)
