- Timestamp:
- Oct 10, 2025, 3:57:59 PM (2 months ago)
- Location:
- LMDZ6/trunk/libf/phylmd
- Files:
-
- 1 added
- 1 edited
-
lmdz_thermcell_plume_5B.f90 (added)
-
lmdz_thermcell_plume_6A.f90 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/lmdz_thermcell_plume_6A.f90
r5620 r5852 684 684 RETURN 685 685 END SUBROUTINE thermcell_plume_6A 686 687 688 689 690 691 692 693 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!694 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!695 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!696 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!697 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!698 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!699 SUBROUTINE thermcell_plume_5B(itap,ngrid,nlay,ptimestep,ztv,zthl,po,zl,rhobarz, &700 & zlev,pplev,pphi,zpspsk,alim_star,alim_star_tot, &701 & lalim,f0,detr_star,entr_star,f_star,csc,ztva, &702 & ztla,zqla,zqta,zha,zw2,w_est,ztva_est,zqsatth,lmix,lmix_bis,linter &703 & ,lev_out,lunout1,igout)704 !& ,lev_out,lunout1,igout,zbuoy,zbuoyjam)705 706 !--------------------------------------------------------------------------707 !thermcell_plume: calcule les valeurs de qt, thetal et w dans l ascendance708 ! Version conforme a l'article de Rio et al. 2010.709 ! Code ecrit par Catherine Rio, Arnaud Jam et Frederic Hourdin710 !--------------------------------------------------------------------------711 712 USE lmdz_thermcell_ini, ONLY: prt_level,fact_thermals_ed_dz,iflag_thermals_ed,RLvCP,RETV,RG713 USE lmdz_thermcell_qsat, ONLY : thermcell_qsat714 IMPLICIT NONE715 716 INTEGER itap717 INTEGER lunout1,igout718 INTEGER ngrid,nlay719 REAL ptimestep720 REAL ztv(ngrid,nlay)721 REAL zthl(ngrid,nlay)722 REAL, INTENT(IN) :: po(ngrid,nlay)723 REAL zl(ngrid,nlay)724 REAL rhobarz(ngrid,nlay)725 REAL zlev(ngrid,nlay+1)726 REAL pplev(ngrid,nlay+1)727 REAL pphi(ngrid,nlay)728 REAL zpspsk(ngrid,nlay)729 REAL alim_star(ngrid,nlay)730 REAL f0(ngrid)731 INTEGER lalim(ngrid)732 integer lev_out ! niveau pour les print733 integer nbpb734 735 real alim_star_tot(ngrid)736 737 REAL ztva(ngrid,nlay)738 REAL ztla(ngrid,nlay)739 REAL zqla(ngrid,nlay)740 REAL zqta(ngrid,nlay)741 REAL zha(ngrid,nlay)742 743 REAL detr_star(ngrid,nlay)744 REAL coefc745 REAL entr_star(ngrid,nlay)746 REAL detr(ngrid,nlay)747 REAL entr(ngrid,nlay)748 749 REAL csc(ngrid,nlay)750 751 REAL zw2(ngrid,nlay+1)752 REAL w_est(ngrid,nlay+1)753 REAL f_star(ngrid,nlay+1)754 REAL wa_moy(ngrid,nlay+1)755 756 REAL ztva_est(ngrid,nlay)757 REAL zqla_est(ngrid,nlay)758 REAL zqsatth(ngrid,nlay)759 REAL zta_est(ngrid,nlay)760 REAL zbuoyjam(ngrid,nlay)761 REAL ztemp(ngrid),zqsat(ngrid)762 REAL zdw2763 REAL zw2modif764 REAL zw2fact765 REAL zeps(ngrid,nlay)766 767 REAL linter(ngrid)768 INTEGER lmix(ngrid)769 INTEGER lmix_bis(ngrid)770 REAL wmaxa(ngrid)771 772 INTEGER ig,l,k773 774 real zdz,zbuoy(ngrid,nlay),zalpha,gamma(ngrid,nlay),zdqt(ngrid,nlay),zw2m775 real zbuoybis776 real zcor,zdelta,zcvm5,qlbef,zdz2777 real betalpha,zbetalpha778 real eps, afact779 logical Zsat780 LOGICAL active(ngrid),activetmp(ngrid)781 REAL fact_gamma,fact_epsilon,fact_gamma2,fact_epsilon2782 REAL c2(ngrid,nlay)783 Zsat=.false.784 ! Initialisation785 786 fact_epsilon=0.002787 betalpha=0.9788 afact=2./3.789 790 zbetalpha=betalpha/(1.+betalpha)791 792 793 ! Initialisations des variables reeles794 if (1==1) then795 ztva(:,:)=ztv(:,:)796 ztva_est(:,:)=ztva(:,:)797 ztla(:,:)=zthl(:,:)798 zqta(:,:)=po(:,:)799 zha(:,:) = ztva(:,:)800 else801 ztva(:,:)=0.802 ztva_est(:,:)=0.803 ztla(:,:)=0.804 zqta(:,:)=0.805 zha(:,:) =0.806 endif807 808 zqla_est(:,:)=0.809 zqsatth(:,:)=0.810 zqla(:,:)=0.811 detr_star(:,:)=0.812 entr_star(:,:)=0.813 alim_star(:,:)=0.814 alim_star_tot(:)=0.815 csc(:,:)=0.816 detr(:,:)=0.817 entr(:,:)=0.818 zw2(:,:)=0.819 zbuoy(:,:)=0.820 zbuoyjam(:,:)=0.821 gamma(:,:)=0.822 zeps(:,:)=0.823 w_est(:,:)=0.824 f_star(:,:)=0.825 wa_moy(:,:)=0.826 linter(:)=1.827 ! linter(:)=1.828 ! Initialisation des variables entieres829 lmix(:)=1830 lmix_bis(:)=2831 wmaxa(:)=0.832 lalim(:)=1833 834 835 !-------------------------------------------------------------------------836 ! On ne considere comme actif que les colonnes dont les deux premieres837 ! couches sont instables.838 !-------------------------------------------------------------------------839 active(:)=ztv(:,1)>ztv(:,2)840 841 !-------------------------------------------------------------------------842 ! Definition de l'alimentation843 !-------------------------------------------------------------------------844 do l=1,nlay-1845 do ig=1,ngrid846 if (ztv(ig,l)> ztv(ig,l+1) .and. ztv(ig,1)>=ztv(ig,l) ) then847 alim_star(ig,l)=MAX((ztv(ig,l)-ztv(ig,l+1)),0.) &848 & *sqrt(zlev(ig,l+1))849 lalim(ig)=l+1850 alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,l)851 endif852 enddo853 enddo854 do l=1,nlay855 do ig=1,ngrid856 if (alim_star_tot(ig) > 1.e-10 ) then857 alim_star(ig,l)=alim_star(ig,l)/alim_star_tot(ig)858 endif859 enddo860 enddo861 alim_star_tot(:)=1.862 863 864 865 !------------------------------------------------------------------------------866 ! Calcul dans la premiere couche867 ! On decide dans cette version que le thermique n'est actif que si la premiere868 ! couche est instable.869 ! Pourrait etre change si on veut que le thermiques puisse se d??clencher870 ! dans une couche l>1871 !------------------------------------------------------------------------------872 do ig=1,ngrid873 ! Le panache va prendre au debut les caracteristiques de l'air contenu874 ! dans cette couche.875 if (active(ig)) then876 ztla(ig,1)=zthl(ig,1)877 zqta(ig,1)=po(ig,1)878 zqla(ig,1)=zl(ig,1)879 !cr: attention, prise en compte de f*(1)=1880 f_star(ig,2)=alim_star(ig,1)881 zw2(ig,2)=2.*RG*(ztv(ig,1)-ztv(ig,2))/ztv(ig,2) &882 & *(zlev(ig,2)-zlev(ig,1)) &883 & *0.4*pphi(ig,1)/(pphi(ig,2)-pphi(ig,1))884 w_est(ig,2)=zw2(ig,2)885 endif886 enddo887 !888 889 !==============================================================================890 !boucle de calcul de la vitesse verticale dans le thermique891 !==============================================================================892 do l=2,nlay-1893 !==============================================================================894 895 896 ! On decide si le thermique est encore actif ou non897 ! AFaire : Il faut sans doute ajouter entr_star a alim_star dans ce test898 do ig=1,ngrid899 active(ig)=active(ig) &900 & .and. zw2(ig,l)>1.e-10 &901 & .and. f_star(ig,l)+alim_star(ig,l)>1.e-10902 enddo903 904 905 906 !---------------------------------------------------------------------------907 ! calcul des proprietes thermodynamiques et de la vitesse de la couche l908 ! sans tenir compte du detrainement et de l'entrainement dans cette909 ! couche910 ! C'est a dire qu'on suppose911 ! ztla(l)=ztla(l-1) et zqta(l)=zqta(l-1)912 ! Ici encore, on doit pouvoir ajouter entr_star (qui peut etre calculer913 ! avant) a l'alimentation pour avoir un calcul plus propre914 !---------------------------------------------------------------------------915 916 ztemp(:)=zpspsk(:,l)*ztla(:,l-1)917 call thermcell_qsat(ngrid, 1, active,pplev(:,l),ztemp,zqta(:,l-1),zqsat(:))918 919 do ig=1,ngrid920 ! print*,'active',active(ig),ig,l921 if(active(ig)) then922 zqla_est(ig,l)=max(0.,zqta(ig,l-1)-zqsat(ig))923 ztva_est(ig,l) = ztla(ig,l-1)*zpspsk(ig,l)+RLvCp*zqla_est(ig,l)924 zta_est(ig,l)=ztva_est(ig,l)925 ztva_est(ig,l) = ztva_est(ig,l)/zpspsk(ig,l)926 ztva_est(ig,l) = ztva_est(ig,l)*(1.+RETV*(zqta(ig,l-1) &927 & -zqla_est(ig,l))-zqla_est(ig,l))928 929 !------------------------------------------------930 !AJAM:nouveau calcul de w?931 !------------------------------------------------932 zdz=zlev(ig,l+1)-zlev(ig,l)933 zbuoy(ig,l)=RG*(ztva_est(ig,l)-ztv(ig,l))/ztv(ig,l)934 935 zw2fact=fact_epsilon*2.*zdz/(1.+betalpha)936 zdw2=(afact)*zbuoy(ig,l)/(fact_epsilon)937 w_est(ig,l+1)=Max(0.0001,exp(-zw2fact)*(w_est(ig,l)-zdw2)+zdw2)938 939 940 if (w_est(ig,l+1).lt.0.) then941 w_est(ig,l+1)=zw2(ig,l)942 endif943 endif944 enddo945 946 947 !-------------------------------------------------948 !calcul des taux d'entrainement et de detrainement949 !-------------------------------------------------950 951 do ig=1,ngrid952 if (active(ig)) then953 954 zw2m=max(0.5*(w_est(ig,l)+w_est(ig,l+1)),0.1)955 zw2m=w_est(ig,l+1)956 zdz=zlev(ig,l+1)-zlev(ig,l)957 zbuoy(ig,l)=RG*(ztva_est(ig,l)-ztv(ig,l))/ztv(ig,l)958 ! zbuoybis=zbuoy(ig,l)+RG*0.1/300.959 zbuoybis=zbuoy(ig,l)960 zalpha=f0(ig)*f_star(ig,l)/sqrt(w_est(ig,l+1))/rhobarz(ig,l)961 zdqt(ig,l)=max(zqta(ig,l-1)-po(ig,l),0.)/po(ig,l)962 963 964 entr_star(ig,l)=f_star(ig,l)*zdz* zbetalpha*MAX(0., &965 & afact*zbuoybis/zw2m - fact_epsilon )966 967 968 detr_star(ig,l)=f_star(ig,l)*zdz &969 & *MAX(1.e-3, -afact*zbetalpha*zbuoy(ig,l)/zw2m &970 & + 0.012*(zdqt(ig,l)/zw2m)**0.5 )971 972 ! En dessous de lalim, on prend le max de alim_star et entr_star pour973 ! alim_star et 0 sinon974 if (l.lt.lalim(ig)) then975 alim_star(ig,l)=max(alim_star(ig,l),entr_star(ig,l))976 entr_star(ig,l)=0.977 endif978 979 ! Calcul du flux montant normalise980 f_star(ig,l+1)=f_star(ig,l)+alim_star(ig,l)+entr_star(ig,l) &981 & -detr_star(ig,l)982 983 endif984 enddo985 986 987 !----------------------------------------------------------------------------988 !calcul de la vitesse verticale en melangeant Tl et qt du thermique989 !---------------------------------------------------------------------------990 activetmp(:)=active(:) .and. f_star(:,l+1)>1.e-10991 do ig=1,ngrid992 if (activetmp(ig)) then993 Zsat=.false.994 ztla(ig,l)=(f_star(ig,l)*ztla(ig,l-1)+ &995 & (alim_star(ig,l)+entr_star(ig,l))*zthl(ig,l)) &996 & /(f_star(ig,l+1)+detr_star(ig,l))997 zqta(ig,l)=(f_star(ig,l)*zqta(ig,l-1)+ &998 & (alim_star(ig,l)+entr_star(ig,l))*po(ig,l)) &999 & /(f_star(ig,l+1)+detr_star(ig,l))1000 1001 endif1002 enddo1003 1004 ztemp(:)=zpspsk(:,l)*ztla(:,l)1005 call thermcell_qsat(ngrid, 1, activetmp,pplev(:,l),ztemp,zqta(:,l),zqsatth(:,l))1006 1007 do ig=1,ngrid1008 if (activetmp(ig)) then1009 ! on ecrit de maniere conservative (sat ou non)1010 ! T = Tl +Lv/Cp ql1011 zqla(ig,l)=max(0.,zqta(ig,l)-zqsatth(ig,l))1012 ztva(ig,l) = ztla(ig,l)*zpspsk(ig,l)+RLvCp*zqla(ig,l)1013 ztva(ig,l) = ztva(ig,l)/zpspsk(ig,l)1014 !on rajoute le calcul de zha pour diagnostiques (temp potentielle)1015 zha(ig,l) = ztva(ig,l)1016 ztva(ig,l) = ztva(ig,l)*(1.+RETV*(zqta(ig,l) &1017 & -zqla(ig,l))-zqla(ig,l))1018 zbuoy(ig,l)=RG*(ztva(ig,l)-ztv(ig,l))/ztv(ig,l)1019 zdz=zlev(ig,l+1)-zlev(ig,l)1020 zeps(ig,l)=(entr_star(ig,l)+alim_star(ig,l))/(f_star(ig,l)*zdz)1021 1022 zw2fact=fact_epsilon*2.*zdz/(1.+betalpha)1023 zdw2=afact*zbuoy(ig,l)/(fact_epsilon)1024 zw2(ig,l+1)=Max(0.0001,exp(-zw2fact)*(zw2(ig,l)-zdw2)+zdw2)1025 endif1026 enddo1027 1028 if (prt_level.ge.20) print*,'coucou calcul detr 460: ig, l',ig, l1029 !1030 !---------------------------------------------------------------------------1031 !initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max1032 !---------------------------------------------------------------------------1033 1034 nbpb=01035 do ig=1,ngrid1036 if (zw2(ig,l+1)>0. .and. zw2(ig,l+1).lt.1.e-10) then1037 ! stop'On tombe sur le cas particulier de thermcell_dry'1038 ! print*,'On tombe sur le cas particulier de thermcell_plume'1039 nbpb=nbpb+11040 zw2(ig,l+1)=0.1041 linter(ig)=l+11042 endif1043 1044 if (zw2(ig,l+1).lt.0.) then1045 linter(ig)=(l*(zw2(ig,l+1)-zw2(ig,l)) &1046 & -zw2(ig,l))/(zw2(ig,l+1)-zw2(ig,l))1047 zw2(ig,l+1)=0.1048 elseif (f_star(ig,l+1).lt.0.) then1049 linter(ig)=(l*(f_star(ig,l+1)-f_star(ig,l)) &1050 & -f_star(ig,l))/(f_star(ig,l+1)-f_star(ig,l))1051 ! print*,"linter plume", linter(ig)1052 zw2(ig,l+1)=0.1053 endif1054 1055 wa_moy(ig,l+1)=sqrt(zw2(ig,l+1))1056 1057 if (wa_moy(ig,l+1).gt.wmaxa(ig)) then1058 ! lmix est le niveau de la couche ou w (wa_moy) est maximum1059 !on rajoute le calcul de lmix_bis1060 if (zqla(ig,l).lt.1.e-10) then1061 lmix_bis(ig)=l+11062 endif1063 lmix(ig)=l+11064 wmaxa(ig)=wa_moy(ig,l+1)1065 endif1066 enddo1067 1068 if (nbpb>0) then1069 print*,'WARNING on tombe ',nbpb,' x sur un pb pour l=',l,' dans thermcell_plume'1070 endif1071 1072 !=========================================================================1073 ! FIN DE LA BOUCLE VERTICALE1074 enddo1075 !=========================================================================1076 1077 !on recalcule alim_star_tot1078 do ig=1,ngrid1079 alim_star_tot(ig)=0.1080 enddo1081 do ig=1,ngrid1082 do l=1,lalim(ig)-11083 alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,l)1084 enddo1085 enddo1086 1087 1088 if (prt_level.ge.20) print*,'coucou calcul detr 470: ig, l', ig, l1089 1090 return1091 END SUBROUTINE thermcell_plume_5B1092 END MODULE lmdz_thermcell_plume_6A
Note: See TracChangeset
for help on using the changeset viewer.
