Index: LMDZ6/trunk/libf/phylmd/ecrad/lmdz/calcul_cloud_overlap_decorr_len.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/lmdz/calcul_cloud_overlap_decorr_len.F90	(revision 4911)
+++ LMDZ6/trunk/libf/phylmd/ecrad/lmdz/calcul_cloud_overlap_decorr_len.F90	(revision 4911)
@@ -0,0 +1,155 @@
+SUBROUTINE CALCUL_CLOUD_OVERLAP_DECORR_LEN &
+     & (KIDIA, KFDIA, KLON, KLEV, &
+     &  driver_config, &
+     &  pressure_hl, &
+     &  PDECORR_LEN_EDGES_M, PDECORR_LEN_WATER_M, PDECORR_LEN_RATIO)
+
+! A Idelkadi ! -------------
+! 04 2024
+! Depart de la routine de l' IFS
+! But : calcul de la Ld (longueur de decorrelation)
+! Dans le cas overlap_scheme_name=="Exp-Ran"
+! 3 cas en fonction de kdecolat (namelist_ecrad) :
+! 0 => Ld=overlap_decorr_length (namelist_ecrad)
+! 1 => Ld=f(latitude) Shonk et al. (2010) Eq. 13 formula
+! 2 => Ld=f(latitude) Shonk et al. (2010) lissee a l equateur
+! 3 => Ld=f(pres) : 
+!      Ld=low_decorrelation_length si pres >= 680hPa 
+!      Ld=mid_decorrelation_length si pres entre [440,680]
+!      Ld=high_decorrelation_length si pres < 440hPa
+!
+! TO DO 
+! Que faire de PDECORR_LEN_WATER_M ?
+! -------------------------------------------------------------------
+
+USE PARKIND1 , ONLY : JPIM, JPRB
+USE YOMHOOK  , ONLY : LHOOK, DR_HOOK, JPHOOK
+USE YOMCST   , ONLY : RPI
+USE geometry_mod, ONLY: latitude_deg
+USE lmdz_cloud_optics_prop_ini , ONLY : prmhc, prlmc
+USE setup_config_from_lmdz,   ONLY : driver_config_type
+USE write_field_phy
+! -------------------------------------------------------------------
+
+IMPLICIT NONE
+
+! INPUT ARGUMENTS
+
+! *** Array dimensions and ranges
+INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA    ! Start column to process
+INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA    ! End column to process
+INTEGER(KIND=JPIM),INTENT(IN) :: KLON     ! Number of columns
+! AI 04 2024
+INTEGER(KIND=JPIM),INTENT(IN) :: KLEV
+
+! *** Single-level variables 
+!AI 04 2024
+REAL(KIND=JPRB), intent(in)   :: pressure_hl(KLON,KLEV+1)
+type(driver_config_type),intent(in)   :: driver_config
+
+! OUTPUT ARGUMENTS
+
+! *** Decorrelation lengths for cloud edges and cloud water content, in m
+! A.I 04 2024
+REAL(KIND=JPRB), INTENT(OUT)           :: PDECORR_LEN_EDGES_M(KLON,KLEV)
+REAL(KIND=JPRB), INTENT(OUT), OPTIONAL :: PDECORR_LEN_WATER_M(KLON,KLEV)
+  
+! Ratio of water-content to cloud-edge decorrelation lengths
+REAL(KIND=JPRB), INTENT(OUT), OPTIONAL :: PDECORR_LEN_RATIO
+
+! LOCAL VARIABLES
+
+REAL(KIND=JPRB) :: ZRADIANS_TO_DEGREES, ZABS_LAT_DEG, ZCOS_LAT
+
+! AI 04 2024
+REAL(KIND=JPRB) :: PGEMU(KLON) ! Sine of latitude
+REAL(KIND=JPRB) :: RDECORR_CF
+REAL(KIND=JPRB) :: RDECORR_CW = 1.0_JPRB
+
+INTEGER(KIND=JPIM) :: JL, JK
+
+REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
+
+! -------------------------------------------------------------------
+
+IF (LHOOK) CALL DR_HOOK('CLOUD_OVERLAP_DECORR_LEN',0,ZHOOK_HANDLE)
+  
+! -------------------------------------------------------------------
+print*,'driver_config%kdecolat = ', driver_config%kdecolat
+
+IF (driver_config%kdecolat == 0) THEN
+
+  ! Decorrelation lengths are constant values
+  ! overlap_decorr_length lu dans namelist en m
+  RDECORR_CF = driver_config%overlap_decorr_length / 1000.0_JPRB
+  PDECORR_LEN_EDGES_M(KIDIA:KFDIA,:) = driver_config%overlap_decorr_length
+!  IF (PRESENT(PDECORR_LEN_WATER_M)) THEN
+!    PDECORR_LEN_WATER_M = RDECORR_CW * 1000.0_JPRB
+!  ENDIF
+!  IF (PRESENT(PDECORR_LEN_RATIO)) THEN
+!    PDECORR_LEN_RATIO = RDECORR_CW / RDECORR_CF
+!  ENDIF
+
+ELSE
+
+  ZRADIANS_TO_DEGREES = 180.0_JPRB / RPI
+  PGEMU = SIN(latitude_deg)
+
+  IF (driver_config%kdecolat == 1) THEN
+    ! Shonk et al. (2010) Eq. 13 formula
+    DO JL = KIDIA,KFDIA
+      ZABS_LAT_DEG = ABS(ASIN(PGEMU(JL)) * ZRADIANS_TO_DEGREES)
+      PDECORR_LEN_EDGES_M(JL,:) = (2.899_JPRB - 0.02759_JPRB * ZABS_LAT_DEG) * 1000.0_JPRB
+    ENDDO
+  ELSE ! KDECOLAT == 2
+    DO JL = KIDIA,KFDIA
+      ! Shonk et al. (2010) but smoothed over the equator
+      ZCOS_LAT = COS(ASIN(PGEMU(JL)))
+      PDECORR_LEN_EDGES_M(JL,:) = (0.75_JPRB + 2.149_JPRB * ZCOS_LAT*ZCOS_LAT) * 1000.0_JPRB
+    ENDDO
+  ENDIF
+
+
+  ! Both KDECOLAT = 1 and 2 assume that the decorrelation length for
+  ! cloud water content is half that for cloud edges
+!  IF (PRESENT(PDECORR_LEN_WATER_M)) THEN
+!    PDECORR_LEN_WATER_M(KIDIA:KFDIA,:) = PDECORR_LEN_EDGES_M(KIDIA:KFDIA,:) * 0.5_JPRB 
+!  ENDIF
+
+!  IF (PRESENT(PDECORR_LEN_RATIO)) THEN
+!    PDECORR_LEN_RATIO = 0.5_JPRB
+!  ENDIF
+
+ENDIF
+
+!AI 04 2024
+IF (driver_config%kdecolat == 3) THEN
+  DO jk = 1, klev
+      DO JL = 1, klon
+        IF (pressure_hl(JL,jk)<prmhc) THEN
+          PDECORR_LEN_EDGES_M(JL,jk) = driver_config%high_decorrelation_length
+        ELSE IF (pressure_hl(JL,jk)>=prmhc .AND. pressure_hl(JL,jk)<prlmc) THEN
+          PDECORR_LEN_EDGES_M(JL,jk) = driver_config%mid_decorrelation_length
+        ELSE IF (pressure_hl(JL,jk)>=prlmc) THEN
+          PDECORR_LEN_EDGES_M(JL,jk) = driver_config%low_decorrelation_length
+        ENDIF
+      ENDDO
+  ENDDO
+  
+  ! Both KDECOLAT = 1 and 2 assume that the decorrelation length for
+  ! cloud water content is half that for cloud edges
+!  IF (PRESENT(PDECORR_LEN_WATER_M)) THEN
+!    PDECORR_LEN_WATER_M(KIDIA:KFDIA,:) = PDECORR_LEN_EDGES_M(KIDIA:KFDIA,:) * 0.5_JPRB 
+!  ENDIF
+!  IF (PRESENT(PDECORR_LEN_RATIO)) THEN
+!    PDECORR_LEN_RATIO = 0.5_JPRB
+!  ENDIF
+ENDIF
+CALL writefield_phy('latitude',latitude_deg,1)
+CALL writefield_phy('pressure_hl',pressure_hl,klev+1)
+CALL writefield_phy('Ldecorel',PDECORR_LEN_EDGES_M,klev)
+! -------------------------------------------------------------------
+
+IF (LHOOK) CALL DR_HOOK('CLOUD_OVERLAP_DECORR_LEN',1,ZHOOK_HANDLE)
+
+END SUBROUTINE CALCUL_CLOUD_OVERLAP_DECORR_LEN
Index: LMDZ6/trunk/libf/phylmd/ecrad/lmdz/radiation_scheme_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/lmdz/radiation_scheme_mod.F90	(revision 4876)
+++ LMDZ6/trunk/libf/phylmd/ecrad/lmdz/radiation_scheme_mod.F90	(revision 4911)
@@ -1,4 +1,5 @@
 ! AI mars 2021
 ! ====================== Interface between ECRAD and LMDZ ====================
+! Depart de la version IFS R.H 
 ! radiation_scheme.F90 appelee dans radlwsw_m.F90 si iflag_rttm = 2
 ! revoir toutes les parties avec "AI ATTENTION" 
@@ -45,43 +46,4 @@
      &  ecrad_cloud_cover_sw)
 
-! RADIATION_SCHEME - Interface to 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. This routine puts the the IFS arrays into appropriate
-!   objects, computing the additional data that is required, and sends
-!   it to the radiation scheme.  It returns net fluxes and surface
-!   flux components needed by the rest of the model. 
-!
-!   Lower case is used for variables and types taken from the
-!   radiation library
-!
-! INTERFACE
-! ---------
-!    RADIATION_SCHEME is called from RADLSWR. The
-!    SETUP_RADIATION_SCHEME routine (in the RADIATION_SETUP module)
-!    should have been run first.
-!
-! AUTHOR
-! ------
-!   Robin Hogan, ECMWF
-!   Original: 2015-09-16
-!
-! MODIFICATIONS
-! -------------
-!
-! TO DO
-! -----
-!
 !-----------------------------------------------------------------------
 
@@ -91,11 +53,4 @@
 USE RADIATION_SETUP
 USE YOMCST   , ONLY : RSIGMA ! Stefan-Boltzmann constant
-!USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, &
-!                         &  config_type, driver_config_type, &
-!                         &  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
 
 ! Modules from radiation library
@@ -117,9 +72,6 @@
 INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA    ! Start column to process
 INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA    ! End column to process
-!INTEGER, INTENT(IN) :: KIDIA, KFDIA
 INTEGER(KIND=JPIM),INTENT(IN) :: KLON     ! Number of columns
 INTEGER(KIND=JPIM),INTENT(IN) :: KLEV     ! Number of levels
-!INTEGER, INTENT(IN) :: KLON, KLEV
-!INTEGER(KIND=JPIM),INTENT(IN) :: KAEROLMDZ ! Number of aerosol types
 INTEGER(KIND=JPIM),INTENT(IN) :: KAEROSOL
 INTEGER(KIND=JPIM),INTENT(IN) :: NSW ! Numbe of bands
@@ -244,6 +196,4 @@
 type(driver_config_type),save  :: driver_config
 !!$OMP THREADPRIVATE(driver_config)
-!type(config_type)        :: rad_config
-!type(driver_config_type)  :: driver_config
 TYPE(single_level_type)   :: single_level
 TYPE(thermodynamics_type) :: thermodynamics
@@ -261,5 +211,7 @@
 
 ! Cloud overlap decorrelation length for cloud boundaries in km
-REAL(KIND=JPRB)           :: ZDECORR_LEN_KM(KLON)
+REAL(KIND=JPRB)           :: ZDECORR_LEN_M
+REAL(KIND=JPRB)           :: ZDECORR_LEN_M_1D(KLON)
+REAL(KIND=JPRB)           :: ZDECORR_LEN_M_2D(KLON,KLEV)
 
 ! Ratio of cloud overlap decorrelation length for cloud water
@@ -306,12 +258,8 @@
 ! Initialisation dans radiation_setup au 1er passage dans Ecrad
 !$OMP MASTER
-!if (.not.ok_3Deffect) then
   if (debut_ecrad) then
    call SETUP_RADIATION_SCHEME(loutput,namelist_file,rad_config,driver_config)
    debut_ecrad=.false. 
   endif 
-!else
-!   call SETUP_RADIATION_SCHEME(loutput,namelist_file,rad_config,driver_config)
-!endif
 !$OMP END MASTER
 !$OMP BARRIER 
@@ -341,6 +289,4 @@
 
 print*,'************* THERMO (input) ************************************'
-! Set thermodynamic profiles: simply copy over the half-level
-! pressure and temperature
 ! AI
 ! pressure_hl > paprs
@@ -416,14 +362,34 @@
 !CALL CLOUD_OVERLAP_DECORR_LEN(KIDIA, KFDIA, KLON, PGEMU, YRERAD%NDECOLAT, &
 !     &    ZDECORR_LEN_KM, PDECORR_LEN_RATIO=ZDECORR_LEN_RATIO)
-! AI valeur dans namelist
-! rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO
-!AI ATTENTION meme valeur que dans offline
-! A mettre dans namelist
-ZDECORR_LEN_KM = driver_config%overlap_decorr_length
-DO JLON = KIDIA,KFDIA
-  CALL cloud%set_overlap_param(thermodynamics, &
-       &                 ZDECORR_LEN_KM(JLON), &
+CALL CALCUL_CLOUD_OVERLAP_DECORR_LEN &
+     & (KIDIA, KFDIA, KLON, KLEV, &
+     &  driver_config, &
+     &  thermodynamics%pressure_hl, &
+     &  ZDECORR_LEN_M_2D)
+
+ if (driver_config%kdecolat.eq.0) then
+  ZDECORR_LEN_M = ZDECORR_LEN_M_2D(1,1)       
+  DO JLON = KIDIA,KFDIA
+   CALL cloud%set_overlap_param(thermodynamics, &
+       &                 ZDECORR_LEN_M, &
        &                 istartcol=JLON, iendcol=JLON)
-ENDDO
+  ENDDO
+ else if (driver_config%kdecolat.eq.1.or.driver_config%kdecolat.eq.2) then
+  ZDECORR_LEN_M_1D = ZDECORR_LEN_M_2D(:,1)
+  DO JLON = KIDIA,KFDIA
+   CALL cloud%set_overlap_param(thermodynamics, &
+       &                 ZDECORR_LEN_M_1D, &
+       &                 istartcol=JLON, iendcol=JLON)
+  ENDDO
+ else if (driver_config%kdecolat.eq.3) then
+  DO JLON = KIDIA,KFDIA
+   CALL cloud%set_overlap_param_var2D(thermodynamics, &
+       &                 ZDECORR_LEN_M_2D, KLEV, &
+       &                 istartcol=JLON, iendcol=JLON)
+  ENDDO
+ endif
+
+
+
 ! IFS :
 ! Cloud water content fractional standard deviation is configurable
@@ -936,5 +902,7 @@
 
 ! Cloud overlap decorrelation length for cloud boundaries in km
-REAL(KIND=JPRB)           :: ZDECORR_LEN_KM(KLON)
+REAL(KIND=JPRB)           :: ZDECORR_LEN_M
+REAL(KIND=JPRB)           :: ZDECORR_LEN_M_1D(KLON)
+REAL(KIND=JPRB)           :: ZDECORR_LEN_M_2D(KLON,KLEV)
 
 ! Ratio of cloud overlap decorrelation length for cloud water
@@ -1095,10 +1063,32 @@
 !AI ATTENTION meme valeur que dans offline
 ! A mettre dans namelist
-ZDECORR_LEN_KM = driver_config%overlap_decorr_length
-DO JLON = KIDIA,KFDIA
-  CALL cloud%set_overlap_param(thermodynamics, &
-       &                 ZDECORR_LEN_KM(JLON), &
+   CALL CALCUL_CLOUD_OVERLAP_DECORR_LEN &
+     & (KIDIA, KFDIA, KLON, KLEV, &
+     &  driver_config, &
+     &  thermodynamics%pressure_hl , &
+     &  ZDECORR_LEN_M_2D)
+
+ if (driver_config%kdecolat.eq.0) then
+  ZDECORR_LEN_M = ZDECORR_LEN_M_2D(1,1)
+  DO JLON = KIDIA,KFDIA
+   CALL cloud%set_overlap_param(thermodynamics, &
+       &                 ZDECORR_LEN_M, &
        &                 istartcol=JLON, iendcol=JLON)
-ENDDO
+  ENDDO
+ else if (driver_config%kdecolat.eq.1.or.driver_config%kdecolat.eq.2) then
+  ZDECORR_LEN_M_1D = ZDECORR_LEN_M_2D(:,1)
+  DO JLON = KIDIA,KFDIA
+   CALL cloud%set_overlap_param(thermodynamics, &
+       &                 ZDECORR_LEN_M_1D, &
+       &                 istartcol=JLON, iendcol=JLON)
+  ENDDO
+ else if (driver_config%kdecolat.eq.3) then
+  DO JLON = KIDIA,KFDIA
+   CALL cloud%set_overlap_param_var2D(thermodynamics, &
+       &                 ZDECORR_LEN_M_2D, KLEV, &
+       &                 istartcol=JLON, iendcol=JLON)
+  ENDDO
+ endif
+   
 ! IFS :
 ! Cloud water content fractional standard deviation is configurable
Index: LMDZ6/trunk/libf/phylmd/ecrad/lmdz/setup_config_from_lmdz.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/lmdz/setup_config_from_lmdz.F90	(revision 4876)
+++ LMDZ6/trunk/libf/phylmd/ecrad/lmdz/setup_config_from_lmdz.F90	(revision 4911)
@@ -19,5 +19,11 @@
      real(jprb) :: frac_std = 0.75_jprb
      real(jprb) :: overlap_decorr_length = 2000.0_jprb
-
+     ! KDECOLAT : 0 > cste, 1 > Shonk et al. (2010) 2 > 1 lisse a l'equateur
+     !            3 : 1+variation sur la verticale
+     !            4 : 2+variation sur la verticale
+     integer    :: kdecolat = 0
+     real(jprb) :: low_decorrelation_length = 2000.0_jprb 
+     real(jprb) :: mid_decorrelation_length = 2000.0_jprb
+     real(jprb) :: high_decorrelation_length = 2000.0_jprb
 
  contains
@@ -47,7 +53,12 @@
     real(jprb) :: frac_std
     real(jprb) :: overlap_decorr_length
+    integer    :: kdecolat 
+    real(jprb) :: low_decorrelation_length
+    real(jprb) :: mid_decorrelation_length 
+    real(jprb) :: high_decorrelation_length 
 
     namelist /radiation_driver/ ok_effective_size, ok_separation, &
-         &  frac_std, overlap_decorr_length, &
+         &  frac_std, overlap_decorr_length, kdecolat, &
+         &  low_decorrelation_length, mid_decorrelation_length, high_decorrelation_length, &
          &  high_inv_effective_size, middle_inv_effective_size, low_inv_effective_size, &
          &  cloud_inhom_separation_factor, cloud_separation_scale_surface, &
@@ -65,4 +76,8 @@
     frac_std = 0.75_jprb
     overlap_decorr_length = 2000.0_jprb
+    kdecolat = 0
+    low_decorrelation_length = 2000.0_jprb
+    mid_decorrelation_length = 2000.0_jprb
+    high_decorrelation_length = 2000.0_jprb
 
     ! Open the namelist file and read the radiation_driver namelist
@@ -92,4 +107,8 @@
     this%frac_std = frac_std
     this%overlap_decorr_length = overlap_decorr_length
+    this%kdecolat = kdecolat
+    this%low_decorrelation_length = low_decorrelation_length
+    this%mid_decorrelation_length = mid_decorrelation_length
+    this%high_decorrelation_length = high_decorrelation_length
     this%cloud_inhom_separation_factor = cloud_inhom_separation_factor
     this%cloud_separation_scale_surface = cloud_separation_scale_surface
Index: LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_cloud.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_cloud.F90	(revision 4876)
+++ LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_cloud.F90	(revision 4911)
@@ -85,4 +85,5 @@
     procedure :: set_overlap_param_var
     generic   :: set_overlap_param => set_overlap_param_fix, set_overlap_param_var
+    procedure :: set_overlap_param_var2D
     procedure :: set_overlap_param_approx
     procedure :: create_fractional_std
@@ -380,4 +381,87 @@
   end subroutine set_overlap_param_var
 
+! AI 04 2024 variation de la longueur Ld en fonction de la verticale  
+  subroutine set_overlap_param_var2D(this, thermodynamics, decorrelation_length, &
+       &                           klev, istartcol, iendcol)
+
+    use yomhook,                  only : lhook, dr_hook, jphook
+    use radiation_thermodynamics, only : thermodynamics_type
+    use radiation_constants,      only : GasConstantDryAir, AccelDueToGravity
+
+    integer,                   intent(in)    :: klev
+    class(cloud_type),         intent(inout) :: this
+    type(thermodynamics_type), intent(in)    :: thermodynamics
+    integer,                   intent(in)    :: istartcol, iendcol
+    real(jprb),                intent(in)    :: decorrelation_length(istartcol:iendcol,klev) ! m
+
+    ! Ratio of gas constant for dry air to acceleration due to gravity
+    real(jprb), parameter :: R_over_g = GasConstantDryAir / AccelDueToGravity
+
+    integer :: ncol, nlev
+
+    integer :: jcol, jlev
+
+    real(jphook) :: hook_handle
+
+    if (lhook) call dr_hook('radiation_cloud:set_overlap_param_var',0,hook_handle)
+
+    ! Pressure at half-levels, pressure_hl, is defined at nlev+1
+    ! points
+    ncol = size(thermodynamics%pressure_hl,dim=1)
+    nlev = size(thermodynamics%pressure_hl,dim=2)-1
+
+    if (.not. allocated(this%overlap_param)) then
+      ! If pressure is of size (ncol,nlev+1) then overlap_param is of
+      ! size (ncol,nlev-1), since overlap parameter is only defined here
+      ! for interfaces between model layers, not for the interface to
+      ! space or the surface
+      allocate(this%overlap_param(ncol, nlev-1))
+    end if
+
+    if (thermodynamics%pressure_hl(istartcol,2) > thermodynamics%pressure_hl(istartcol,1)) then
+      ! Pressure is increasing with index (order of layers is
+      ! top-of-atmosphere to surface). In case pressure_hl(:,1)=0, we
+      ! don't take the logarithm of the first pressure in each column.
+      do jcol = istartcol,iendcol
+        this%overlap_param(jcol,1) = exp(-(R_over_g/decorrelation_length(jcol,1)) &
+             &                            * thermodynamics%temperature_hl(jcol,2) &
+             &                            *log(thermodynamics%pressure_hl(jcol,3) &
+             &                                /thermodynamics%pressure_hl(jcol,2)))
+      end do
+
+      do jlev = 2,nlev-1
+        do jcol = istartcol,iendcol
+          this%overlap_param(jcol,jlev) = exp(-(0.5_jprb*R_over_g/decorrelation_length(jcol,jlev)) &
+              &                            * thermodynamics%temperature_hl(jcol,jlev+1) &
+              &                            *log(thermodynamics%pressure_hl(jcol,jlev+2) &
+              &                                /thermodynamics%pressure_hl(jcol,jlev)))
+        end do
+      end do
+
+    else
+       ! Pressure is decreasing with index (order of layers is surface
+       ! to top-of-atmosphere).  In case pressure_hl(:,nlev+1)=0, we
+       ! don't take the logarithm of the last pressure in each column.
+      do jlev = 1,nlev-2
+        do jcol = istartcol,iendcol
+          this%overlap_param(jcol,jlev) = exp(-(0.5_jprb*R_over_g/decorrelation_length(jcol,jlev)) &
+              &                            * thermodynamics%temperature_hl(jcol,jlev+1) &
+              &                            *log(thermodynamics%pressure_hl(jcol,jlev) &
+              &                                /thermodynamics%pressure_hl(jcol,jlev+2)))
+        end do
+      end do
+
+      do jcol = istartcol,iendcol
+      ! AI ATTENTION a verifier decorrelation_length(jcol,nlev-1) ou nlev
+        this%overlap_param(jcol,nlev-1) = exp(-(R_over_g/decorrelation_length(jcol,nlev-1)) &
+            &                            * thermodynamics%temperature_hl(jcol,nlev) &
+            &                            *log(thermodynamics%pressure_hl(jcol,nlev-1) &
+            &                                /thermodynamics%pressure_hl(jcol,nlev)))
+      end do
+    end if
+
+    if (lhook) call dr_hook('radiation_cloud:set_overlap_param_var',1,hook_handle)
+
+  end subroutine set_overlap_param_var2D
 
   !---------------------------------------------------------------------
