- Timestamp:
- Jan 14, 2010, 3:35:30 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/thermcell_main.F90
r1146 r1294 22 22 ! de "thermiques" explicitement representes avec processus nuageux 23 23 ! 24 ! R éécriture à partir d'un listing papier àHabas, le 14/02/0025 ! 26 ! le thermique est suppos é homogène et dissipé par mélange avec27 ! son environnement. la longueur l_mix contr ôle l'efficacitédu28 ! m élange29 ! 30 ! Le calcul du transport des diff érentes espèces se fait en prenant24 ! Reecriture a partir d'un listing papier a Habas, le 14/02/00 25 ! 26 ! le thermique est suppose homogene et dissipe par melange avec 27 ! son environnement. la longueur l_mix controle l'efficacite du 28 ! melange 29 ! 30 ! Le calcul du transport des differentes especes se fait en prenant 31 31 ! en compte: 32 32 ! 1. un flux de masse montant … … 85 85 real linter(klon) 86 86 real zmix(klon) 87 real zmax(klon),zw2(klon,klev+1),ztva(klon,klev),zw_est(klon,klev+1) 87 real zmax(klon),zw2(klon,klev+1),ztva(klon,klev),zw_est(klon,klev+1),ztva_est(klon,klev) 88 88 ! real fraca(klon,klev) 89 89 … … 115 115 ! FH probleme de dimensionnement avec l'allocation dynamique 116 116 ! common/comtherm/thetath2,wth2 117 real wq(klon,klev) 118 real wthl(klon,klev) 119 real wthv(klon,klev) 117 120 118 121 real ratqscth(klon,klev) … … 142 145 real f_star(klon,klev+1),entr_star(klon,klev) 143 146 real detr_star(klon,klev) 144 real alim_star_tot(klon) ,alim_star2(klon)147 real alim_star_tot(klon) 145 148 real alim_star(klon,klev) 149 real alim_star_clos(klon,klev) 146 150 real f(klon), f0(klon) 147 151 !FH/IM save f0 … … 149 153 logical debut 150 154 real seuil 155 real csc(klon,klev) 151 156 152 157 ! … … 220 225 ENDIF 221 226 ! 222 !Initialisation 223 ! 224 ! IF (1.eq.0) THEN 225 ! do ig=1,klon 226 !FH/IM 130308 if ((debut).or.((.not.debut).and.(f0(ig).lt.1.e-10))) then 227 ! if ((.not.debut).and.(f0(ig).lt.1.e-10)) then 228 ! f0(ig)=1.e-5 229 ! zmax0(ig)=40. 230 !v1d therm=.false. 231 ! endif 232 ! enddo 233 ! ENDIF !(1.eq.0) THEN 234 if (prt_level.ge.10)write(lunout,*) & 235 & 'WARNING thermcell_main f0=max(f0,1.e-2)' 227 write(lunout,*)'WARNING thermcell_main f0=max(f0,1.e-2)' 236 228 do ig=1,klon 237 229 if (prt_level.ge.20) then … … 239 231 endif 240 232 f0(ig)=max(f0(ig),1.e-2) 233 zmax0(ig)=max(zmax0(ig),40.) 241 234 !IMmarche pas ?! if (f0(ig)<1.e-2) f0(ig)=1.e-2 242 235 enddo … … 364 357 365 358 !------------------------------------------------------------------ 366 ! 1. alim_star est le profil vertical de l'alimentation àla base du367 ! panache thermique, calcul é à partir de la flotabilitéde l'air sec359 ! 1. alim_star est le profil vertical de l'alimentation a la base du 360 ! panache thermique, calcule a partir de la flotabilite de l'air sec 368 361 ! 2. lmin et lalim sont les indices inferieurs et superieurs de alim_star 369 362 !------------------------------------------------------------------ 370 363 ! 371 364 entr_star=0. ; detr_star=0. ; alim_star=0. ; alim_star_tot=0. 372 CALL thermcell_init(ngrid,nlay,ztv,zlay,zlev, & 373 & lalim,lmin,alim_star,alim_star_tot,lev_out) 374 375 call test_ltherm(ngrid,nlay,pplev,pplay,lmin,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_init lmin ') 376 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_init lalim ') 377 378 379 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_init' 380 if (prt_level.ge.10) then 381 write(lunout1,*) 'Dans thermcell_main 1' 382 write(lunout1,*) 'lmin ',lmin(igout) 383 write(lunout1,*) 'lalim ',lalim(igout) 384 write(lunout1,*) ' ig l alim_star thetav' 385 write(lunout1,'(i6,i4,2e15.5)') (igout,l,alim_star(igout,l) & 386 & ,ztv(igout,l),l=1,lalim(igout)+4) 387 endif 388 389 !v1d do ig=1,klon 390 !v1d if (alim_star(ig,1).gt.1.e-10) then 391 !v1d therm=.true. 392 !v1d endif 393 !v1d enddo 365 lmin=1 366 394 367 !----------------------------------------------------------------------------- 395 368 ! 3. wmax_sec et zmax_sec sont les vitesses et altitudes maximum d'un 396 369 ! panache sec conservatif (e=d=0) alimente selon alim_star 397 370 ! Il s'agit d'un calcul de type CAPE 398 ! zmax_sec est utilis é pour déterminer la géométrie du thermique.371 ! zmax_sec est utilise pour determiner la geometrie du thermique. 399 372 !------------------------------------------------------------------------------ 400 ! 373 !--------------------------------------------------------------------------------- 374 !calcul du melange et des variables dans le thermique 375 !-------------------------------------------------------------------------------- 376 ! 377 if (prt_level.ge.1) print*,'avant thermcell_plume ',lev_out 378 !IM 140508 CALL thermcell_plume(ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, & 379 CALL thermcell_plume(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, & 380 & zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot, & 381 & lalim,f0,detr_star,entr_star,f_star,csc,ztva, & 382 & ztla,zqla,zqta,zha,zw2,zw_est,ztva_est,zqsatth,lmix,lmix_bis,linter & 383 & ,lev_out,lunout1,igout) 384 if (prt_level.ge.1) print*,'apres thermcell_plume ',lev_out 385 386 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ') 387 call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix ') 388 389 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_plume' 390 if (prt_level.ge.10) then 391 write(lunout1,*) 'Dans thermcell_main 2' 392 write(lunout1,*) 'lmin ',lmin(igout) 393 write(lunout1,*) 'lalim ',lalim(igout) 394 write(lunout1,*) ' ig l alim_star entr_star detr_star f_star ' 395 write(lunout1,'(i6,i4,4e15.5)') (igout,l,alim_star(igout,l),entr_star(igout,l),detr_star(igout,l) & 396 & ,f_star(igout,l+1),l=1,nint(linter(igout))+5) 397 endif 398 399 !------------------------------------------------------------------------------- 400 ! Calcul des caracteristiques du thermique:zmax,zmix,wmax 401 !------------------------------------------------------------------------------- 402 ! 403 CALL thermcell_height(ngrid,nlay,lalim,lmin,linter,lmix,zw2, & 404 & zlev,lmax,zmax,zmax0,zmix,wmax,lev_out) 405 406 407 408 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lalim ') 409 call test_ltherm(ngrid,nlay,pplev,pplay,lmin ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmin ') 410 call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmix ') 411 call test_ltherm(ngrid,nlay,pplev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmax ') 412 413 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_height' 414 415 !------------------------------------------------------------------------------- 416 ! Fermeture,determination de f 417 !------------------------------------------------------------------------------- 418 ! 419 ! 420 write(lunout,*)'THERM NOUVEAU RIO2009 31B' 401 421 CALL thermcell_dry(ngrid,nlay,zlev,pphi,ztv,alim_star, & 402 422 & lalim,lmin,zmax_sec,wmax_sec,lev_out) 403 423 404 424 call test_ltherm(ngrid,nlay,pplev,pplay,lmin,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_dry lmin ') … … 417 437 418 438 419 !--------------------------------------------------------------------------------- 420 !calcul du melange et des variables dans le thermique 421 !-------------------------------------------------------------------------------- 422 ! 423 if (prt_level.ge.1) print*,'avant thermcell_plume ',lev_out 424 !IM 140508 CALL thermcell_plume(ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, & 425 CALL thermcell_plume(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, & 426 & zlev,pplev,pphi,zpspsk,l_mix,r_aspect,alim_star,alim_star_tot, & 427 & lalim,zmax_sec,f0,detr_star,entr_star,f_star,ztva, & 428 & ztla,zqla,zqta,zha,zw2,zw_est,zqsatth,lmix,lmix_bis,linter & 429 & ,lev_out,lunout1,igout) 430 if (prt_level.ge.1) print*,'apres thermcell_plume ',lev_out 431 432 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lalim ') 433 call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_plum lmix ') 434 435 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_plume' 436 if (prt_level.ge.10) then 437 write(lunout1,*) 'Dans thermcell_main 2' 438 write(lunout1,*) 'lmin ',lmin(igout) 439 write(lunout1,*) 'lalim ',lalim(igout) 440 write(lunout1,*) ' ig l alim_star entr_star detr_star f_star ' 441 write(lunout1,'(i6,i4,4e15.5)') (igout,l,alim_star(igout,l),entr_star(igout,l),detr_star(igout,l) & 442 & ,f_star(igout,l+1),l=1,nint(linter(igout))+5) 443 endif 444 445 !------------------------------------------------------------------------------- 446 ! Calcul des caracteristiques du thermique:zmax,zmix,wmax 447 !------------------------------------------------------------------------------- 448 ! 449 CALL thermcell_height(ngrid,nlay,lalim,lmin,linter,lmix,zw2, & 450 & zlev,lmax,zmax,zmax0,zmix,wmax,lev_out) 451 452 453 call test_ltherm(ngrid,nlay,pplev,pplay,lalim,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lalim ') 454 call test_ltherm(ngrid,nlay,pplev,pplay,lmin ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmin ') 455 call test_ltherm(ngrid,nlay,pplev,pplay,lmix ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmix ') 456 call test_ltherm(ngrid,nlay,pplev,pplay,lmax ,seuil,ztv,po,ztva,zqla,f_star,zw2,'thermcell_heig lmax ') 457 458 if (prt_level.ge.1) print*,'thermcell_main apres thermcell_height' 459 460 !------------------------------------------------------------------------------- 461 ! Fermeture,determination de f 462 !------------------------------------------------------------------------------- 463 ! 464 !avant closure: on redéfinit lalim, alim_star_tot et alim_star 465 ! do ig=1,klon 466 ! do l=2,lalim(ig) 467 ! alim_star(ig,l)=entr_star(ig,l) 468 ! entr_star(ig,l)=0. 469 ! enddo 470 ! enddo 471 439 print*,'THERM 26JJJ' 440 441 ! Choix de la fonction d'alimentation utilisee pour la fermeture. 442 ! Apparemment sans importance 443 alim_star_clos(:,:)=alim_star(:,:) 444 alim_star_clos(:,:)=entr_star(:,:)+alim_star(:,:) 445 446 ! Appel avec la version seche 472 447 CALL thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho, & 473 & zlev,lalim,alim_star,alim_star_tot,zmax_sec,wmax_sec,zmax,wmax,f,lev_out) 448 & zlev,lalim,alim_star_clos,f_star,zmax_sec,wmax_sec,f,lev_out) 449 450 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 451 ! Appel avec les zmax et wmax tenant compte de la condensation 452 ! Semble moins bien marcher 453 ! CALL thermcell_closure(ngrid,nlay,r_aspect,ptimestep,rho, & 454 ! & zlev,lalim,alim_star,f_star,zmax,wmax,f,lev_out) 455 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 474 456 475 457 if(prt_level.ge.1)print*,'thermcell_closure apres thermcell_closure' … … 484 466 ! Test valable seulement en 1D mais pas genant 485 467 if (.not. (f0(1).ge.0.) ) then 486 stop 468 stop'Dans thermcell_main' 487 469 endif 488 470 … … 511 493 fm0=(1.-lambda)*fm+lambda*fm0 512 494 entr0=(1.-lambda)*entr+lambda*entr0 513 !detr0=(1.-lambda)*detr+lambda*detr0495 detr0=(1.-lambda)*detr+lambda*detr0 514 496 else 515 497 fm0=fm … … 560 542 & ,fraca,zmax & 561 543 & ,zu,zv,pduadj,pdvadj,zua,zva,lev_out) 562 !IM 050508 & ,zu,zv,pduadj,pdvadj,zua,zva,igout,lev_out) 544 563 545 else 564 546 … … 636 618 ! 637 619 if (prt_level.ge.10) print*,'14f OK convect8 ig,l,zha zh zpspsk ',ig,l,zha(ig,l),zh(ig,l),zpspsk(ig,l) 638 thetath2(ig,l)=zf2*(z ha(ig,l)-zh(ig,l)/zpspsk(ig,l))**2620 thetath2(ig,l)=zf2*(ztla(ig,l)-zthl(ig,l))**2 639 621 if(zw2(ig,l).gt.1.e-10) then 640 622 wth2(ig,l)=zf2*(zw2(ig,l))**2 … … 651 633 enddo 652 634 enddo 635 !calcul des flux: q, thetal et thetav 636 do l=1,nlay 637 do ig=1,ngrid 638 wq(ig,l)=fraca(ig,l)*zw2(ig,l)*(zqta(ig,l)*1000.-po(ig,l)*1000.) 639 wthl(ig,l)=fraca(ig,l)*zw2(ig,l)*(ztla(ig,l)-zthl(ig,l)) 640 wthv(ig,l)=fraca(ig,l)*zw2(ig,l)*(ztva(ig,l)-ztv(ig,l)) 641 enddo 642 enddo 653 643 !calcul de ale_bl et alp_bl 654 !pour le calcul d'une valeur int égrée entre la surface et lmax644 !pour le calcul d'une valeur integree entre la surface et lmax 655 645 do ig=1,ngrid 656 646 alp_int(ig)=0. … … 782 772 ! print*,'15 OK convect8' 783 773 774 #ifdef wrgrads_thermcell 784 775 if (prt_level.ge.1) print*,'thermcell_main sorties 3D' 785 #ifdef wrgrads_thermcell786 776 #include "thermcell_out3d.h" 787 777 #endif
Note: See TracChangeset
for help on using the changeset viewer.