Changeset 972 for LMDZ4/trunk/libf/phylmd/thermcell_plume.F90
- Timestamp:
- Jun 19, 2008, 12:24:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/phylmd/thermcell_plume.F90
r938 r972 1 SUBROUTINE thermcell_plume( ngrid,klev,ztv,zthl,po,zl,rhobarz, &1 SUBROUTINE thermcell_plume(itap,ngrid,klev,ptimestep,ztv,zthl,po,zl,rhobarz, & 2 2 & zlev,pplev,pphi,zpspsk,l_mix,r_aspect,alim_star, & 3 3 & lalim,zmax_sec,f0,detr_star,entr_star,f_star,ztva, & … … 15 15 #include "iniprint.h" 16 16 17 INTEGER itap 18 17 19 INTEGER ngrid,klev 20 REAL ptimestep 18 21 REAL ztv(ngrid,klev) 19 22 REAL zthl(ngrid,klev) … … 32 35 INTEGER lalim(ngrid) 33 36 integer lev_out ! niveau pour les print 37 real zcon2(ngrid) 34 38 35 39 REAL ztva(ngrid,klev) 36 40 REAL ztla(ngrid,klev) 37 41 REAL zqla(ngrid,klev) 42 REAL zqla0(ngrid,klev) 38 43 REAL zqta(ngrid,klev) 39 44 REAL zha(ngrid,klev) 40 45 41 46 REAL detr_star(ngrid,klev) 47 REAL coefc 48 REAL detr_stara(ngrid,klev) 49 REAL detr_starb(ngrid,klev) 50 REAL detr_starc(ngrid,klev) 51 REAL detr_star0(ngrid,klev) 52 REAL detr_star1(ngrid,klev) 53 REAL detr_star2(ngrid,klev) 54 42 55 REAL entr_star(ngrid,klev) 56 REAL entr_star1(ngrid,klev) 57 REAL entr_star2(ngrid,klev) 43 58 REAL detr(ngrid,klev) 44 59 REAL entr(ngrid,klev) … … 55 70 REAL linter(ngrid) 56 71 INTEGER lmix(ngrid) 72 INTEGER lmix_bis(ngrid) 57 73 REAL wmaxa(ngrid) 58 74 … … 85 101 zqla(ig,k)=0. 86 102 zqta(ig,k)=po(ig,k) 103 ! 104 ztva(ig,k) = ztla(ig,k)*zpspsk(ig,k)+RLvCp*zqla(ig,k) 105 ztva(ig,k) = ztva(ig,k)/zpspsk(ig,k) 106 zha(ig,k) = ztva(ig,k) 107 ! 87 108 enddo 88 109 enddo … … 91 112 detr_star(ig,k)=0. 92 113 entr_star(ig,k)=0. 114 115 detr_stara(ig,k)=0. 116 detr_starb(ig,k)=0. 117 detr_starc(ig,k)=0. 118 detr_star0(ig,k)=0. 119 zqla0(ig,k)=0. 120 detr_star1(ig,k)=0. 121 detr_star2(ig,k)=0. 122 entr_star1(ig,k)=0. 123 entr_star2(ig,k)=0. 124 93 125 detr(ig,k)=0. 94 126 entr(ig,k)=0. … … 117 149 do l=1,klev-1 118 150 do ig=1,ngrid 151 152 153 154 ! Calcul dans la premiere couche active du thermique (ce qu'on teste 155 ! en disant que la couche est instable et que w2 en bas de la couche 156 ! est nulle. 157 119 158 if (ztv(ig,l).gt.ztv(ig,l+1) & 120 159 & .and.alim_star(ig,l).gt.1.e-10 & 121 160 & .and.zw2(ig,l).lt.1e-10) then 161 162 163 ! Le panache va prendre au debut les caracteristiques de l'air contenu 164 ! dans cette couche. 122 165 ztla(ig,l)=zthl(ig,l) 123 166 zqta(ig,l)=po(ig,l) 124 167 zqla(ig,l)=zl(ig,l) 125 168 f_star(ig,l+1)=alim_star(ig,l) 169 126 170 zw2(ig,l+1)=2.*RG*(ztv(ig,l)-ztv(ig,l+1))/ztv(ig,l+1) & 127 171 & *(zlev(ig,l+1)-zlev(ig,l)) & … … 129 173 w_est(ig,l+1)=zw2(ig,l+1) 130 174 ! 175 176 131 177 else if ((zw2(ig,l).ge.1e-10).and. & 132 178 & (f_star(ig,l)+alim_star(ig,l)).gt.1.e-10) then … … 147 193 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 148 194 195 196 197 ! Premier calcul de la vitesse verticale a partir de la temperature 198 ! potentielle virtuelle 199 200 ! FH CESTQUOI CA ???? 201 #define int1d2 202 !#undef int1d2 203 #ifdef int1d2 204 if (l.ge.2) then 205 #else 149 206 if (l.gt.2) then 207 #endif 208 209 if (1.eq.1) then 150 210 w_est(ig,3)=zw2(ig,2)* & 151 211 & ((f_star(ig,2))**2) & … … 153 213 & 2.*RG*(ztva(ig,2)-ztv(ig,2))/ztv(ig,2) & 154 214 & *(zlev(ig,3)-zlev(ig,2)) 215 endif 155 216 156 217 … … 160 221 ! 161 222 !test:estimation de ztva_new_est sans entrainement 223 162 224 Tbef=ztla(ig,l-1)*zpspsk(ig,l) 163 225 zdelta=MAX(0.,SIGN(1.,RTT-Tbef)) … … 204 266 ! 205 267 !calcul du detrainement 268 !======================= 269 270 271 ! Modifications du calcul du detrainement. 272 ! Dans la version de la these de Catherine, on passe brusquement 273 ! de la version seche a la version nuageuse pour le detrainement 274 ! ce qui peut occasioner des oscillations. 275 ! dans la nouvelle version, on commence par calculer un detrainement sec. 276 ! Puis un autre en cas de nuages. 277 ! Puis on combine les deux lineairement en fonction de la quantite d'eau. 278 279 #define int1d3 280 !#undef int1d3 281 #define RIO_TH 282 #ifdef RIO_TH 283 !1. Cas non nuageux 284 ! 1.1 on est sous le zmax_sec et w croit 206 285 if ((w_est(ig,l+1).gt.w_est(ig,l)).and. & 207 286 & (zlev(ig,l+1).lt.zmax_sec(ig)).and. & 287 #ifdef int1d3 288 & (zqla_est(ig,l).lt.1.e-10)) then 289 #else 208 290 & (zqla(ig,l-1).lt.1.e-10)) then 291 #endif 209 292 detr_star(ig,l)=MAX(0.,(rhobarz(ig,l+1) & 210 293 & *sqrt(w_est(ig,l+1))*sqrt(l_mix*zlev(ig,l+1)) & 211 294 & -rhobarz(ig,l)*sqrt(w_est(ig,l))*sqrt(l_mix*zlev(ig,l))) & 212 295 & /(r_aspect*zmax_sec(ig))) 213 if (prt_level.ge.20) print*,'coucou calcul detr 1' 296 detr_stara(ig,l)=detr_star(ig,l) 297 298 if (prt_level.ge.20) print*,'coucou calcul detr 1: ig, l',ig,l 299 300 ! 1.2 on est sous le zmax_sec et w decroit 214 301 else if ((zlev(ig,l+1).lt.zmax_sec(ig)).and. & 302 #ifdef int1d3 303 & (zqla_est(ig,l).lt.1.e-10)) then 304 #else 215 305 & (zqla(ig,l-1).lt.1.e-10)) then 306 #endif 216 307 detr_star(ig,l)=-f0(ig)*f_star(ig,lmix(ig)) & 217 308 & /(rhobarz(ig,lmix(ig))*wmaxa(ig))* & … … 222 313 & *((zmax_sec(ig)-zlev(ig,l))/ & 223 314 & ((zmax_sec(ig)-zlev(ig,lmix(ig)))))**2.) 224 if (prt_level.ge.20) print*,'coucou calcul detr 2' 315 detr_starb(ig,l)=detr_star(ig,l) 316 317 if (prt_level.ge.20) print*,'coucou calcul detr 2: ig, l',ig,l 318 225 319 else 320 321 ! 1.3 dans les autres cas 226 322 detr_star(ig,l)=0.002*f0(ig)*f_star(ig,l) & 227 323 & *(zlev(ig,l+1)-zlev(ig,l)) 228 if (prt_level.ge.20) print*,'coucou calcul detr 3' 324 detr_starc(ig,l)=detr_star(ig,l) 325 326 if (prt_level.ge.20) print*,'coucou calcul detr 3 n: ig, l',ig, l 229 327 230 328 endif 231 detr_star(ig,l)=detr_star(ig,l)/f0(ig) 329 330 #else 331 332 ! 1.1 on est sous le zmax_sec et w croit 333 if ((w_est(ig,l+1).gt.w_est(ig,l)).and. & 334 & (zlev(ig,l+1).lt.zmax_sec(ig)) ) then 335 detr_star(ig,l)=MAX(0.,(rhobarz(ig,l+1) & 336 & *sqrt(w_est(ig,l+1))*sqrt(l_mix*zlev(ig,l+1)) & 337 & -rhobarz(ig,l)*sqrt(w_est(ig,l))*sqrt(l_mix*zlev(ig,l))) & 338 & /(r_aspect*zmax_sec(ig))) 339 340 if (prt_level.ge.20) print*,'coucou calcul detr 1: ig, l', ig, l 341 342 ! 1.2 on est sous le zmax_sec et w decroit 343 else if ((zlev(ig,l+1).lt.zmax_sec(ig)) ) then 344 detr_star(ig,l)=-f0(ig)*f_star(ig,lmix(ig)) & 345 & /(rhobarz(ig,lmix(ig))*wmaxa(ig))* & 346 & (rhobarz(ig,l+1)*sqrt(w_est(ig,l+1)) & 347 & *((zmax_sec(ig)-zlev(ig,l+1))/ & 348 & ((zmax_sec(ig)-zlev(ig,lmix(ig)))))**2. & 349 & -rhobarz(ig,l)*sqrt(w_est(ig,l)) & 350 & *((zmax_sec(ig)-zlev(ig,l))/ & 351 & ((zmax_sec(ig)-zlev(ig,lmix(ig)))))**2.) 352 if (prt_level.ge.20) print*,'coucou calcul detr 1: ig, l', ig, l 353 354 else 355 detr_star=0. 356 endif 357 358 ! 1.3 dans les autres cas 359 detr_starc(ig,l)=0.002*f0(ig)*f_star(ig,l) & 360 & *(zlev(ig,l+1)-zlev(ig,l)) 361 362 coefc=min(zqla(ig,l-1)/1.e-3,1.) 363 if (zlev(ig,l+1).ge.zmax_sec(ig)) coefc=1. 364 coefc=1. 365 ! il semble qu'il soit important de baser le calcul sur 366 ! zqla_est(ig,l-1) plutot que sur zqla_est(ig,l) 367 detr_star(ig,l)=detr_starc(ig,l)*coefc+detr_star(ig,l)*(1.-coefc) 368 369 if (prt_level.ge.20) print*,'coucou calcul detr 2: ig, l', ig, l 370 371 #endif 372 373 374 if (prt_level.ge.20) print*,'coucou calcul detr 444: ig, l', ig, l 375 !IM 730508 beg 376 ! if(itap.GE.7200) THEN 377 ! print*,'th_plume ig,l,itap,zqla_est=',ig,l,itap,zqla_est(ig,l) 378 ! endif 379 !IM 730508 end 380 381 zqla0(ig,l)=zqla_est(ig,l) 382 detr_star0(ig,l)=detr_star(ig,l) 383 !IM 060508 beg 384 ! if(detr_star(ig,l).GT.1.) THEN 385 ! print*,'th_plumeBEF ig l detr_star detr_starc coefc',ig,l,detr_star(ig,l) & 386 ! & ,detr_starc(ig,l),coefc 387 ! endif 388 !IM 060508 end 389 !IM 160508 beg 390 !IM 160508 IF (f0(ig).NE.0.) THEN 391 detr_star(ig,l)=detr_star(ig,l)/f0(ig) 392 !IM 160508 ELSE IF(detr_star(ig,l).EQ.0.) THEN 393 !IM 160508 print*,'WARNING1 : th_plume f0=0, detr_star=0: ig, l, itap',ig,l,itap 394 !IM 160508 ELSE 395 !IM 160508 print*,'WARNING2 : th_plume f0=0, ig, l, itap, detr_star',ig,l,itap,detr_star(ig,l) 396 !IM 160508 ENDIF 397 !IM 160508 end 398 !IM 060508 beg 399 ! if(detr_star(ig,l).GT.1.) THEN 400 ! print*,'th_plumeAFT ig l detr_star f0 1/f0',ig,l,detr_star(ig,l),f0(ig), & 401 ! & float(1)/f0(ig) 402 ! endif 403 !IM 060508 end 404 if (prt_level.ge.20) print*,'coucou calcul detr 445: ig, l', ig, l 232 405 ! 233 406 !calcul de entr_star 407 408 ! #undef test2 409 ! #ifdef test2 410 ! La version test2 destabilise beaucoup le modele. 411 ! Il semble donc que ca aide d'avoir un entrainement important sous 412 ! le nuage. 413 ! if (zqla_est(ig,l-1).ge.1.e-10.and.l.gt.lalim(ig)) then 414 ! entr_star(ig,l)=0.4*detr_star(ig,l) 415 ! else 416 ! entr_star(ig,l)=0. 417 ! endif 418 ! #else 234 419 ! 235 420 ! Deplacement du calcul de entr_star pour eviter d'avoir aussi … … 237 422 ! Redeplacer suite a la transformation du cas detr>f 238 423 ! FH 424 425 if (prt_level.ge.20) print*,'coucou calcul detr 446: ig, l', ig, l 426 #define int1d 427 !FH 070508 #define int1d4 428 !#undef int1d4 429 ! L'option int1d4 correspond au choix dans le cas ou le detrainement 430 ! devient trop grand. 431 432 #ifdef int1d 433 434 #ifdef int1d4 435 #else 436 detr_star(ig,l)=min(detr_star(ig,l),f_star(ig,l)) 437 !FH 070508 plus 438 detr_star(ig,l)=min(detr_star(ig,l),1.) 439 #endif 440 441 entr_star(ig,l)=max(0.4*detr_star(ig,l)-alim_star(ig,l),0.) 442 443 if (prt_level.ge.20) print*,'coucou calcul detr 447: ig, l', ig, l 444 #ifdef int1d4 445 ! Si le detrainement excede le flux en bas + l'entrainement, le thermique 446 ! doit disparaitre. 447 if (detr_star(ig,l)>f_star(ig,l)+entr_star(ig,l)) then 448 detr_star(ig,l)=f_star(ig,l)+entr_star(ig,l) 449 f_star(ig,l+1)=0. 450 linter(ig)=l+1 451 zw2(ig,l+1)=-1.e-10 452 endif 453 #endif 454 455 456 #else 457 458 if (prt_level.ge.20) print*,'coucou calcul detr 448: ig, l', ig, l 239 459 if(l.gt.lalim(ig)) then 240 460 entr_star(ig,l)=0.4*detr_star(ig,l) … … 249 469 ! d* non nul) on a une discontinuité de e* ou d* en haut de la couche 250 470 ! d'alimentation, ce qui n'est pas forcement heureux. 471 472 if (prt_level.ge.20) print*,'coucou calcul detr 449: ig, l', ig, l 473 #undef pre_int1c 474 #ifdef pre_int1c 251 475 entr_star(ig,l)=max(detr_star(ig,l)-alim_star(ig,l),0.) 252 476 detr_star(ig,l)=entr_star(ig,l) 477 #else 478 entr_star(ig,l)=0. 479 #endif 480 253 481 endif 254 482 255 ! 483 #endif 484 485 if (prt_level.ge.20) print*,'coucou calcul detr 440: ig, l', ig, l 486 entr_star1(ig,l)=entr_star(ig,l) 487 detr_star1(ig,l)=detr_star(ig,l) 488 ! 489 490 #ifdef int1d 491 #else 256 492 if (detr_star(ig,l).gt.f_star(ig,l)) then 257 493 … … 261 497 262 498 detr_star(ig,l)=f_star(ig,l) 499 #ifdef pre_int1c 263 500 if (l.gt.lalim(ig)+1) then 264 501 entr_star(ig,l)=0. … … 269 506 linter(ig)=l+1 270 507 else 271 entr_star(ig,l)= detr_star(ig,l)508 entr_star(ig,l)=0.4*detr_star(ig,l) 272 509 endif 510 #else 511 entr_star(ig,l)=0.4*detr_star(ig,l) 512 #endif 273 513 endif 274 275 else 514 #endif 515 516 else !l > 2 276 517 detr_star(ig,l)=0. 277 518 entr_star(ig,l)=0. 278 519 endif 520 521 entr_star2(ig,l)=entr_star(ig,l) 522 detr_star2(ig,l)=detr_star(ig,l) 523 if (prt_level.ge.20) print*,'coucou calcul detr 450: ig, l', ig, l 279 524 280 525 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! … … 292 537 293 538 !test sur le signe de f_star 539 if (prt_level.ge.20) print*,'coucou calcul detr 451: ig, l', ig, l 294 540 if (f_star(ig,l+1).gt.1.e-10) then 295 541 !---------------------------------------------------------------------------- … … 336 582 endif 337 583 ! 584 if (prt_level.ge.20) print*,'coucou calcul detr 4512: ig, l', ig, l 338 585 ! on ecrit de maniere conservative (sat ou non) 339 586 ! T = Tl +Lv/Cp ql … … 356 603 endif 357 604 endif 605 if (prt_level.ge.20) print*,'coucou calcul detr 460: ig, l',ig, l 358 606 ! 359 607 !initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max … … 383 631 enddo 384 632 633 if (prt_level.ge.20) print*,'coucou calcul detr 470: ig, l', ig, l 634 #ifdef troisD 635 call wrgradsfi(1,klev,zqla_est,'ql_es ','ql_es ') 636 call wrgradsfi(1,klev,entr_star1,'e_st1 ','e_st1 ') 637 call wrgradsfi(1,klev,entr_star2,'e_st2 ','e_st2 ') 638 call wrgradsfi(1,klev,detr_stara,'d_sta ','d_sta ') 639 call wrgradsfi(1,klev,detr_starb,'d_stb ','d_stb ') 640 call wrgradsfi(1,klev,detr_starc,'d_stc ','d_stc ') 641 call wrgradsfi(1,klev,zqla0 ,'zqla0 ','zqla0 ') 642 call wrgradsfi(1,klev,detr_star0,'d_st0 ','d_st0 ') 643 call wrgradsfi(1,klev,detr_star1,'d_st1 ','d_st1 ') 644 call wrgradsfi(1,klev,detr_star2,'d_st2 ','d_st2 ') 645 #endif 646 647 ! print*,'thermcell_plume OK' 385 648 386 649 return
Note: See TracChangeset
for help on using the changeset viewer.