! ! ! SUBROUTINE thermcell_dry(ngrid,nlay,zlev,pphi,ztv,alim_star, & & lalim,lmin,zmax,wmax,lev_out) USE print_control_mod, ONLY: prt_level USE thermcell_mod IMPLICIT NONE !============================================================================== ! thermcell_dry: calcul de zmax et wmax du thermique sec ! Calcul de la vitesse maximum et de la hauteur maximum pour un panache ! ascendant avec une fonction d'alimentation alim_star et sans changement ! de phase. ! Le calcul pourrait etre sans doute simplifie. ! La temperature potentielle virtuelle dans la panache ascendant est ! la temperature potentielle virtuelle ponderee par alim_star. !============================================================================== !============================================================================== ! Declaration !============================================================================== INTEGER l,ig INTEGER lalim(ngrid) INTEGER lev_out ! niveau pour les print INTEGER ngrid,nlay REAL zlev(ngrid,nlay+1) REAL pphi(ngrid,nlay) REAl ztv(ngrid,nlay) REAL alim_star(ngrid,nlay) REAL zmax(ngrid) REAL wmax(ngrid) ! local: ! ------ REAL zw2(ngrid,nlay+1) REAL f_star(ngrid,nlay+1) REAL ztva(ngrid,nlay+1) REAL wmaxa(ngrid) REAL wa_moy(ngrid,nlay+1) REAL linter(ngrid) ! level such as zw2(zlev=0) REAL zlevinter(ngrid) ! zlev such as zw2(zlev=0) INTEGER lmix(ngrid) ! level where zw2 is max INTEGER lmax(ngrid) ! plume highest level INTEGER lmin(ngrid) ! plume starting level CHARACTER (LEN=20) :: modname='thermcell_dry' CHARACTER (LEN=80) :: abort_message !============================================================================== ! Initialization !============================================================================== DO ig=1,ngrid DO l=1,nlay+1 zw2(ig,l)=0. wa_moy(ig,l)=0. ENDDO ENDDO DO ig=1,ngrid DO l=1,nlay ztva(ig,l)=ztv(ig,l) ENDDO ENDDO DO ig=1,ngrid wmax(ig)=0. wmaxa(ig)=0. ENDDO !------------------------------------------------------------------------------ ! Calcul de la vitesse a partir de la CAPE en melangeant thetav !------------------------------------------------------------------------------ f_star(:,1)=0. DO l=1,nlay f_star(:,l+1)=f_star(:,l)+alim_star(:,l) ENDDO linter(:) = 0. lmax(:) = 1 !============================================================================== ! Calcul de la vitesse verticale au carre !============================================================================== DO l=1,nlay-2 DO ig=1,ngrid IF (l.eq.lmin(ig).and.lalim(ig).gt.lmin(ig)) THEN zw2(ig,l+1) = 2. * RG * (zlev(ig,l+1) - zlev(ig,l)) & & * (ztv(ig,l) - ztv(ig,l+1)) / ztv(ig,l+1) !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! Tant que la vitesse en bas de la couche et la somme du flux de masse ! et de l'entrainement (c'est a dire le flux de masse en haut) sont ! positifs, on calcul ! 1. le flux de masse en haut f_star(ig,l+1) ! 2. la temperature potentielle virtuelle dans la couche ztva(ig,l) ! 3. la vitesse au carré en haut zw2(ig,l+1) !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ELSEIF (zw2(ig,l).ge.1e-10) THEN ztva(ig,l) = (f_star(ig,l)*ztva(ig,l-1)+alim_star(ig,l) & & *ztv(ig,l))/f_star(ig,l+1) zw2(ig,l+1) = zw2(ig,l)*(f_star(ig,l)/f_star(ig,l+1))**2+ & & 2.*RG*(ztva(ig,l)-ztv(ig,l))/ztv(ig,l) & & *(zlev(ig,l+1)-zlev(ig,l)) ENDIF !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! determination de zmax continu par interpolation lineaire ! Le niveau linter est une variable continue qui se trouve dans la couche lmax !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IF (zw2(ig,l+1)>0. .and. zw2(ig,l+1).lt.1.e-10) then ! stop'On tombe sur le cas particulier de thermcell_dry' ! print *, 'On tombe sur le cas particulier de thermcell_dry' zw2(ig,l+1) = 0. linter(ig) = l+1 lmax(ig) = l ENDIF IF (zw2(ig,l+1).lt.0.) THEN linter(ig)=(l*(zw2(ig,l+1)-zw2(ig,l)) & & -zw2(ig,l))/(zw2(ig,l+1)-zw2(ig,l)) zw2(ig,l+1)=0. lmax(ig)=l !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !CR:zmax continu 06/05/12: calcul de linter quand le thermique est stoppe par le detrainement !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ELSEIF (f_star(ig,l+1).lt.0.) THEN linter(ig)=(l*(f_star(ig,l+1)-f_star(ig,l)) & & -f_star(ig,l))/(f_star(ig,l+1)-f_star(ig,l)) zw2(ig,l+1)=0. lmax(ig)=l ENDIF wa_moy(ig,l+1) = sqrt(zw2(ig,l+1)) IF (wa_moy(ig,l+1).gt.wmaxa(ig)) THEN !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! lmix est le niveau de la couche ou w (wa_moy) est maximum !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lmix(ig) = l + 1 wmaxa(ig) = wa_moy(ig,l+1) ENDIF ENDDO ENDDO IF (prt_level.ge.1) print*,'fin calcul zw2' !============================================================================== ! Determination de zw2 max !============================================================================== DO ig=1,ngrid wmax(ig)=0. ENDDO DO l=1,nlay DO ig=1,ngrid IF (l.le.lmax(ig) .and. l.gt.lmin(ig)) THEN zw2(ig,l) = sqrt(zw2(ig,l)) !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! AB : WARNING zw2 becomes its square root ! !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wmax(ig)=max(wmax(ig),zw2(ig,l)) ELSE zw2(ig,l)=0. ENDIF ENDDO ENDDO !============================================================================== ! Calcul de la longueur caracteristique correspondant a la hauteur des thermiques. !============================================================================== DO ig=1,ngrid zmax(ig) = 0. zlevinter(ig) = zlev(ig,1) ENDDO !------------------------------------------------------------------------------ ! Calcul de zlevinter !------------------------------------------------------------------------------ DO ig=1,ngrid zlevinter(ig)=zlev(ig,lmax(ig)) + & & (linter(ig)-lmax(ig))*(zlev(ig,lmax(ig)+1)-zlev(ig,lmax(ig))) zmax(ig)=max(zmax(ig),zlevinter(ig)-zlev(ig,lmin(ig))) ENDDO RETURN END