/[lmdze]/trunk/Sources/phylmd/coefkzmin.f
ViewVC logotype

Contents of /trunk/Sources/phylmd/coefkzmin.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 134 - (show annotations)
Wed Apr 29 15:47:56 2015 UTC (9 years ago) by guez
File size: 3270 byte(s)
Sources inside, compilation outside.
1 module coefkzmin_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE coefkzmin(ngrid, ypaprs, ypplay, yu, yv, yt, yq, ycoefm, km, kn)
8
9 ! From LMDZ4/libf/phylmd/coefkzmin.F, version 1.1.1.1 2004/05/19 12:53:08
10
11 ! Entrées modifiées en attendant une version où les zlev et zlay
12 ! soient disponibles.
13
14 USE dimphy, ONLY: klev, klon
15 USE suphec_m, ONLY: rd, rg, rkappa
16
17 integer, intent(in):: ngrid
18 REAL, intent(in):: ypaprs(klon, klev+1), ypplay(klon, klev)
19 REAL, intent(in):: yu(klon, klev), yv(klon, klev) ! wind, in m s-1
20 REAL, intent(in):: yt(klon, klev) ! temperature, in K
21 REAL, intent(in):: yq(klon, klev)
22 REAL, intent(in):: ycoefm(:) ! (ngrid) drag coefficient
23
24 REAL, intent(inout):: km(klon, klev)
25 ! coefficient de diffusion turbulente de quantité de mouvement (au
26 ! bas de chaque couche) (en sortie : la valeur à la fin du pas de
27 ! temps), m2 s-1
28
29 REAL, intent(inout):: kn(klon, klev)
30 ! coefficient de diffusion turbulente des scalaires (au bas de
31 ! chaque couche) (en sortie : la valeur à la fin du pas de temps), m2 s-1
32
33 ! Local:
34
35 real ustar(ngrid) ! u*
36 real zlay(ngrid, klev) ! in m
37 integer i, k
38 real pblhmin(ngrid)
39 real, parameter:: coriol = 1e-4
40
41 REAL zlev(ngrid, 2: klev)
42 ! altitude at level (interface between layer with same index), in m
43
44 REAL teta(ngrid, klev)
45 ! température potentielle au centre de chaque couche (la valeur au
46 ! debut du pas de temps)
47
48 real, PARAMETER:: kap = 0.4
49
50 !---------------------------------------------------------------------
51
52 ! Debut de la partie qui doit etre incluse a terme dans clmain.
53
54 do i = 1, ngrid
55 zlay(i, 1) = RD * yt(i, 1) * 2 / (ypaprs(i, 1) + ypplay(i, 1)) &
56 * (ypaprs(i, 1) - ypplay(i, 1)) / RG
57 enddo
58
59 do k = 2, klev
60 do i = 1, ngrid
61 zlay(i, k) = zlay(i, k-1) + RD * 0.5 * (yt(i, k - 1) + yt(i, k)) &
62 / ypaprs(i, k) * (ypplay(i, k - 1) - ypplay(i, k)) / RG
63 enddo
64 enddo
65
66 do k=1, klev
67 do i = 1, ngrid
68 ! Attention : on passe la temperature potentielle virtuelle
69 ! pour le calcul de K.
70 teta(i, k) = yt(i, k) * (ypaprs(i, 1) / ypplay(i, k))**rkappa &
71 * (1. + 0.61 * yq(i, k))
72 enddo
73 enddo
74
75 forall (k = 2: klev) zlev(:, k) = 0.5 * (zlay(:, k) + zlay(:, k-1))
76 ustar = SQRT(ycoefm * (yu(:ngrid, 1)**2 + yv(:ngrid, 1)**2))
77
78 ! Fin de la partie qui doit être incluse à terme dans clmain
79
80 ! Cette routine est ecrite pour avoir en entree ustar, teta et zlev
81 ! Ici, on a inclus le calcul de ces trois variables dans la routine
82 ! coefkzmin en attendant une nouvelle version de la couche limite
83 ! ou ces variables seront disponibles.
84
85 ! Debut de la routine coefkzmin proprement dite
86
87 pblhmin = 0.07 * ustar / coriol
88
89 do k = 2, klev
90 do i = 1, ngrid
91 if (teta(i, 2) > teta(i, 1)) then
92 kn(i, k) = kap * zlev(i, k) * ustar(i) &
93 * (max(1. - zlev(i, k) / pblhmin(i), 0.))**2
94 else
95 kn(i, k) = 0. ! min n'est utilisé que pour les SL stables
96 endif
97 km(i, k) = kn(i, k)
98 enddo
99 enddo
100
101 end SUBROUTINE coefkzmin
102
103 end module coefkzmin_m

  ViewVC Help
Powered by ViewVC 1.1.21