[782] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | MODULE coef_diff_turb_mod |
---|
| 5 | ! |
---|
| 6 | ! This module contains some procedures for calculation of the coefficients of the |
---|
| 7 | ! turbulent diffusion in the atmosphere and coefficients for turbulent diffusion |
---|
| 8 | ! at surface(cdrag) |
---|
| 9 | ! |
---|
| 10 | USE dimphy |
---|
| 11 | |
---|
| 12 | IMPLICIT NONE |
---|
| 13 | |
---|
| 14 | CONTAINS |
---|
| 15 | ! |
---|
| 16 | !**************************************************************************************** |
---|
| 17 | ! |
---|
| 18 | SUBROUTINE coef_diff_turb(dtime, nsrf, knon, ni, & |
---|
| 19 | ypaprs, ypplay, yu, yv, yq, yt, yts, yrugos, yqsurf, & |
---|
[878] | 20 | ycoefm, ycoefh ,yq2) |
---|
[782] | 21 | ! |
---|
| 22 | ! Calculate coefficients(ycoefm, ycoefh) for turbulent diffusion in the |
---|
| 23 | ! atmosphere and coefficients for turbulent diffusion at surface - cdrag |
---|
| 24 | ! (ycoefm(:,1), ycoefh(:,1)). |
---|
| 25 | ! |
---|
| 26 | ! |
---|
| 27 | ! Input arguments |
---|
| 28 | !**************************************************************************************** |
---|
| 29 | REAL, INTENT(IN) :: dtime |
---|
| 30 | INTEGER, INTENT(IN) :: nsrf, knon |
---|
| 31 | INTEGER, DIMENSION(klon), INTENT(IN) :: ni |
---|
| 32 | REAL, DIMENSION(klon,klev+1), INTENT(IN) :: ypaprs |
---|
| 33 | REAL, DIMENSION(klon,klev), INTENT(IN) :: ypplay |
---|
| 34 | REAL, DIMENSION(klon,klev), INTENT(IN) :: yu, yv |
---|
| 35 | REAL, DIMENSION(klon,klev), INTENT(IN) :: yq, yt |
---|
| 36 | REAL, DIMENSION(klon), INTENT(IN) :: yts, yrugos, yqsurf |
---|
[878] | 37 | REAL, DIMENSION(klon,klev+1) :: yq2 |
---|
[782] | 38 | |
---|
| 39 | ! Output arguments |
---|
| 40 | !**************************************************************************************** |
---|
| 41 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: ycoefh |
---|
| 42 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: ycoefm |
---|
| 43 | |
---|
| 44 | ! Other local variables |
---|
| 45 | !**************************************************************************************** |
---|
| 46 | INTEGER :: k, i, j |
---|
| 47 | REAL, DIMENSION(klon,klev) :: ycoefm0, ycoefh0, yzlay, yteta |
---|
[878] | 48 | REAL, DIMENSION(klon,klev+1) :: yzlev, q2diag, ykmm, ykmn, ykmq |
---|
[782] | 49 | REAL, DIMENSION(klon) :: y_cd_h, y_cd_m |
---|
| 50 | REAL, DIMENSION(klon) :: yustar |
---|
| 51 | |
---|
| 52 | ! Include |
---|
| 53 | !**************************************************************************************** |
---|
[793] | 54 | INCLUDE "clesphys.h" |
---|
| 55 | INCLUDE "indicesol.h" |
---|
[782] | 56 | INCLUDE "iniprint.h" |
---|
| 57 | INCLUDE "compbl.h" |
---|
[793] | 58 | INCLUDE "YOETHF.h" |
---|
| 59 | INCLUDE "YOMCST.h" |
---|
[782] | 60 | |
---|
| 61 | !**************************************************************************************** |
---|
| 62 | ! Start calculation |
---|
| 63 | ! - Initilalize output variables |
---|
| 64 | !**************************************************************************************** |
---|
| 65 | |
---|
| 66 | ycoefm(:,:) = 0.0 |
---|
| 67 | ycoefh(:,:) = 0.0 |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | !**************************************************************************************** |
---|
| 71 | ! Methode 1 : |
---|
| 72 | ! |
---|
| 73 | !**************************************************************************************** |
---|
| 74 | |
---|
| 75 | CALL coefkz(nsrf, knon, ypaprs, ypplay, & |
---|
| 76 | ksta, ksta_ter, & |
---|
| 77 | yts, yrugos, yu, yv, yt, yq, & |
---|
| 78 | yqsurf, & |
---|
| 79 | ycoefm, ycoefh) |
---|
| 80 | |
---|
| 81 | !**************************************************************************************** |
---|
| 82 | ! Methode 2 : |
---|
| 83 | ! |
---|
| 84 | !**************************************************************************************** |
---|
| 85 | |
---|
| 86 | IF (iflag_pbl.EQ.1) THEN |
---|
| 87 | CALL coefkz2(nsrf, knon, ypaprs, ypplay, yt, & |
---|
| 88 | ycoefm0, ycoefh0) |
---|
| 89 | |
---|
[878] | 90 | DO k = 2, klev |
---|
[782] | 91 | DO i = 1, knon |
---|
| 92 | ycoefm(i,k) = MAX(ycoefm(i,k),ycoefm0(i,k)) |
---|
| 93 | ycoefh(i,k) = MAX(ycoefh(i,k),ycoefh0(i,k)) |
---|
| 94 | ENDDO |
---|
| 95 | ENDDO |
---|
| 96 | ENDIF |
---|
| 97 | |
---|
| 98 | !**************************************************************************************** |
---|
| 99 | ! IM cf JLD : on seuille ycoefm et ycoefh |
---|
| 100 | ! |
---|
| 101 | !**************************************************************************************** |
---|
| 102 | IF (nsrf.EQ.is_oce) THEN |
---|
| 103 | DO j=1,knon |
---|
| 104 | ycoefm(j,1)=MIN(ycoefm(j,1),cdmmax) |
---|
| 105 | ycoefh(j,1)=MIN(ycoefh(j,1),cdhmax) |
---|
| 106 | ENDDO |
---|
| 107 | ENDIF |
---|
| 108 | |
---|
| 109 | !**************************************************************************************** |
---|
| 110 | ! Calcul d'une diffusion minimale pour les conditions tres stables |
---|
| 111 | ! |
---|
| 112 | !**************************************************************************************** |
---|
| 113 | IF (ok_kzmin) THEN |
---|
| 114 | CALL coefkzmin(knon,ypaprs,ypplay,yu,yv,yt,yq,ycoefm, & |
---|
| 115 | ycoefm0,ycoefh0) |
---|
| 116 | |
---|
[878] | 117 | DO k = 2, klev |
---|
[782] | 118 | DO i = 1, knon |
---|
| 119 | ycoefm(i,k) = MAX(ycoefm(i,k),ycoefm0(i,k)) |
---|
| 120 | ycoefh(i,k) = MAX(ycoefh(i,k),ycoefh0(i,k)) |
---|
| 121 | ENDDO |
---|
| 122 | ENDDO |
---|
| 123 | |
---|
| 124 | ENDIF |
---|
| 125 | |
---|
| 126 | |
---|
| 127 | !**************************************************************************************** |
---|
| 128 | ! MELLOR ET YAMADA adapte a Mars Richard Fournier et Frederic Hourdin |
---|
| 129 | ! Methode 3 : |
---|
| 130 | !**************************************************************************************** |
---|
| 131 | |
---|
| 132 | IF (iflag_pbl.GE.3) THEN |
---|
| 133 | |
---|
| 134 | yzlay(1:knon,1)= & |
---|
| 135 | RD*yt(1:knon,1)/(0.5*(ypaprs(1:knon,1)+ypplay(1:knon,1))) & |
---|
| 136 | *(ypaprs(1:knon,1)-ypplay(1:knon,1))/RG |
---|
| 137 | DO k=2,klev |
---|
| 138 | DO i = 1, knon |
---|
| 139 | yzlay(i,k)= & |
---|
| 140 | yzlay(i,k-1)+RD*0.5*(yt(i,k-1)+yt(i,k)) & |
---|
| 141 | /ypaprs(i,k)*(ypplay(i,k-1)-ypplay(i,k))/RG |
---|
| 142 | END DO |
---|
| 143 | END DO |
---|
| 144 | |
---|
| 145 | DO k=1,klev |
---|
| 146 | DO i = 1, knon |
---|
| 147 | yteta(i,k)= & |
---|
| 148 | yt(i,k)*(ypaprs(i,1)/ypplay(i,k))**RKAPPA & |
---|
| 149 | *(1.+0.61*yq(i,k)) |
---|
| 150 | END DO |
---|
| 151 | END DO |
---|
| 152 | |
---|
| 153 | yzlev(1:knon,1)=0. |
---|
| 154 | yzlev(1:knon,klev+1)=2.*yzlay(1:knon,klev)-yzlay(1:knon,klev-1) |
---|
| 155 | DO k=2,klev |
---|
| 156 | DO i = 1, knon |
---|
| 157 | yzlev(i,k)=0.5*(yzlay(i,k)+yzlay(i,k-1)) |
---|
| 158 | END DO |
---|
| 159 | END DO |
---|
| 160 | |
---|
[878] | 161 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 162 | ! Pour memoire, le papier Hourdin et al. 2002 a ete obtenur avec un |
---|
| 163 | ! bug sur les coefficients de surface : |
---|
| 164 | ! y_cd_h(1:knon) = ycoefm(1:knon,1) |
---|
| 165 | ! y_cd_m(1:knon) = ycoefh(1:knon,1) |
---|
| 166 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
| 167 | |
---|
| 168 | y_cd_m(1:knon) = ycoefm(1:knon,1) |
---|
| 169 | y_cd_h(1:knon) = ycoefh(1:knon,1) |
---|
[782] | 170 | |
---|
| 171 | CALL ustarhb(knon,yu,yv,y_cd_m, yustar) |
---|
| 172 | |
---|
| 173 | IF (prt_level > 9) THEN |
---|
| 174 | WRITE(lunout,*) 'USTAR = ',yustar |
---|
| 175 | ENDIF |
---|
| 176 | |
---|
| 177 | ! iflag_pbl peut etre utilise comme longuer de melange |
---|
| 178 | IF (iflag_pbl.GE.11) THEN |
---|
| 179 | CALL vdif_kcay(knon,dtime,RG,RD,ypaprs,yt, & |
---|
| 180 | yzlev,yzlay,yu,yv,yteta, & |
---|
| 181 | y_cd_m,yq2,q2diag,ykmm,ykmn,yustar, & |
---|
| 182 | iflag_pbl) |
---|
| 183 | ELSE |
---|
| 184 | CALL yamada4(knon,dtime,RG,RD,ypaprs,yt, & |
---|
| 185 | yzlev,yzlay,yu,yv,yteta, & |
---|
| 186 | y_cd_m,yq2,ykmm,ykmn,ykmq,yustar, & |
---|
| 187 | iflag_pbl) |
---|
| 188 | ENDIF |
---|
| 189 | |
---|
| 190 | ycoefm(1:knon,1)=y_cd_m(1:knon) |
---|
| 191 | ycoefh(1:knon,1)=y_cd_h(1:knon) |
---|
| 192 | ycoefm(1:knon,2:klev)=ykmm(1:knon,2:klev) |
---|
| 193 | ycoefh(1:knon,2:klev)=ykmn(1:knon,2:klev) |
---|
| 194 | |
---|
| 195 | ENDIF !(iflag_pbl.ge.3) |
---|
| 196 | |
---|
| 197 | END SUBROUTINE coef_diff_turb |
---|
| 198 | ! |
---|
| 199 | !**************************************************************************************** |
---|
| 200 | ! |
---|
| 201 | SUBROUTINE coefkz(nsrf, knon, paprs, pplay, & |
---|
| 202 | ksta, ksta_ter, & |
---|
| 203 | ts, rugos, & |
---|
| 204 | u,v,t,q, & |
---|
| 205 | qsurf, & |
---|
| 206 | pcfm, pcfh) |
---|
| 207 | |
---|
| 208 | !====================================================================== |
---|
| 209 | ! Auteur(s) F. Hourdin, M. Forichon, Z.X. Li (LMD/CNRS) date: 19930922 |
---|
| 210 | ! (une version strictement identique a l'ancien modele) |
---|
| 211 | ! Objet: calculer le coefficient du frottement du sol (Cdrag) et les |
---|
| 212 | ! coefficients d'echange turbulent dans l'atmosphere. |
---|
| 213 | ! Arguments: |
---|
| 214 | ! nsrf-----input-I- indicateur de la nature du sol |
---|
| 215 | ! knon-----input-I- nombre de points a traiter |
---|
| 216 | ! paprs----input-R- pregssion a chaque intercouche (en Pa) |
---|
| 217 | ! pplay----input-R- pression au milieu de chaque couche (en Pa) |
---|
| 218 | ! ts-------input-R- temperature du sol (en Kelvin) |
---|
| 219 | ! rugos----input-R- longeur de rugosite (en m) |
---|
| 220 | ! u--------input-R- vitesse u |
---|
| 221 | ! v--------input-R- vitesse v |
---|
| 222 | ! t--------input-R- temperature (K) |
---|
| 223 | ! q--------input-R- vapeur d'eau (kg/kg) |
---|
| 224 | ! |
---|
| 225 | ! pcfm-----output-R- coefficients a calculer (vitesse) |
---|
| 226 | ! pcfh-----output-R- coefficients a calculer (chaleur et humidite) |
---|
| 227 | !====================================================================== |
---|
[793] | 228 | INCLUDE "YOETHF.h" |
---|
| 229 | INCLUDE "FCTTRE.h" |
---|
[782] | 230 | INCLUDE "iniprint.h" |
---|
[793] | 231 | INCLUDE "indicesol.h" |
---|
[782] | 232 | INCLUDE "compbl.h" |
---|
[793] | 233 | INCLUDE "YOMCST.h" |
---|
[782] | 234 | ! |
---|
| 235 | ! Arguments: |
---|
| 236 | ! |
---|
| 237 | INTEGER, INTENT(IN) :: knon, nsrf |
---|
| 238 | REAL, DIMENSION(klon), INTENT(IN) :: ts |
---|
| 239 | REAL, DIMENSION(klon,klev+1), INTENT(IN) :: paprs |
---|
| 240 | REAL, DIMENSION(klon,klev), INTENT(IN) :: pplay |
---|
| 241 | REAL, DIMENSION(klon,klev), INTENT(IN) :: u, v, t, q |
---|
| 242 | REAL, DIMENSION(klon), INTENT(IN) :: rugos |
---|
| 243 | |
---|
| 244 | REAL, DIMENSION(klon,klev), INTENT(OUT) :: pcfm, pcfh |
---|
| 245 | |
---|
| 246 | |
---|
| 247 | ! Local variables |
---|
| 248 | |
---|
| 249 | ! numero de couche du sommet de la couche limite |
---|
| 250 | INTEGER, DIMENSION(klon) :: itop |
---|
| 251 | ! |
---|
| 252 | ! Quelques constantes et options: |
---|
| 253 | ! |
---|
| 254 | REAL cepdu2, ckap, cb, cc, cd, clam |
---|
| 255 | PARAMETER (cepdu2 =(0.1)**2) |
---|
| 256 | PARAMETER (CKAP=0.4) |
---|
| 257 | PARAMETER (cb=5.0) |
---|
| 258 | PARAMETER (cc=5.0) |
---|
| 259 | PARAMETER (cd=5.0) |
---|
| 260 | PARAMETER (clam=160.0) |
---|
| 261 | REAL ratqs ! largeur de distribution de vapeur d'eau |
---|
| 262 | PARAMETER (ratqs=0.05) |
---|
| 263 | LOGICAL richum ! utilise le nombre de Richardson humide |
---|
| 264 | PARAMETER (richum=.TRUE.) |
---|
| 265 | REAL ric ! nombre de Richardson critique |
---|
| 266 | PARAMETER(ric=0.4) |
---|
| 267 | REAL prandtl |
---|
| 268 | PARAMETER (prandtl=0.4) |
---|
| 269 | REAL kstable ! diffusion minimale (situation stable) |
---|
| 270 | ! GKtest |
---|
| 271 | ! PARAMETER (kstable=1.0e-10) |
---|
| 272 | REAL ksta, ksta_ter |
---|
| 273 | !IM: 261103 REAL kstable_ter, kstable_sinon |
---|
| 274 | !IM: 211003 cf GK PARAMETER (kstable_ter = 1.0e-6) |
---|
| 275 | !IM: 261103 PARAMETER (kstable_ter = 1.0e-8) |
---|
| 276 | !IM: 261103 PARAMETER (kstable_ter = 1.0e-10) |
---|
| 277 | !IM: 261103 PARAMETER (kstable_sinon = 1.0e-10) |
---|
| 278 | ! fin GKtest |
---|
| 279 | REAL mixlen ! constante controlant longueur de melange |
---|
| 280 | PARAMETER (mixlen=35.0) |
---|
| 281 | INTEGER isommet ! le sommet de la couche limite |
---|
| 282 | LOGICAL tvirtu ! calculer Ri d'une maniere plus performante |
---|
| 283 | PARAMETER (tvirtu=.TRUE.) |
---|
| 284 | LOGICAL opt_ec ! formule du Centre Europeen dans l'atmosphere |
---|
| 285 | PARAMETER (opt_ec=.FALSE.) |
---|
| 286 | |
---|
| 287 | ! |
---|
| 288 | ! Variables locales: |
---|
| 289 | |
---|
| 290 | INTEGER i, k !IM 120704 |
---|
| 291 | REAL zgeop(klon,klev) |
---|
| 292 | REAL zmgeom(klon) |
---|
| 293 | REAL zri(klon) |
---|
| 294 | REAL zl2(klon) |
---|
| 295 | |
---|
| 296 | REAL u1(klon), v1(klon), t1(klon), q1(klon), z1(klon) |
---|
| 297 | REAL pcfm1(klon), pcfh1(klon) |
---|
| 298 | |
---|
| 299 | REAL zdphi, zdu2, ztvd, ztvu, zcdn |
---|
| 300 | REAL zscf |
---|
| 301 | REAL zt, zq, zdelta, zcvm5, zcor, zqs, zfr, zdqs |
---|
| 302 | REAL z2geomf, zalh2, zalm2, zscfh, zscfm |
---|
| 303 | REAL t_coup |
---|
| 304 | PARAMETER (t_coup=273.15) |
---|
| 305 | !IM |
---|
| 306 | LOGICAL check |
---|
| 307 | PARAMETER (check=.FALSE.) |
---|
| 308 | ! |
---|
| 309 | ! contre-gradient pour la chaleur sensible: Kelvin/metre |
---|
| 310 | REAL gamt(2:klev) |
---|
| 311 | REAL qsurf(klon) |
---|
| 312 | |
---|
| 313 | LOGICAL, SAVE :: appel1er |
---|
| 314 | !$OMP THREADPRIVATE(appel1er) |
---|
| 315 | ! |
---|
| 316 | ! Fonctions thermodynamiques et fonctions d'instabilite |
---|
| 317 | REAL fsta, fins, x |
---|
| 318 | LOGICAL zxli ! utiliser un jeu de fonctions simples |
---|
| 319 | PARAMETER (zxli=.FALSE.) |
---|
| 320 | |
---|
| 321 | fsta(x) = 1.0 / (1.0+10.0*x*(1+8.0*x)) |
---|
| 322 | fins(x) = SQRT(1.0-18.0*x) |
---|
| 323 | |
---|
| 324 | DATA appel1er /.TRUE./ |
---|
| 325 | |
---|
| 326 | |
---|
| 327 | isommet=klev |
---|
| 328 | |
---|
| 329 | IF (appel1er) THEN |
---|
| 330 | IF (prt_level > 9) THEN |
---|
| 331 | WRITE(lunout,*)'coefkz, opt_ec:', opt_ec |
---|
| 332 | WRITE(lunout,*)'coefkz, richum:', richum |
---|
| 333 | IF (richum) WRITE(lunout,*)'coefkz, ratqs:', ratqs |
---|
| 334 | WRITE(lunout,*)'coefkz, isommet:', isommet |
---|
| 335 | WRITE(lunout,*)'coefkz, tvirtu:', tvirtu |
---|
| 336 | appel1er = .FALSE. |
---|
| 337 | ENDIF |
---|
| 338 | ENDIF |
---|
| 339 | ! |
---|
| 340 | ! Initialiser les sorties |
---|
| 341 | ! |
---|
| 342 | DO k = 1, klev |
---|
| 343 | DO i = 1, knon |
---|
| 344 | pcfm(i,k) = 0.0 |
---|
| 345 | pcfh(i,k) = 0.0 |
---|
| 346 | ENDDO |
---|
| 347 | ENDDO |
---|
| 348 | DO i = 1, knon |
---|
| 349 | itop(i) = 0 |
---|
| 350 | ENDDO |
---|
| 351 | |
---|
| 352 | ! |
---|
| 353 | ! Prescrire la valeur de contre-gradient |
---|
| 354 | ! |
---|
| 355 | IF (iflag_pbl.EQ.1) THEN |
---|
| 356 | DO k = 3, klev |
---|
| 357 | gamt(k) = -1.0E-03 |
---|
| 358 | ENDDO |
---|
| 359 | gamt(2) = -2.5E-03 |
---|
| 360 | ELSE |
---|
| 361 | DO k = 2, klev |
---|
| 362 | gamt(k) = 0.0 |
---|
| 363 | ENDDO |
---|
| 364 | ENDIF |
---|
| 365 | !IM cf JLD/ GKtest |
---|
| 366 | IF ( nsrf .NE. is_oce ) THEN |
---|
| 367 | !IM 261103 kstable = kstable_ter |
---|
| 368 | kstable = ksta_ter |
---|
| 369 | ELSE |
---|
| 370 | !IM 261103 kstable = kstable_sinon |
---|
| 371 | kstable = ksta |
---|
| 372 | ENDIF |
---|
| 373 | !IM cf JLD/ GKtest fin |
---|
| 374 | |
---|
| 375 | ! |
---|
| 376 | ! Calculer les geopotentiels de chaque couche |
---|
| 377 | ! |
---|
| 378 | DO i = 1, knon |
---|
| 379 | zgeop(i,1) = RD * t(i,1) / (0.5*(paprs(i,1)+pplay(i,1))) & |
---|
| 380 | * (paprs(i,1)-pplay(i,1)) |
---|
| 381 | ENDDO |
---|
| 382 | DO k = 2, klev |
---|
| 383 | DO i = 1, knon |
---|
| 384 | zgeop(i,k) = zgeop(i,k-1) & |
---|
| 385 | + RD * 0.5*(t(i,k-1)+t(i,k)) / paprs(i,k) & |
---|
| 386 | * (pplay(i,k-1)-pplay(i,k)) |
---|
| 387 | ENDDO |
---|
| 388 | ENDDO |
---|
| 389 | |
---|
| 390 | ! |
---|
| 391 | ! Calculer le frottement au sol (Cdrag) |
---|
| 392 | ! |
---|
| 393 | DO i = 1, knon |
---|
| 394 | u1(i) = u(i,1) |
---|
| 395 | v1(i) = v(i,1) |
---|
| 396 | t1(i) = t(i,1) |
---|
| 397 | q1(i) = q(i,1) |
---|
| 398 | z1(i) = zgeop(i,1) |
---|
| 399 | ENDDO |
---|
| 400 | |
---|
| 401 | CALL clcdrag(klon, knon, nsrf, zxli, & |
---|
| 402 | u1, v1, t1, q1, z1, & |
---|
| 403 | ts, qsurf, rugos, & |
---|
| 404 | pcfm1, pcfh1) |
---|
| 405 | !IM ts, qsurf, rugos, |
---|
| 406 | |
---|
| 407 | DO i = 1, knon |
---|
| 408 | pcfm(i,1)=pcfm1(i) |
---|
| 409 | pcfh(i,1)=pcfh1(i) |
---|
| 410 | ENDDO |
---|
| 411 | ! |
---|
| 412 | ! Calculer les coefficients turbulents dans l'atmosphere |
---|
| 413 | ! |
---|
| 414 | DO i = 1, knon |
---|
| 415 | itop(i) = isommet |
---|
| 416 | ENDDO |
---|
| 417 | |
---|
| 418 | |
---|
| 419 | DO k = 2, isommet |
---|
| 420 | DO i = 1, knon |
---|
| 421 | zdu2=MAX(cepdu2,(u(i,k)-u(i,k-1))**2 & |
---|
| 422 | +(v(i,k)-v(i,k-1))**2) |
---|
| 423 | zmgeom(i)=zgeop(i,k)-zgeop(i,k-1) |
---|
| 424 | zdphi =zmgeom(i) / 2.0 |
---|
| 425 | zt = (t(i,k)+t(i,k-1)) * 0.5 |
---|
| 426 | zq = (q(i,k)+q(i,k-1)) * 0.5 |
---|
| 427 | |
---|
| 428 | ! |
---|
| 429 | ! Calculer Qs et dQs/dT: |
---|
| 430 | ! |
---|
| 431 | IF (thermcep) THEN |
---|
| 432 | zdelta = MAX(0.,SIGN(1.,RTT-zt)) |
---|
| 433 | zcvm5 = R5LES*RLVTT/RCPD/(1.0+RVTMP2*zq)*(1.-zdelta) & |
---|
| 434 | + R5IES*RLSTT/RCPD/(1.0+RVTMP2*zq)*zdelta |
---|
| 435 | zqs = R2ES * FOEEW(zt,zdelta) / pplay(i,k) |
---|
| 436 | zqs = MIN(0.5,zqs) |
---|
| 437 | zcor = 1./(1.-RETV*zqs) |
---|
| 438 | zqs = zqs*zcor |
---|
| 439 | zdqs = FOEDE(zt,zdelta,zcvm5,zqs,zcor) |
---|
| 440 | ELSE |
---|
| 441 | IF (zt .LT. t_coup) THEN |
---|
| 442 | zqs = qsats(zt) / pplay(i,k) |
---|
| 443 | zdqs = dqsats(zt,zqs) |
---|
| 444 | ELSE |
---|
| 445 | zqs = qsatl(zt) / pplay(i,k) |
---|
| 446 | zdqs = dqsatl(zt,zqs) |
---|
| 447 | ENDIF |
---|
| 448 | ENDIF |
---|
| 449 | ! |
---|
| 450 | ! calculer la fraction nuageuse (processus humide): |
---|
| 451 | ! |
---|
| 452 | zfr = (zq+ratqs*zq-zqs) / (2.0*ratqs*zq) |
---|
| 453 | zfr = MAX(0.0,MIN(1.0,zfr)) |
---|
| 454 | IF (.NOT.richum) zfr = 0.0 |
---|
| 455 | ! |
---|
| 456 | ! calculer le nombre de Richardson: |
---|
| 457 | ! |
---|
| 458 | IF (tvirtu) THEN |
---|
| 459 | ztvd =( t(i,k) & |
---|
| 460 | + zdphi/RCPD/(1.+RVTMP2*zq) & |
---|
| 461 | *( (1.-zfr) + zfr*(1.+RLVTT*zqs/RD/zt)/(1.+zdqs) ) & |
---|
| 462 | )*(1.+RETV*q(i,k)) |
---|
| 463 | ztvu =( t(i,k-1) & |
---|
| 464 | - zdphi/RCPD/(1.+RVTMP2*zq) & |
---|
| 465 | *( (1.-zfr) + zfr*(1.+RLVTT*zqs/RD/zt)/(1.+zdqs) ) & |
---|
| 466 | )*(1.+RETV*q(i,k-1)) |
---|
| 467 | zri(i) =zmgeom(i)*(ztvd-ztvu)/(zdu2*0.5*(ztvd+ztvu)) |
---|
| 468 | zri(i) = zri(i) & |
---|
| 469 | + zmgeom(i)*zmgeom(i)/RG*gamt(k) & |
---|
| 470 | *(paprs(i,k)/101325.0)**RKAPPA & |
---|
| 471 | /(zdu2*0.5*(ztvd+ztvu)) |
---|
| 472 | |
---|
| 473 | ELSE ! calcul de Ridchardson compatible LMD5 |
---|
| 474 | |
---|
| 475 | zri(i) =(RCPD*(t(i,k)-t(i,k-1)) & |
---|
| 476 | -RD*0.5*(t(i,k)+t(i,k-1))/paprs(i,k) & |
---|
| 477 | *(pplay(i,k)-pplay(i,k-1)) & |
---|
| 478 | )*zmgeom(i)/(zdu2*0.5*RCPD*(t(i,k-1)+t(i,k))) |
---|
| 479 | zri(i) = zri(i) + & |
---|
| 480 | zmgeom(i)*zmgeom(i)*gamt(k)/RG & |
---|
| 481 | *(paprs(i,k)/101325.0)**RKAPPA & |
---|
| 482 | /(zdu2*0.5*(t(i,k-1)+t(i,k))) |
---|
| 483 | ENDIF |
---|
| 484 | ! |
---|
| 485 | ! finalement, les coefficients d'echange sont obtenus: |
---|
| 486 | ! |
---|
| 487 | zcdn=SQRT(zdu2) / zmgeom(i) * RG |
---|
| 488 | |
---|
| 489 | IF (opt_ec) THEN |
---|
| 490 | z2geomf=zgeop(i,k-1)+zgeop(i,k) |
---|
| 491 | zalm2=(0.5*ckap/RG*z2geomf & |
---|
| 492 | /(1.+0.5*ckap/rg/clam*z2geomf))**2 |
---|
| 493 | zalh2=(0.5*ckap/rg*z2geomf & |
---|
| 494 | /(1.+0.5*ckap/RG/(clam*SQRT(1.5*cd))*z2geomf))**2 |
---|
| 495 | IF (zri(i).LT.0.0) THEN ! situation instable |
---|
| 496 | zscf = ((zgeop(i,k)/zgeop(i,k-1))**(1./3.)-1.)**3 & |
---|
| 497 | / (zmgeom(i)/RG)**3 / (zgeop(i,k-1)/RG) |
---|
| 498 | zscf = SQRT(-zri(i)*zscf) |
---|
| 499 | zscfm = 1.0 / (1.0+3.0*cb*cc*zalm2*zscf) |
---|
| 500 | zscfh = 1.0 / (1.0+3.0*cb*cc*zalh2*zscf) |
---|
| 501 | pcfm(i,k)=zcdn*zalm2*(1.-2.0*cb*zri(i)*zscfm) |
---|
| 502 | pcfh(i,k)=zcdn*zalh2*(1.-3.0*cb*zri(i)*zscfh) |
---|
| 503 | ELSE ! situation stable |
---|
| 504 | zscf=SQRT(1.+cd*zri(i)) |
---|
| 505 | pcfm(i,k)=zcdn*zalm2/(1.+2.0*cb*zri(i)/zscf) |
---|
| 506 | pcfh(i,k)=zcdn*zalh2/(1.+3.0*cb*zri(i)*zscf) |
---|
| 507 | ENDIF |
---|
| 508 | ELSE |
---|
| 509 | zl2(i)=(mixlen*MAX(0.0,(paprs(i,k)-paprs(i,itop(i)+1)) & |
---|
| 510 | /(paprs(i,2)-paprs(i,itop(i)+1)) ))**2 |
---|
| 511 | pcfm(i,k)=SQRT(MAX(zcdn*zcdn*(ric-zri(i))/ric, kstable)) |
---|
| 512 | pcfm(i,k)= zl2(i)* pcfm(i,k) |
---|
| 513 | pcfh(i,k) = pcfm(i,k) /prandtl ! h et m different |
---|
| 514 | ENDIF |
---|
| 515 | ENDDO |
---|
| 516 | ENDDO |
---|
| 517 | |
---|
| 518 | ! |
---|
| 519 | ! Au-dela du sommet, pas de diffusion turbulente: |
---|
| 520 | ! |
---|
| 521 | DO i = 1, knon |
---|
| 522 | IF (itop(i)+1 .LE. klev) THEN |
---|
| 523 | DO k = itop(i)+1, klev |
---|
| 524 | pcfh(i,k) = 0.0 |
---|
| 525 | pcfm(i,k) = 0.0 |
---|
| 526 | ENDDO |
---|
| 527 | ENDIF |
---|
| 528 | ENDDO |
---|
| 529 | |
---|
| 530 | END SUBROUTINE coefkz |
---|
| 531 | ! |
---|
| 532 | !**************************************************************************************** |
---|
| 533 | ! |
---|
| 534 | SUBROUTINE coefkz2(nsrf, knon, paprs, pplay,t, & |
---|
| 535 | pcfm, pcfh) |
---|
| 536 | |
---|
| 537 | !====================================================================== |
---|
| 538 | ! J'introduit un peu de diffusion sauf dans les endroits |
---|
| 539 | ! ou une forte inversion est presente |
---|
| 540 | ! On peut dire qu'il represente la convection peu profonde |
---|
| 541 | ! |
---|
| 542 | ! Arguments: |
---|
| 543 | ! nsrf-----input-I- indicateur de la nature du sol |
---|
| 544 | ! knon-----input-I- nombre de points a traiter |
---|
| 545 | ! paprs----input-R- pression a chaque intercouche (en Pa) |
---|
| 546 | ! pplay----input-R- pression au milieu de chaque couche (en Pa) |
---|
| 547 | ! t--------input-R- temperature (K) |
---|
| 548 | ! |
---|
| 549 | ! pcfm-----output-R- coefficients a calculer (vitesse) |
---|
| 550 | ! pcfh-----output-R- coefficients a calculer (chaleur et humidite) |
---|
| 551 | !====================================================================== |
---|
| 552 | ! |
---|
| 553 | ! Arguments: |
---|
| 554 | ! |
---|
| 555 | INTEGER, INTENT(IN) :: knon, nsrf |
---|
| 556 | REAL, DIMENSION(klon, klev+1), INTENT(IN) :: paprs |
---|
| 557 | REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay |
---|
| 558 | REAL, DIMENSION(klon, klev), INTENT(IN) :: t(klon,klev) |
---|
| 559 | |
---|
| 560 | REAL, DIMENSION(klon, klev), INTENT(OUT) :: pcfm, pcfh |
---|
| 561 | ! |
---|
| 562 | ! Quelques constantes et options: |
---|
| 563 | ! |
---|
| 564 | REAL prandtl |
---|
| 565 | PARAMETER (prandtl=0.4) |
---|
| 566 | REAL kstable |
---|
| 567 | PARAMETER (kstable=0.002) |
---|
| 568 | ! PARAMETER (kstable=0.001) |
---|
| 569 | REAL mixlen ! constante controlant longueur de melange |
---|
| 570 | PARAMETER (mixlen=35.0) |
---|
| 571 | REAL seuil ! au-dela l'inversion est consideree trop faible |
---|
| 572 | PARAMETER (seuil=-0.02) |
---|
| 573 | ! PARAMETER (seuil=-0.04) |
---|
| 574 | ! PARAMETER (seuil=-0.06) |
---|
| 575 | ! PARAMETER (seuil=-0.09) |
---|
| 576 | |
---|
| 577 | ! |
---|
| 578 | ! Variables locales: |
---|
| 579 | ! |
---|
| 580 | INTEGER i, k, invb(knon) |
---|
| 581 | REAL zl2(knon) |
---|
| 582 | REAL zdthmin(knon), zdthdp |
---|
| 583 | |
---|
[793] | 584 | INCLUDE "indicesol.h" |
---|
| 585 | INCLUDE "YOMCST.h" |
---|
[782] | 586 | ! |
---|
| 587 | ! Initialiser les sorties |
---|
| 588 | ! |
---|
| 589 | DO k = 1, klev |
---|
| 590 | DO i = 1, knon |
---|
| 591 | pcfm(i,k) = 0.0 |
---|
| 592 | pcfh(i,k) = 0.0 |
---|
| 593 | ENDDO |
---|
| 594 | ENDDO |
---|
| 595 | |
---|
| 596 | ! |
---|
| 597 | ! Chercher la zone d'inversion forte |
---|
| 598 | ! |
---|
| 599 | DO i = 1, knon |
---|
| 600 | invb(i) = klev |
---|
| 601 | zdthmin(i)=0.0 |
---|
| 602 | ENDDO |
---|
| 603 | DO k = 2, klev/2-1 |
---|
| 604 | DO i = 1, knon |
---|
| 605 | zdthdp = (t(i,k)-t(i,k+1))/(pplay(i,k)-pplay(i,k+1)) & |
---|
| 606 | - RD * 0.5*(t(i,k)+t(i,k+1))/RCPD/paprs(i,k+1) |
---|
| 607 | zdthdp = zdthdp * 100.0 |
---|
| 608 | IF (pplay(i,k).GT.0.8*paprs(i,1) .AND. & |
---|
| 609 | zdthdp.LT.zdthmin(i) ) THEN |
---|
| 610 | zdthmin(i) = zdthdp |
---|
| 611 | invb(i) = k |
---|
| 612 | ENDIF |
---|
| 613 | ENDDO |
---|
| 614 | ENDDO |
---|
| 615 | |
---|
| 616 | ! |
---|
| 617 | ! Introduire une diffusion: |
---|
| 618 | ! |
---|
| 619 | IF ( nsrf.EQ.is_oce ) THEN |
---|
| 620 | DO k = 2, klev |
---|
| 621 | DO i = 1, knon |
---|
| 622 | !IM cf FH/GK IF ( (nsrf.NE.is_oce) .OR. ! si ce n'est pas sur l'ocean |
---|
| 623 | !IM cf FH/GK . (invb(i).EQ.klev) .OR. ! s'il n'y a pas d'inversion |
---|
| 624 | !IM cf JLD/ GKtest TERkz2 |
---|
| 625 | ! IF ( (nsrf.EQ.is_ter) .OR. ! si on est sur la terre |
---|
| 626 | ! fin GKtest |
---|
| 627 | |
---|
| 628 | |
---|
| 629 | ! s'il n'y a pas d'inversion ou si l'inversion est trop faible |
---|
| 630 | ! IF ( (nsrf.EQ.is_oce) .AND. & |
---|
| 631 | IF ( (invb(i).EQ.klev) .OR. (zdthmin(i).GT.seuil) ) THEN |
---|
| 632 | zl2(i)=(mixlen*MAX(0.0,(paprs(i,k)-paprs(i,klev+1)) & |
---|
| 633 | /(paprs(i,2)-paprs(i,klev+1)) ))**2 |
---|
| 634 | pcfm(i,k)= zl2(i)* kstable |
---|
| 635 | pcfh(i,k) = pcfm(i,k) /prandtl ! h et m different |
---|
| 636 | ENDIF |
---|
| 637 | ENDDO |
---|
| 638 | ENDDO |
---|
| 639 | ENDIF |
---|
| 640 | |
---|
| 641 | END SUBROUTINE coefkz2 |
---|
| 642 | ! |
---|
| 643 | !**************************************************************************************** |
---|
| 644 | ! |
---|
| 645 | END MODULE coef_diff_turb_mod |
---|