Changeset 4365


Ignore:
Timestamp:
Dec 2, 2022, 8:00:55 PM (19 months ago)
Author:
fhourdin
Message:

Poursuite codage des subsidences des thermiques

sous clé cpp

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

Legend:

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

    r4351 r4365  
    1    SUBROUTINE thermcell_down(ngrid,nlay,po,pt,pu,pv,pplay,  &
    2      &           pplev,deltaz,lmax,fup,eup,dup)
     1   SUBROUTINE thermcell_updown_dq(ngrid,nlay,lmax,eup,dup,edn,ddn,masse,theta,dtheta,thetau,thetad)
    32
    43!--------------------------------------------------------------
    5 !thermcell_env: calcule les caracteristiques de l environnement
    6 !necessaires au calcul des proprietes dans le thermique
     4! thermcell_updown_dq: calcul du transport d'un traceur en présence
     5! d'up/down drafts
     6!--------------------------------------------------------------
     7
     8   ! Suite du travail :
     9   ! Calculer les tendances d'un traceur (ici theta) en tenant compte
     10   ! des up et down drafts et de la subsidence compensatoire.
     11
     12
     13   IMPLICIT NONE
     14
     15! arguments
     16
     17   integer,intent(in) :: ngrid,nlay
     18   real,intent(in), dimension(ngrid,nlay) :: eup,dup,edn,ddn,masse
     19   real,intent(in), dimension(ngrid,nlay) :: theta
     20   real,intent(out), dimension(ngrid,nlay) :: thetau,thetad,dtheta
     21   integer, intent(out), dimension(ngrid) :: lmax
     22
     23   
     24! Local
     25
     26   real, dimension(ngrid,nlay+1) :: fup,fdn
     27
     28   integer ig,ilay
     29
     30   fdn(:,:)=0.
     31   thetad(:,:)=0.
     32
     33   ! lmax : indice tel que fu(kmax+1)=0
     34   
     35   ! Dans ce cas, pas besoin d'initialiser thetad(lmax) ( =theta(lmax) )
     36
     37   do ilay=nlay,1,-1
     38      do ig=1,ngrid
     39         if (ilay.le.lmax(ig)) then
     40            fdn(ig,ilay)=fdn(ig,ilay+1)+edn(ig,ilay)-ddn(ig,ilay)
     41            thetad(ig,ilay)=( fdn(ig,ilay+1)*thetad(ig,ilay+1) + edn(ig,ilay)*theta(ig,ilay) ) / (fdn(ig,ilay)+ddn(ig,ilay))
     42         endif
     43      enddo
     44   enddo
     45
     46
     47
     48!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     49! Initialisations :
     50!------------------
     51
     52
     53!
     54 RETURN
     55   END
     56
     57!=========================================================================
     58
     59   SUBROUTINE thermcell_down(ngrid,nlay,po,pt,pu,pv,pplay,pplev,  &
     60     &           lmax,fup,eup,dup,theta)
     61
     62!--------------------------------------------------------------
     63!thermcell_down: calcul des propriétés du panache descendant.
    764!--------------------------------------------------------------
    865
     
    1471
    1572   integer,intent(in) :: ngrid,nlay
    16    real,intent(in), dimension(ngrid,nlay) :: po,pt,pu,pv,pplay,eup,dup,deltaz
     73   real,intent(in), dimension(ngrid,nlay) :: po,pt,pu,pv,pplay,eup,dup
     74   real,intent(in), dimension(ngrid,nlay) :: theta
    1775   real,intent(in), dimension(ngrid,nlay+1) :: pplev,fup
    1876   integer, intent(in), dimension(ngrid) :: lmax
     
    2280! Local
    2381
    24    real, dimension(ngrid,nlay) :: edn,ddn
     82   real, dimension(ngrid,nlay) :: edn,ddn,thetad
    2583   real, dimension(ngrid,nlay+1) :: fdn
    2684
     
    3290   ddn(:,:)=0.
    3391   fdn(:,:)=0.
     92   thetad(:,:)=0.
    3493
    35    ! lmax : indice de la derniere couche ou les thermiques sont actifs
     94   ! lmax : indice tel que fu(kmax+1)=0
    3695   
    37    ! Convention de flux : fdn négatif vers le bas
    38    ! Pas évident qu'on veuille conserver ce choix
     96   ! Dans ce cas, pas besoin d'initialiser thetad(lmax) ( =theta(lmax) )
    3997
    40    print*,'LMAX ',lmax(1)
    41    do ilay=nlay+1,1,-1
     98! FH MODIFS APRES REUNIONS POUR COMMISSIONS
     99! quelques erreurs de declaration
     100! probleme si lmax=1 ce qui a l'air d'être le cas en début de simu. Devrait être 0 ?
     101! Remarques :
     102! on pourrait écrire la formule de thetad
     103!    www=fdn(ig,ilay+1)/ (fdn(ig,ilay)+ddn(ig,ilay))
     104!    thetad(ig,ilay)= www * thetad(ig,ilay+1) + (1.-www) * theta(ig,ilay)
     105! Elle a l'avantage de bien montré la conservation, l'idée fondamentale dans le
     106!   transport qu'on ne fait que sommer des "sources" au travers d'un "propagateur"
     107!   (Green)
     108! Elle montre aussi beaucoup plus clairement pourquoi on n'a pas à se souccier (trop)
     109!   de la possible nulité du dénominateur
     110
     111
     112   do ilay=nlay,1,-1
    42113      do ig=1,ngrid
    43          if (ilay.le.lmax(ig)) then
    44             edn(ig,ilay)=0.5*dup(ig,ilay)*deltaz(ig,ilay)
    45             ddn(ig,ilay)=0.
    46             fdn(ig,ilay)=-(-fdn(ig,ilay+1)+edn(ig,ilay)-ddn(ig,ilay))
     114         if (ilay.le.lmax(ig).and.lmax(ig)>1) then
     115            edn(ig,ilay)=0.5*dup(ig,ilay)
     116            ddn(ig,ilay)=0.5*eup(ig,ilay)
     117            fdn(ig,ilay)=fdn(ig,ilay+1)+edn(ig,ilay)-ddn(ig,ilay)
     118            thetad(ig,ilay)=( fdn(ig,ilay+1)*thetad(ig,ilay+1) + edn(ig,ilay)*theta(ig,ilay) ) / (fdn(ig,ilay)+ddn(ig,ilay))
    47119         endif
    48120      enddo
  • LMDZ6/trunk/libf/phylmd/thermcell_main.F90

    r4351 r4365  
    459459#ifdef DevThermcellDown
    460460      print*,'WARNING !!! routine thermcell_down en cours de developpement'
    461       CALL thermcell_down(ngrid,nlay,po,pt,pu,pv,pplay,  &
    462      &           pplev,deltaz,lmax,fm,entr,detr)
     461      CALL thermcell_down(ngrid,nlay,po,pt,pu,pv,pplay,pplev,  &
     462     &           lmax,fm,entr,detr,zthl)
     463
    463464#endif
    464465
Note: See TracChangeset for help on using the changeset viewer.