Changeset 4690 for LMDZ6/trunk/libf/phylmd/lmdz_thermcell_main.F90
- Timestamp:
- Sep 17, 2023, 1:16:26 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/lmdz_thermcell_main.F90
r4684 r4690 4 4 ! A REGARDER !!!!!!!!!!!!!!!!! 5 5 ! ATTENTION : zpspsk est inout et out mais c'est pas forcement pour de bonnes raisons (FH, 2023) 6 ! ATTENTION : dans thermcell_env, on condense potentiellement de l'eau. Mais comme on ne mélange pas l'eau liquide supposant qu'il n'y en n'a pas, c'est potentiellement un souci 6 7 CONTAINS 7 8 8 9 subroutine thermcell_main(itap,ngrid,nlay,ptimestep & 9 10 & ,pplay,pplev,pphi,debut & 10 & ,puwind,pvwind,ptemp,p_o &11 & ,puwind,pvwind,ptemp,p_o,ptemp_env, po_env & 11 12 & ,pduadj,pdvadj,pdtadj,pdoadj & 12 13 & ,fm0,entr0,detr0,zqta,zqla,lmax & … … 21 22 22 23 24 25 ! USE necessaires pour les lignes importees de thermcell_env 23 26 USE lmdz_thermcell_ini, ONLY: thermcell_ini,dqimpl,dvdq,prt_level,lunout,prt_level 24 27 USE lmdz_thermcell_ini, ONLY: iflag_thermals_closure,iflag_thermals_ed,tau_thermals,r_aspect_thermals 25 28 USE lmdz_thermcell_ini, ONLY: iflag_thermals_down,fact_thermals_down 29 USE lmdz_thermcell_ini, ONLY: iflag_thermals_tenv 26 30 USE lmdz_thermcell_ini, ONLY: RD,RG 27 31 … … 36 40 USE lmdz_thermcell_plume, ONLY: thermcell_plume 37 41 USE lmdz_thermcell_plume_6A, ONLY: thermcell_plume_6A,thermcell_plume_5B 42 43 ! USE necessaires pour les lignes importees de thermcell_env 44 USE lmdz_thermcell_ini, ONLY : RLvCp,RKAPPA,RETV 45 USE lmdz_thermcell_qsat, ONLY : thermcell_qsat 46 38 47 39 48 #ifdef ISO … … 105 114 integer, intent(in) :: itap,ngrid,nlay 106 115 real, intent(in) :: ptimestep 107 real, intent(in), dimension(ngrid,nlay) :: ptemp,puwind,pvwind,pplay,pphi 116 real, intent(in), dimension(ngrid,nlay) :: ptemp,puwind,pvwind,pplay,pphi,ptemp_env,po_env 108 117 ! ATTENTION : zpspsk est inout et out mais c'est pas forcement pour de bonnes raisons (FH, 2023) 109 118 real, intent(in), dimension(ngrid,nlay) :: p_o … … 144 153 integer,dimension(ngrid) :: lmin,lmix,lmix_bis,nivcon 145 154 real, dimension(ngrid,nlay) :: ztva_est 146 real, dimension(ngrid,nlay) :: deltaz,zlay,zh,zdthladj,zu,zv,z_o,zl,zva,zua,z_oa 155 real, dimension(ngrid,nlay) :: deltaz,zlay,zdthladj,zu,zv,z_o,zl,zva,zua,z_oa 156 real, dimension(ngrid,nlay) :: ztemp_env ! temperarure liquide de l'environnement 147 157 real, dimension(ngrid,nlay) :: zta,zha,q2,wq,wthl,wthv,thetath2,wth2 148 158 real, dimension(ngrid,nlay) :: rho,masse … … 154 164 real, dimension(ngrid) :: zcon,zcon2,alim_star_tot,f 155 165 real, dimension(ngrid,nlay) :: entrdn,detrdn 166 logical, dimension(ngrid,nlay) :: mask 156 167 157 168 character (len=20) :: modname='thermcell_main' … … 199 210 enddo 200 211 endif 212 201 213 !----------------------------------------------------------------------- 202 214 ! Calcul de T,q,ql a partir de Tl et qT dans l environnement 203 215 ! -------------------------------------------------------------------- 204 216 ! 205 CALL thermcell_env(ngrid,nlay,p_o,ptemp,puwind,pvwind,pplay, & 206 & pplev,z_o,zh,zl,ztv,zthl,zu,zv,zpspsk,zqsat,lev_out) 217 ! On condense l'eau liquide si besoin. 218 ! En fait on arrive ici d'habitude (jusque 6A) après réévaporation 219 ! Dans une nouvelle mouture, on passe les profiles 220 ! avant la couche limite : iflag_thermals_tenv=1 221 ! dés le début de la physique : iflag_thermals_tenv=2 222 ! Mais même pour 2) on ne veut sans doute pas réévaporer. 223 ! On veut comparer thetav dans le thermique, après condensation, 224 ! avec le theta_v effectif de l'environnement. 225 226 if (iflag_thermals_tenv - 10 * ( iflag_thermals_tenv / 10 ) == 0) then 227 228 CALL thermcell_env(ngrid,nlay,p_o,ptemp_env,puwind,pvwind,pplay, & 229 & pplev,z_o,ztemp_env,zl,ztv,zthl,zu,zv,zpspsk,zqsat,lev_out) 230 231 else 232 233 ! Chantier en cours : ne pas effacer (Fredho). 15 septembre 2023 234 ! Dans la version originale de thermcell_env, on condense l'eau de l'environnement 235 ! pour calculer une temperature potentielle liquide. 236 ! On en déduit un Theta v. 237 238 ! ... 239 ! contenu de thermcell_env 240 ! SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay, & 241 ! & pplev,zo,zh,zl,ztv,zthl,zu,zv,zpspsk,pqsat,lev_out) 242 ! contenu thermcell_env : call thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat) 243 ! contenu thermcell_env : do ll=1,nlay 244 ! contenu thermcell_env : do ig=1,ngrid 245 ! contenu thermcell_env : zl(ig,ll) = max(0.,po(ig,ll)-pqsat(ig,ll)) 246 ! contenu thermcell_env : zh(ig,ll) = pt(ig,ll)+RLvCp*zl(ig,ll) ! T = Tl + Lv/Cp ql 247 ! contenu thermcell_env : zo(ig,ll) = po(ig,ll)-zl(ig,ll) 248 ! contenu thermcell_env : enddo 249 ! contenu thermcell_env : enddo 250 ! contenu thermcell_env : do ll=1,nlay 251 ! contenu thermcell_env : do ig=1,ngrid 252 ! contenu thermcell_env : zpspsk(ig,ll)=(pplay(ig,ll)/100000.)**RKAPPA 253 ! contenu thermcell_env : zu(ig,ll)=pu(ig,ll) 254 ! contenu thermcell_env : zv(ig,ll)=pv(ig,ll) 255 ! contenu thermcell_env : ztv(ig,ll)=zh(ig,ll)/zpspsk(ig,ll) 256 ! contenu thermcell_env : ztv(ig,ll)=ztv(ig,ll)*(1.+RETV*(zo(ig,ll))-zl(ig,ll)) 257 ! contenu thermcell_env : zthl(ig,ll)=pt(ig,ll)/zpspsk(ig,ll) 258 ! contenu thermcell_env : enddo 259 ! contenu thermcell_env : enddo 260 261 do l=1,nlay 262 do ig=1,ngrid 263 zl(ig,l)=0. 264 zu(ig,l)=puwind(ig,l) 265 zv(ig,l)=pvwind(ig,l) 266 ztemp_env(ig,l)=ptemp_env(ig,l) 267 zpspsk(ig,l)=(pplay(ig,l)/100000.)**RKAPPA 268 ztv(ig,l)=ztemp_env(ig,l)/zpspsk(ig,l) 269 ztv(ig,l)=ztv(ig,l)*(1.+RETV*po_env(ig,l)) 270 zthl(ig,l)=ptemp(ig,l)/zpspsk(ig,l) 271 mask(ig,l)=.true. 272 enddo 273 enddo 274 call thermcell_qsat(ngrid*nlay,mask,pplev,ptemp_env,p_o,zqsat) 275 276 endif 207 277 208 278 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_env' … … 532 602 !-------------------------------------------------------------- 533 603 604 ! Temperature potentielle liquide effectivement mélangée par les thermiques 605 do ll=1,nlay 606 do ig=1,ngrid 607 zthl(ig,ll)=ptemp(ig,ll)/zpspsk(ig,ll) 608 enddo 609 enddo 534 610 call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, & 535 611 & zthl,zdthladj,zta,lev_out) … … 632 708 !nouveau calcul 633 709 do ig=1,ngrid 634 CHI=zh(ig,1)/(1669.0-122.0*z_o(ig,1)/zqsat(ig,1)-zh(ig,1)) 710 ! WARNING !!! verifier que c'est bien ztemp_env qu'on veut là 711 CHI=ztemp_env(ig,1)/(1669.0-122.0*z_o(ig,1)/zqsat(ig,1)-ztemp_env(ig,1)) 635 712 pcon(ig)=pplay(ig,1)*(z_o(ig,1)/zqsat(ig,1))**CHI 636 713 enddo
Note: See TracChangeset
for help on using the changeset viewer.