- Timestamp:
- Jul 23, 2024, 3:29:36 PM (8 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90
r5101 r5103 7 7 CONTAINS 8 8 9 subroutinethermcell_main(itap,ngrid,nlay,ptimestep &9 SUBROUTINE thermcell_main(itap,ngrid,nlay,ptimestep & 10 10 ,pplay,pplev,pphi,debut & 11 11 ,puwind,pvwind,ptemp,p_o,ptemp_env, po_env & … … 185 185 fm=0. ; entr=0. ; detr=0. 186 186 187 if (prt_level>=1) print*,'thermcell_main V4'188 189 sorties=. true.187 if (prt_level>=1) PRINT*,'thermcell_main V4' 188 189 sorties=.TRUE. 190 190 IF(ngrid/=ngrid) THEN 191 191 PRINT* … … 195 195 ENDIF 196 196 197 ! print*,'thermcell_main debut'197 !PRINT*,'thermcell_main debut' 198 198 ! write(lunout,*)'WARNING thermcell_main f0=max(f0,1.e-2)' 199 199 do ig=1,ngrid … … 205 205 if (prt_level>=20) then 206 206 do ig=1,ngrid 207 print*,'th_main ig f0',ig,f0(ig)207 PRINT*,'th_main ig f0',ig,f0(ig) 208 208 enddo 209 209 endif … … 238 238 ! SUBROUTINE thermcell_env(ngrid,nlay,po,pt,pu,pv,pplay, & 239 239 ! & pplev,zo,zh,zl,ztv,zthl,zu,zv,zpspsk,pqsat,lev_out) 240 ! contenu thermcell_env : callthermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat)240 ! contenu thermcell_env : CALL thermcell_qsat(ngrid*nlay,mask,pplev,pt,po,pqsat) 241 241 ! contenu thermcell_env : do ll=1,nlay 242 242 ! contenu thermcell_env : do ig=1,ngrid … … 267 267 ztv(ig,l)=ztv(ig,l)*(1.+RETV*po_env(ig,l)) 268 268 zthl(ig,l)=ptemp(ig,l)/zpspsk(ig,l) 269 mask(ig,l)=. true.269 mask(ig,l)=.TRUE. 270 270 enddo 271 271 enddo 272 callthermcell_qsat(ngrid*nlay,mask,pplev,ptemp_env,p_o,zqsat)272 CALL thermcell_qsat(ngrid*nlay,mask,pplev,ptemp_env,p_o,zqsat) 273 273 274 274 endif 275 275 276 if (prt_level>=1) print*,'thermcell_main apres thermcell_env'276 if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_env' 277 277 278 278 !------------------------------------------------------------------------ … … 322 322 masse(:,l)=(pplev(:,l)-pplev(:,l+1))/RG 323 323 enddo 324 if (prt_level>=1) print*,'thermcell_main apres initialisation'324 if (prt_level>=1) PRINT*,'thermcell_main apres initialisation' 325 325 326 326 !------------------------------------------------------------------ … … 395 395 !-------------------------------------------------------------------------------- 396 396 397 if (prt_level>=1) print*,'avant thermcell_plume ',lev_out397 if (prt_level>=1) PRINT*,'avant thermcell_plume ',lev_out 398 398 399 399 !===================================================================== … … 412 412 413 413 if (iflag_thermals_ed<=9) then 414 ! print*,'THERM NOUVELLE/NOUVELLE Arnaud'414 ! PRINT*,'THERM NOUVELLE/NOUVELLE Arnaud' 415 415 CALL thermcell_plume_6A(itap,ngrid,nlay,ptimestep,ztv,zthl,p_o,zl,rhobarz,& 416 416 zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot, & … … 420 420 421 421 elseif (iflag_thermals_ed<=19) then 422 ! print*,'THERM RIO et al 2010, version d Arnaud'422 ! PRINT*,'THERM RIO et al 2010, version d Arnaud' 423 423 CALL thermcell_plume_5B(itap,ngrid,nlay,ptimestep,ztv,zthl,p_o,zl,rhobarz,& 424 424 zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot, & … … 434 434 endif 435 435 436 if (prt_level>=1) print*,'apres thermcell_plume ',lev_out437 438 calltest_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lalim ')439 calltest_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lmix ')440 441 if (prt_level>=1) print*,'thermcell_main apres thermcell_plume'436 if (prt_level>=1) PRINT*,'apres thermcell_plume ',lev_out 437 438 CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lalim ') 439 CALL test_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_plum lmix ') 440 441 if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_plume' 442 442 if (prt_level>=10) then 443 443 write(lunout1,*) 'Dans thermcell_main 2' … … 461 461 wmax_tmp(:)=max(wmax_tmp(:),zw2(:,l)) 462 462 enddo 463 ! print*,"ZMAX ",lalim,lmin,linter,lmix,lmax,zmax,zmax0,zmix,wmax464 465 466 467 calltest_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lalim ')468 calltest_ltherm(ngrid,nlay,pplay,lmin ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmin ')469 calltest_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmix ')470 calltest_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmax ')471 472 if (prt_level>=1) print*,'thermcell_main apres thermcell_height'463 ! PRINT*,"ZMAX ",lalim,lmin,linter,lmix,lmax,zmax,zmax0,zmix,wmax 464 465 466 467 CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lalim ') 468 CALL test_ltherm(ngrid,nlay,pplay,lmin ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmin ') 469 CALL test_ltherm(ngrid,nlay,pplay,lmix ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmix ') 470 CALL test_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_heig lmax ') 471 472 if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_height' 473 473 474 474 !------------------------------------------------------------------------------- … … 481 481 482 482 483 calltest_ltherm(ngrid,nlay,pplay,lmin,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry lmin ')484 calltest_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry lalim ')485 486 if (prt_level>=1) print*,'thermcell_main apres thermcell_dry'483 CALL test_ltherm(ngrid,nlay,pplay,lmin,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry lmin ') 484 CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_dry lalim ') 485 486 if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_dry' 487 487 if (prt_level>=10) then 488 488 write(lunout1,*) 'Dans thermcell_main 1b' … … 521 521 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 522 522 523 if(prt_level>=1) print*,'thermcell_closure apres thermcell_closure'523 if(prt_level>=1)PRINT*,'thermcell_closure apres thermcell_closure' 524 524 525 525 if (tau_thermals>1.) then … … 546 546 !IM 060508 & detr,zqla,zmax,lev_out,lunout,igout) 547 547 548 if (prt_level>=1) print*,'thermcell_main apres thermcell_flux'549 calltest_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lalim ')550 calltest_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lmax ')548 if (prt_level>=1) PRINT*,'thermcell_main apres thermcell_flux' 549 CALL test_ltherm(ngrid,nlay,pplay,lalim,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lalim ') 550 CALL test_ltherm(ngrid,nlay,pplay,lmax ,ztv,p_o,ztva,zqla,f_star,zw2,'thermcell_flux lmax ') 551 551 552 552 !------------------------------------------------------------------ … … 588 588 !------------------------------------------------------------------ 589 589 IF (iflag_thermals_down > 0) THEN 590 if (debut) print*,'WARNING !!! routine thermcell_down en cours de developpement'590 if (debut) PRINT*,'WARNING !!! routine thermcell_down en cours de developpement' 591 591 entrdn=fact_thermals_down*detr0 592 592 detrdn=fact_thermals_down*entr0 … … 605 605 enddo 606 606 enddo 607 callthermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, &607 CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, & 608 608 zthl,zdthladj,zta,lev_out) 609 609 … … 613 613 enddo 614 614 enddo 615 callthermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, &615 CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, & 616 616 z_o,pdoadj,z_oa,lev_out) 617 617 … … 625 625 enddo 626 626 enddo 627 callthermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, &627 CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse, & 628 628 xtpo_tmp,xtpdoadj_tmp,xtzo_tmp,lev_out) 629 629 do ll=1,nlay … … 640 640 DO ig=1,ngrid 641 641 if (iso_eau.gt.0) then 642 calliso_verif_egalite(xtpo(iso_eau,ig,ll), &642 CALL iso_verif_egalite(xtpo(iso_eau,ig,ll), & 643 643 p_o(ig,ll),'thermcell_main 594') 644 calliso_verif_egalite(xtpdoadj(iso_eau,ig,ll), &644 CALL iso_verif_egalite(xtpdoadj(iso_eau,ig,ll), & 645 645 pdoadj(ig,ll),'thermcell_main 596') 646 646 endif 647 647 if (iso_HDO.gt.0) then 648 calliso_verif_aberrant_encadre(xtpo(iso_hdo,ig,ll) &648 CALL iso_verif_aberrant_encadre(xtpo(iso_hdo,ig,ll) & 649 649 /p_o(ig,ll),'thermcell_main 610') 650 650 endif … … 666 666 ! de pression horizontal avec l'environnement 667 667 668 callthermcell_dv2(ngrid,nlay,ptimestep,fm0,entr0,masse &668 CALL thermcell_dv2(ngrid,nlay,ptimestep,fm0,entr0,masse & 669 669 ! & ,fraca*dvdq,zmax & 670 670 ,fraca,zmax & … … 674 674 675 675 ! calcul purement conservatif pour le transport de V 676 callthermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse &676 CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse & 677 677 ,zu,pduadj,zua,lev_out) 678 callthermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse &678 CALL thermcell_dq(ngrid,nlay,dqimpl,ptimestep,fm0,entr0,masse & 679 679 ,zv,pdvadj,zva,lev_out) 680 680 … … 682 682 ENDIF 683 683 684 ! print*,'13 OK convect8'684 ! PRINT*,'13 OK convect8' 685 685 do l=1,nlay 686 686 do ig=1,ngrid … … 689 689 enddo 690 690 691 if (prt_level>=1) print*,'14 OK convect8'691 if (prt_level>=1) PRINT*,'14 OK convect8' 692 692 !------------------------------------------------------------------ 693 693 ! Calculs de diagnostiques pour les sorties … … 696 696 697 697 if (sorties) then 698 if (prt_level>=1) print*,'14a OK convect8'698 if (prt_level>=1) PRINT*,'14a OK convect8' 699 699 ! calcul du niveau de condensation 700 700 ! initialisation … … 731 731 ! endif 732 732 733 if (prt_level>=1) print*,'14b OK convect8'733 if (prt_level>=1) PRINT*,'14b OK convect8' 734 734 do k=nlay,1,-1 735 735 do ig=1,ngrid … … 740 740 enddo 741 741 enddo 742 if (prt_level>=1) print*,'14c OK convect8'742 if (prt_level>=1) PRINT*,'14c OK convect8' 743 743 !calcul des moments 744 744 !initialisation … … 752 752 enddo 753 753 enddo 754 if (prt_level>=1) print*,'14d OK convect8'754 if (prt_level>=1) PRINT*,'14d OK convect8' 755 755 if (prt_level>=10)write(lunout,*) & 756 756 'WARNING thermcell_main wth2=0. si zw2 > 1.e-10' … … 783 783 784 784 !calcul du ratqscdiff 785 if (prt_level>=1) print*,'14e OK convect8'785 if (prt_level>=1) PRINT*,'14e OK convect8' 786 786 var=0. 787 787 vardiff=0. … … 796 796 enddo 797 797 798 if (prt_level>=1) print*,'14f OK convect8'798 if (prt_level>=1) PRINT*,'14f OK convect8' 799 799 800 800 do l=1,nlay … … 808 808 enddo 809 809 810 if (prt_level>=1) print*,'14g OK convect8'810 if (prt_level>=1) PRINT*,'14g OK convect8' 811 811 do l=1,nlay 812 812 do ig=1,ngrid … … 816 816 endif 817 817 818 if (prt_level>=1) print*,'thermcell_main FIN OK'819 820 ! print*,'thermcell_main fin'818 if (prt_level>=1) PRINT*,'thermcell_main FIN OK' 819 820 !PRINT*,'thermcell_main fin' 821 821 RETURN 822 end subroutinethermcell_main822 END SUBROUTINE thermcell_main 823 823 824 824 !============================================================================= 825 825 !///////////////////////////////////////////////////////////////////////////// 826 826 !============================================================================= 827 subroutinetest_ltherm(ngrid,nlay,pplay,long,ztv,p_o,ztva, & ! in827 SUBROUTINE test_ltherm(ngrid,nlay,pplay,long,ztv,p_o,ztva, & ! in 828 828 zqla,f_star,zw2,comment) ! in 829 829 !============================================================================= … … 841 841 842 842 if (prt_level>=1) THEN 843 print*,'WARNING !!! TEST ',comment843 PRINT*,'WARNING !!! TEST ',comment 844 844 endif 845 845 return … … 849 849 !IMtemp if (pplay(i,long(i)).lt.seuil*pplev(i,1)) then 850 850 if (prt_level>=10) then 851 print*,'WARNING ',comment,' au point ',i,' K= ',long(i)852 print*,' K P(MB) THV(K) Qenv(g/kg)THVA QLA(g/kg) F* W2'851 PRINT*,'WARNING ',comment,' au point ',i,' K= ',long(i) 852 PRINT*,' K P(MB) THV(K) Qenv(g/kg)THVA QLA(g/kg) F* W2' 853 853 do k=1,nlay 854 854 write(6,'(i3,7f10.3)') k,pplay(i,k),ztv(i,k),1000*p_o(i,k),ztva(i,k),1000*zqla(i,k),f_star(i,k),zw2(i,k) … … 863 863 ! nrlmd le 10/04/2012 Transport de la TKE par le thermique moyen pour la fermeture en ALP 864 864 ! On transporte pbl_tke pour donner therm_tke 865 ! Copie conforme de la subroutineDTKE dans physiq.F ecrite par Frederic Hourdin865 ! Copie conforme de la SUBROUTINE DTKE dans physiq.F ecrite par Frederic Hourdin 866 866 867 867 !======================================================================= … … 869 869 !======================================================================= 870 870 871 subroutinethermcell_tke_transport( &871 SUBROUTINE thermcell_tke_transport( & 872 872 ngrid,nlay,ptimestep,fm0,entr0,rg,pplev, & ! in 873 873 therm_tke_max) ! out … … 905 905 906 906 907 if (prt_level>=1) print*,'Q2 THERMCEL_DQ 0'907 if (prt_level>=1) PRINT*,'Q2 THERMCEL_DQ 0' 908 908 909 909 ! calcul du detrainement … … 946 946 endif 947 947 if (qa(ig,k)<0.) then 948 ! print*,'qa<0!!!'948 ! PRINT*,'qa<0!!!' 949 949 endif 950 950 if (q(ig,k)<0.) then 951 ! print*,'q<0!!!'951 ! PRINT*,'q<0!!!' 952 952 endif 953 953 enddo … … 960 960 wqd(ig,k)=fm(ig,k)*q(ig,k) 961 961 if (wqd(ig,k)<0.) then 962 ! print*,'wqd<0!!!'962 ! PRINT*,'wqd<0!!!' 963 963 endif 964 964 enddo
Note: See TracChangeset
for help on using the changeset viewer.