Ignore:
Timestamp:
Apr 19, 2024, 11:12:57 AM (8 months ago)
Author:
idelkadi
Message:

Introduction of 2 routines for LMDZ-ECRAD :

  • One for LMDZ (calcul_cloud_overlap_decorr_len.F90) to calculate the decorrelation length (Ld) in the case of "Exp-Ran" cloud overlap.
    1. Ld=constant
    2. Ld=linear function of the absolute value of latitude (Shonk and Hogan 2010)
    3. Ld=function of vertical level
  • One for Ecrad (set_overlap_param_var2D in radiation_cloud.F90) : Compute and store the overlap parameter from the provided overlap decorrelation length, which depends on vertical level.

Translated with DeepL.com (free version)

Location:
LMDZ6/trunk/libf/phylmd/ecrad
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/ecrad/lmdz/radiation_scheme_mod.F90

    r4853 r4911  
    11! AI mars 2021
    22! ====================== Interface between ECRAD and LMDZ ====================
     3! Depart de la version IFS R.H
    34! radiation_scheme.F90 appelee dans radlwsw_m.F90 si iflag_rttm = 2
    45! revoir toutes les parties avec "AI ATTENTION"
     
    4546     &  ecrad_cloud_cover_sw)
    4647
    47 ! RADIATION_SCHEME - Interface to modular radiation scheme
    48 !
    49 ! (C) Copyright 2015- ECMWF.
    50 !
    51 ! This software is licensed under the terms of the Apache Licence Version 2.0
    52 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
    53 !
    54 ! In applying this licence, ECMWF does not waive the privileges and immunities
    55 ! granted to it by virtue of its status as an intergovernmental organisation
    56 ! nor does it submit to any jurisdiction.
    57 !
    58 ! PURPOSE
    59 ! -------
    60 !   The modular radiation scheme is contained in a separate
    61 !   library. This routine puts the the IFS arrays into appropriate
    62 !   objects, computing the additional data that is required, and sends
    63 !   it to the radiation scheme.  It returns net fluxes and surface
    64 !   flux components needed by the rest of the model.
    65 !
    66 !   Lower case is used for variables and types taken from the
    67 !   radiation library
    68 !
    69 ! INTERFACE
    70 ! ---------
    71 !    RADIATION_SCHEME is called from RADLSWR. The
    72 !    SETUP_RADIATION_SCHEME routine (in the RADIATION_SETUP module)
    73 !    should have been run first.
    74 !
    75 ! AUTHOR
    76 ! ------
    77 !   Robin Hogan, ECMWF
    78 !   Original: 2015-09-16
    79 !
    80 ! MODIFICATIONS
    81 ! -------------
    82 !
    83 ! TO DO
    84 ! -----
    85 !
    8648!-----------------------------------------------------------------------
    8749
     
    9153USE RADIATION_SETUP
    9254USE YOMCST   , ONLY : RSIGMA ! Stefan-Boltzmann constant
    93 !USE RADIATION_SETUP, ONLY : SETUP_RADIATION_SCHEME, &
    94 !                         &  config_type, driver_config_type, &
    95 !                         &  NWEIGHT_UV,  IBAND_UV,  WEIGHT_UV, &
    96 !                         &  NWEIGHT_PAR, IBAND_PAR, WEIGHT_PAR, &
    97 !                         &  ITYPE_TROP_BG_AER,  TROP_BG_AER_MASS_EXT, &
    98 !                         &  ITYPE_STRAT_BG_AER, STRAT_BG_AER_MASS_EXT, &
    99 !                         &  ISolverSpartacus
    10055
    10156! Modules from radiation library
     
    11772INTEGER(KIND=JPIM),INTENT(IN) :: KIDIA    ! Start column to process
    11873INTEGER(KIND=JPIM),INTENT(IN) :: KFDIA    ! End column to process
    119 !INTEGER, INTENT(IN) :: KIDIA, KFDIA
    12074INTEGER(KIND=JPIM),INTENT(IN) :: KLON     ! Number of columns
    12175INTEGER(KIND=JPIM),INTENT(IN) :: KLEV     ! Number of levels
    122 !INTEGER, INTENT(IN) :: KLON, KLEV
    123 !INTEGER(KIND=JPIM),INTENT(IN) :: KAEROLMDZ ! Number of aerosol types
    12476INTEGER(KIND=JPIM),INTENT(IN) :: KAEROSOL
    12577INTEGER(KIND=JPIM),INTENT(IN) :: NSW ! Numbe of bands
     
    244196type(driver_config_type),save  :: driver_config
    245197!!$OMP THREADPRIVATE(driver_config)
    246 !type(config_type)        :: rad_config
    247 !type(driver_config_type)  :: driver_config
    248198TYPE(single_level_type)   :: single_level
    249199TYPE(thermodynamics_type) :: thermodynamics
     
    261211
    262212! Cloud overlap decorrelation length for cloud boundaries in km
    263 REAL(KIND=JPRB)           :: ZDECORR_LEN_KM(KLON)
     213REAL(KIND=JPRB)           :: ZDECORR_LEN_M
     214REAL(KIND=JPRB)           :: ZDECORR_LEN_M_1D(KLON)
     215REAL(KIND=JPRB)           :: ZDECORR_LEN_M_2D(KLON,KLEV)
    264216
    265217! Ratio of cloud overlap decorrelation length for cloud water
     
    306258! Initialisation dans radiation_setup au 1er passage dans Ecrad
    307259!$OMP MASTER
    308 !if (.not.ok_3Deffect) then
    309260  if (debut_ecrad) then
    310261   call SETUP_RADIATION_SCHEME(loutput,namelist_file,rad_config,driver_config)
    311262   debut_ecrad=.false.
    312263  endif
    313 !else
    314 !   call SETUP_RADIATION_SCHEME(loutput,namelist_file,rad_config,driver_config)
    315 !endif
    316264!$OMP END MASTER
    317265!$OMP BARRIER
     
    341289
    342290print*,'************* THERMO (input) ************************************'
    343 ! Set thermodynamic profiles: simply copy over the half-level
    344 ! pressure and temperature
    345291! AI
    346292! pressure_hl > paprs
     
    416362!CALL CLOUD_OVERLAP_DECORR_LEN(KIDIA, KFDIA, KLON, PGEMU, YRERAD%NDECOLAT, &
    417363!     &    ZDECORR_LEN_KM, PDECORR_LEN_RATIO=ZDECORR_LEN_RATIO)
    418 ! AI valeur dans namelist
    419 ! rad_config%cloud_inhom_decorr_scaling = ZDECORR_LEN_RATIO
    420 !AI ATTENTION meme valeur que dans offline
    421 ! A mettre dans namelist
    422 ZDECORR_LEN_KM = driver_config%overlap_decorr_length
    423 DO JLON = KIDIA,KFDIA
    424   CALL cloud%set_overlap_param(thermodynamics, &
    425        &                 ZDECORR_LEN_KM(JLON), &
     364CALL CALCUL_CLOUD_OVERLAP_DECORR_LEN &
     365     & (KIDIA, KFDIA, KLON, KLEV, &
     366     &  driver_config, &
     367     &  thermodynamics%pressure_hl, &
     368     &  ZDECORR_LEN_M_2D)
     369
     370 if (driver_config%kdecolat.eq.0) then
     371  ZDECORR_LEN_M = ZDECORR_LEN_M_2D(1,1)       
     372  DO JLON = KIDIA,KFDIA
     373   CALL cloud%set_overlap_param(thermodynamics, &
     374       &                 ZDECORR_LEN_M, &
    426375       &                 istartcol=JLON, iendcol=JLON)
    427 ENDDO
     376  ENDDO
     377 else if (driver_config%kdecolat.eq.1.or.driver_config%kdecolat.eq.2) then
     378  ZDECORR_LEN_M_1D = ZDECORR_LEN_M_2D(:,1)
     379  DO JLON = KIDIA,KFDIA
     380   CALL cloud%set_overlap_param(thermodynamics, &
     381       &                 ZDECORR_LEN_M_1D, &
     382       &                 istartcol=JLON, iendcol=JLON)
     383  ENDDO
     384 else if (driver_config%kdecolat.eq.3) then
     385  DO JLON = KIDIA,KFDIA
     386   CALL cloud%set_overlap_param_var2D(thermodynamics, &
     387       &                 ZDECORR_LEN_M_2D, KLEV, &
     388       &                 istartcol=JLON, iendcol=JLON)
     389  ENDDO
     390 endif
     391
     392
     393
    428394! IFS :
    429395! Cloud water content fractional standard deviation is configurable
     
    936902
    937903! Cloud overlap decorrelation length for cloud boundaries in km
    938 REAL(KIND=JPRB)           :: ZDECORR_LEN_KM(KLON)
     904REAL(KIND=JPRB)           :: ZDECORR_LEN_M
     905REAL(KIND=JPRB)           :: ZDECORR_LEN_M_1D(KLON)
     906REAL(KIND=JPRB)           :: ZDECORR_LEN_M_2D(KLON,KLEV)
    939907
    940908! Ratio of cloud overlap decorrelation length for cloud water
     
    10951063!AI ATTENTION meme valeur que dans offline
    10961064! A mettre dans namelist
    1097 ZDECORR_LEN_KM = driver_config%overlap_decorr_length
    1098 DO JLON = KIDIA,KFDIA
    1099   CALL cloud%set_overlap_param(thermodynamics, &
    1100        &                 ZDECORR_LEN_KM(JLON), &
     1065   CALL CALCUL_CLOUD_OVERLAP_DECORR_LEN &
     1066     & (KIDIA, KFDIA, KLON, KLEV, &
     1067     &  driver_config, &
     1068     &  thermodynamics%pressure_hl , &
     1069     &  ZDECORR_LEN_M_2D)
     1070
     1071 if (driver_config%kdecolat.eq.0) then
     1072  ZDECORR_LEN_M = ZDECORR_LEN_M_2D(1,1)
     1073  DO JLON = KIDIA,KFDIA
     1074   CALL cloud%set_overlap_param(thermodynamics, &
     1075       &                 ZDECORR_LEN_M, &
    11011076       &                 istartcol=JLON, iendcol=JLON)
    1102 ENDDO
     1077  ENDDO
     1078 else if (driver_config%kdecolat.eq.1.or.driver_config%kdecolat.eq.2) then
     1079  ZDECORR_LEN_M_1D = ZDECORR_LEN_M_2D(:,1)
     1080  DO JLON = KIDIA,KFDIA
     1081   CALL cloud%set_overlap_param(thermodynamics, &
     1082       &                 ZDECORR_LEN_M_1D, &
     1083       &                 istartcol=JLON, iendcol=JLON)
     1084  ENDDO
     1085 else if (driver_config%kdecolat.eq.3) then
     1086  DO JLON = KIDIA,KFDIA
     1087   CALL cloud%set_overlap_param_var2D(thermodynamics, &
     1088       &                 ZDECORR_LEN_M_2D, KLEV, &
     1089       &                 istartcol=JLON, iendcol=JLON)
     1090  ENDDO
     1091 endif
     1092   
    11031093! IFS :
    11041094! Cloud water content fractional standard deviation is configurable
  • LMDZ6/trunk/libf/phylmd/ecrad/lmdz/setup_config_from_lmdz.F90

    r4853 r4911  
    1919     real(jprb) :: frac_std = 0.75_jprb
    2020     real(jprb) :: overlap_decorr_length = 2000.0_jprb
    21 
     21     ! KDECOLAT : 0 > cste, 1 > Shonk et al. (2010) 2 > 1 lisse a l'equateur
     22     !            3 : 1+variation sur la verticale
     23     !            4 : 2+variation sur la verticale
     24     integer    :: kdecolat = 0
     25     real(jprb) :: low_decorrelation_length = 2000.0_jprb
     26     real(jprb) :: mid_decorrelation_length = 2000.0_jprb
     27     real(jprb) :: high_decorrelation_length = 2000.0_jprb
    2228
    2329 contains
     
    4753    real(jprb) :: frac_std
    4854    real(jprb) :: overlap_decorr_length
     55    integer    :: kdecolat
     56    real(jprb) :: low_decorrelation_length
     57    real(jprb) :: mid_decorrelation_length
     58    real(jprb) :: high_decorrelation_length
    4959
    5060    namelist /radiation_driver/ ok_effective_size, ok_separation, &
    51          &  frac_std, overlap_decorr_length, &
     61         &  frac_std, overlap_decorr_length, kdecolat, &
     62         &  low_decorrelation_length, mid_decorrelation_length, high_decorrelation_length, &
    5263         &  high_inv_effective_size, middle_inv_effective_size, low_inv_effective_size, &
    5364         &  cloud_inhom_separation_factor, cloud_separation_scale_surface, &
     
    6576    frac_std = 0.75_jprb
    6677    overlap_decorr_length = 2000.0_jprb
     78    kdecolat = 0
     79    low_decorrelation_length = 2000.0_jprb
     80    mid_decorrelation_length = 2000.0_jprb
     81    high_decorrelation_length = 2000.0_jprb
    6782
    6883    ! Open the namelist file and read the radiation_driver namelist
     
    92107    this%frac_std = frac_std
    93108    this%overlap_decorr_length = overlap_decorr_length
     109    this%kdecolat = kdecolat
     110    this%low_decorrelation_length = low_decorrelation_length
     111    this%mid_decorrelation_length = mid_decorrelation_length
     112    this%high_decorrelation_length = high_decorrelation_length
    94113    this%cloud_inhom_separation_factor = cloud_inhom_separation_factor
    95114    this%cloud_separation_scale_surface = cloud_separation_scale_surface
  • LMDZ6/trunk/libf/phylmd/ecrad/radiation/radiation_cloud.F90

    r4853 r4911  
    8585    procedure :: set_overlap_param_var
    8686    generic   :: set_overlap_param => set_overlap_param_fix, set_overlap_param_var
     87    procedure :: set_overlap_param_var2D
    8788    procedure :: set_overlap_param_approx
    8889    procedure :: create_fractional_std
     
    380381  end subroutine set_overlap_param_var
    381382
     383! AI 04 2024 variation de la longueur Ld en fonction de la verticale 
     384  subroutine set_overlap_param_var2D(this, thermodynamics, decorrelation_length, &
     385       &                           klev, istartcol, iendcol)
     386
     387    use yomhook,                  only : lhook, dr_hook, jphook
     388    use radiation_thermodynamics, only : thermodynamics_type
     389    use radiation_constants,      only : GasConstantDryAir, AccelDueToGravity
     390
     391    integer,                   intent(in)    :: klev
     392    class(cloud_type),         intent(inout) :: this
     393    type(thermodynamics_type), intent(in)    :: thermodynamics
     394    integer,                   intent(in)    :: istartcol, iendcol
     395    real(jprb),                intent(in)    :: decorrelation_length(istartcol:iendcol,klev) ! m
     396
     397    ! Ratio of gas constant for dry air to acceleration due to gravity
     398    real(jprb), parameter :: R_over_g = GasConstantDryAir / AccelDueToGravity
     399
     400    integer :: ncol, nlev
     401
     402    integer :: jcol, jlev
     403
     404    real(jphook) :: hook_handle
     405
     406    if (lhook) call dr_hook('radiation_cloud:set_overlap_param_var',0,hook_handle)
     407
     408    ! Pressure at half-levels, pressure_hl, is defined at nlev+1
     409    ! points
     410    ncol = size(thermodynamics%pressure_hl,dim=1)
     411    nlev = size(thermodynamics%pressure_hl,dim=2)-1
     412
     413    if (.not. allocated(this%overlap_param)) then
     414      ! If pressure is of size (ncol,nlev+1) then overlap_param is of
     415      ! size (ncol,nlev-1), since overlap parameter is only defined here
     416      ! for interfaces between model layers, not for the interface to
     417      ! space or the surface
     418      allocate(this%overlap_param(ncol, nlev-1))
     419    end if
     420
     421    if (thermodynamics%pressure_hl(istartcol,2) > thermodynamics%pressure_hl(istartcol,1)) then
     422      ! Pressure is increasing with index (order of layers is
     423      ! top-of-atmosphere to surface). In case pressure_hl(:,1)=0, we
     424      ! don't take the logarithm of the first pressure in each column.
     425      do jcol = istartcol,iendcol
     426        this%overlap_param(jcol,1) = exp(-(R_over_g/decorrelation_length(jcol,1)) &
     427             &                            * thermodynamics%temperature_hl(jcol,2) &
     428             &                            *log(thermodynamics%pressure_hl(jcol,3) &
     429             &                                /thermodynamics%pressure_hl(jcol,2)))
     430      end do
     431
     432      do jlev = 2,nlev-1
     433        do jcol = istartcol,iendcol
     434          this%overlap_param(jcol,jlev) = exp(-(0.5_jprb*R_over_g/decorrelation_length(jcol,jlev)) &
     435              &                            * thermodynamics%temperature_hl(jcol,jlev+1) &
     436              &                            *log(thermodynamics%pressure_hl(jcol,jlev+2) &
     437              &                                /thermodynamics%pressure_hl(jcol,jlev)))
     438        end do
     439      end do
     440
     441    else
     442       ! Pressure is decreasing with index (order of layers is surface
     443       ! to top-of-atmosphere).  In case pressure_hl(:,nlev+1)=0, we
     444       ! don't take the logarithm of the last pressure in each column.
     445      do jlev = 1,nlev-2
     446        do jcol = istartcol,iendcol
     447          this%overlap_param(jcol,jlev) = exp(-(0.5_jprb*R_over_g/decorrelation_length(jcol,jlev)) &
     448              &                            * thermodynamics%temperature_hl(jcol,jlev+1) &
     449              &                            *log(thermodynamics%pressure_hl(jcol,jlev) &
     450              &                                /thermodynamics%pressure_hl(jcol,jlev+2)))
     451        end do
     452      end do
     453
     454      do jcol = istartcol,iendcol
     455      ! AI ATTENTION a verifier decorrelation_length(jcol,nlev-1) ou nlev
     456        this%overlap_param(jcol,nlev-1) = exp(-(R_over_g/decorrelation_length(jcol,nlev-1)) &
     457            &                            * thermodynamics%temperature_hl(jcol,nlev) &
     458            &                            *log(thermodynamics%pressure_hl(jcol,nlev-1) &
     459            &                                /thermodynamics%pressure_hl(jcol,nlev)))
     460      end do
     461    end if
     462
     463    if (lhook) call dr_hook('radiation_cloud:set_overlap_param_var',1,hook_handle)
     464
     465  end subroutine set_overlap_param_var2D
    382466
    383467  !---------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.