Changeset 4089 for LMDZ6/trunk/libf/phylmd/thermcell_main.F90
- Timestamp:
- Mar 10, 2022, 7:23:47 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/thermcell_main.F90
r3451 r4089 1 ! 1 2 2 ! $Id$ 3 3 ! 4 SUBROUTINEthermcell_main(itap,ngrid,nlay,ptimestep &4 subroutine thermcell_main(itap,ngrid,nlay,ptimestep & 5 5 & ,pplay,pplev,pphi,debut & 6 6 & ,pu,pv,pt,po & … … 8 8 & ,fm0,entr0,detr0,zqta,zqla,lmax & 9 9 & ,ratqscth,ratqsdiff,zqsatth & 10 & ,Ale_bl,Alp_bl,lalim_conv,wght_th &11 10 & ,zmax0, f0,zw2,fraca,ztv & 12 & ,zpspsk,ztla,zthl & 13 !!! nrlmd le 10/04/2012 14 & ,pbl_tke,pctsrf,omega,airephy & 15 & ,zlcl,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 & 16 & ,n2,s2,ale_bl_stat & 17 & ,therm_tke_max,env_tke_max & 18 & ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke & 19 & ,alp_bl_conv,alp_bl_stat & 20 !!! fin nrlmd le 10/04/2012 21 & ,ztva ) 22 23 USE dimphy 24 USE ioipsl 25 USE indice_sol_mod 26 USE print_control_mod, ONLY: lunout,prt_level 11 & ,zpspsk,ztla,zthl,ztva & 12 & ,pcon,rhobarz,wth3,wmax_sec,lalim,fm,alim_star,zmax & 13 #ifdef ISO 14 & ,xtpo,xtpdoadj & 15 #endif 16 & ) 17 18 19 USE thermcell_ini_mod, ONLY: thermcell_ini,dqimpl,dvdq,prt_level,lunout,prt_level 20 USE thermcell_ini_mod, ONLY: iflag_thermals_closure,iflag_thermals_ed,tau_thermals,r_aspect_thermals 21 USE thermcell_ini_mod, ONLY: RD,RG 22 23 #ifdef ISO 24 USE infotrac_phy, ONLY : ntraciso 25 #ifdef ISOVERIF 26 USE isotopes_mod, ONLY : iso_eau,iso_HDO 27 USE isotopes_verif_mod, ONLY: iso_verif_egalite, & 28 iso_verif_aberrant_encadre 29 #endif 30 #endif 31 32 27 33 IMPLICIT NONE 28 34 … … 62 68 ! ------------- 63 69 64 #include "YOMCST.h"65 #include "YOETHF.h"66 #include "FCTTRE.h"67 #include "thermcell.h"68 70 69 71 ! arguments: 70 72 ! ---------- 71 72 !IM 140508 73 INTEGER itap 74 75 INTEGER ngrid,nlay 76 real ptimestep 77 REAL pt(ngrid,nlay),pdtadj(ngrid,nlay) 78 REAL pu(ngrid,nlay),pduadj(ngrid,nlay) 79 REAL pv(ngrid,nlay),pdvadj(ngrid,nlay) 80 REAL po(ngrid,nlay),pdoadj(ngrid,nlay) 81 REAL pplay(ngrid,nlay),pplev(ngrid,nlay+1) 82 real pphi(ngrid,nlay) 83 LOGICAL debut 73 integer, intent(in) :: itap,ngrid,nlay 74 real, intent(in) :: ptimestep 75 real, intent(in), dimension(ngrid,nlay) :: pt,pu,pv,po,pplay,pphi,zpspsk 76 real, intent(in), dimension(ngrid,nlay+1) :: pplev 77 real, intent(out), dimension(ngrid,nlay) :: pdtadj,pduadj,pdvadj,pdoadj,entr0,detr0 78 real, intent(out), dimension(ngrid,nlay) :: ztla,zqla,zqta,zqsatth,zthl 79 real, intent(out), dimension(ngrid,nlay+1) :: fm0,zw2,fraca 80 real, intent(out), dimension(ngrid) :: zmax0,f0 81 real, intent(out), dimension(ngrid,nlay) :: ztva,ztv 82 logical, intent(in) :: debut 83 84 real, intent(out), dimension(ngrid) :: pcon 85 real, intent(out), dimension(ngrid,nlay) :: rhobarz,wth3 86 real, intent(out), dimension(ngrid) :: wmax_sec 87 integer,intent(out), dimension(ngrid) :: lalim 88 real, intent(out), dimension(ngrid,nlay+1) :: fm 89 real, intent(out), dimension(ngrid,nlay) :: alim_star 90 real, intent(out), dimension(ngrid) :: zmax 84 91 85 92 ! local: 86 93 ! ------ 87 94 88 integer icount89 90 integer, save :: dvdq=1,dqimpl=-191 !$OMP THREADPRIVATE(dvdq,dqimpl)92 data icount/0/93 save icount94 !$OMP THREADPRIVATE(icount)95 95 96 96 integer,save :: igout=1 … … 101 101 !$OMP THREADPRIVATE(lev_out) 102 102 103 REAL susqr2pi, Reuler 104 105 INTEGER ig,k,l,ll,ierr 106 real zsortie1d(klon) 107 INTEGER lmax(klon),lmin(klon),lalim(klon) 108 INTEGER lmix(klon) 109 INTEGER lmix_bis(klon) 110 real linter(klon) 111 real zmix(klon) 112 real zmax(klon),zw2(klon,klev+1),ztva(klon,klev),zw_est(klon,klev+1),ztva_est(klon,klev) 113 ! real fraca(klon,klev) 114 115 real zmax_sec(klon) 116 !on garde le zmax du pas de temps precedent 117 real zmax0(klon) 118 !FH/IM save zmax0 119 120 real lambda 121 122 real zlev(klon,klev+1),zlay(klon,klev) 123 real deltaz(klon,klev) 124 REAL zh(klon,klev) 125 real zthl(klon,klev),zdthladj(klon,klev) 126 REAL ztv(klon,klev) 127 real zu(klon,klev),zv(klon,klev),zo(klon,klev) 128 real zl(klon,klev) 129 real zsortie(klon,klev) 130 real zva(klon,klev) 131 real zua(klon,klev) 132 real zoa(klon,klev) 133 134 real zta(klon,klev) 135 real zha(klon,klev) 136 real fraca(klon,klev+1) 137 real zf,zf2 138 real thetath2(klon,klev),wth2(klon,klev),wth3(klon,klev) 139 real q2(klon,klev) 140 ! FH probleme de dimensionnement avec l'allocation dynamique 141 ! common/comtherm/thetath2,wth2 142 real wq(klon,klev) 143 real wthl(klon,klev) 144 real wthv(klon,klev) 145 146 real ratqscth(klon,klev) 147 real var 148 real vardiff 149 real ratqsdiff(klon,klev) 150 103 real lambda, zf,zf2,var,vardiff,CHI 104 integer ig,k,l,ierr,ll 151 105 logical sorties 152 real rho(klon,klev),rhobarz(klon,klev),masse(klon,klev) 153 real zpspsk(klon,klev) 154 155 real wmax(klon) 156 real wmax_tmp(klon) 157 real wmax_sec(klon) 158 real fm0(klon,klev+1),entr0(klon,klev),detr0(klon,klev) 159 real fm(klon,klev+1),entr(klon,klev),detr(klon,klev) 160 161 real ztla(klon,klev),zqla(klon,klev),zqta(klon,klev) 162 !niveau de condensation 163 integer nivcon(klon) 164 real zcon(klon) 165 REAL CHI 166 real zcon2(klon) 167 real pcon(klon) 168 real zqsat(klon,klev) 169 real zqsatth(klon,klev) 170 171 real f_star(klon,klev+1),entr_star(klon,klev) 172 real detr_star(klon,klev) 173 real alim_star_tot(klon) 174 real alim_star(klon,klev) 175 real alim_star_clos(klon,klev) 176 real f(klon), f0(klon) 177 !FH/IM save f0 178 real zlevinter(klon) 179 real seuil 180 real csc(klon,klev) 181 182 !!! nrlmd le 10/04/2012 183 184 !------Entrées 185 real pbl_tke(klon,klev+1,nbsrf) 186 real pctsrf(klon,nbsrf) 187 real omega(klon,klev) 188 real airephy(klon) 189 !------Sorties 190 real zlcl(klon),fraca0(klon),w0(klon),w_conv(klon) 191 real therm_tke_max0(klon),env_tke_max0(klon) 192 real n2(klon),s2(klon) 193 real ale_bl_stat(klon) 194 real therm_tke_max(klon,klev),env_tke_max(klon,klev) 195 real alp_bl_det(klon),alp_bl_fluct_m(klon),alp_bl_fluct_tke(klon),alp_bl_conv(klon),alp_bl_stat(klon) 196 !------Local 197 integer nsrf 198 real rhobarz0(klon) ! Densité au LCL 199 logical ok_lcl(klon) ! Existence du LCL des thermiques 200 integer klcl(klon) ! Niveau du LCL 201 real interp(klon) ! Coef d'interpolation pour le LCL 202 !--Triggering 203 real Su ! Surface unité: celle d'un updraft élémentaire 204 parameter(Su=4e4) 205 real hcoef ! Coefficient directeur pour le calcul de s2 206 parameter(hcoef=1) 207 real hmincoef ! Coefficient directeur pour l'ordonnée à l'origine pour le calcul de s2 208 parameter(hmincoef=0.3) 209 real eps1 ! Fraction de surface occupée par la population 1 : eps1=n1*s1/(fraca0*Sd) 210 parameter(eps1=0.3) 211 real hmin(ngrid) ! Ordonnée à l'origine pour le calcul de s2 212 real zmax_moy(ngrid) ! Hauteur moyenne des thermiques : zmax_moy = zlcl + 0.33 (zmax-zlcl) 213 real zmax_moy_coef 214 parameter(zmax_moy_coef=0.33) 215 real depth(klon) ! Epaisseur moyenne du cumulus 216 real w_max(klon) ! Vitesse max statistique 217 real s_max(klon) 218 !--Closure 219 real pbl_tke_max(klon,klev) ! Profil de TKE moyenne 220 real pbl_tke_max0(klon) ! TKE moyenne au LCL 221 real w_ls(klon,klev) ! Vitesse verticale grande échelle (m/s) 222 real coef_m ! On considère un rendement pour alp_bl_fluct_m 223 parameter(coef_m=1.) 224 real coef_tke ! On considère un rendement pour alp_bl_fluct_tke 225 parameter(coef_tke=1.) 226 227 !!! fin nrlmd le 10/04/2012 228 229 ! 230 !nouvelles variables pour la convection 231 real Ale_bl(klon) 232 real Alp_bl(klon) 233 real alp_int(klon),dp_int(klon),zdp 234 real ale_int(klon) 235 integer n_int(klon) 236 real fm_tot(klon) 237 real wght_th(klon,klev) 238 integer lalim_conv(klon) 239 !v1d logical therm 240 !v1d save therm 241 242 character*2 str2 243 character*10 str10 106 real, dimension(ngrid) :: linter,zmix, zmax_sec 107 integer,dimension(ngrid) :: lmax,lmin,lmix,lmix_bis,nivcon 108 real, dimension(ngrid,nlay) :: ztva_est 109 real, dimension(ngrid,nlay) :: deltaz,zlay,zh,zdthladj,zu,zv,zo,zl,zva,zua,zoa 110 real, dimension(ngrid,nlay) :: zta,zha,q2,wq,wthl,wthv,thetath2,wth2 111 real, dimension(ngrid,nlay) :: ratqscth,ratqsdiff,rho,masse 112 real, dimension(ngrid,nlay+1) :: zw_est,zlev 113 real, dimension(ngrid) :: wmax,wmax_tmp 114 real, dimension(ngrid,nlay+1) :: f_star 115 real, dimension(ngrid,nlay) :: entr,detr,entr_star,detr_star,alim_star_clos 116 real, dimension(ngrid,nlay) :: zqsat,csc 117 real, dimension(ngrid) :: zcon,zcon2,alim_star_tot,f 244 118 245 119 character (len=20) :: modname='thermcell_main' 246 120 character (len=80) :: abort_message 247 121 248 EXTERNAL SCOPY 122 123 #ifdef ISO 124 REAL xtpo(ntraciso,ngrid,nlay),xtpdoadj(ntraciso,ngrid,nlay) 125 REAL xtzo(ntraciso,ngrid,nlay) 126 REAL xtpdoadj_tmp(ngrid,nlay) 127 REAL xtpo_tmp(ngrid,nlay) 128 REAL xtzo_tmp(ngrid,nlay) 129 integer ixt 130 #endif 131 249 132 ! 250 133 … … 253 136 ! --------------- 254 137 ! 255 256 seuil=0.25 257 258 if (debut) then 259 if (iflag_thermals==15.or.iflag_thermals==16) then 260 dvdq=0 261 dqimpl=-1 262 else 263 dvdq=1 264 dqimpl=1 265 endif 266 267 fm0=0. 268 entr0=0. 269 detr0=0. 270 endif 138 print*,'NEW THERMCELL cool' 139 140 271 141 fm=0. ; entr=0. ; detr=0. 272 icount=icount+1273 274 !IM 090508 beg275 !print*,'====================================================================='276 !print*,'====================================================================='277 !print*,' PAS ',icount,' PAS ',icount,' PAS ',icount,' PAS ',icount278 !print*,'====================================================================='279 !print*,'====================================================================='280 !IM 090508 end281 142 282 143 if (prt_level.ge.1) print*,'thermcell_main V4' 283 144 284 145 sorties=.true. 285 IF(ngrid.NE. klon) THEN146 IF(ngrid.NE.ngrid) THEN 286 147 PRINT* 287 148 PRINT*,'STOP dans convadj' 288 149 PRINT*,'ngrid =',ngrid 289 PRINT*,' klon =',klon150 PRINT*,'ngrid =',ngrid 290 151 ENDIF 291 152 ! 292 153 ! write(lunout,*)'WARNING thermcell_main f0=max(f0,1.e-2)' 293 do ig=1, klon154 do ig=1,ngrid 294 155 f0(ig)=max(f0(ig),1.e-2) 295 156 zmax0(ig)=max(zmax0(ig),40.) … … 336 197 zlev(:,l)=0.5*(pphi(:,l)+pphi(:,l-1))/RG 337 198 enddo 338 339 zlev(:,nlay+1)=(2.*pphi(:,klev)-pphi(:,klev-1))/RG199 zlev(:,1)=0. 200 zlev(:,nlay+1)=(2.*pphi(:,nlay)-pphi(:,nlay-1))/RG 340 201 do l=1,nlay 341 202 zlay(:,l)=pphi(:,l)/RG 342 203 enddo 343 !calcul de l epaisseur des couches344 204 do l=1,nlay 345 205 deltaz(:,l)=zlev(:,l+1)-zlev(:,l) 346 206 enddo 347 207 348 ! print*,'2 OK convect8'349 208 !----------------------------------------------------------------------- 350 ! Calcul des densites 209 ! Calcul des densites et masses 351 210 !----------------------------------------------------------------------- 352 211 353 rho(:,:)=pplay(:,:)/(zpspsk(:,:)*RD*ztv(:,:)) 354 355 if (prt_level.ge.10)write(lunout,*) & 356 & 'WARNING thermcell_main rhobarz(:,1)=rho(:,1)' 212 rho(:,:)=pplay(:,:)/(zpspsk(:,:)*RD*ztv(:,:)) 213 if (prt_level.ge.10) write(lunout,*) 'WARNING thermcell_main rhobarz(:,1)=rho(:,1)' 357 214 rhobarz(:,1)=rho(:,1) 358 359 215 do l=2,nlay 360 216 rhobarz(:,l)=0.5*(rho(:,l)+rho(:,l-1)) 361 217 enddo 362 363 !calcul de la masse364 218 do l=1,nlay 365 219 masse(:,l)=(pplev(:,l)-pplev(:,l+1))/RG 366 220 enddo 367 368 221 if (prt_level.ge.1) print*,'thermcell_main apres initialisation' 369 222 … … 480 333 if (prt_level.ge.1) print*,'apres thermcell_plume ',lev_out 481 334 482 call test_ltherm(ngrid,nlay,ppl ev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ')483 call test_ltherm(ngrid,nlay,ppl ev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix ')335 call test_ltherm(ngrid,nlay,pplay,lalim,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ') 336 call test_ltherm(ngrid,nlay,pplay,lmix ,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix ') 484 337 485 338 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_plume' … … 509 362 510 363 511 call test_ltherm(ngrid,nlay,ppl ev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lalim ')512 call test_ltherm(ngrid,nlay,ppl ev,pplay,lmin ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmin ')513 call test_ltherm(ngrid,nlay,ppl ev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmix ')514 call test_ltherm(ngrid,nlay,ppl ev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmax ')364 call test_ltherm(ngrid,nlay,pplay,lalim,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lalim ') 365 call test_ltherm(ngrid,nlay,pplay,lmin ,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmin ') 366 call test_ltherm(ngrid,nlay,pplay,lmix ,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmix ') 367 call test_ltherm(ngrid,nlay,pplay,lmax ,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmax ') 515 368 516 369 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_height' … … 526 379 527 380 528 call test_ltherm(ngrid,nlay,ppl ev,pplay,lmin,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_dry lmin ')529 call test_ltherm(ngrid,nlay,ppl ev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_dry lalim ')381 call test_ltherm(ngrid,nlay,pplay,lmin,ztv,po,ztva,zqla,f_star,zw2,'thermcell_dry lmin ') 382 call test_ltherm(ngrid,nlay,pplay,lalim,ztv,po,ztva,zqla,f_star,zw2,'thermcell_dry lalim ') 530 383 531 384 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_dry' … … 582 435 !------------------------------------------------------------------------------- 583 436 !deduction des flux 584 !-------------------------------------------------------------------------------585 437 586 438 CALL thermcell_flux2(ngrid,nlay,ptimestep,masse, & … … 591 443 592 444 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_flux' 593 call test_ltherm(ngrid,nlay,ppl ev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_flux lalim ')594 call test_ltherm(ngrid,nlay,ppl ev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_flux lmax ')445 call test_ltherm(ngrid,nlay,pplay,lalim,ztv,po,ztva,zqla,f_star,zw2,'thermcell_flux lalim ') 446 call test_ltherm(ngrid,nlay,pplay,lmax ,ztv,po,ztva,zqla,f_star,zw2,'thermcell_flux lmax ') 595 447 596 448 !------------------------------------------------------------------ … … 620 472 & po,pdoadj,zoa,lev_out) 621 473 474 #ifdef ISO 475 ! C Risi: on utilise directement la même routine 476 do ixt=1,ntraciso 477 do ll=1,nlay 478 DO ig=1,ngrid 479 xtpo_tmp(ig,ll)=xtpo(ixt,ig,ll) 480 xtzo_tmp(ig,ll)=xtzo(ixt,ig,ll) 481 enddo 482 enddo 483 call thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, & 484 & xtpo_tmp,xtpdoadj_tmp,xtzo_tmp,lev_out) 485 do ll=1,nlay 486 DO ig=1,ngrid 487 xtpdoadj(ixt,ig,ll)=xtpdoadj_tmp(ig,ll) 488 enddo 489 enddo 490 enddo !do ixt=1,ntraciso 491 #endif 492 493 #ifdef ISO 494 #ifdef ISOVERIF 495 DO ll=1,nlay 496 DO ig=1,ngrid 497 if (iso_eau.gt.0) then 498 call iso_verif_egalite(xtpo(iso_eau,ig,ll), & 499 & po(ig,ll),'thermcell_main 594') 500 call iso_verif_egalite(xtpdoadj(iso_eau,ig,ll), & 501 & pdoadj(ig,ll),'thermcell_main 596') 502 endif 503 if (iso_HDO.gt.0) then 504 call iso_verif_aberrant_encadre(xtpo(iso_hdo,ig,ll) & 505 & /po(ig,ll),'thermcell_main 610') 506 endif 507 enddo 508 enddo !DO ll=1,nlay 509 write(*,*) 'thermcell_main 600 tmp: apres thermcell_dq' 510 #endif 511 #endif 512 513 514 622 515 !------------------------------------------------------------------ 623 516 ! Calcul de la fraction de l'ascendance 624 517 !------------------------------------------------------------------ 625 do ig=1, klon518 do ig=1,ngrid 626 519 fraca(ig,1)=0. 627 520 fraca(ig,nlay+1)=0. 628 521 enddo 629 522 do l=2,nlay 630 do ig=1, klon523 do ig=1,ngrid 631 524 if (zw2(ig,l).gt.1.e-10) then 632 525 fraca(ig,l)=fm(ig,l)/(rhobarz(ig,l)*zw2(ig,l)) … … 760 653 enddo 761 654 enddo 762 !763 ! $Id$764 !765 CALL thermcell_alp(ngrid,nlay,ptimestep &766 & ,pplay,pplev &767 & ,fm0,entr0,lmax &768 & ,Ale_bl,Alp_bl,lalim_conv,wght_th &769 & ,zw2,fraca &770 !!! necessire en plus771 & ,pcon,rhobarz,wth3,wmax_sec,lalim,fm,alim_star,zmax &772 !!! nrlmd le 10/04/2012773 & ,pbl_tke,pctsrf,omega,airephy &774 & ,zlcl,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &775 & ,n2,s2,ale_bl_stat &776 & ,therm_tke_max,env_tke_max &777 & ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke &778 & ,alp_bl_conv,alp_bl_stat &779 !!! fin nrlmd le 10/04/2012780 & )781 782 783 655 784 656 !calcul du ratqscdiff … … 788 660 ratqsdiff(:,:)=0. 789 661 790 do l=1, klev662 do l=1,nlay 791 663 do ig=1,ngrid 792 664 if (l<=lalim(ig)) then … … 798 670 if (prt_level.ge.1) print*,'14f OK convect8' 799 671 800 do l=1, klev672 do l=1,nlay 801 673 do ig=1,ngrid 802 674 if (l<=lalim(ig)) then … … 809 681 810 682 if (prt_level.ge.1) print*,'14g OK convect8' 811 do l=1,nlay 812 do ig=1,ngrid 813 ratqsdiff(ig,l)=sqrt(vardiff)/(po(ig,l)*1000.) 814 ! write(11,*)'ratqsdiff=',ratqsdiff(ig,l) 815 enddo 816 enddo 817 !-------------------------------------------------------------------- 818 ! 819 !ecriture des fichiers sortie 820 ! print*,'15 OK convect8 CCCCCCCCCCCCCCCCCCc' 821 683 do l=1,nlay 684 do ig=1,ngrid 685 ratqsdiff(ig,l)=sqrt(vardiff)/(po(ig,l)*1000.) 686 enddo 687 enddo 822 688 endif 823 689 … … 825 691 826 692 return 827 end 828 829 !----------------------------------------------------------------------------- 830 831 subroutine test_ltherm(klon,klev,pplev,pplay,long,seuil,ztv,po,ztva,zqla,f_star,zw2,comment) 832 USE print_control_mod, ONLY: prt_level 693 end subroutine thermcell_main 694 695 !============================================================================= 696 !///////////////////////////////////////////////////////////////////////////// 697 !============================================================================= 698 subroutine test_ltherm(ngrid,nlay,pplay,long,ztv,po,ztva, & ! in 699 & zqla,f_star,zw2,comment) ! in 700 !============================================================================= 701 USE thermcell_ini_mod, ONLY: prt_level 833 702 IMPLICIT NONE 834 703 835 integer i, k, klon,klev 836 real pplev(klon,klev+1),pplay(klon,klev) 837 real ztv(klon,klev) 838 real po(klon,klev) 839 real ztva(klon,klev) 840 real zqla(klon,klev) 841 real f_star(klon,klev) 842 real zw2(klon,klev) 843 integer long(klon) 704 integer i, k, ngrid,nlay 705 real, intent(in), dimension(ngrid,nlay) :: pplay,ztv,po,ztva,zqla 706 real, intent(in), dimension(ngrid,nlay) :: f_star,zw2 707 integer, intent(in), dimension(ngrid) :: long 844 708 real seuil 845 709 character*21 comment 710 seuil=0.25 846 711 847 712 if (prt_level.ge.1) THEN … … 851 716 852 717 ! test sur la hauteur des thermiques ... 853 do i=1, klon718 do i=1,ngrid 854 719 !IMtemp if (pplay(i,long(i)).lt.seuil*pplev(i,1)) then 855 720 if (prt_level.ge.10) then 856 721 print*,'WARNING ',comment,' au point ',i,' K= ',long(i) 857 722 print*,' K P(MB) THV(K) Qenv(g/kg)THVA QLA(g/kg) F* W2' 858 do k=1, klev723 do k=1,nlay 859 724 write(6,'(i3,7f10.3)') k,pplay(i,k),ztv(i,k),1000*po(i,k),ztva(i,k),1000*zqla(i,k),f_star(i,k),zw2(i,k) 860 725 enddo … … 866 731 end 867 732 868 !!! nrlmd le 10/04/2012 Transport de la TKE par le thermique moyen pour la fermeture en ALP 869 ! On transporte pbl_tke pour donner therm_tke 870 ! Copie conforme de la subroutine DTKE dans physiq.F écrite par Frederic Hourdin 871 subroutine thermcell_tke_transport(ngrid,nlay,ptimestep,fm0,entr0, & 872 & rg,pplev,therm_tke_max) 873 USE print_control_mod, ONLY: prt_level 733 ! nrlmd le 10/04/2012 Transport de la TKE par le thermique moyen pour la fermeture en ALP 734 ! On transporte pbl_tke pour donner therm_tke 735 ! Copie conforme de la subroutine DTKE dans physiq.F écrite par Frederic Hourdin 736 737 !======================================================================= 738 !/////////////////////////////////////////////////////////////////////// 739 !======================================================================= 740 741 subroutine thermcell_tke_transport( & 742 & ngrid,nlay,ptimestep,fm0,entr0,rg,pplev, & ! in 743 & therm_tke_max) ! out 744 USE thermcell_ini_mod, ONLY: prt_level 874 745 implicit none 875 746 … … 882 753 !======================================================================= 883 754 884 integer ngrid,nlay,nsrf 885 886 real ptimestep 887 real masse0(ngrid,nlay),fm0(ngrid,nlay+1),pplev(ngrid,nlay+1) 888 real entr0(ngrid,nlay),rg 889 real therm_tke_max(ngrid,nlay) 755 integer ngrid,nlay 756 757 real, intent(in) :: ptimestep 758 real, intent(in), dimension(ngrid,nlay+1) :: fm0,pplev 759 real, intent(in), dimension(ngrid,nlay) :: entr0 760 real, intent(in) :: rg 761 real, intent(out), dimension(ngrid,nlay) :: therm_tke_max 762 890 763 real detr0(ngrid,nlay) 891 892 764 real masse0(ngrid,nlay) 893 765 real masse(ngrid,nlay),fm(ngrid,nlay+1) 894 766 real entr(ngrid,nlay) … … 897 769 898 770 real qa(ngrid,nlay),detr(ngrid,nlay),wqd(ngrid,nlay+1) 899 900 real zzm901 902 771 integer ig,k 903 integer isrf904 772 905 773 … … 929 797 fm(:,nlay+1)=0. 930 798 931 !!! nrlmd le 16/09/2010 932 ! calcul de la valeur dans les ascendances 933 ! do ig=1,ngrid 934 ! qa(ig,1)=q(ig,1) 935 ! enddo 936 !!! 937 938 !do isrf=1,nsrf 939 940 ! q(:,:)=therm_tke(:,:,isrf) 799 941 800 q(:,:)=therm_tke_max(:,:) 942 801 !!! nrlmd le 16/09/2010
Note: See TracChangeset
for help on using the changeset viewer.