Changeset 2397 for LMDZ5/trunk/libf
- Timestamp:
- Nov 19, 2015, 12:07:15 AM (9 years ago)
- Location:
- LMDZ5/trunk/libf/phylmd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/cv3p_mixing.F90
r2393 r2397 1 1 SUBROUTINE cv3p_mixing(nloc, ncum, nd, na, ntra, icb, nk, inb, & 2 ph, t, rr, rs, u, v, tra, h, lv, qnk, &2 ph, t, rr, rs, u, v, tra, h, lv, lf, frac, qnk, & 3 3 unk, vnk, hp, tv, tvp, ep, clw, sig, & 4 4 Ment, Qent, hent, uent, vent, nent, & … … 20 20 include "cv3param.h" 21 21 include "YOMCST2.h" 22 include "cvflag.h" 22 23 23 24 !inputs: … … 32 33 REAL, DIMENSION (nloc, nd, ntra), INTENT (IN) :: tra ! input of convect3 33 34 REAL, DIMENSION (nloc, na), INTENT (IN) :: lv 35 REAL, DIMENSION (nloc, na), INTENT (IN) :: lf 36 REAL, DIMENSION (nloc, na), INTENT (IN) :: frac !ice fraction in condensate 34 37 REAL, DIMENSION (nloc, na), INTENT (IN) :: h !liquid water static energy of environment 35 38 REAL, DIMENSION (nloc, na), INTENT (IN) :: hp !liquid water static energy of air shed from adiab. asc. … … 51 54 INTEGER i, j, k, il, im, jm 52 55 INTEGER num1, num2 53 REAL :: rti, bf2, anum, denom, dei, altem, cwat, stemp , qp56 REAL :: rti, bf2, anum, denom, dei, altem, cwat, stemp 54 57 REAL :: alt, delp, delm 55 58 REAL, DIMENSION (nloc) :: Qmixmax, Rmixmax, sqmrmax … … 60 63 REAL, DIMENSION (nloc) :: Smid, Sjmin, Sjmax 61 64 REAL, DIMENSION (nloc) :: Sbef, sup, smin 62 !jyg REAL, DIMENSION (nloc) :: ASij, smax, Scrit63 65 REAL, DIMENSION (nloc) :: ASij, ASij_inv, smax, Scrit 64 66 REAL, DIMENSION (nloc, nd, nd) :: Sij 65 67 REAL, DIMENSION (nloc, nd) :: csum 66 68 REAL :: awat 69 REAL :: cpm !Mixed draught heat capacity 70 REAL :: Tm !Mixed draught temperature 67 71 LOGICAL, DIMENSION (nloc) :: lwork 68 72 … … 165 169 rti = qnk(il) - ep(il, i)*clw(il, i) 166 170 bf2 = 1. + lv(il, j)*lv(il, j)*rs(il, j)/(rrv*t(il,j)*t(il,j)*cpd) 171 !jyg(from aj)< 172 IF (cvflag_ice) THEN 173 ! print*,cvflag_ice,'cvflag_ice dans do 700' 174 IF (t(il,j)<=263.15) THEN 175 bf2 = 1. + (lf(il,j)+lv(il,j))*(lv(il,j)+frac(il,j)* & 176 lf(il,j))*rs(il, j)/(rrv*t(il,j)*t(il,j)*cpd) 177 END IF 178 END IF 179 !>jyg 167 180 anum = h(il, j) - hp(il, i) + (cpv-cpd)*t(il, j)*(rti-rr(il,j)) 168 181 denom = h(il, i) - hp(il, i) + (cpd-cpv)*(rr(il,i)-rti)*t(il, j) … … 176 189 stemp = Sij(il, i, j) 177 190 IF ((stemp<0.0 .OR. stemp>1.0 .OR. altem>cwat) .AND. j>i) THEN 178 anum = anum - lv(il, j)*(rti-rs(il,j)-cwat*bf2) 179 denom = denom + lv(il, j)*(rr(il,i)-rti) 191 !jyg(from aj)< 192 IF (cvflag_ice) THEN 193 anum = anum - (lv(il,j)+frac(il,j)*lf(il,j))*(rti-rs(il,j)-cwat*bf2) 194 denom = denom + (lv(il,j)+frac(il,j)*lf(il,j))*(rr(il,i)-rti) 195 ELSE 196 anum = anum - lv(il, j)*(rti-rs(il,j)-cwat*bf2) 197 denom = denom + lv(il, j)*(rr(il,i)-rti) 198 END IF 199 !>jyg 180 200 IF (abs(denom)<0.01) denom = 0.01 181 201 Sij(il, i, j) = anum/denom … … 299 319 lwork(il) = (nent(il,i)/=0) 300 320 rti = qnk(il) - ep(il, i)*clw(il, i) 301 anum = h(il, i) - hp(il, i) - lv(il, i)*(rti-rs(il,i)) + & 302 (cpv-cpd)*t(il, i)*(rti-rr(il,i)) 303 denom = h(il, i) - hp(il, i) + lv(il, i)*(rr(il,i)-rti) + & 304 (cpd-cpv)*t(il, i)*(rr(il,i)-rti) 321 !jyg< 322 IF (cvflag_ice) THEN 323 324 anum = h(il, i) - hp(il, i) - (lv(il,i)+frac(il,i)*lf(il,i))* & 325 (rti-rs(il,i)) + (cpv-cpd)*t(il, i)*(rti-rr(il,i)) 326 denom = h(il, i) - hp(il, i) + (lv(il,i)+frac(il,i)*lf(il,i))* & 327 (rr(il,i)-rti) + (cpd-cpv)*t(il, i)*(rr(il,i)-rti) 328 ELSE 329 330 anum = h(il, i) - hp(il, i) - lv(il, i)*(rti-rs(il,i)) + & 331 (cpv-cpd)*t(il, i)*(rti-rr(il,i)) 332 denom = h(il, i) - hp(il, i) + lv(il, i)*(rr(il,i)-rti) + & 333 (cpd-cpv)*t(il, i)*(rr(il,i)-rti) 334 END IF 335 !>jyg 305 336 IF (abs(denom)<0.01) denom = 0.01 306 337 Scrit(il) = min(anum/denom, 1.) … … 452 483 hent(il, i, j) = (1.-Sigij(il,i,j))*hp(il, i) + Sigij(il, i, j)*h(il, i) 453 484 485 !jyg< 486 ! elij(il, i, j) = Qent(il, i, j) - rs(il, j) 487 ! elij(il, i, j) = elij(il, i, j) + & 488 ! ((h(il,j)-hent(il,i,j))*rs(il,j)*lv(il,j) / & 489 ! ((cpd*(1.-Qent(il,i,j))+Qent(il,i,j)*cpv)*rrv*t(il,j)*t(il,j))) 490 ! elij(il, i, j) = elij(il, i, j) / & 491 ! (1.+lv(il,j)*lv(il,j)*rs(il,j) / & 492 ! ((cpd*(1.-Qent(il,i,j))+Qent(il,i,j)*cpv)*rrv*t(il,j)*t(il,j))) 493 ! 494 ! Computation of condensate amount Elij, taking into account the ice fraction frac 495 ! Warning : the same saturation humidity rs is used over both liquid water and ice; this 496 ! should be corrected. 497 ! 498 ! Heat capacity of mixed draught 499 cpm = cpd+Qent(il,i,j)*(cpv-cpd) 500 ! 501 IF (cvflag_ice .and. frac(il,j) .gt. 0.) THEN 454 502 elij(il, i, j) = Qent(il, i, j) - rs(il, j) 455 503 elij(il, i, j) = elij(il, i, j) + & 456 ((h(il,j)-hent(il,i,j))*rs(il,j)*lv(il,j) / & 457 ((cpd*(1.-Qent(il,i,j))+Qent(il,i,j)*cpv)*rrv*t(il,j)*t(il,j))) 504 (h(il,j)-hent(il,i,j)+(cpv-cpd)*(Qent(il,i,j)-rr(il,j))*t(il,j))* & 505 rs(il,j)*lv(il,j) / (cpm*rrv*t(il,j)*t(il,j)) 506 elij(il, i, j) = elij(il, i, j) / & 507 (1.+(lv(il,j)+frac(il,j)*lf(il,j))*lv(il,j)*rs(il,j) / & 508 (cpm*rrv*t(il,j)*t(il,j))) 509 ELSE 510 elij(il, i, j) = Qent(il, i, j) - rs(il, j) 511 elij(il, i, j) = elij(il, i, j) + & 512 (h(il,j)-hent(il,i,j)+(cpv-cpd)*(Qent(il,i,j)-rr(il,j))*t(il,j))* & 513 rs(il,j)*lv(il,j) / (cpm*rrv*t(il,j)*t(il,j)) 458 514 elij(il, i, j) = elij(il, i, j) / & 459 515 (1.+lv(il,j)*lv(il,j)*rs(il,j) / & 460 ((cpd*(1.-Qent(il,i,j))+Qent(il,i,j)*cpv)*rrv*t(il,j)*t(il,j))) 461 516 (cpm*rrv*t(il,j)*t(il,j))) 517 ENDIF 518 !>jyg 462 519 elij(il, i, j) = max(elij(il,i,j), 0.) 463 520 … … 474 531 ! : t(il,j)) 475 532 476 hent(il, i, j) = hent(il, i, j) + (lv(il,j)+(cpd-cpv)*t(il,j))*awat 533 !jyg< 534 ! hent(il, i, j) = hent(il, i, j) + (lv(il,j)+(cpd-cpv)*t(il,j))*awat 535 ! Mixed draught temperature at level j 536 IF (cvflag_ice .and. frac(il,j) .gt. 0.) THEN 537 Tm = t(il,j) + (Qent(il,i,j)-elij(il,i,j)-rs(il,j))*rrv*t(il,j)*t(il,j)/(lv(il,j)*rs(il,j)) 538 hent(il, i, j) = hent(il, i, j) + (lv(il,j)+frac(il,j)*lf(il,j)+(cpd-cpv)*Tm)*awat 539 ELSE 540 Tm = t(il,j) + (Qent(il,i,j)-elij(il,i,j)-rs(il,j))*rrv*t(il,j)*t(il,j)/(lv(il,j)*rs(il,j)) 541 hent(il, i, j) = hent(il, i, j) + (lv(il,j)+(cpd-cpv)*Tm)*awat 542 ENDIF 543 !>jyg 544 477 545 !IM 301008 end 478 546 -
LMDZ5/trunk/libf/phylmd/cva_driver.F90
r2393 r2397 900 900 CALL zilch(supmax, nloc*klev) 901 901 CALL cv3p_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, & ! na->nd 902 ph, t, q, qs, u, v, tra, h, lv, qnk, &902 ph, t, q, qs, u, v, tra, h, lv, lf, frac, qnk, & 903 903 unk, vnk, hp, tv, tvp, ep, clw, sig, & 904 904 ment, qent, hent, uent, vent, nent, &
Note: See TracChangeset
for help on using the changeset viewer.