Changeset 4396 for LMDZ6/trunk/libf/phylmd/thermcell_down.F90
- Timestamp:
- Jan 24, 2023, 2:16:46 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/thermcell_down.F90
r4383 r4396 1 SUBROUTINE thermcell_updown_dq(ngrid,nlay,ptimestep,lmax,eup,dup,edn,ddn,masse,trac )1 SUBROUTINE thermcell_updown_dq(ngrid,nlay,ptimestep,lmax,eup,dup,edn,ddn,masse,trac,dtrac) 2 2 3 3 !----------------------------------------------------------------- … … 25 25 real,intent(in), dimension(ngrid,nlay) :: ddn ! detrainment from downdrafts * dz [same unit as flux] 26 26 real,intent(in), dimension(ngrid,nlay) :: masse ! mass of layers = rho dz 27 real,intent(in out), dimension(ngrid,nlay) :: trac ! tracer27 real,intent(in), dimension(ngrid,nlay) :: trac ! tracer 28 28 integer, intent(in), dimension(ngrid) :: lmax ! max level index at which downdraft are present 29 real,intent(out),dimension(ngrid,nlay) ::dtrac ! tendance du traceur 29 30 30 31 … … 32 33 33 34 real, dimension(ngrid,nlay+1) :: fup,fdn,fthu,fthd,fthe,fthtot 34 real, dimension(ngrid,nlay) :: tracu,tracd ,dtrac35 real, dimension(ngrid,nlay) :: tracu,tracd 35 36 real :: www 36 37 integer ig,ilay … … 68 69 do ilay=1,nlay,1 69 70 do ig=1,ngrid 70 if (ilay.l e.lmax(ig) .and. lmax(ig)>1) then71 if (ilay.lt.lmax(ig) .and. lmax(ig)>1) then 71 72 fup(ig,ilay+1)=fup(ig,ilay)+eup(ig,ilay)-dup(ig,ilay) 72 73 if (ilay == 1 ) then … … 83 84 enddo 84 85 enddo 85 !Boucle pour calculer le flux up86 !Boucle pour calculer le flux du traceur flux updraft, flux downdraft, flux compensatoire 86 87 do ilay=2,nlay,1 87 88 do ig=1,ngrid … … 95 96 endif 96 97 fthe(ig,ilay)=-(fup(ig,ilay)-fdn(ig,ilay))*trac(ig,ilay) 98 !! si on voulait le prendre en compte on 99 !fthe(ig,ilay)=-(fup(ig,ilay)-fdn(ig,ilay))*trac(ig,ilay-1) 97 100 fthtot(ig,ilay)=fthu(ig,ilay)+fthd(ig,ilay)+fthe(ig,ilay) 98 101 enddo … … 101 104 do ilay=1,nlay,1 102 105 do ig=1,ngrid 103 dtrac(ig,ilay)=(fthtot(ig,ilay)-fthtot(ig,ilay+1))*( ptimestep/masse(ig,ilay))106 dtrac(ig,ilay)=(fthtot(ig,ilay)-fthtot(ig,ilay+1))*(1./masse(ig,ilay)) 104 107 ! trac(ig,ilay)=trac(ig,ilay) + (fthtot(ig,ilay)-fthtot(ig,ilay+1))*(ptimestep/masse(ig,ilay)) 105 108 enddo 106 109 enddo 107 if (1==0) then108 do ilay=1,nlay,1109 do ig=1,ngrid110 trac(ig,ilay)=trac(ig,ilay) + (fup(ig,ilay)*tracu(ig,ilay-1)-fup(ig,ilay+1)*tracu(ig,ilay) + &111 & (fup(ig,ilay+1)+fdn(ig,ilay+1))*trac(ig,ilay+1) - (fup(ig,ilay)+fdn(ig,ilay))*trac(ig,ilay) + &112 & fdn(ig,ilay+1)*tracd(ig,ilay+1)-fdn(ig,ilay)*tracd(ig,ilay))*(ptimestep/masse(ig,ilay))113 enddo114 enddo115 endif116 110 ! Il reste a coder : 117 111 ! d(rho trac)/dt = - d/dz(rho w'trac')
Note: See TracChangeset
for help on using the changeset viewer.