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