Ignore:
Timestamp:
Aug 30, 2023, 9:15:43 AM (15 months ago)
Author:
evignon
Message:

prise en compte de l'humidite pour le calcul du flux de flottabilite dans atke
+ petits ajustements

File:
1 edited

Legend:

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

    r4644 r4653  
    66
    77subroutine atke_compute_km_kh(ngrid,nlay,dtime, &
    8                         wind_u,wind_v,temp,play,pinterf,cdrag_uv, &
     8                        wind_u,wind_v,temp,qvap,play,pinterf,cdrag_uv, &
    99                        tke,Km_out,Kh_out)
    1010
     
    2626
    2727
    28 USE atke_turbulence_ini_mod, ONLY : iflag_atke, kappa, l0, ric, cinf, rpi, rcpd, ok_vdiff_tke
    29 USE atke_turbulence_ini_mod, ONLY : cepsilon, pr_slope, pr_asym, pr_neut, ctkes,rg, rd
     28USE atke_turbulence_ini_mod, ONLY : iflag_atke, kappa, l0, ric, cinf, rpi, rcpd, atke_ok_virtual
     29USE atke_turbulence_ini_mod, ONLY : cepsilon, pr_slope, pr_asym, pr_neut, ctkes,rg, rd, rv, atke_ok_vdiff
    3030USE atke_turbulence_ini_mod, ONLY : viscom, viscoh, clmix, iflag_atke_lmix, lmin, smmin
    3131
     
    4343REAL, DIMENSION(ngrid,nlay), INTENT(IN)       :: wind_v   ! meridional velocity (m/s)
    4444REAL, DIMENSION(ngrid,nlay), INTENT(IN)       :: temp   ! temperature (K)
     45REAL, DIMENSION(ngrid,nlay), INTENT(IN)       :: qvap   ! specific humidity (kg/kg)
    4546REAL, DIMENSION(ngrid,nlay), INTENT(IN)       :: play   ! pressure (Pa)
    4647REAL, DIMENSION(ngrid,nlay+1), INTENT(IN)     :: pinterf   ! pressure at interfaces(Pa)
     
    8182REAL    :: netsource  ! net source term of tke
    8283REAL    :: ustar      ! friction velocity estimation
     84REAL    :: invtau     
     85REAL    :: rvap
    8386
    8487! Initializations:
     
    9093END DO
    9194
    92 ! Calculation of potential temperature: (if vapor -> todo virtual potential temperature)
     95! Calculation of potential temperature: (if vapor -> virtual potential temperature)
    9396!=====================================
    9497
    9598preff=100000.
    96 ! The result should not depend on the choice of preff
     99! results should not depend on the choice of preff
    97100DO ilay=1,nlay
    98101     DO igrid = 1, ngrid
     
    101104END DO
    102105
     106! account for water vapor mass for buoyancy calculation
     107IF (atke_ok_virtual) THEN
     108  DO ilay=1,nlay
     109     DO igrid = 1, ngrid
     110        rvap=max(0.,qvap(igrid,ilay)/(1.-qvap(igrid,ilay)))
     111        theta(igrid,ilay)=theta(igrid,ilay)*(1.+rvap/(RD/RV))/(1.+rvap)
     112     END DO
     113  END DO
     114ENDIF
    103115
    104116
     
    287299
    288300
     301ELSE IF (iflag_atke == 5) THEN
     302! semi implicit scheme from Arpege (V. Masson methodology with
     303! Taylor expansion of the dissipation term)
     304! and implicit resolution when switch num (when we use the mixing length as a function of tke)
     305    DO ilay=2,nlay
     306        DO igrid=1,ngrid
     307           qq=max(sqrt(2.*tke(igrid,ilay)),1.e-10)
     308           if (switch_num(igrid,ilay) .and. N2(igrid,ilay)>0.) then
     309             invtau=clmix*Sm(igrid,ilay)/sqrt(N2(igrid,ilay))*shear2(igrid,ilay)*(1.-Ri(igrid,ilay)/Prandtl(igrid,ilay))  &
     310                   -sqrt(N2(igrid,ilay))/(cepsilon*clmix)
     311             !qq=qq/(1.-dtime*invtau)
     312             !qq=qq*exp(dtime*invtau)
     313             tke(igrid,ilay)=tke(igrid,ilay)/(1.-dtime*invtau)
     314             tke(igrid,ilay)=max(0.,tke(igrid,ilay))
     315           else
     316             qq=(l_exchange(igrid,ilay)*Sm(igrid,ilay)/sqrt(2.)*shear2(igrid,ilay)*(1.-Ri(igrid,ilay)/Prandtl(igrid,ilay)) &
     317             +qq*(1.+dtime*qq/(cepsilon*l_exchange(igrid,ilay)*2.*sqrt(2.)))) &
     318             /(1.+2.*qq*dtime/(cepsilon*l_exchange(igrid,ilay)*2.*sqrt(2.)))
     319             qq=max(0.,qq)
     320             tke(igrid,ilay)=0.5*(qq**2)
     321           endif
     322        ENDDO
     323    ENDDO
     324
     325
    289326ELSE
    290327   call abort_physic("atke_compute_km_kh", &
     
    312349! vertical diffusion of TKE
    313350!==========================
    314 IF (ok_vdiff_tke) THEN
     351IF (atke_ok_vdiff) THEN
    315352   CALL atke_vdiff_tke(ngrid,nlay,dtime,z_lay,z_interf,temp,play,l_exchange,Sm,tke)
    316353ENDIF
     
    338375
    339376! routine that computes the vertical diffusion of TKE by the turbulence
    340 ! using an implicit resolution (See note by Dufresne and Ghattas
     377! using an implicit resolution (See note by Dufresne and Ghattas (2009))
    341378! E Vignon, July 2023
    342379
Note: See TracChangeset for help on using the changeset viewer.