Changeset 2900 for LMDZ5/trunk
- Timestamp:
- Jun 2, 2017, 1:27:59 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/cv3p_mixing.F90
r2478 r2900 14 14 15 15 USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level 16 USE ioipsl_getin_p_mod, ONLY: getin_p 17 USE add_phys_tend_mod, ONLY: fl_cor_ebil 16 18 17 19 IMPLICIT NONE … … 70 72 REAL :: Tm !Mixed draught temperature 71 73 LOGICAL, DIMENSION (nloc) :: lwork 74 LOGICAL, SAVE :: ok_entrain=.TRUE. 75 !$OMP THREADPRIVATE(ok_entrain) 72 76 73 77 REAL amxupcrit, df, ff … … 110 114 fmax, gammas, qqa1, qqa2, Qcoef1max, Qcoef2max 111 115 !>jyg 112 116 ! 117 CALL getin_p('ok_entrain',ok_entrain) 113 118 END IF 114 119 … … 165 170 DO i = minorig + 1, nl 166 171 167 DO j = minorig, nl 168 DO il = 1, ncum 169 IF ((i>=icb(il)) .AND. (i<=inb(il)) .AND. (j>=(icb(il)-1)) & 170 .AND. (j<=inb(il))) THEN 171 172 rti = qnk(il) - ep(il, i)*clw(il, i) 173 bf2 = 1. + lv(il, j)*lv(il, j)*rs(il, j)/(rrv*t(il,j)*t(il,j)*cpd) 174 !jyg(from aj)< 175 IF (cvflag_ice) THEN 176 ! print*,cvflag_ice,'cvflag_ice dans do 700' 177 IF (t(il,j)<=263.15) THEN 178 bf2 = 1. + (lf(il,j)+lv(il,j))*(lv(il,j)+frac(il,j)* & 179 lf(il,j))*rs(il, j)/(rrv*t(il,j)*t(il,j)*cpd) 180 END IF 181 END IF 182 !>jyg 183 anum = h(il, j) - hp(il, i) + (cpv-cpd)*t(il, j)*(rti-rr(il,j)) 184 denom = h(il, i) - hp(il, i) + (cpd-cpv)*(rr(il,i)-rti)*t(il, j) 185 dei = denom 186 IF (abs(dei)<0.01) dei = 0.01 187 Sij(il, i, j) = anum/dei 188 Sij(il, i, i) = 1.0 189 altem = Sij(il, i, j)*rr(il, i) + (1.-Sij(il,i,j))*rti - rs(il, j) 190 altem = altem/bf2 191 cwat = clw(il, j)*(1.-ep(il,j)) 192 stemp = Sij(il, i, j) 193 IF ((stemp<0.0 .OR. stemp>1.0 .OR. altem>cwat) .AND. j>i) THEN 172 IF (ok_entrain) THEN 173 DO j = minorig, nl 174 DO il = 1, ncum 175 IF ((i>=icb(il)) .AND. (i<=inb(il)) .AND. (j>=(icb(il)-1)) & 176 .AND. (j<=inb(il))) THEN 177 178 rti = qnk(il) - ep(il, i)*clw(il, i) 179 bf2 = 1. + lv(il, j)*lv(il, j)*rs(il, j)/(rrv*t(il,j)*t(il,j)*cpd) 194 180 !jyg(from aj)< 195 181 IF (cvflag_ice) THEN 196 anum = anum - (lv(il,j)+frac(il,j)*lf(il,j))*(rti-rs(il,j)-cwat*bf2) 197 denom = denom + (lv(il,j)+frac(il,j)*lf(il,j))*(rr(il,i)-rti)198 ELSE199 anum = anum - lv(il, j)*(rti-rs(il,j)-cwat*bf2)200 denom = denom + lv(il, j)*(rr(il,i)-rti)182 ! print*,cvflag_ice,'cvflag_ice dans do 700' 183 IF (t(il,j)<=263.15) THEN 184 bf2 = 1. + (lf(il,j)+lv(il,j))*(lv(il,j)+frac(il,j)* & 185 lf(il,j))*rs(il, j)/(rrv*t(il,j)*t(il,j)*cpd) 186 END IF 201 187 END IF 202 188 !>jyg 203 IF (abs(denom)<0.01) denom = 0.01 204 Sij(il, i, j) = anum/denom 189 anum = h(il, j) - hp(il, i) + (cpv-cpd)*t(il, j)*(rti-rr(il,j)) 190 denom = h(il, i) - hp(il, i) + (cpd-cpv)*(rr(il,i)-rti)*t(il, j) 191 dei = denom 192 IF (abs(dei)<0.01) dei = 0.01 193 Sij(il, i, j) = anum/dei 194 Sij(il, i, i) = 1.0 205 195 altem = Sij(il, i, j)*rr(il, i) + (1.-Sij(il,i,j))*rti - rs(il, j) 206 altem = altem - (bf2-1.)*cwat 207 END IF 208 IF (Sij(il,i,j)>0.0) THEN 196 altem = altem/bf2 197 cwat = clw(il, j)*(1.-ep(il,j)) 198 stemp = Sij(il, i, j) 199 IF ((stemp<0.0 .OR. stemp>1.0 .OR. altem>cwat) .AND. j>i) THEN 200 !jyg(from aj)< 201 IF (cvflag_ice) THEN 202 anum = anum - (lv(il,j)+frac(il,j)*lf(il,j))*(rti-rs(il,j)-cwat*bf2) 203 denom = denom + (lv(il,j)+frac(il,j)*lf(il,j))*(rr(il,i)-rti) 204 ELSE 205 anum = anum - lv(il, j)*(rti-rs(il,j)-cwat*bf2) 206 denom = denom + lv(il, j)*(rr(il,i)-rti) 207 END IF 208 !>jyg 209 IF (abs(denom)<0.01) denom = 0.01 210 Sij(il, i, j) = anum/denom 211 altem = Sij(il, i, j)*rr(il, i) + (1.-Sij(il,i,j))*rti - rs(il, j) 212 altem = altem - (bf2-1.)*cwat 213 END IF 214 IF (Sij(il,i,j)>0.0) THEN 209 215 !!! Ment(il,i,j)=m(il,i) 210 Ment(il, i, j) = 1. 211 elij(il, i, j) = altem 212 elij(il, i, j) = amax1(0.0, elij(il,i,j)) 213 nent(il, i) = nent(il, i) + 1 214 END IF 215 216 Sij(il, i, j) = amax1(0.0, Sij(il,i,j)) 217 Sij(il, i, j) = amin1(1.0, Sij(il,i,j)) 218 END IF ! new 219 END DO 220 END DO 216 Ment(il, i, j) = 1. 217 elij(il, i, j) = altem 218 elij(il, i, j) = amax1(0.0, elij(il,i,j)) 219 nent(il, i) = nent(il, i) + 1 220 END IF 221 222 Sij(il, i, j) = amax1(0.0, Sij(il,i,j)) 223 Sij(il, i, j) = amin1(1.0, Sij(il,i,j)) 224 END IF ! new 225 END DO 226 END DO 227 ELSE ! (ok_entrain) 228 DO il = 1,ncum 229 nent(il,i) = 0 230 ENDDO 231 ENDIF ! (ok_entrain) 221 232 222 233 !jygdebug<
Note: See TracChangeset
for help on using the changeset viewer.