- Timestamp:
- Jul 22, 2024, 9:29:09 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90
r5087 r5099 57 57 !jyg< 58 58 ! noff is chosen such that nl = k_upper so that upmost loops end at about 22 km 59 ! 59 60 60 noff = min(max(nd-k_upper, 1), (nd+1)/2) 61 61 !! noff = 1 … … 1616 1616 qnk(i)*(lv0-clmcpv*(tnk(i)-273.15)) + gznk(i) 1617 1617 END DO 1618 ! 1618 1619 1619 ! Ice fraction 1620 ! 1620 1621 1621 IF (cvflag_ice) THEN 1622 1622 DO k = minorig, nl … … 1686 1686 END DO 1687 1687 !>jyg 1688 !1689 1688 1690 1689 ! *** Find lifted parcel quantities above cloud base *** 1691 1690 1692 1691 !---------------------------------------------------------------------------- 1693 ! 1692 1694 1693 IF (icvflag_Tpa == 2) THEN 1695 1694 #ifdef ISO 1696 1695 CALL abort_gcm('cv3_routines 1813','isos pas prevus ici',1) 1697 1696 #endif 1698 ! 1697 1699 1698 !---------------------------------------------------------------------------- 1700 ! 1699 1701 1700 DO k = minorig + 1, nl 1702 1701 DO i = 1,ncum … … 1774 1773 Ux* (ah0(i) - ahg - ddelta) /aa 1775 1774 ENDIF ! (tg .gt. Tx) 1776 ! 1775 1777 1776 !! print *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta 1778 1777 !! print *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff … … 1802 1801 END DO ! k = minorig + 1, nl 1803 1802 !---------------------------------------------------------------------------- 1804 ! 1803 1805 1804 ELSE IF (icvflag_Tpa == 1) THEN ! (icvflag_Tpa == 2) 1806 ! 1805 1807 1806 !---------------------------------------------------------------------------- 1808 ! 1807 1809 1808 #ifdef ISO 1810 1809 CALL abort_gcm('cv3_routines 1813','isos pas prevus ici',1) … … 1872 1871 END IF ! (k>=(icbs(i)+1)) 1873 1872 END DO ! i = 1, ncum 1874 ! 1873 1875 1874 IF (cvflag_prec_eject) THEN 1876 1875 #ifdef ISO … … 1898 1897 ! ejection. 1899 1898 ! ===================================================================================== 1900 ! 1899 1901 1900 ! Verif 1902 1901 qpreca(i,k) = ejectliq*qpl(i,k) + ejectice*qps(i,k) !!jygprl … … 1904 1903 frac_s(i,k) = (1.-ejectliq)*frac(i,k) + & !!jygprl 1905 1904 ejectliq*(1. - (qpl(i,k)+(1.-frac(i,k))*qcld(i,k))/max(clw(i,k),smallestreal)) !!jygprl 1906 ! 1905 1907 1906 denomm1 = 1./(1. - qpreca(i,k)) 1908 ! 1907 1909 1908 qta(i,k) = qta(i,k-1) - & 1910 1909 qpreca(i,k)*(1.-qta(i,k-1))*denomm1 … … 1925 1924 END DO ! i = 1, ncum 1926 1925 ENDIF ! (cvflag_prec_eject) 1927 ! 1926 1928 1927 END DO ! k = minorig + 1, nl 1929 ! 1928 1930 1929 !---------------------------------------------------------------------------- 1931 ! 1930 1932 1931 ELSE IF (icvflag_Tpa == 0) THEN! (icvflag_Tpa == 2) ELSE IF(icvflag_Tpa == 1) 1933 ! 1932 1934 1933 !---------------------------------------------------------------------------- 1935 ! 1934 1936 1935 DO k = minorig + 1, nl 1937 1936 DO i = 1, ncum … … 2160 2159 2161 2160 !---------------------------------------------------------------------------- 2162 ! 2161 2163 2162 ENDIF ! (icvflag_Tpa == 2) ELSEIF (icvflag_Tpa == 1) ELSE (icvflag_Tpa == 0) 2164 2163 #ifdef ISOVERIF … … 2170 2169 enddo 2171 2170 #endif 2172 ! 2171 2173 2172 !---------------------------------------------------------------------------- 2174 ! 2173 2175 2174 ! ===================================================================== 2176 2175 ! --- SET THE PRECIPITATION EFFICIENCIES 2177 2176 ! --- THESE MAY BE FUNCTIONS OF TP(I), P(I) AND CLW(I) 2178 2177 ! ===================================================================== 2179 ! 2178 2180 2179 IF (flag_epkeorig/=1) THEN 2181 2180 DO k = 1, nl ! convect3 … … 2213 2212 END DO 2214 2213 END IF 2215 ! 2214 2216 2215 ! ========================================================================= 2217 2216 IF (prt_level >= 10) THEN … … 2219 2218 (k, tp(1,k), tvp(1,k), k = 1,nl) 2220 2219 ENDIF 2221 ! 2220 2222 2221 ! ===================================================================== 2223 2222 ! --- CALCULATE VIRTUAL TEMPERATURE AND LIFTED PARCEL … … 2451 2450 2452 2451 !jyg : cvflag_ice test outside the loops (07042015) 2453 ! 2452 2454 2453 IF (cvflag_ice) THEN 2455 ! 2454 2456 2455 IF (cvflag_prec_eject) THEN 2457 2456 !! DO k = minorig + 1, nl … … 2485 2484 END DO 2486 2485 END DO 2487 ! 2486 2488 2487 ELSE ! (cvflag_ice) 2489 ! 2488 2490 2489 DO k = minorig + 1, nl 2491 2490 DO i = 1, ncum … … 2501 2500 END DO 2502 2501 END DO 2503 ! 2502 2504 2503 END IF ! (cvflag_ice) 2505 2504 … … 2514 2513 ! =================================================================== 2515 2514 ! --- CLOSURE OF CONVECT3 2516 ! 2515 2517 2516 ! vectorization: S. Bony 2518 2517 ! =================================================================== … … 3820 3819 END DO 3821 3820 3822 !3823 3821 ! Get adiabatic ascent mass flux 3824 ! 3822 3825 3823 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 3826 3824 IF (adiab_ascent_mass_flux_depends_on_ejectliq) THEN … … 3857 3855 3858 3856 ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3859 ! 3857 3860 3858 ! *** begin downdraft loop *** 3861 ! 3859 3862 3860 ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3863 3861 … … 3878 3876 ! *** integrate liquid water equation to find condensed water *** 3879 3877 ! *** and condensed water flux *** 3880 ! 3881 ! 3878 3879 3882 3880 ! *** calculate detrained precipitation *** 3883 3881 … … 4088 4086 bfac = 1./(sigd(il)*wt(il,i)) 4089 4087 4090 !4091 4088 IF (prt_level >= 20) THEN 4092 4089 Print*, 'cv3_unsat after provisional rp estimate: rp, afac, bfac ', & 4093 4090 i, rp(1, i), afac,bfac 4094 4091 ENDIF 4095 ! 4092 4096 4093 !JYG1 4097 4094 ! cc sigt=1.0 … … 4171 4168 evap(il, i) = (wdtrain(il)+sigd(il)*wt(il,i)*(prec(il,i+1)-prec(il,i))) / & 4172 4169 (sigd(il)*(ph(il,i)-ph(il,i+1))*100.) 4173 ! 4170 4174 4171 IF (prt_level >= 20) THEN 4175 4172 Print*, 'cv3_unsat after evap computation: wdtrain, sigd, wt, prec(i+1),prec(i) ', & 4176 4173 i, wdtrain(1), sigd(1), wt(1,i), prec(1,i+1),prec(1,i) 4177 4174 ENDIF 4178 !4179 4175 4180 4176 !jyg< … … 4403 4399 END DO 4404 4400 ! ---------------------------------------------------------------- 4405 ! 4401 4406 4402 IF (prt_level >= 20) THEN 4407 4403 Print*, 'cv3_unsat after mp computation: mp, b(i), b(i-1) ', & 4408 4404 i, mp(1, i), b(1,i), b(1,max(i-1,1)) 4409 4405 ENDIF 4410 !4411 4406 4412 4407 ! *** find mixing ratio of precipitating downdraft *** … … 4766 4761 REAL, DIMENSION (ntraciso,nloc, na), INTENT (IN) :: xtice 4767 4762 #endif 4768 ! 4763 4769 4764 !input/output: 4770 4765 REAL, DIMENSION (nloc, na), INTENT (INOUT) :: m, mp … … 4773 4768 REAL, DIMENSION (nloc, nd), INTENT (INOUT) :: sig 4774 4769 REAL, DIMENSION (nloc), INTENT (INOUT) :: sigd 4775 ! 4770 4776 4771 !outputs: 4777 4772 REAL, DIMENSION (nloc), INTENT (OUT) :: precip … … 4794 4789 real, DIMENSION (ntraciso,nloc, nd+1), INTENT (OUT) :: xtVprecip, xtVprecipi 4795 4790 #endif 4796 ! 4791 4797 4792 !local variables: 4798 4793 INTEGER :: i, k, il, n, j, num1 … … 4863 4858 #endif 4864 4859 #endif 4865 ! 4860 4866 4861 ! ------------------------------------------------------------- 4867 4862 … … 5134 5129 ENDIF ! (adiab_ascent_mass_flux_depends_on_ejectliq) ELSE 5135 5130 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 5136 ! 5131 5137 5132 ! print*,'cv3_yield avant ft' 5138 5133 ! am is the part of cbmf taken from the first level … … 5408 5403 IF (ok_optim_yield) THEN !| 5409 5404 !----------------------------------------------------------- 5410 ! 5405 5411 5406 !*** *** 5412 5407 !*** Compute convective mass fluxes upwd and dnwd *** 5413 5408 5414 !5415 5409 ! ================================================= 5416 5410 ! upward fluxes | 5417 5411 ! ------------------------------------------------ 5418 ! 5412 5419 5413 upwd(:,:) = 0. 5420 5414 up_to(:,:) = 0. 5421 5415 up_from(:,:) = 0. 5422 ! 5416 5423 5417 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 5424 5418 IF (adiab_ascent_mass_flux_depends_on_ejectliq) THEN … … 5428 5422 !! WARNING : in the present version, taking into account the mass-flux decrease due to 5429 5423 !! precipitation ejection leads to water conservation violation. 5430 ! 5424 5431 5425 ! - Upward mass flux of mixed draughts 5432 5426 !--------------------------------------- … … 5440 5434 ENDDO 5441 5435 ENDDO 5442 ! 5436 5443 5437 DO j = 3, nl 5444 5438 DO i = 2, j-1 … … 5450 5444 ENDDO 5451 5445 ENDDO 5452 ! 5446 5453 5447 ! The difference between upwd(il,i) and upwd(il,i-1) is due to updrafts ending in layer 5454 5448 !(i-1) (theses drafts cross interface (i-1) but not interface(i)) and to updrafts starting 5455 5449 !from layer (i-1) (theses drafts cross interface (i) but not interface(i-1)): 5456 ! 5450 5457 5451 DO i = 2, nlp 5458 5452 DO il = 1, ncum … … 5462 5456 ENDDO 5463 5457 ENDDO 5464 ! 5458 5465 5459 ! - Total upward mass flux 5466 5460 !--------------------------- … … 5477 5471 !! The decrease of the adiabatic ascent mass flux due to ejection of precipitation 5478 5472 !! is not taken into account. 5479 ! 5473 5480 5474 ! - Upward mass flux 5481 5475 !------------------- … … 5494 5488 ENDDO 5495 5489 ENDDO 5496 ! 5490 5497 5491 DO i = 1, nl 5498 5492 DO il = 1, ncum … … 5502 5496 ENDDO 5503 5497 ENDDO 5504 ! 5498 5505 5499 DO j = 3, nl 5506 5500 DO i = 2, j-1 … … 5512 5506 ENDDO 5513 5507 ENDDO 5514 ! 5508 5515 5509 ! The difference between upwd(il,i) and upwd(il,i-1) is due to updrafts ending in layer 5516 5510 !(i-1) (theses drafts cross interface (i-1) but not interface(i)) and to updrafts starting 5517 5511 !from layer (i-1) (theses drafts cross interface (i) but not interface(i-1)): 5518 ! 5512 5519 5513 DO i = 2, nlp 5520 5514 DO il = 1, ncum … … 5529 5523 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 5530 5524 5531 !5532 5525 ! ================================================= 5533 5526 ! downward fluxes | … … 5546 5539 ENDDO 5547 5540 ENDDO 5548 ! 5541 5549 5542 DO j = 1, nl 5550 5543 DO i = j+1, nl … … 5557 5550 ENDDO 5558 5551 ENDDO 5559 ! 5552 5560 5553 ! The difference between dnwd(il,i) and dnwd(il,i+1) is due to downdrafts ending in layer 5561 5554 !(i) (theses drafts cross interface (i+1) but not interface(i)) and to downdrafts 5562 5555 !starting from layer (i) (theses drafts cross interface (i) but not interface(i+1)): 5563 ! 5556 5564 5557 DO i = nl-1, 1, -1 5565 5558 DO il = 1, ncum … … 5569 5562 ENDDO 5570 5563 ! ================================================= 5571 ! 5564 5572 5565 !----------------------------------------------------------- 5573 5566 ENDIF !(ok_optim_yield) !| … … 5593 5586 IF (num1<=0) GO TO 500 5594 5587 5595 !5596 5588 !jyg< 5597 5589 !----------------------------------------------------------- … … 5651 5643 END DO 5652 5644 END DO 5653 ! 5645 5654 5646 !----------------------------------------------------------- 5655 5647 ENDIF !(ok_optim_yield) !| 5656 5648 !----------------------------------------------------------- 5657 ! 5649 5658 5650 !! print *,'yield, i, amp1, ad', i, amp1(1), ad(1) 5659 5651 … … 5712 5704 t(il,i)*(cpv-cpd)*(rr(il,i)-qent(il,i,i)))*cpinv 5713 5705 END IF 5714 ! 5706 5715 5707 ! sb: on ne fait pas encore la correction permettant de mieux 5716 5708 ! conserver l'eau: … … 5848 5840 ! ajout du terme des ddfts sensi stricto 5849 5841 ! write(*,*) 'tmp cv3_yield 4165: i,il=',i,il 5850 ! 5842 5851 5843 if (option_traceurs.eq.6) then 5852 5844 do iiso = 1, niso … … 6153 6145 ft(il, i) = ft(il, i) + 0.01*grav*dpinv*ment(il, k, i) * & 6154 6146 (hent(il,k,i)-h(il,i)+t(il,i)*(cpv-cpd)*(rr(il,i)+awat(il)-qent(il,k,i)))*cpinv 6155 ! 6147 6156 6148 #ifdef ISO 6157 6149 ! on change le traitement de cette ligne le 8 mai 2009: … … 6192 6184 ! end cam verif 6193 6185 #endif 6194 ! 6186 6195 6187 END IF ! i 6196 6188 END DO … … 6814 6806 END IF 6815 6807 END DO 6816 ! 6808 6817 6809 IF (prt_level >= 5) THEN 6818 6810 print *,' CV3_YIELD : alpha_qpos ',alpha_qpos(1) 6819 6811 ENDIF 6820 6812 6821 !6822 6813 DO il = 1, ncum 6823 6814 IF (iflag(il)<=1) THEN … … 7303 7294 REAL, DIMENSION (len, na, na), INTENT (OUT) :: phi, phi2, epmlmMm 7304 7295 REAL, DIMENSION (len, na), INTENT (OUT) :: da, d1a, dam, eplaMm 7305 ! 7296 7306 7297 ! variables pour tracer dans precip de l'AA et des mel 7307 7298 !local variables: … … 7600 7591 !AC! 2110 continue 7601 7592 !AC! 2100 continue 7602 ! 7593 7603 7594 RETURN 7604 7595 END SUBROUTINE cv3_uncompress
Note: See TracChangeset
for help on using the changeset viewer.