Changeset 5144 for LMDZ6/branches/Amaury_dev/libf/phylmd/fisrtilp_tr.F90
- Timestamp:
- Jul 29, 2024, 11:01:04 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/fisrtilp_tr.F90
r5143 r5144 1 2 1 ! $Id$ 3 2 4 3 5 4 SUBROUTINE fisrtilp_tr(dtime, paprs, pplay, t, q, ratqs, d_t, d_q, d_ql, & 6 rneb, radliq, rain, snow, pfrac_impa, pfrac_nucl, pfrac_1nucl, frac_impa, &7 frac_nucl, prfl, psfl, rhcl) ! relative humidity in clear sky (needed for aer optical5 rneb, radliq, rain, snow, pfrac_impa, pfrac_nucl, pfrac_1nucl, frac_impa, & 6 frac_nucl, prfl, psfl, rhcl) ! relative humidity in clear sky (needed for aer optical 8 7 ! properties; aeropt.F) 9 10 8 11 9 USE dimphy 12 10 USE lmdz_print_control, ONLY: lunout 13 USE lmdz_ YOETHF11 USE lmdz_yoethf 14 12 USE lmdz_fcttre, ONLY: foeew, foede, qsats, qsatl, dqsats, dqsatl, thermcep 13 USE lmdz_yomcst 15 14 16 15 IMPLICIT NONE … … 22 21 ! ====================================================================== 23 22 ! ====================================================================== 24 include "YOMCST.h"25 23 26 24 ! Arguments: 27 25 28 26 REAL dtime ! intervalle du temps (s) 29 REAL paprs(klon, klev +1) ! pression a inter-couche27 REAL paprs(klon, klev + 1) ! pression a inter-couche 30 28 REAL pplay(klon, klev) ! pression au milieu de couche 31 29 REAL t(klon, klev) ! temperature (K) … … 38 36 REAL rain(klon) ! pluies (mm/s) 39 37 REAL snow(klon) ! neige (mm/s) 40 REAL prfl(klon, klev +1) ! flux d'eau precipitante aux interfaces (kg/m2/s)41 REAL psfl(klon, klev +1) ! flux d'eau precipitante aux interfaces (kg/m2/s)38 REAL prfl(klon, klev + 1) ! flux d'eau precipitante aux interfaces (kg/m2/s) 39 REAL psfl(klon, klev + 1) ! flux d'eau precipitante aux interfaces (kg/m2/s) 42 40 43 41 ! jq For aerosol opt properties needed (see aeropt.F) … … 61 59 62 60 REAL seuil_neb ! un nuage existe vraiment au-dela 63 PARAMETER (seuil_neb =0.001)61 PARAMETER (seuil_neb = 0.001) 64 62 REAL ct ! inverse du temps pour qu'un nuage precipite 65 PARAMETER (ct =1./1800.)63 PARAMETER (ct = 1. / 1800.) 66 64 REAL cl ! seuil de precipitation 67 PARAMETER (cl =2.6E-4)65 PARAMETER (cl = 2.6E-4) 68 66 ! cc PARAMETER (cl=2.3e-4) 69 67 ! cc PARAMETER (cl=2.0e-4) 70 68 INTEGER ninter ! sous-intervals pour la precipitation 71 PARAMETER (ninter =5)69 PARAMETER (ninter = 5) 72 70 LOGICAL evap_prec ! evaporation de la pluie 73 PARAMETER (evap_prec =.TRUE.)71 PARAMETER (evap_prec = .TRUE.) 74 72 REAL coef_eva 75 PARAMETER (coef_eva =2.0E-05)73 PARAMETER (coef_eva = 2.0E-05) 76 74 LOGICAL calcrat ! calculer ratqs au lieu de fixer sa valeur 77 75 REAL ratqs(klon, klev) ! determine la largeur de distribution de vapeur 78 PARAMETER (calcrat =.TRUE.)76 PARAMETER (calcrat = .TRUE.) 79 77 REAL zx_min, rat_max 80 PARAMETER (zx_min =1.0, rat_max=0.01)78 PARAMETER (zx_min = 1.0, rat_max = 0.01) 81 79 REAL zx_max, rat_min 82 PARAMETER (zx_max =0.1, rat_min=0.3)80 PARAMETER (zx_max = 0.1, rat_min = 0.3) 83 81 REAL zx 84 82 85 83 LOGICAL cpartiel ! condensation partielle 86 PARAMETER (cpartiel =.TRUE.)84 PARAMETER (cpartiel = .TRUE.) 87 85 REAL t_coup 88 PARAMETER (t_coup =234.0)86 PARAMETER (t_coup = 234.0) 89 87 90 88 ! Variables locales: … … 125 123 REAL fallv ! vitesse de chute pour crystaux de glace 126 124 REAL zzz 127 fallv(zzz) = 3.29/2.0*((zzz)**0.16) 125 DATA appel1er/.TRUE./ 126 fallv(zzz) = 3.29 / 2.0 * ((zzz)**0.16) 128 127 ! cc fallv (zzz) = 3.29/3.0 * ((zzz)**0.16) 129 128 ! cc fallv (zzz) = 3.29 * ((zzz)**0.16) 130 131 DATA appel1er/.TRUE./132 129 133 130 IF (appel1er) THEN … … 137 134 WRITE (lunout, *) 'fisrtilp, evap_prec:', evap_prec 138 135 WRITE (lunout, *) 'fisrtilp, cpartiel:', cpartiel 139 IF (abs(dtime /real(ninter)-360.0)>0.001) THEN136 IF (abs(dtime / real(ninter) - 360.0)>0.001) THEN 140 137 WRITE (lunout, *) 'fisrtilp: Ce n est pas prevu, voir Z.X.Li', dtime 141 138 WRITE (lunout, *) 'Je prefere un sous-intervalle de 6 minutes' … … 229 226 IF (zrfl(i)>0.) THEN 230 227 IF (thermcep) THEN 231 zdelta = max(0., sign(1., rtt-zt(i)))232 zqs(i) = r2es *foeew(zt(i), zdelta)/pplay(i, k)228 zdelta = max(0., sign(1., rtt - zt(i))) 229 zqs(i) = r2es * foeew(zt(i), zdelta) / pplay(i, k) 233 230 zqs(i) = min(0.5, zqs(i)) 234 zcor = 1. /(1.-retv*zqs(i))235 zqs(i) = zqs(i) *zcor231 zcor = 1. / (1. - retv * zqs(i)) 232 zqs(i) = zqs(i) * zcor 236 233 ELSE 237 234 IF (zt(i)<t_coup) THEN 238 zqs(i) = qsats(zt(i)) /pplay(i, k)235 zqs(i) = qsats(zt(i)) / pplay(i, k) 239 236 ELSE 240 zqs(i) = qsatl(zt(i)) /pplay(i, k)237 zqs(i) = qsatl(zt(i)) / pplay(i, k) 241 238 END IF 242 239 END IF 243 zqev = max(0.0, (zqs(i) -zq(i))*zneb(i))244 zqevt = coef_eva *(1.0-zq(i)/zqs(i))*sqrt(zrfl(i))* &245 (paprs(i,k)-paprs(i,k+1))/pplay(i, k)*zt(i)*rd/rg246 zqevt = max(0.0, min(zqevt, zrfl(i)))*rg*dtime/ &247 (paprs(i,k)-paprs(i,k+1))240 zqev = max(0.0, (zqs(i) - zq(i)) * zneb(i)) 241 zqevt = coef_eva * (1.0 - zq(i) / zqs(i)) * sqrt(zrfl(i)) * & 242 (paprs(i, k) - paprs(i, k + 1)) / pplay(i, k) * zt(i) * rd / rg 243 zqevt = max(0.0, min(zqevt, zrfl(i))) * rg * dtime / & 244 (paprs(i, k) - paprs(i, k + 1)) 248 245 zqev = min(zqev, zqevt) 249 zrfln(i) = zrfl(i) - zqev *(paprs(i,k)-paprs(i,k+1))/rg/dtime250 zq(i) = zq(i) - (zrfln(i) -zrfl(i))*(rg/(paprs(i,k)-paprs(i, &251 k+1)))*dtime252 zt(i) = zt(i) + (zrfln(i) -zrfl(i))*(rg/(paprs(i,k)-paprs(i, &253 k+1)))*dtime*rlvtt/rcpd/(1.0+rvtmp2*zq(i))246 zrfln(i) = zrfl(i) - zqev * (paprs(i, k) - paprs(i, k + 1)) / rg / dtime 247 zq(i) = zq(i) - (zrfln(i) - zrfl(i)) * (rg / (paprs(i, k) - paprs(i, & 248 k + 1))) * dtime 249 zt(i) = zt(i) + (zrfln(i) - zrfl(i)) * (rg / (paprs(i, k) - paprs(i, & 250 k + 1))) * dtime * rlvtt / rcpd / (1.0 + rvtmp2 * zq(i)) 254 251 zrfl(i) = zrfln(i) 255 252 END IF … … 261 258 IF (thermcep) THEN 262 259 DO i = 1, klon 263 zdelta = max(0., sign(1., rtt-zt(i)))264 zcvm5 = r5les *rlvtt*(1.-zdelta) + r5ies*rlstt*zdelta265 zcvm5 = zcvm5 /rcpd/(1.0+rvtmp2*zq(i))266 zqs(i) = r2es *foeew(zt(i), zdelta)/pplay(i, k)260 zdelta = max(0., sign(1., rtt - zt(i))) 261 zcvm5 = r5les * rlvtt * (1. - zdelta) + r5ies * rlstt * zdelta 262 zcvm5 = zcvm5 / rcpd / (1.0 + rvtmp2 * zq(i)) 263 zqs(i) = r2es * foeew(zt(i), zdelta) / pplay(i, k) 267 264 zqs(i) = min(0.5, zqs(i)) 268 zcor = 1. /(1.-retv*zqs(i))269 zqs(i) = zqs(i) *zcor265 zcor = 1. / (1. - retv * zqs(i)) 266 zqs(i) = zqs(i) * zcor 270 267 zdqs(i) = foede(zt(i), zdelta, zcvm5, zqs(i), zcor) 271 268 END DO … … 273 270 DO i = 1, klon 274 271 IF (zt(i)<t_coup) THEN 275 zqs(i) = qsats(zt(i)) /pplay(i, k)272 zqs(i) = qsats(zt(i)) / pplay(i, k) 276 273 zdqs(i) = dqsats(zt(i), zqs(i)) 277 274 ELSE 278 zqs(i) = qsatl(zt(i)) /pplay(i, k)275 zqs(i) = qsatl(zt(i)) / pplay(i, k) 279 276 zdqs(i) = dqsatl(zt(i), zqs(i)) 280 277 END IF … … 288 285 DO i = 1, klon 289 286 290 zdelq = ratqs(i, k) *zq(i)291 rneb(i, k) = (zq(i) +zdelq-zqs(i))/(2.0*zdelq)292 zqn(i) = (zq(i) +zdelq+zqs(i))/2.0293 IF (rneb(i, k)<=0.0) zqn(i) = 0.0294 IF (rneb(i, k)>=1.0) zqn(i) = zq(i)295 rneb(i, k) = max(0.0, min(1.0, rneb(i,k)))296 zcond(i) = max(0.0, zqn(i) -zqs(i))*rneb(i, k)/(1.+zdqs(i))287 zdelq = ratqs(i, k) * zq(i) 288 rneb(i, k) = (zq(i) + zdelq - zqs(i)) / (2.0 * zdelq) 289 zqn(i) = (zq(i) + zdelq + zqs(i)) / 2.0 290 IF (rneb(i, k)<=0.0) zqn(i) = 0.0 291 IF (rneb(i, k)>=1.0) zqn(i) = zq(i) 292 rneb(i, k) = max(0.0, min(1.0, rneb(i, k))) 293 zcond(i) = max(0.0, zqn(i) - zqs(i)) * rneb(i, k) / (1. + zdqs(i)) 297 294 298 295 ! --Olivier 299 rhcl(i, k) = (zqs(i) +zq(i)-zdelq)/2./zqs(i)300 IF (rneb(i, k)<=0.0) rhcl(i, k) = zq(i)/zqs(i)301 IF (rneb(i, k)>=1.0) rhcl(i, k) = 1.0296 rhcl(i, k) = (zqs(i) + zq(i) - zdelq) / 2. / zqs(i) 297 IF (rneb(i, k)<=0.0) rhcl(i, k) = zq(i) / zqs(i) 298 IF (rneb(i, k)>=1.0) rhcl(i, k) = 1.0 302 299 ! --fin 303 300 … … 310 307 rneb(i, k) = 0.0 311 308 END IF 312 zcond(i) = max(0.0, zq(i) -zqs(i))/(1.+zdqs(i))309 zcond(i) = max(0.0, zq(i) - zqs(i)) / (1. + zdqs(i)) 313 310 END DO 314 311 END IF … … 316 313 DO i = 1, klon 317 314 zq(i) = zq(i) - zcond(i) 318 zt(i) = zt(i) + zcond(i) *rlvtt/rcpd315 zt(i) = zt(i) + zcond(i) * rlvtt / rcpd 319 316 END DO 320 317 … … 322 319 323 320 DO i = 1, klon 324 IF (rneb(i, k)>0.0) THEN321 IF (rneb(i, k)>0.0) THEN 325 322 zoliq(i) = zcond(i) 326 zrho(i) = pplay(i, k) /zt(i)/rd327 zdz(i) = (paprs(i, k)-paprs(i,k+1))/(zrho(i)*rg)328 zfice(i) = 1.0 - (zt(i) -ztglace)/(273.13-ztglace)329 zfice(i) = min(max(zfice(i), 0.0), 1.0)323 zrho(i) = pplay(i, k) / zt(i) / rd 324 zdz(i) = (paprs(i, k) - paprs(i, k + 1)) / (zrho(i) * rg) 325 zfice(i) = 1.0 - (zt(i) - ztglace) / (273.13 - ztglace) 326 zfice(i) = min(max(zfice(i), 0.0), 1.0) 330 327 zfice(i) = zfice(i)**nexpo 331 zneb(i) = max(rneb(i, k), seuil_neb)332 radliq(i, k) = zoliq(i) /real(ninter+1)328 zneb(i) = max(rneb(i, k), seuil_neb) 329 radliq(i, k) = zoliq(i) / real(ninter + 1) 333 330 END IF 334 331 END DO … … 336 333 DO n = 1, ninter 337 334 DO i = 1, klon 338 IF (rneb(i, k)>0.0) THEN339 zchau(i) = ct *dtime/real(ninter)*zoliq(i)* &340 (1.0-exp(-(zoliq(i)/zneb(i)/cl)**2))*(1.-zfice(i))341 zrhol(i) = zrho(i) *zoliq(i)/zneb(i)342 zfroi(i) = dtime /real(ninter)/zdz(i)*zoliq(i)*fallv(zrhol(i))* &343 zfice(i)335 IF (rneb(i, k)>0.0) THEN 336 zchau(i) = ct * dtime / real(ninter) * zoliq(i) * & 337 (1.0 - exp(-(zoliq(i) / zneb(i) / cl)**2)) * (1. - zfice(i)) 338 zrhol(i) = zrho(i) * zoliq(i) / zneb(i) 339 zfroi(i) = dtime / real(ninter) / zdz(i) * zoliq(i) * fallv(zrhol(i)) * & 340 zfice(i) 344 341 ztot(i) = zchau(i) + zfroi(i) 345 342 IF (zneb(i)==seuil_neb) ztot(i) = 0.0 346 ztot(i) = min(max(ztot(i), 0.0), zoliq(i))347 zoliq(i) = max(zoliq(i) -ztot(i), 0.0)348 radliq(i, k) = radliq(i, k) + zoliq(i) /real(ninter+1)349 END IF 350 END DO 351 END DO 352 353 DO i = 1, klon 354 IF (rneb(i, k)>0.0) THEN343 ztot(i) = min(max(ztot(i), 0.0), zoliq(i)) 344 zoliq(i) = max(zoliq(i) - ztot(i), 0.0) 345 radliq(i, k) = radliq(i, k) + zoliq(i) / real(ninter + 1) 346 END IF 347 END DO 348 END DO 349 350 DO i = 1, klon 351 IF (rneb(i, k)>0.0) THEN 355 352 d_ql(i, k) = zoliq(i) 356 zrfl(i) = zrfl(i) + max(zcond(i) -zoliq(i), 0.0)*(paprs(i,k)-paprs(i,k &357 +1))/(rg*dtime)353 zrfl(i) = zrfl(i) + max(zcond(i) - zoliq(i), 0.0) * (paprs(i, k) - paprs(i, k & 354 + 1)) / (rg * dtime) 358 355 END IF 359 356 IF (zt(i)<rtt) THEN … … 375 372 DO i = 1, klon 376 373 377 zprec_cond(i) = max(zcond(i) -zoliq(i), 0.0)*(paprs(i,k)-paprs(i,k+1))/ &378 rg379 IF (rneb(i, k)>0.0 .AND. zprec_cond(i)>0.) THEN374 zprec_cond(i) = max(zcond(i) - zoliq(i), 0.0) * (paprs(i, k) - paprs(i, k + 1)) / & 375 rg 376 IF (rneb(i, k)>0.0 .AND. zprec_cond(i)>0.) THEN 380 377 ! AA lessivage nucleation LMD5 dans la couche elle-meme 381 IF (t(i, k)>=ztglace) THEN378 IF (t(i, k)>=ztglace) THEN 382 379 zalpha_tr = a_tr_sca(3) 383 380 ELSE 384 381 zalpha_tr = a_tr_sca(4) 385 382 END IF 386 zfrac_lessi = 1. - exp(zalpha_tr *zprec_cond(i)/zneb(i))387 pfrac_nucl(i, k) = pfrac_nucl(i, k) *(1.-zneb(i)*zfrac_lessi)388 frac_nucl(i, k) = 1. - zneb(i) *zfrac_lessi383 zfrac_lessi = 1. - exp(zalpha_tr * zprec_cond(i) / zneb(i)) 384 pfrac_nucl(i, k) = pfrac_nucl(i, k) * (1. - zneb(i) * zfrac_lessi) 385 frac_nucl(i, k) = 1. - zneb(i) * zfrac_lessi 389 386 390 387 ! nucleation avec un facteur -1 au lieu de -0.5 391 zfrac_lessi = 1. - exp(-zprec_cond(i) /zneb(i))392 pfrac_1nucl(i, k) = pfrac_1nucl(i, k) *(1.-zneb(i)*zfrac_lessi)388 zfrac_lessi = 1. - exp(-zprec_cond(i) / zneb(i)) 389 pfrac_1nucl(i, k) = pfrac_1nucl(i, k) * (1. - zneb(i) * zfrac_lessi) 393 390 END IF 394 391 … … 398 395 DO kk = k - 1, 1, -1 399 396 DO i = 1, klon 400 IF (rneb(i, k)>0.0 .AND. zprec_cond(i)>0.) THEN401 IF (t(i, kk)>=ztglace) THEN397 IF (rneb(i, k)>0.0 .AND. zprec_cond(i)>0.) THEN 398 IF (t(i, kk)>=ztglace) THEN 402 399 zalpha_tr = a_tr_sca(1) 403 400 ELSE 404 401 zalpha_tr = a_tr_sca(2) 405 402 END IF 406 zfrac_lessi = 1. - exp(zalpha_tr *zprec_cond(i)/zneb(i))407 pfrac_impa(i, kk) = pfrac_impa(i, kk) *(1.-zneb(i)*zfrac_lessi)408 frac_impa(i, kk) = 1. - zneb(i) *zfrac_lessi403 zfrac_lessi = 1. - exp(zalpha_tr * zprec_cond(i) / zneb(i)) 404 pfrac_impa(i, kk) = pfrac_impa(i, kk) * (1. - zneb(i) * zfrac_lessi) 405 frac_impa(i, kk) = 1. - zneb(i) * zfrac_lessi 409 406 END IF 410 407 END DO … … 420 417 421 418 DO i = 1, klon 422 IF ((t(i, 1)+d_t(i,1))<rtt) THEN419 IF ((t(i, 1) + d_t(i, 1))<rtt) THEN 423 420 snow(i) = zrfl(i) 424 421 ELSE … … 427 424 END DO 428 425 429 430 426 END SUBROUTINE fisrtilp_tr
Note: See TracChangeset
for help on using the changeset viewer.