lmdz_thermcell_dry.f90 Source File


This file depends on

sourcefile~~lmdz_thermcell_dry.f90~~EfferentGraph sourcefile~lmdz_thermcell_dry.f90 lmdz_thermcell_dry.f90 sourcefile~lmdz_thermcell_ini.f90 lmdz_thermcell_ini.f90 sourcefile~lmdz_thermcell_dry.f90->sourcefile~lmdz_thermcell_ini.f90 sourcefile~strings_mod.f90 strings_mod.f90 sourcefile~lmdz_thermcell_ini.f90->sourcefile~strings_mod.f90 sourcefile~ioipsl_getin_p_mod.f90 ioipsl_getin_p_mod.f90 sourcefile~lmdz_thermcell_ini.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~strings_mod.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~mod_phys_lmdz_transfert_para.f90 mod_phys_lmdz_transfert_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_mpi_data.f90 mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~print_control_mod.f90 print_control_mod.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_omp_data.f90 mod_phys_lmdz_omp_data.F90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90 mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90 mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~print_control_mod.f90 sourcefile~lmdz_mpi.f90 lmdz_mpi.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_mpi.f90 sourcefile~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~print_control_mod.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~dimphy.f90

Files dependent on this one

sourcefile~~lmdz_thermcell_dry.f90~~AfferentGraph sourcefile~lmdz_thermcell_dry.f90 lmdz_thermcell_dry.f90 sourcefile~lmdz_thermcell_main.f90 lmdz_thermcell_main.F90 sourcefile~lmdz_thermcell_main.f90->sourcefile~lmdz_thermcell_dry.f90 sourcefile~lmdz_thermcell_main.f90~2 lmdz_thermcell_main.F90 sourcefile~lmdz_thermcell_main.f90~2->sourcefile~lmdz_thermcell_dry.f90 sourcefile~lmdz_thermcell_alp.f90 lmdz_thermcell_alp.f90 sourcefile~lmdz_thermcell_alp.f90->sourcefile~lmdz_thermcell_main.f90 sourcefile~calltherm_mod.f90 calltherm_mod.F90 sourcefile~calltherm_mod.f90->sourcefile~lmdz_thermcell_main.f90 sourcefile~calltherm_mod.f90->sourcefile~lmdz_thermcell_alp.f90 sourcefile~calltherm_mod.f90~2 calltherm_mod.F90 sourcefile~calltherm_mod.f90~2->sourcefile~lmdz_thermcell_main.f90 sourcefile~calltherm_mod.f90~2->sourcefile~lmdz_thermcell_alp.f90 sourcefile~lmdz_thermcell_alp.f90~2 lmdz_thermcell_alp.f90 sourcefile~lmdz_thermcell_alp.f90~2->sourcefile~lmdz_thermcell_main.f90 sourcefile~physiq_mod.f90 physiq_mod.F90 sourcefile~physiq_mod.f90->sourcefile~calltherm_mod.f90 sourcefile~physiq_mod.f90~2 physiq_mod.F90 sourcefile~physiq_mod.f90~2->sourcefile~calltherm_mod.f90 sourcefile~old_lmdz1d.f90 old_lmdz1d.f90 sourcefile~old_lmdz1d.f90->sourcefile~physiq_mod.f90 sourcefile~scm.f90 scm.f90 sourcefile~scm.f90->sourcefile~physiq_mod.f90 sourcefile~callphysiq_mod.f90 callphysiq_mod.f90 sourcefile~callphysiq_mod.f90->sourcefile~physiq_mod.f90 sourcefile~callphysiq_mod.f90~2 callphysiq_mod.f90 sourcefile~callphysiq_mod.f90~2->sourcefile~physiq_mod.f90 sourcefile~calfis.f90 calfis.f90 sourcefile~calfis.f90->sourcefile~callphysiq_mod.f90

Contents


Source Code

MODULE lmdz_thermcell_dry
!
! $Id: lmdz_thermcell_dry.f90 5512 2025-01-28 18:07:51Z ymeurdesoif $
!
CONTAINS

       SUBROUTINE thermcell_dry(ngrid,nlay,zlev,pphi,ztv,alim_star,  &
     &                            lalim,lmin,zmax,wmax)

!--------------------------------------------------------------------------
!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 simplifier.
! La temperature potentielle virtuelle dans la panache ascendant est
! la temperature potentielle virtuelle ponderee par alim_star.
!--------------------------------------------------------------------------
       USE lmdz_thermcell_ini, ONLY: prt_level, RG
       IMPLICIT NONE

       integer, intent(in) :: ngrid,nlay
       real, intent(in), dimension(ngrid,nlay+1) :: zlev,pphi,ztv,alim_star
       integer, intent(in), dimension(ngrid) :: lalim
       real, intent(out), dimension(ngrid) :: zmax,wmax

!variables locales
       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),zlevinter(ngrid)
       INTEGER lmix(ngrid),lmax(ngrid),lmin(ngrid)
       CHARACTER (LEN=20), PARAMETER :: modname='thermcell_dry'
       CHARACTER (LEN=80) :: abort_message
       INTEGER l,ig

!initialisations
       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


! Calcul des F^*, integrale verticale de E^*
       f_star(:,1)=0.
       do l=1,nlay
          f_star(:,l+1)=f_star(:,l)+alim_star(:,l)
       enddo

! niveau (reel) auquel zw2 s'annule FH :n'etait pas initialise
       linter(:)=0.

! couche la plus haute concernee par le thermique. 
       lmax(:)=1

! Le niveau linter est une variable continue qui se trouve dans la couche
! lmax

       do l=1,nlay-2
         do ig=1,ngrid
            if (l.eq.lmin(ig).and.lalim(ig).gt.1) then

!------------------------------------------------------------------------
!  Calcul de la vitesse en haut de la premiere couche instable.
!  Premiere couche du panache thermique
!------------------------------------------------------------------------

               zw2(ig,l+1)=2.*RG*(ztv(ig,l)-ztv(ig,l+1))/ztv(ig,l+1)  &
     &                     *(zlev(ig,l+1)-zlev(ig,l))  &
     &                     *0.4*pphi(ig,l)/(pphi(ig,l+1)-pphi(ig,l))

!------------------------------------------------------------------------
! 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 carre en haut zw2(ig,l+1)
!------------------------------------------------------------------------

            else if (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
!------------------------------------------------------------------------

            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
!            endif
!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
!CRfin
               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)) then
                zw2(ig,l)=sqrt(zw2(ig,l))
                wmax(ig)=max(wmax(ig),zw2(ig,l))
            else
                 zw2(ig,l)=0.
            endif
          enddo
      enddo

!   Longueur caracteristique correspondant a la hauteur des thermiques.
      do  ig=1,ngrid
         zmax(ig)=0.
         zlevinter(ig)=zlev(ig,1)
      enddo
      do  ig=1,ngrid
! calcul de zlevinter
          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 SUBROUTINE thermcell_dry
END MODULE lmdz_thermcell_dry