1 |
guez |
104 |
module stdlevvar_m |
2 |
|
|
|
3 |
|
|
IMPLICIT NONE |
4 |
|
|
|
5 |
|
|
contains |
6 |
|
|
|
7 |
|
|
SUBROUTINE stdlevvar(klon, knon, nsrf, zxli, u1, v1, t1, q1, z1, ts1, & |
8 |
|
|
qsurf, rugos, psol, pat1, t_2m, q_2m, t_10m, q_10m, u_10m, ustar) |
9 |
|
|
|
10 |
|
|
! From LMDZ4/libf/phylmd/stdlevvar.F90, version 1.3 2005/05/25 13:10:09 |
11 |
|
|
|
12 |
guez |
108 |
use coefcdrag_m, only: coefcdrag |
13 |
guez |
104 |
USE suphec_m, ONLY: rg, rkappa |
14 |
guez |
178 |
use screenp_m, only: screenp |
15 |
guez |
104 |
|
16 |
|
|
! Objet : calcul de la température et de l'humidité relative à 2 m |
17 |
|
|
! et du module du vent à 10 m à partir des relations de |
18 |
|
|
! Dyer-Businger et des équations de Louis. |
19 |
|
|
|
20 |
|
|
! Reference: Hess, Colman and McAvaney (1995) |
21 |
|
|
|
22 |
guez |
208 |
! Author: I. Musat, July 1st, 2002 |
23 |
guez |
104 |
|
24 |
|
|
INTEGER, intent(in):: klon |
25 |
|
|
! dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude) |
26 |
|
|
|
27 |
guez |
208 |
INTEGER, intent(in):: knon ! nombre de points pour un type de surface |
28 |
|
|
|
29 |
guez |
106 |
INTEGER, intent(in):: nsrf |
30 |
guez |
208 |
! indice pour le type de surface; voir indicesol.inc |
31 |
|
|
|
32 |
|
|
LOGICAL, intent(in):: zxli ! calcul des cdrags selon Laurent Li |
33 |
|
|
REAL, dimension(klon), intent(in):: u1 ! vent zonal au 1er niveau du modele |
34 |
|
|
|
35 |
|
|
REAL, dimension(klon), intent(in):: v1 |
36 |
|
|
! vent meridien au 1er niveau du modele |
37 |
|
|
|
38 |
|
|
REAL, dimension(klon), intent(in):: t1 |
39 |
|
|
! temperature de l'air au 1er niveau du modele |
40 |
|
|
|
41 |
guez |
106 |
REAL, dimension(klon), intent(in):: q1 |
42 |
guez |
208 |
! humidite relative au 1er niveau du modele |
43 |
guez |
104 |
|
44 |
guez |
208 |
REAL, dimension(klon), intent(in):: z1 |
45 |
|
|
! geopotentiel au 1er niveau du modele |
46 |
|
|
|
47 |
|
|
REAL, dimension(klon), intent(in):: ts1 ! temperature de l'air a la surface |
48 |
|
|
REAL, dimension(klon), intent(in):: qsurf ! humidite relative a la surface |
49 |
|
|
REAL, dimension(klon), intent(in):: rugos ! rugosite |
50 |
|
|
REAL, dimension(klon), intent(in):: psol ! pression au sol |
51 |
|
|
REAL, dimension(klon), intent(in):: pat1 ! pression au 1er niveau du modele |
52 |
|
|
REAL, dimension(klon), intent(out):: t_2m ! temperature de l'air a 2m |
53 |
|
|
REAL, dimension(klon), intent(out):: q_2m ! humidite relative a 2m |
54 |
|
|
REAL, dimension(klon), intent(out):: t_10m ! temperature de l'air a 10m |
55 |
|
|
REAL, dimension(klon), intent(out):: q_10m ! humidite specifique a 10m |
56 |
|
|
REAL, dimension(klon), intent(out):: u_10m ! vitesse du vent a 10m |
57 |
guez |
104 |
REAL, intent(out):: ustar(klon) ! u* |
58 |
|
|
|
59 |
|
|
! Local: |
60 |
|
|
|
61 |
|
|
! RKAR : constante de von Karman |
62 |
|
|
REAL, PARAMETER:: RKAR=0.40 |
63 |
|
|
! niter : nombre iterations calcul "corrector" |
64 |
guez |
188 |
INTEGER, parameter:: niter=2 |
65 |
guez |
104 |
|
66 |
|
|
! Variables locales |
67 |
|
|
INTEGER i, n |
68 |
|
|
REAL zref |
69 |
|
|
REAL, dimension(klon):: speed |
70 |
|
|
! tpot : temperature potentielle |
71 |
|
|
REAL, dimension(klon):: tpot |
72 |
|
|
REAL, dimension(klon):: zri1, cdran |
73 |
|
|
REAL cdram(klon), cdrah(klon) |
74 |
|
|
! ri1 : nb. de Richardson entre la surface --> la 1ere couche |
75 |
|
|
REAL, dimension(klon):: ri1 |
76 |
|
|
REAL, dimension(klon):: testar, qstar |
77 |
|
|
REAL, dimension(klon):: zdte, zdq |
78 |
|
|
! lmon : longueur de Monin-Obukhov selon Hess, Colman and McAvaney |
79 |
|
|
DOUBLE PRECISION, dimension(klon):: lmon |
80 |
|
|
REAL, dimension(klon):: delu, delte, delq |
81 |
|
|
REAL, dimension(klon):: u_zref, te_zref, q_zref |
82 |
|
|
REAL, dimension(klon):: temp, pref |
83 |
|
|
LOGICAL okri |
84 |
|
|
REAL, dimension(klon):: u_zref_p, temp_p, q_zref_p |
85 |
|
|
!convertgence |
86 |
|
|
REAL, dimension(klon):: u_zref_c, temp_c, q_zref_c |
87 |
|
|
REAL, dimension(klon):: ok_pred, ok_corr |
88 |
|
|
|
89 |
|
|
!------------------------------------------------------------------------- |
90 |
|
|
|
91 |
|
|
DO i=1, knon |
92 |
guez |
3 |
speed(i)=SQRT(u1(i)**2+v1(i)**2) |
93 |
|
|
ri1(i) = 0.0 |
94 |
guez |
104 |
ENDDO |
95 |
|
|
|
96 |
|
|
okri=.FALSE. |
97 |
|
|
CALL coefcdrag(klon, knon, nsrf, zxli, speed, t1, q1, z1, psol, ts1, & |
98 |
|
|
qsurf, rugos, okri, ri1, cdram, cdrah, cdran, zri1, pref) |
99 |
|
|
|
100 |
|
|
! Star variables |
101 |
|
|
|
102 |
|
|
DO i = 1, knon |
103 |
|
|
ri1(i) = zri1(i) |
104 |
|
|
tpot(i) = t1(i)* (psol(i)/pat1(i))**RKAPPA |
105 |
|
|
ustar(i) = sqrt(cdram(i) * speed(i) * speed(i)) |
106 |
|
|
zdte(i) = tpot(i) - ts1(i) |
107 |
|
|
zdq(i) = max(q1(i), 0.0) - max(qsurf(i), 0.0) |
108 |
|
|
|
109 |
|
|
zdte(i) = sign(max(abs(zdte(i)), 1.e-10), zdte(i)) |
110 |
|
|
|
111 |
|
|
testar(i) = (cdrah(i) * zdte(i) * speed(i))/ustar(i) |
112 |
|
|
qstar(i) = (cdrah(i) * zdq(i) * speed(i))/ustar(i) |
113 |
|
|
lmon(i) = (ustar(i) * ustar(i) * tpot(i))/ & |
114 |
|
|
(RKAR * RG * testar(i)) |
115 |
|
|
ENDDO |
116 |
|
|
|
117 |
|
|
! First aproximation of variables at zref |
118 |
|
|
zref = 2.0 |
119 |
guez |
178 |
CALL screenp(klon, knon, speed, tpot, q1, & |
120 |
guez |
104 |
ts1, qsurf, rugos, lmon, & |
121 |
|
|
ustar, testar, qstar, zref, & |
122 |
|
|
delu, delte, delq) |
123 |
|
|
|
124 |
|
|
DO i = 1, knon |
125 |
|
|
u_zref(i) = delu(i) |
126 |
|
|
q_zref(i) = max(qsurf(i), 0.0) + delq(i) |
127 |
|
|
te_zref(i) = ts1(i) + delte(i) |
128 |
|
|
temp(i) = te_zref(i) * (psol(i)/pat1(i))**(-RKAPPA) |
129 |
|
|
q_zref_p(i) = q_zref(i) |
130 |
|
|
temp_p(i) = temp(i) |
131 |
|
|
ENDDO |
132 |
|
|
|
133 |
|
|
! Iteration of the variables at the reference level zref : |
134 |
|
|
! corrector calculation ; see Hess & McAvaney, 1995 |
135 |
|
|
|
136 |
|
|
DO n = 1, niter |
137 |
|
|
okri=.TRUE. |
138 |
|
|
CALL screenc(klon, knon, nsrf, zxli, & |
139 |
|
|
u_zref, temp, q_zref, zref, & |
140 |
|
|
ts1, qsurf, rugos, psol, & |
141 |
|
|
ustar, testar, qstar, okri, ri1, & |
142 |
|
|
pref, delu, delte, delq) |
143 |
|
|
|
144 |
|
|
DO i = 1, knon |
145 |
guez |
3 |
u_zref(i) = delu(i) |
146 |
guez |
104 |
q_zref(i) = delq(i) + max(qsurf(i), 0.0) |
147 |
guez |
3 |
te_zref(i) = delte(i) + ts1(i) |
148 |
guez |
104 |
|
149 |
|
|
! return to normal temperature |
150 |
|
|
|
151 |
guez |
3 |
temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA) |
152 |
guez |
104 |
ENDDO |
153 |
|
|
ENDDO |
154 |
|
|
|
155 |
|
|
! verifier le critere de convergence : 0.25% pour te_zref et 5% pour qe_zref |
156 |
|
|
|
157 |
|
|
DO i = 1, knon |
158 |
|
|
q_zref_c(i) = q_zref(i) |
159 |
|
|
temp_c(i) = temp(i) |
160 |
|
|
|
161 |
|
|
ok_pred(i)=0. |
162 |
|
|
ok_corr(i)=1. |
163 |
|
|
|
164 |
|
|
t_2m(i) = temp_p(i) * ok_pred(i) + temp_c(i) * ok_corr(i) |
165 |
|
|
q_2m(i) = q_zref_p(i) * ok_pred(i) + q_zref_c(i) * ok_corr(i) |
166 |
|
|
ENDDO |
167 |
|
|
|
168 |
|
|
! First aproximation of variables at zref |
169 |
|
|
|
170 |
|
|
zref = 10.0 |
171 |
guez |
178 |
CALL screenp(klon, knon, speed, tpot, q1, & |
172 |
guez |
104 |
ts1, qsurf, rugos, lmon, & |
173 |
|
|
ustar, testar, qstar, zref, & |
174 |
|
|
delu, delte, delq) |
175 |
|
|
|
176 |
|
|
DO i = 1, knon |
177 |
|
|
u_zref(i) = delu(i) |
178 |
|
|
q_zref(i) = max(qsurf(i), 0.0) + delq(i) |
179 |
|
|
te_zref(i) = ts1(i) + delte(i) |
180 |
|
|
temp(i) = te_zref(i) * (psol(i)/pat1(i))**(-RKAPPA) |
181 |
|
|
u_zref_p(i) = u_zref(i) |
182 |
|
|
ENDDO |
183 |
|
|
|
184 |
|
|
! Iteration of the variables at the reference level zref: |
185 |
|
|
! corrector ; see Hess & McAvaney, 1995 |
186 |
|
|
|
187 |
|
|
DO n = 1, niter |
188 |
|
|
okri=.TRUE. |
189 |
|
|
CALL screenc(klon, knon, nsrf, zxli, & |
190 |
|
|
u_zref, temp, q_zref, zref, & |
191 |
|
|
ts1, qsurf, rugos, psol, & |
192 |
|
|
ustar, testar, qstar, okri, ri1, & |
193 |
|
|
pref, delu, delte, delq) |
194 |
|
|
|
195 |
|
|
DO i = 1, knon |
196 |
guez |
3 |
u_zref(i) = delu(i) |
197 |
guez |
104 |
q_zref(i) = delq(i) + max(qsurf(i), 0.0) |
198 |
guez |
3 |
te_zref(i) = delte(i) + ts1(i) |
199 |
|
|
temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA) |
200 |
guez |
104 |
ENDDO |
201 |
|
|
ENDDO |
202 |
|
|
|
203 |
|
|
DO i = 1, knon |
204 |
|
|
u_zref_c(i) = u_zref(i) |
205 |
|
|
|
206 |
|
|
u_10m(i) = u_zref_p(i) * ok_pred(i) + u_zref_c(i) * ok_corr(i) |
207 |
|
|
|
208 |
|
|
q_zref_c(i) = q_zref(i) |
209 |
|
|
temp_c(i) = temp(i) |
210 |
|
|
t_10m(i) = temp_p(i) * ok_pred(i) + temp_c(i) * ok_corr(i) |
211 |
|
|
q_10m(i) = q_zref_p(i) * ok_pred(i) + q_zref_c(i) * ok_corr(i) |
212 |
|
|
ENDDO |
213 |
|
|
|
214 |
|
|
END subroutine stdlevvar |
215 |
|
|
|
216 |
|
|
end module stdlevvar_m |