Changeset 4481 for LMDZ6/trunk/libf


Ignore:
Timestamp:
Mar 28, 2023, 4:00:31 PM (21 months ago)
Author:
evignon
Message:

quelques petites modifs pour le prochain atelier tke (lundi 03/04/2023)

Location:
LMDZ6/trunk/libf/phylmd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/atke_exchange_coeff_mod.F90

    r4478 r4481  
    2626
    2727
    28 USE atke_turbulence_ini_mod, ONLY : iflag_atke, kappa, l0, ric, cn, cinf, rpi, rcpd
     28USE atke_turbulence_ini_mod, ONLY : iflag_atke, kappa, l0, ric, cinf, rpi, rcpd
    2929USE atke_turbulence_ini_mod, ONLY : cepsilon, pr_slope, pr_asym, pr_neut, rg, rd
    3030USE atke_turbulence_ini_mod, ONLY : viscom, viscoh
     
    6666
    6767INTEGER :: igrid,ilay ! horizontal,vertical index (flat grid)
    68 REAL    :: Ri0,Ri1    ! parameter for Sm stability function and Prandlt
     68REAL    :: cn,Ri0,Ri1    ! parameter for Sm stability function and Prandlt
    6969REAL    :: preff      ! reference pressure for potential temperature calculations
    7070REAL    :: thetam     ! mean potential temperature at interface
     
    7777    dz_interf(igrid,1) = 0.0
    7878    z_interf(igrid,1) = 0.0
    79 !    Km(igrid,1) = 0.0
    80 !    Kh(igrid,1) = 0.0
    81 !    tke(igrid,1) = 0.0
    82 !    Km(igrid,nlay+1) = 0.0             
    83 !    Kh(igrid,nlay+1) = 0.0             
    84 !    tke(igrid,nlay+1) = 0.0
    8579END DO
    8680
     
    129123!===================================================================
    130124
     125! calculation of cn = Sm value at Ri=0
     126! direct dependance on cepsilon to guarantee Fm=1 (first-order like stability function) at Ri=0
     127cn=(1./sqrt(cepsilon))**(2/3)
     128! calculation of Ri0 such that continuity in slope of Sm at Ri=0
     129Ri0=2./rpi*(cinf - cn)*ric/cn
     130! calculation of Ri1 to guarantee continuity in slope of Prandlt number at Ri=0
     131Ri1 = -2./rpi * (pr_asym - pr_neut) / pr_slope
     132
     133
    131134DO ilay=2,nlay
    132135    DO igrid=1,ngrid
     
    136139        MAX(((wind_u(igrid,ilay) - wind_u(igrid,ilay-1)) / dz_lay(igrid,ilay))**2 + &
    137140        ((wind_v(igrid,ilay) - wind_v(igrid,ilay-1)) / dz_lay(igrid,ilay))**2,1E-10)
    138         ! calculation of Ri0 such that continuity in slope of Sm at Ri=0
    139         Ri0=2./rpi*(cinf - cn)*ric/cn
    140         ! calculation of Ri1 to guarantee continuity in slope of Prandlt number at Ri=0
    141         Ri1 = -2./rpi * (pr_asym - pr_neut) / pr_slope
    142 
    143         IF (Ri(igrid,ilay) < 0.) THEN
     141       
     142        IF (Ri(igrid,ilay) < 0.) THEN ! unstable cases
    144143            Sm(igrid,ilay) = 2./rpi * (cinf-cn) * atan(-Ri(igrid,ilay)/Ri0) + cn
    145144            Prandtl(igrid,ilay) = -2./rpi * (pr_asym - pr_neut) * atan(Ri(igrid,ilay)/Ri1) + pr_neut
    146         ELSE
     145        ELSE ! stable cases
    147146            Sm(igrid,ilay) = max(0.,cn*(1.-Ri(igrid,ilay)/Ric))
    148147            Prandtl(igrid,ilay) = pr_neut + Ri(igrid,ilay) * pr_slope
     148            IF (Ri(igrid,ilay) .GE. Prandtl(igrid,ilay)) THEN
     149               call abort_physic("atke_compute_km_kh", &
     150               'Ri>=Pr in stable conditions -> violates energy conservation principles, change pr_neut or slope', 1)
     151            ENDIF
    149152        END IF
    150153       
  • LMDZ6/trunk/libf/phylmd/atke_turbulence_ini_mod.F90

    r4478 r4481  
    99  real :: kappa = 0.4 ! Von Karman constant
    1010  !$OMP THREADPRIVATE(kappa)
    11   real :: l0, ric, ri0, cn, cinf, cepsilon, pr_slope, pr_asym, pr_neut
    12   !$OMP THREADPRIVATE(l0, ric, cn, cinf, cepsilon, pr_slope, pr_asym, pr_neut)
     11  real :: l0, ric, ri0, cinf, cepsilon, pr_slope, pr_asym, pr_neut
     12  !$OMP THREADPRIVATE(l0, ric, cinf, cepsilon, pr_slope, pr_asym, pr_neut)
    1313  integer :: lunout,prt_level
    1414  !$OMP THREADPRIVATE(lunout,prt_level)
     
    5353  CALL getin_p('atke_ric',ric)
    5454
    55   ! value of Sm stability function for neutral conditions (Ri=0)
    56   cn=1.0
    57   CALL getin_p('atke_cn',cn)
    58 
    5955  ! asymptotic value of Sm for Ri=-Inf
    6056  cinf=1.5
     
    7470
    7571  ! value of turbulent prandtl number in neutral conditions (Ri=0)
    76   ! to guarantee tke>0 in stationary case, pr_neut has to be >= 1
    77   pr_neut=1.0
     72  pr_neut=0.8
    7873  CALL getin_p('atke_pr_neut',pr_neut)
    7974
  • LMDZ6/trunk/libf/phylmd/cdrag_mod.F90

    r4478 r4481  
    2323  USE print_control_mod, ONLY: lunout, prt_level
    2424  USE ioipsl_getin_p_mod, ONLY : getin_p
    25   USE atke_turbulence_ini_mod, ONLY : ric, cn, cinf, cepsilon, pr_slope, pr_asym, pr_neut
     25  USE atke_turbulence_ini_mod, ONLY : ric, cinf, cepsilon, pr_slope, pr_asym, pr_neut
    2626
    2727  IMPLICIT NONE
     
    128128  REAL zzzcd
    129129  REAL, DIMENSION(klon) :: sm, prandtl              ! Stability function from atke turbulence scheme
    130   REAL                  ri0, ri1                    ! to have dimensionless term in sm and prandtl
     130  REAL                  ri0, ri1, cn                ! to have dimensionless term in sm and prandtl
    131131
    132132  LOGICAL, SAVE :: firstcall = .TRUE.
     
    168168
    169169  ALPHA=5.0
     170
     171! Consistent with atke scheme
     172cn=(1./sqrt(cepsilon))**(2/3)
     173ri0=2./rpi*(cinf - cn)*ric/cn
     174ri1=-2./rpi * (pr_asym - pr_neut)/pr_slope
    170175
    171176
     
    246251!*******************************************************
    247252
     253
     254
    248255!''''''''''''''
    249256! Cas instables
     
    291298         CASE (6) ! Consistent with turbulence scheme (in stationary case) derived in atke (2023)
    292299         
    293            ri0=2./rpi*(cinf - cn)*ric/cn
    294            ri1=-2./rpi * (pr_asym - pr_neut)/pr_slope
    295300           sm(i) = 2./rpi * (cinf - cn) * atan(-zri(i)/ri0) + cn
    296301           prandtl(i) = -2./rpi * (pr_asym - pr_neut) * atan(zri(i)/ri1) + pr_neut
Note: See TracChangeset for help on using the changeset viewer.