Index: LMDZ6/trunk/libf/phylmd/ecrad/radiation_config.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/radiation_config.F90	(revision 4031)
+++ LMDZ6/trunk/libf/phylmd/ecrad/radiation_config.F90	(revision 4115)
@@ -609,4 +609,6 @@
 
     integer :: iunit ! Unit number of namelist file
+
+    logical :: lldeb_conf = .false.
 
     namelist /radiation/ do_sw, do_lw, do_sw_direct, &
@@ -844,4 +846,71 @@
     this%i_lw_emiss_index              = i_lw_emiss_index
 
+! AI mars 2022
+if (lldeb_conf) then
+print*,'**************PARAMETRES DE CONFIGURATION OFFLINE*******************'
+print*,'config%iverbosesetup   = ', iverbosesetup
+print*,'config%do_lw   = ', do_lw
+print*,'config%do_sw   = ', do_sw
+print*,'config%do_clear   = ', do_clear
+print*,'config%do_sw_direct   = ', do_sw_direct
+print*,'config%do_3d_effects   = ', do_3d_effects
+print*,'config%do_3d_lw_multilayer_effects   = ', do_3d_lw_multilayer_effects
+print*,'config%do_lw_side_emissivity   = ', do_lw_side_emissivity
+print*,'config%use_expm_everywhere   = ', use_expm_everywhere
+print*,'config%use_aerosols   = ', use_aerosols
+print*,'config%do_lw_cloud_scattering   = ', do_lw_cloud_scattering
+print*,'config%do_lw_aerosol_scattering   = ', do_lw_aerosol_scattering
+print*,'config%nregions   = ', n_regions
+print*,'config%do_surface_sw_spectral_flux   = ', do_surface_sw_spectral_flux
+print*,'config%do_sw_delta_scaling_with_gases   = ', &
+do_sw_delta_scaling_with_gases
+print*,'config%do_fu_lw_ice_optics_bug   = ', do_fu_lw_ice_optics_bug
+print*,'config%do_canopy_fluxes_sw   = ', do_canopy_fluxes_sw
+print*,'config%do_canopy_fluxes_lw   = ', do_canopy_fluxes_lw
+print*,'config%use_canopy_full_spectrum_sw   = ', use_canopy_full_spectrum_sw
+print*,'config%use_canopy_full_spectrum_lw   = ', use_canopy_full_spectrum_lw
+print*,'config%do_canopy_gases_sw   = ', do_canopy_gases_sw
+print*,'config%do_canopy_gases_lw   = ', do_canopy_gases_lw
+print*,'config%mono_lw_wavelength   = ', mono_lw_wavelength
+print*,'config%mono_lw_total_od   = ', mono_lw_total_od
+print*,'config%mono_sw_total_od   = ', mono_sw_total_od
+print*,'config%mono_lw_single_scattering_albedo   = ', &
+mono_lw_single_scattering_albedo
+print*,'config%mono_sw_single_scattering_albedo   = ', &
+mono_sw_single_scattering_albedo
+print*,'config%mono_lw_asymmetry_factor   = ', mono_lw_asymmetry_factor
+print*,'config%mono_sw_asymmetry_factor   = ', mono_sw_asymmetry_factor
+print*,'config%use_beta_overlap   = ', use_beta_overlap
+print*,'config%cloud_inhom_decorr_scaling   = ', cloud_inhom_decorr_scaling
+print*,'config%clear_to_thick_fraction   = ', clear_to_thick_fraction
+print*,'config%overhead_sun_factor   = ', overhead_sun_factor
+print*,'config%max_gas_od_3d   = ', max_gas_od_3d
+print*,'config%max_cloud_od   = ', max_cloud_od
+print*,'config%max_3d_transfer_rate   = ', max_3d_transfer_rate
+print*,'config%min_cloud_effective_size   = ', &
+max(1.0e-6_jprb,min_cloud_effective_size)
+print*,'config%overhang_factor   = ', encroachment_scaling
+
+print*,'config%directory_name  = ',directory_name
+print*,'config%cloud_pdf_override_file_name  = ',cloud_pdf_override_file_name
+print*,'config%liq_optics_override_file_name  = ',liq_optics_override_file_name
+print*,'config%ice_optics_override_file_name  = ',ice_optics_override_file_name
+print*,'config%aerosol_optics_override_file_name  = ', &
+aerosol_optics_override_file_name
+print*,'config%cloud_fraction_threshold  = ',cloud_fraction_threshold
+print*,'config%cloud_mixing_ratio_threshold  = ',cloud_mixing_ratio_threshold
+print*,'config%n_aerosol_types  = ',n_aerosol_types
+print*,'config%do_save_radiative_properties  = ',do_save_radiative_properties
+print*,'config%do_lw_derivatives  = ',do_lw_derivatives
+print*,'config%do_save_spectral_flux  = ',do_save_spectral_flux
+print*,'config%do_save_gpoint_flux  = ',do_save_gpoint_flux
+print*,'config%do_nearest_spectral_sw_albedo  = ',do_nearest_spectral_sw_albedo
+print*,'config%do_nearest_spectral_lw_emiss   = ',do_nearest_spectral_lw_emiss
+print*,'config%sw_albedo_wavelength_bound     = ',sw_albedo_wavelength_bound
+print*,'config%lw_emiss_wavelength_bound      = ',lw_emiss_wavelength_bound
+print*,'config%i_sw_albedo_index              = ',i_sw_albedo_index
+print*,'config%i_lw_emiss_index               = ',i_lw_emiss_index
+print*,'************************************************************************'
+endif
     if (do_save_gpoint_flux) then
       ! Saving the fluxes every g-point overrides saving as averaged
@@ -850,4 +919,5 @@
       ! save anything
       this%do_save_spectral_flux = .true.
+      print*,'config%do_save_spectral_flux = .true.'
     end if
 
@@ -855,19 +925,22 @@
     call get_enum_code(liquid_model_name, LiquidModelName, &
          &            'liquid_model_name', this%i_liq_model)
+    print*,'config%i_liq_model =', this%i_liq_model
 
     ! Determine ice optics model
     call get_enum_code(ice_model_name, IceModelName, &
          &            'ice_model_name', this%i_ice_model)
-
+    print*,'config%i_ice_model =', this%i_ice_model
     ! Determine gas optics model
     call get_enum_code(gas_model_name, GasModelName, &
          &            'gas_model_name', this%i_gas_model)
+    print*,'config%%i_gas_model = ', this%i_gas_model
 
     ! Determine solvers
     call get_enum_code(sw_solver_name, SolverName, &
          &            'sw_solver_name', this%i_solver_sw)
+    print*,'config%i_solver_sw = ', this%i_solver_sw
     call get_enum_code(lw_solver_name, SolverName, &
          &            'lw_solver_name', this%i_solver_lw)
-
+    print*,'config%i_solver_lw = ', this%i_solver_lw
     if (len_trim(sw_encroachment_name) > 1) then
       call get_enum_code(sw_encroachment_name, EncroachmentName, &
@@ -877,4 +950,5 @@
       call get_enum_code(sw_entrapment_name, EntrapmentName, &
            &             'sw_entrapment_name', this%i_3d_sw_entrapment)
+      print*,'config%i_3d_sw_entrapment = ', this%i_3d_sw_entrapment
     end if
 
@@ -882,13 +956,14 @@
     call get_enum_code(overlap_scheme_name, OverlapName, &
          &             'overlap_scheme_name', this%i_overlap_scheme)
-    
+    print*,'config%i_overlap_scheme = ', this%i_overlap_scheme
     ! Determine cloud PDF shape 
     call get_enum_code(cloud_pdf_shape_name, PdfShapeName, &
          &             'cloud_pdf_shape_name', this%i_cloud_pdf_shape)
-
+    print*,'config%i_cloud_pdf_shape = ', this%i_cloud_pdf_shape
     this%i_aerosol_type_map = 0
     if (this%use_aerosols) then
       this%i_aerosol_type_map(1:n_aerosol_types) &
            &  = i_aerosol_type_map(1:n_aerosol_types)
+      print*,'config%i_aerosol_type_map = ', this%i_aerosol_type_map
     end if
 
@@ -900,4 +975,5 @@
       this%do_clouds = .false.
     end if
+    print*,'config%do_clouds = ', this%do_clouds
 
     ! Normal subroutine exit
Index: LMDZ6/trunk/libf/phylmd/ecrad/radiation_ifs_rrtm.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/radiation_ifs_rrtm.F90	(revision 4031)
+++ LMDZ6/trunk/libf/phylmd/ecrad/radiation_ifs_rrtm.F90	(revision 4115)
@@ -97,16 +97,8 @@
     ! can compute UV and photosynthetically active radiation for a
     ! particular wavelength range
-   if (.not.allocated(config%wavenumber1_sw)) then
     allocate(config%wavenumber1_sw(config%n_bands_sw))
-   end if
-   if (.not.allocated(config%wavenumber2_sw)) then
     allocate(config%wavenumber2_sw(config%n_bands_sw))
-   end if
-   if (.not.allocated(config%wavenumber1_lw)) then
     allocate(config%wavenumber1_lw(config%n_bands_lw))
-   end if
-   if (.not.allocated(config%wavenumber2_lw)) then
     allocate(config%wavenumber2_lw(config%n_bands_lw))
-   end if
     config%wavenumber1_lw = (/ 10, 350, 500, 630, 700, 820, 980, 1080, 1180, 1390, 1480, &
          &  1800, 2080, 2250, 2380, 2600 /)
@@ -117,23 +109,11 @@
     config%wavenumber2_sw = (/ 3250, 4000, 4650, 5150, 6150, 7700, 8050, 12850, 16000, &
          &  22650, 29000, 38000, 50000, 2600 /)
-
-   if (.not.allocated(config%i_band_from_g_sw)) then
+    print*,'allocate dans ifs_rrtm'
     allocate(config%i_band_from_g_sw          (config%n_g_sw))
-   end if
-   if (.not.allocated(config%i_band_from_g_lw)) then
     allocate(config%i_band_from_g_lw          (config%n_g_lw))
-   end if
-   if (.not.allocated(config%i_band_from_reordered_g_sw)) then
     allocate(config%i_band_from_reordered_g_sw(config%n_g_sw))
-   end if
-   if (.not.allocated(config%i_band_from_reordered_g_lw)) then
     allocate(config%i_band_from_reordered_g_lw(config%n_g_lw))
-   end if
-   if (.not.allocated(config%i_g_from_reordered_g_sw)) then
     allocate(config%i_g_from_reordered_g_sw(config%n_g_sw))
-   end if
-   if (.not.allocated(config%i_g_from_reordered_g_lw)) then
     allocate(config%i_g_from_reordered_g_lw(config%n_g_lw))
-   end if
 
     ! Shortwave starts at 16: need to start at 1
Index: LMDZ6/trunk/libf/phylmd/ecrad/radiation_scheme.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/radiation_scheme.F90	(revision 4031)
+++ LMDZ6/trunk/libf/phylmd/ecrad/radiation_scheme.F90	(revision 4115)
@@ -96,6 +96,4 @@
 
 ! Modules from radiation library
-! AI ATTENTION
-!use radiation_config,         only : config_type
 USE radiation_single_level,   ONLY : single_level_type
 USE radiation_thermodynamics, ONLY : thermodynamics_type
@@ -106,4 +104,6 @@
 USE radiation_interface,      ONLY : radiation, set_gas_units
 USE radiation_save,           ONLY : save_inputs
+
+USE mod_phys_lmdz_para
 
 IMPLICIT NONE
@@ -297,5 +297,7 @@
 logical :: loutput=.true.
 logical :: lprint_input=.false.
-logical :: lprint_config=.true.
+logical :: lprint_config=.false.
+logical, save :: debut_ecrad=.true.
+!$OMP THREADPRIVATE(debut_ecrad)
 
 ! Import time functions for iseed calculation
@@ -335,23 +337,14 @@
   print*,'PAEROSOL_OLD, PAEROSOL =', PAEROSOL_OLD, PAEROSOL
 endif
-! AI ATTENTION lecture de namelist 
-! alternative a l appel de radiation_setup ifs
-!file_name="namelist_ecrad"
-!call rad_config%read(file_name=file_name)
-! Setup the radiation scheme: load the coefficients for gas and
-! cloud optics, currently from RRTMG
-!call setup_radiation(rad_config)
 
 IF (LHOOK) CALL DR_HOOK('RADIATION_SCHEME',0,ZHOOK_HANDLE)
 print*,'Entree dans radiation_scheme'
+
+!$OMP MASTER
+if (debut_ecrad) then
 ! AI appel radiation_setup
 call SETUP_RADIATION_SCHEME(loutput)
-!! Les 6 bandes SW pour l'albedo :
-!! 0.185-0.25, 0.25-0.4, 0.4-0.69 , 0.69-1.19, 1.19-2.38, 2.38-4.00 micro-metre
-  call rad_config%define_sw_albedo_intervals(6, &
-             &  (/ 0.25e-6_jprb, 0.44e-6_jprb, 1.19e-6_jprb, &
-             &     2.38e-6_jprb, 4.00e-6_jprb /),  (/ 1,2,3,4,5,6 /))
-
-if (lprint_config) then
+
+ if (lprint_config) then
   print*,'************* Parametres de configuration  ********************'
   print*,'rad_config%iverbosesetup = ',rad_config%iverbosesetup 
@@ -378,8 +371,17 @@
   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
-
+ endif
+ debut_ecrad=.false. 
+endif 
+!$OMP END MASTER
+!$OMP BARRIER 
+! Fin partie initialisation et configuration 
+
+! AI : allocation des tableaux pour chaque partie (thermo, ...)
+!      passage des champs LMDZ aux structures Ecrad
+!      calculs Ecrad
 ! AI ATTENTION
 ! Allocate memory in radiation objects
+! emissivite avec une seule bande
 CALL single_level%allocate(KLON, NSW, 1, &
      &                     use_sw_albedo_direct=.TRUE.)
@@ -388,7 +390,7 @@
 ! Set thermodynamic profiles: simply copy over the half-level
 ! pressure and temperature
-print*,'Appel allocate thermo'
+!print*,'Appel allocate thermo'
 CALL thermodynamics%allocate(KLON, KLEV, use_h2o_sat=.true.)
-print*,'Definir les champs thermo'
+!print*,'Definir les champs thermo'
 ! AI
 ! pressure_hl > paprs
@@ -397,40 +399,12 @@
 thermodynamics%temperature_hl(KIDIA:KFDIA,:) = PTEMPERATURE_H(KIDIA:KFDIA,:)
 
-! IFS currently sets the half-level temperature at the surface to be
-! equal to the skin temperature. The radiation scheme takes as input
-! only the half-level temperatures and assumes the Planck function to
-! vary linearly in optical depth between half levels. In the lowest
-! atmospheric layer, where the atmospheric temperature can be much
-! cooler than the skin temperature, this can lead to significant
-! differences between the effective temperature of this lowest layer
-! and the true value in the model.
-!
-! We may approximate the temperature profile in the lowest model level
-! as piecewise linear between the top of the layer T[k-1/2], the
-! centre of the layer T[k] and the base of the layer Tskin.  The mean
-! temperature of the layer is then 0.25*T[k-1/2] + 0.5*T[k] +
-! 0.25*Tskin, which can be achieved by setting the atmospheric
-! temperature at the half-level corresponding to the surface as
-! follows:
-!thermodynamics%temperature_hl(KIDIA:KFDIA,KLEV+1) &
-!     &  = PTEMPERATURE(KIDIA:KFDIA,KLEV) &
-!     &  + 0.5_JPRB * (PTEMPERATURE_H(KIDIA:KFDIA,KLEV+1) &
-!     &               -PTEMPERATURE_H(KIDIA:KFDIA,KLEV))
-
-! Alternatively we respect the model's atmospheric temperature in the
-! lowest model level by setting the temperature at the lowest
-! half-level such that the mean temperature of the layer is correct:
-!thermodynamics%temperature_hl(KIDIA:KFDIA,KLEV+1) &
-!     &  = 2.0_JPRB * PTEMPERATURE(KIDIA:KFDIA,KLEV) &
-!     &             - PTEMPERATURE_H(KIDIA:KFDIA,KLEV)
-
+!print*,'Compute saturation specific humidity'
 ! Compute saturation specific humidity, used to hydrate aerosols. The
 ! "2" for the last argument indicates that the routine is not being
 ! called from within the convection scheme.
 !CALL SATUR(KIDIA, KFDIA, KLON, 1, KLEV, &
-!     &  PPRESSURE, PTEMPERATURE, thermodynamics%h2o_sat_liq, 2)  
+!     &  PPRESSURE, PTEMPERATURE, thermodynamics%h2o_sat_liq, 2)
 ! Alternative approximate version using temperature and pressure from
 ! the thermodynamics structure
-print*,'Compute saturation specific humidity'
 CALL thermodynamics%calc_saturation_wrt_liquid(KIDIA, KFDIA)
 
@@ -440,17 +414,8 @@
 ! Set single-level fileds
 single_level%solar_irradiance              = PSOLAR_IRRADIANCE
-!allocate(single_level%cos_sza(KIDIA:KFDIA))
 single_level%cos_sza(KIDIA:KFDIA)          = PMU0(KIDIA:KFDIA)
-!allocate(single_level%skin_temperature(KIDIA:KFDIA))
 single_level%skin_temperature(KIDIA:KFDIA) = PTEMPERATURE_SKIN(KIDIA:KFDIA)
-!allocate(single_level%sw_albedo(KIDIA:KFDIA,1))
 single_level%sw_albedo(KIDIA:KFDIA,:)      = PALBEDO_DIF(KIDIA:KFDIA,:)
-!single_level%sw_albedo(KIDIA:KFDIA,:)      = 0.2_JPRB
-!allocate(single_level%sw_albedo_direct(KIDIA:KFDIA,1))
 single_level%sw_albedo_direct(KIDIA:KFDIA,:)=PALBEDO_DIR(KIDIA:KFDIA,:)
-!single_level%sw_albedo_direct(KIDIA:KFDIA,:)=0.2_JPRB
-! Longwave emissivity is in two bands
-!allocate(single_level%lw_emissivity(KIDIA:KFDIA,1))
-!single_level%lw_emissivity(KIDIA:KFDIA,1)  = 1.0_JPRB
 single_level%lw_emissivity(KIDIA:KFDIA,1)  = PEMIS(KIDIA:KFDIA)
 !single_level%lw_emissivity(KIDIA:KFDIA,2)  = PEMIS_WINDOW(KIDIA:KFDIA)
@@ -480,5 +445,5 @@
 
 print*,'********** CLOUDS (allocate + input) *******************************************'
-print*,'Appel Allocate clouds'
+!print*,'Appel Allocate clouds'
 CALL cloud%allocate(KLON, KLEV)
 ! Set cloud fields
@@ -487,4 +452,5 @@
 cloud%fraction(KIDIA:KFDIA,:) = PCLOUD_FRAC(KIDIA:KFDIA,:)
 
+!AI ATTENTION a voir avec JL
 ! Compute effective radii and convert to metres
 !CALL LIQUID_EFFECTIVE_RADIUS(KIDIA, KFDIA, KLON, KLEV, &
@@ -506,7 +472,9 @@
 !CALL CLOUD_OVERLAP_DECORR_LEN(KIDIA, KFDIA, KLON, PGEMU, YRERAD%NDECOLAT, &
 !     &    ZDECORR_LEN_KM, PDECORR_LEN_RATIO=ZDECORR_LEN_RATIO)
-! AI ATTENTION a revoir
-ZDECORR_LEN_RATIO = 0.5_JPRB
-rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO
+
+! AI ATTENTION (valeur lue dans namelist)
+!ZDECORR_LEN_RATIO = 0.5_JPRB
+!rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO
+!AI ATTENTION meme valeur que dans offline
 ZDECORR_LEN_KM = 2000.0_JPRB
 DO JLON = KIDIA,KFDIA
@@ -520,22 +488,24 @@
 ! hard coded at 1.0.
 !CALL cloud%create_fractional_std(KLON, KLEV, YRERAD%RCLOUD_FRAC_STD)
+! AI ATTENTION frac_std=0.75 meme valeur que dans la version offline
 CALL cloud%create_fractional_std(KLON, KLEV, frac_std)
 
+! AI ! Read cloud properties needed by SPARTACUS
 ! By default mid and high cloud effective size is 10 km
-CALL cloud%create_inv_cloud_effective_size(KLON,KLEV,1.0_JPRB/10000.0_JPRB)
+!CALL cloud%create_inv_cloud_effective_size(KLON,KLEV,1.0_JPRB/10000.0_JPRB)
 ! But for boundary clouds (eta > 0.8) we set it to 1 km
-DO JLEV = 1,KLEV
-  DO JLON = KIDIA,KFDIA
-    IF (PPRESSURE(JLON,JLEV) > 0.8_JPRB * PPRESSURE_H(JLON,KLEV+1)) THEN
-      cloud%inv_cloud_effective_size(JLON,JLEV) = 1.0e-3_JPRB
-    ENDIF
-  ENDDO
-ENDDO
+!DO JLEV = 1,KLEV
+!  DO JLON = KIDIA,KFDIA
+!    IF (PPRESSURE(JLON,JLEV) > 0.8_JPRB * PPRESSURE_H(JLON,KLEV+1)) THEN
+!      cloud%inv_cloud_effective_size(JLON,JLEV) = 1.0e-3_JPRB
+!    ENDIF
+!  ENDDO
+!ENDDO
 !AI ATTENTION meme traitement dans le version offline
-!call cloud%create_inv_cloud_effective_size_eta(ncol, nlev, &
-!               &  thermodynamics%pressure_hl, &
-!               &  low_inv_effective_size, &
-!               &  middle_inv_effective_size, &
-!               &  high_inv_effective_size, 0.8_jprb, 0.45_jprb)      
+call cloud%create_inv_cloud_effective_size_eta(KLON, KLEV, &
+               &  thermodynamics%pressure_hl, &
+               &  0.005_JPRB, &
+               &  0.0001_JPRB, &
+               &  0.0001, 0.8_jprb, 0.45_jprb)      
 
 print*,'******** AEROSOLS (allocate + input) **************************************'
@@ -596,5 +566,5 @@
 
 print*,'********** GAS (allocate + input) ************************************************'
-print*,'Appel Allocate gas'
+!print*,'Appel Allocate gas'
 CALL gas%allocate(KLON, KLEV)
 
@@ -609,15 +579,15 @@
 
 !  Insert gas mixing ratios
-print*,'Insert gas mixing ratios'
+!print*,'Insert gas mixing ratios'
 CALL gas%put(IH2O,    IMassMixingRatio, PQ)
 CALL gas%put(IO3,     IMassMixingRatio, PO3)
-CALL gas%put_well_mixed(ICO2,    IVolumeMixingRatio, PCO2)
-CALL gas%put_well_mixed(ICH4,    IVolumeMixingRatio, PCH4)
-CALL gas%put_well_mixed(IN2O,    IVolumeMixingRatio, PN2O)
-CALL gas%put_well_mixed(ICFC11,  IVolumeMixingRatio, PCFC11)
-CALL gas%put_well_mixed(ICFC12,  IVolumeMixingRatio, PCFC12)
-CALL gas%put_well_mixed(IHCFC22, IVolumeMixingRatio, PHCFC22)
-CALL gas%put_well_mixed(ICCL4,   IVolumeMixingRatio, PCCL4)
-CALL gas%put_well_mixed(IO2,     IVolumeMixingRatio, PO2)
+CALL gas%put_well_mixed(ICO2,    IMAssMixingRatio, PCO2)
+CALL gas%put_well_mixed(ICH4,    IMassMixingRatio, PCH4)
+CALL gas%put_well_mixed(IN2O,    IMassMixingRatio, PN2O)
+CALL gas%put_well_mixed(ICFC11,  IMassMixingRatio, PCFC11)
+CALL gas%put_well_mixed(ICFC12,  IMassMixingRatio, PCFC12)
+CALL gas%put_well_mixed(IHCFC22, IMassMixingRatio, PHCFC22)
+CALL gas%put_well_mixed(ICCL4,   IMassMixingRatio, PCCL4)
+CALL gas%put_well_mixed(IO2,     IMassMixingRatio, PO2)
 ! Ensure the units of the gas mixing ratios are what is required by
 ! the gas absorption model
@@ -675,21 +645,19 @@
 ! Compute UV fluxes as weighted sum of appropriate shortwave bands
 PFLUX_UV       (KIDIA:KFDIA) = 0.0_JPRB
-! AI ATTENTION
-!DO JBAND = 1,NWEIGHT_UV
-!  PFLUX_UV(KIDIA:KFDIA) = PFLUX_UV(KIDIA:KFDIA) + WEIGHT_UV(JBAND) &
-!       &  * flux%sw_dn_surf_band(IBAND_UV(JBAND),KIDIA:KFDIA)
-!ENDDO
+DO JBAND = 1,NWEIGHT_UV
+  PFLUX_UV(KIDIA:KFDIA) = PFLUX_UV(KIDIA:KFDIA) + WEIGHT_UV(JBAND) &
+       &  * flux%sw_dn_surf_band(IBAND_UV(JBAND),KIDIA:KFDIA)
+ENDDO
 
 ! Compute photosynthetically active radiation similarly
 PFLUX_PAR      (KIDIA:KFDIA) = 0.0_JPRB
 PFLUX_PAR_CLEAR(KIDIA:KFDIA) = 0.0_JPRB
-!AI ATTENTION
-!DO JBAND = 1,NWEIGHT_PAR
-!  PFLUX_PAR(KIDIA:KFDIA) = PFLUX_PAR(KIDIA:KFDIA) + WEIGHT_PAR(JBAND) &
-!       &  * flux%sw_dn_surf_band(IBAND_PAR(JBAND),KIDIA:KFDIA)
-!  PFLUX_PAR_CLEAR(KIDIA:KFDIA) = PFLUX_PAR_CLEAR(KIDIA:KFDIA) &
-!       &  + WEIGHT_PAR(JBAND) &
-!       &  * flux%sw_dn_surf_clear_band(IBAND_PAR(JBAND),KIDIA:KFDIA)
-!ENDDO
+DO JBAND = 1,NWEIGHT_PAR
+  PFLUX_PAR(KIDIA:KFDIA) = PFLUX_PAR(KIDIA:KFDIA) + WEIGHT_PAR(JBAND) &
+       &  * flux%sw_dn_surf_band(IBAND_PAR(JBAND),KIDIA:KFDIA)
+  PFLUX_PAR_CLEAR(KIDIA:KFDIA) = PFLUX_PAR_CLEAR(KIDIA:KFDIA) &
+       &  + WEIGHT_PAR(JBAND) &
+       &  * flux%sw_dn_surf_clear_band(IBAND_PAR(JBAND),KIDIA:KFDIA)
+ENDDO
 
 ! Compute effective broadband emissivity
@@ -702,4 +670,5 @@
 
 ! Copy longwave derivatives
+! AI ATTENTION
 !IF (YRERAD%LAPPROXLWUPDATE) THEN
 IF (rad_config%do_lw_derivatives) THEN
@@ -708,4 +677,5 @@
 
 ! Store the shortwave downwelling fluxes in each albedo band
+!AI ATTENTION
 !IF (YRERAD%LAPPROXSWUPDATE) THEN
 IF (rad_config%do_surface_sw_spectral_flux) THEN
Index: LMDZ6/trunk/libf/phylmd/ecrad/radiation_setup.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/radiation_setup.F90	(revision 4031)
+++ LMDZ6/trunk/libf/phylmd/ecrad/radiation_setup.F90	(revision 4115)
@@ -290,5 +290,5 @@
 !    ENDIF
 
-    ! *** SETUP SOLVER ***
+! *** SETUP SOLVER ***
 
     ! 3D effects are off by default (ifs)
@@ -412,8 +412,10 @@
 !!    NMPSRTM(:)=(/ 6, 6, 5, 5, 5, 5, 5, 4, 4, 3, 2, 2, 1, 6 /)
 !!    rad_config%i_albedo_from_band_sw = NMPSRTM
-    !call rad_config%define_sw_albedo_intervals(6, &
-    !         &  (/ 0.25e-6_jprb, 0.44e-6_jprb, 1.19e-6_jprb, &
-    !         &     2.38e-6_jprb, 4.00e-6_jprb /),  (/ 1,2,3,4,5,6 /))
-    
+!    call rad_config%define_sw_albedo_intervals(6, &
+!             &  (/ 0.25e-6_jprb, 0.44e-6_jprb, 1.19e-6_jprb, &
+!             &     2.38e-6_jprb, 4.00e-6_jprb /),  (/ 1,2,3,4,5,6 /))
+    call rad_config%define_sw_albedo_intervals(6, &
+       &  [0.25e-6_jprb, 0.44e-6_jprb, 0.69e-6_jprb, &
+       &   1.19e-6_jprb, 2.38e-6_jprb], [1,2,3,4,5,6])
     ! Likewise between the 16 RRTM longwave bands and the 2 emissivity
     ! inputs (info taken from rrtm_ecrt_140gp_mcica.F90) representing
@@ -425,9 +427,9 @@
 
 !    ! Get spectral weightings for UV and PAR
-!!    call rad_config%get_sw_weights(0.2e-6_jprb, 0.4415e-6_jprb, &
-!!         &  NWEIGHT_UV, IBAND_UV, WEIGHT_UV, 'ultraviolet')
-!!    call rad_config%get_sw_weights(0.4e-6_jprb, 0.7e-6_jprb, &
-!!         &  NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &
-!!         &  'photosynthetically active radiation, PAR')
+    call rad_config%get_sw_weights(0.2e-6_jprb, 0.4415e-6_jprb, &
+         &  NWEIGHT_UV, IBAND_UV, WEIGHT_UV, 'ultraviolet')
+    call rad_config%get_sw_weights(0.4e-6_jprb, 0.7e-6_jprb, &
+         &  NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &
+         &  'photosynthetically active radiation, PAR')
 
 !    IF (YRERAD%NAERMACC > 0) THEN
Index: LMDZ6/trunk/libf/phylmd/ecrad/surdi.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/surdi.F90	(revision 4031)
+++ LMDZ6/trunk/libf/phylmd/ecrad/surdi.F90	(revision 4115)
@@ -104,4 +104,14 @@
 !RCCL4   =   1.E-12_JPRB*ZCL4MWG/ZAIRMWG
 
+!ATTENTION AI 02 2022
+RCCO2 = 353.E-06_JPRB
+RCCH4 = 1.72E-06_JPRB
+RCN2O = 310.E-09_JPRB
+RCCFC11 = 280.E-12_JPRB
+RCCFC12 = 484.E-12_JPRB
+RCCFC22 = 1.E-12_JPRB
+RCCCL4 = 1.E-12_JPRB
+RCNO2 = 500.E-13_JPRB
+
 IF( LAQUA ) THEN
   RCARDI  = 348.E-06_JPRB*ZCO2MWG/ZAIRMWG
