- Timestamp:
- Jul 24, 2024, 4:23:34 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_down.F90
r5116 r5117 23 23 ! input/output 24 24 25 integer, intent(in) :: ngrid ! number of horizontal grid points26 integer, intent(in) :: nlay ! number of vertical layers27 real, intent(in) :: ptimestep ! time step of the physics [s]28 real, intent(in), dimension(ngrid, nlay) :: eup ! entrainment to updrafts * dz [same unit as flux]29 real, intent(in), dimension(ngrid, nlay) :: dup ! detrainment from updrafts * dz [same unit as flux]30 real, intent(in), dimension(ngrid, nlay) :: edn ! entrainment to downdrafts * dz [same unit as flux]31 real, intent(in), dimension(ngrid, nlay) :: ddn ! detrainment from downdrafts * dz [same unit as flux]32 real, intent(in), dimension(ngrid, nlay) :: masse ! mass of layers = rho dz33 real, intent(in), dimension(ngrid, nlay) :: trac ! tracer34 integer, intent(in), dimension(ngrid) :: lmax ! max level index at which downdraft are present35 real, intent(out), dimension(ngrid, nlay) :: dtrac ! tendance du traceur25 INTEGER, INTENT(IN) :: ngrid ! number of horizontal grid points 26 INTEGER, INTENT(IN) :: nlay ! number of vertical layers 27 REAL, INTENT(IN) :: ptimestep ! time step of the physics [s] 28 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: eup ! entrainment to updrafts * dz [same unit as flux] 29 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: dup ! detrainment from updrafts * dz [same unit as flux] 30 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: edn ! entrainment to downdrafts * dz [same unit as flux] 31 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: ddn ! detrainment from downdrafts * dz [same unit as flux] 32 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: masse ! mass of layers = rho dz 33 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: trac ! tracer 34 INTEGER, INTENT(IN), DIMENSION(ngrid) :: lmax ! max level index at which downdraft are present 35 REAL, INTENT(OUT), DIMENSION(ngrid, nlay) :: dtrac ! tendance du traceur 36 36 37 37 38 38 ! Local 39 39 40 real, dimension(ngrid, nlay + 1) :: fup, fdn, fc, fthu, fthd, fthe, fthtot41 real, dimension(ngrid, nlay) :: tracu, tracd, traci, tracold40 REAL, DIMENSION(ngrid, nlay + 1) :: fup, fdn, fc, fthu, fthd, fthe, fthtot 41 REAL, DIMENSION(ngrid, nlay) :: tracu, tracd, traci, tracold 42 42 REAL :: www, mstar_inv 43 integerig, ilay44 real, dimension(ngrid, nlay) :: s1, s2, num !coefficients pour la resolution implicite43 INTEGER ig, ilay 44 REAL, DIMENSION(ngrid, nlay) :: s1, s2, num !coefficients pour la resolution implicite 45 45 INTEGER :: iflag_impl = 1 ! 0 pour explicite, 1 pour implicite "classique", 2 pour implicite avec entrainement et detrainement 46 46 … … 60 60 num(:, :) = 1. 61 61 62 if(iflag_thermals_down < 10) THEN62 IF (iflag_thermals_down < 10) THEN 63 63 CALL abort_physic("thermcell_updown_dq", & 64 64 'thermcell_down_dq = 0 or >= 10', 1) … … 74 74 do ig = 1, ngrid 75 75 !if ( lmax(ig) > nlay - 2 ) stop "les thermiques montent trop haut" 76 if (ilay<=lmax(ig) .and. lmax(ig)>1) THEN76 IF (ilay<=lmax(ig) .AND. lmax(ig)>1) THEN 77 77 fdn(ig, ilay) = fdn(ig, ilay + 1) + edn(ig, ilay) - ddn(ig, ilay) 78 if(fdn(ig, ilay) + ddn(ig, ilay) > 0.) THEN78 IF (fdn(ig, ilay) + ddn(ig, ilay) > 0.) THEN 79 79 www = fdn(ig, ilay + 1) / (fdn(ig, ilay) + ddn(ig, ilay)) 80 80 else … … 90 90 do ilay = 1, nlay, 1 91 91 do ig = 1, ngrid 92 if (ilay<lmax(ig) .and. lmax(ig)>1) THEN92 IF (ilay<lmax(ig) .AND. lmax(ig)>1) THEN 93 93 fup(ig, ilay + 1) = fup(ig, ilay) + eup(ig, ilay) - dup(ig, ilay) 94 if(fup(ig, ilay + 1) + dup(ig, ilay) > 0.) THEN94 IF (fup(ig, ilay + 1) + dup(ig, ilay) > 0.) THEN 95 95 www = fup(ig, ilay) / (fup(ig, ilay + 1) + dup(ig, ilay)) 96 96 else 97 97 www = 0. 98 98 endif 99 if(ilay == 1) THEN99 IF (ilay == 1) THEN 100 100 tracu(ig, ilay) = trac(ig, ilay) 101 101 else … … 131 131 !!!!ATTENTION HYPOTHESE de FLUX COMPENSATOIRE DESCENDANT ET DONC comme schema amont on va chercher trac au dessus!!!!! 132 132 !!!! tentative de prise en compte d'un flux compensatoire montant !!!! 133 if(fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN133 IF (fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN 134 134 CALL abort_physic("thermcell_updown_dq", 'flux compensatoire '& 135 135 // 'montant, cas non traite par thermcell_updown_dq', 1) … … 164 164 do ilay = 2, nlay, 1 165 165 do ig = 1, ngrid 166 if(fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN166 IF (fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN 167 167 CALL abort_physic("thermcell_updown_dq", 'flux compensatoire ' & 168 168 // 'montant, cas non traite par thermcell_updown_dq', 1) … … 183 183 enddo !fin du calculer de la tendance du traceur avec la methode explicite 184 184 185 else if(iflag_impl==1) THEN185 ELSE IF (iflag_impl==1) THEN 186 186 do ilay = 1, nlay 187 187 do ig = 1, ngrid … … 193 193 do ilay = nlay - 1, 1, -1 194 194 do ig = 1, ngrid 195 if((fup(ig, ilay) - fdn(ig, ilay)) < 0) THEN195 IF((fup(ig, ilay) - fdn(ig, ilay)) < 0) THEN 196 196 WRITE(*, *) 'flux compensatoire montant, cas non traite par thermcell_updown_dq dans le cas d une resolution implicite, ilay : ', ilay 197 197 CALL abort_physic("thermcell_updown_dq", "", 1) … … 230 230 ! arguments 231 231 232 integer, intent(in) :: ngrid, nlay233 real, intent(in), dimension(ngrid, nlay) :: po, pt, pu, pv, pplay, eup, dup234 real, intent(in), dimension(ngrid, nlay) :: theta235 real, intent(in), dimension(ngrid, nlay + 1) :: pplev, fup236 integer, intent(in), dimension(ngrid) :: lmax232 INTEGER, INTENT(IN) :: ngrid, nlay 233 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: po, pt, pu, pv, pplay, eup, dup 234 REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: theta 235 REAL, INTENT(IN), DIMENSION(ngrid, nlay + 1) :: pplev, fup 236 INTEGER, INTENT(IN), DIMENSION(ngrid) :: lmax 237 237 238 238 … … 240 240 ! Local 241 241 242 real, dimension(ngrid, nlay) :: edn, ddn, thetad243 real, dimension(ngrid, nlay + 1) :: fdn244 245 integerig, ilay246 realdqsat_dT247 logicalmask(ngrid, nlay)242 REAL, DIMENSION(ngrid, nlay) :: edn, ddn, thetad 243 REAL, DIMENSION(ngrid, nlay + 1) :: fdn 244 245 INTEGER ig, ilay 246 REAL dqsat_dT 247 LOGICAL mask(ngrid, nlay) 248 248 249 249 edn(:, :) = 0. … … 271 271 do ilay = nlay, 1, -1 272 272 do ig = 1, ngrid 273 if (ilay<=lmax(ig).and.lmax(ig)>1) THEN273 IF (ilay<=lmax(ig).AND.lmax(ig)>1) THEN 274 274 edn(ig, ilay) = fact_thermals_down * dup(ig, ilay) 275 275 ddn(ig, ilay) = fact_thermals_down * eup(ig, ilay)
Note: See TracChangeset
for help on using the changeset viewer.