6 & ,ale_bl,alp_bl,lalim_conv,wght_th &
9 & ,pcon,rhobarz,wth3,wmax_sec,lalim,fm,alim_star,zmax &
11 & ,pbl_tke,pctsrf,omega,
airephy &
12 & ,zlcl,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &
13 & ,n2,s2,ale_bl_stat &
14 & ,therm_tke_max,env_tke_max &
15 & ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke &
16 & ,alp_bl_conv,alp_bl_stat &
60 #include "thermcell.h"
69 REAL pplay(ngrid,nlay),pplev(ngrid,nlay+1)
108 real therm_tke_max0(
klon),env_tke_max0(
klon)
110 real ale_bl_stat(
klon)
112 real alp_bl_det(
klon),alp_bl_fluct_m(
klon),alp_bl_fluct_tke(
klon),alp_bl_conv(
klon),alp_bl_stat(
klon)
137 real pbl_tke_max0(
klon)
153 integer lalim_conv(
klon)
166 therm_tke_max0(ig) = 0.
167 env_tke_max0(ig) = 0.
172 alp_bl_fluct_m(ig) = 0.
173 alp_bl_fluct_tke(ig) = 0.
179 therm_tke_max(ig,l) = 0.
180 env_tke_max(ig,l) = 0.
189 if ( (pcon(ig) .gt. pplay(ig,
klev-1)) .and. (pcon(ig) .lt. pplay(ig,1)) ) ok_lcl(ig)=.
true.
201 if ((pplev(ig,l) .ge. pcon(ig)) .and. (pplev(ig,l+1) .le. pcon(ig)))
then
203 interp(ig)=(pcon(ig)-pplev(ig,klcl(ig)))/(pplev(ig,klcl(ig)+1)-pplev(ig,klcl(ig)))
220 rhobarz0(ig)=rhobarz(ig,klcl(ig))+(rhobarz(ig,klcl(ig)+1) &
221 & -rhobarz(ig,klcl(ig)))*interp(ig)
222 zlcl(ig)=(pplev(ig,1)-pcon(ig))/(rhobarz0(ig)*
rg)
223 zlcl(ig)=min(zlcl(ig),zmax(ig))
245 pbl_tke_max(ig,l)=pctsrf(ig,nsrf)*pbl_tke(ig,l,nsrf)+pbl_tke_max(ig,l)
253 therm_tke_max(ig,l)=pbl_tke_max(ig,l)
254 env_tke_max(ig,l)=pbl_tke_max(ig,l)
259 call thermcell_tke_transport(ngrid,nlay,ptimestep,fm0,entr0, &
260 &
rg,pplev,therm_tke_max)
266 pbl_tke_max(ig,l)=fraca(ig,l)*therm_tke_max(ig,l)+(1.-fraca(ig,l))*env_tke_max(ig,l)
267 env_tke_max(ig,l)=(pbl_tke_max(ig,l)-fraca(ig,l)*therm_tke_max(ig,l))/(1.-fraca(ig,l))
268 w_ls(ig,l)=-1.*omega(ig,l)/(
rg*rhobarz(ig,l))
275 fraca0(ig)=fraca(ig,klcl(ig))+(fraca(ig,klcl(ig)+1) &
276 & -fraca(ig,klcl(ig)))*interp(ig)
277 w0(ig)=zw2(ig,klcl(ig))+(zw2(ig,klcl(ig)+1) &
278 & -zw2(ig,klcl(ig)))*interp(ig)
279 w_conv(ig)=w_ls(ig,klcl(ig))+(w_ls(ig,klcl(ig)+1) &
280 & -w_ls(ig,klcl(ig)))*interp(ig)
281 therm_tke_max0(ig)=therm_tke_max(ig,klcl(ig)) &
282 & +(therm_tke_max(ig,klcl(ig)+1)-therm_tke_max(ig,klcl(ig)))*interp(ig)
283 env_tke_max0(ig)=env_tke_max(ig,klcl(ig))+(env_tke_max(ig,klcl(ig)+1) &
284 & -env_tke_max(ig,klcl(ig)))*interp(ig)
285 pbl_tke_max0(ig)=pbl_tke_max(ig,klcl(ig))+(pbl_tke_max(ig,klcl(ig)+1) &
286 & -pbl_tke_max(ig,klcl(ig)))*interp(ig)
287 if (therm_tke_max0(ig).ge.20.) therm_tke_max0(ig)=20.
288 if (env_tke_max0(ig).ge.20.) env_tke_max0(ig)=20.
289 if (pbl_tke_max0(ig).ge.20.) pbl_tke_max0(ig)=20.
313 zmax_moy(ig)=zlcl(ig)+zmax_moy_coef*(zmax(ig)-zlcl(ig))
314 depth(ig)=zmax_moy(ig)-zlcl(ig)
315 hmin(ig)=hmincoef*zlcl(ig)
316 if (depth(ig).ge.10.)
then
317 s2(ig)=(hcoef*depth(ig)+hmin(ig))**2
318 n2(ig)=(1.-eps1)*fraca0(ig)*airephy(ig)/s2(ig)
323 s_max(ig)=s2(ig)*log(max(n2(ig),1.))
343 susqr2pi=su*sqrt(2.*rpi)
346 if ( (depth(ig).ge.10.) .and. (s_max(ig).gt.susqr2pi*reuler) )
then
347 w_max(ig)=w0(ig)*(1.+sqrt(2.*log(s_max(ig)/susqr2pi)-log(2.*log(s_max(ig)/susqr2pi))))
348 ale_bl_stat(ig)=0.5*w_max(ig)**2
360 IF (iflag_clos_bl.ge.2)
THEN
364 alp_bl_det(ig)=0.5*coef_m*rhobarz0(ig)*(w0(ig)**3)*fraca0(ig)*(1.-2.*fraca0(ig))/((1.-fraca0(ig))**2)
365 alp_bl_fluct_m(ig)=1.5*rhobarz0(ig)*fraca0(ig)*(w_conv(ig)+coef_m*w0(ig))* &
367 alp_bl_fluct_tke(ig)=3.*coef_m*rhobarz0(ig)*w0(ig)*fraca0(ig)*(therm_tke_max0(ig)-env_tke_max0(ig)) &
368 & +3.*rhobarz0(ig)*w_conv(ig)*pbl_tke_max0(ig)
369 if (iflag_clos_bl.ge.2)
then
370 alp_bl_conv(ig)=1.5*coef_m*rhobarz0(ig)*fraca0(ig)*(fraca0(ig)/(1.-fraca0(ig)))*w_conv(ig)* &
375 alp_bl_stat(ig)=alp_bl_det(ig)+alp_bl_fluct_m(ig)+alp_bl_fluct_tke(ig)+alp_bl_conv(ig)
380 if (fraca0(ig).gt.0.98) alp_bl_stat(ig)=2.
394 alp_bl(ig)=max(alp_bl(ig),0.5*rhobarz(ig,l)*wth3(ig,l) )
395 ale_bl(ig)=max(ale_bl(ig),0.5*zw2(ig,l)**2)
409 lalim_conv(:)=lalim(:)
413 if (k<=lalim_conv(ig)) fm_tot(ig)=fm_tot(ig)+fm(ig,k)
421 if (k<=lalim_conv(ig).and.alim_star(ig,k)>1.e-10)
then
422 wght_th(ig,k)=alim_star(ig,k)
431 if ((alim_star(ig,1).lt.1.e-10))
then
449 if(l.LE.lmax(ig))
THEN
450 zdp=pplay(ig,l-1)-pplay(ig,l)
451 alp_int(ig)=alp_int(ig)+0.5*rhobarz(ig,l)*wth3(ig,l)*zdp
452 dp_int(ig)=dp_int(ig)+zdp
460 if (dp_int(ig)>0.)
then
461 alp_bl(ig)=alp_int(ig)/dp_int(ig)
nsplit_thermals!nrlmd le iflag_clos_bl tau_trig_deep real::s_trig!fin nrlmd le fact_thermals_ed_dz iflag_wake iflag_thermals_closure common ctherm1 iflag_thermals_closure common ctherm2 fact_thermals_ed_dz common ctherm4 iflag_coupl
nsplit_thermals!nrlmd le iflag_clos_bl tau_trig_deep real::s_trig!fin nrlmd le fact_thermals_ed_dz iflag_wake iflag_thermals_closure common ctherm1 iflag_thermals_closure common ctherm2 fact_thermals_ed_dz common ctherm4 iflag_wake common ctherm5 iflag_thermals_optflux!nrlmd le common ctherm6 iflag_trig_bl
!$Id!c c c Common de passage de la geometrie de la dynamique a la physique real airephy(klon)
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL pplay
!$Header!integer nvarmx parameter(nfmx=10, imx=200, jmx=150, lmx=200, nvarmx=1000) real xd(imx
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL ulevSTD CALL &zphi philevSTD CALL &zx_rh rhlevSTD!DO klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon du jour ou toutes les read_climoz CALL true
subroutine thermcell_alp(ngrid, nlay, ptimestep, pplay, pplev, fm0, entr0, lmax, ale_bl, alp_bl, lalim_conv, wght_th, zw2, fraca, pcon, rhobarz, wth3, wmax_sec, lalim, fm, alim_star, zmax, pbl_tke, pctsrf, omega, airephy, zlcl, fraca0, w0, w_conv, therm_tke_max0, env_tke_max0, n2, s2, ale_bl_stat, therm_tke_max, env_tke_max, alp_bl_det, alp_bl_fluct_m, alp_bl_fluct_tke, alp_bl_conv, alp_bl_stat)
nsplit_thermals!nrlmd le iflag_clos_bl tau_trig_deep real::s_trig!fin nrlmd le fact_thermals_ed_dz iflag_wake iflag_thermals_closure common ctherm1 iflag_thermals_closure common ctherm2 alp_bl_k