1 | SUBROUTINE stdlevvar(klon, knon, nsrf, zxli, & |
---|
2 | & u1, v1, t1, q1, z1, & |
---|
3 | & ts1, qsurf, rugos, psol, pat1, & |
---|
4 | & t_2m, q_2m, u_10m) |
---|
5 | IMPLICIT NONE |
---|
6 | !------------------------------------------------------------------------- |
---|
7 | ! |
---|
8 | ! Objet : calcul de la temperature et l'humidite relative a 2m et du |
---|
9 | ! module du vent a 10m a partir des relations de Dyer-Businger et |
---|
10 | ! des equations de Louis. |
---|
11 | ! |
---|
12 | ! Reference : Hess, Colman et McAvaney (1995) |
---|
13 | ! |
---|
14 | ! I. Musat, 01.07.2002 |
---|
15 | !------------------------------------------------------------------------- |
---|
16 | ! |
---|
17 | ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude) |
---|
18 | ! knon----input-I- nombre de points pour un type de surface |
---|
19 | ! nsrf----input-I- indice pour le type de surface; voir indicesol.inc |
---|
20 | ! zxli----input-L- TRUE si calcul des cdrags selon Laurent Li |
---|
21 | ! u1------input-R- vent zonal au 1er niveau du modele |
---|
22 | ! v1------input-R- vent meridien au 1er niveau du modele |
---|
23 | ! t1------input-R- temperature de l'air au 1er niveau du modele |
---|
24 | ! q1------input-R- humidite relative au 1er niveau du modele |
---|
25 | ! z1------input-R- geopotentiel au 1er niveau du modele |
---|
26 | ! ts1-----input-R- temperature de l'air a la surface |
---|
27 | ! qsurf---input-R- humidite relative a la surface |
---|
28 | ! rugos---input-R- rugosite |
---|
29 | ! psol----input-R- pression au sol |
---|
30 | ! pat1----input-R- pression au 1er niveau du modele |
---|
31 | ! |
---|
32 | ! t_2m---output-R- temperature de l'air a 2m |
---|
33 | ! q_2m---output-R- humidite relative a 2m |
---|
34 | ! u_10m--output-R- vitesse du vent a 10m |
---|
35 | ! |
---|
36 | INTEGER, intent(in) :: klon, knon, nsrf |
---|
37 | LOGICAL, intent(in) :: zxli |
---|
38 | REAL, dimension(klon), intent(in) :: u1, v1, t1, q1, z1, ts1 |
---|
39 | REAL, dimension(klon), intent(in) :: qsurf, rugos |
---|
40 | REAL, dimension(klon), intent(in) :: psol, pat1 |
---|
41 | ! |
---|
42 | REAL, dimension(klon), intent(out) :: t_2m, q_2m, u_10m |
---|
43 | !------------------------------------------------------------------------- |
---|
44 | #include "YOMCST.inc" |
---|
45 | !IM PLUS |
---|
46 | #include "YOETHF.inc" |
---|
47 | ! |
---|
48 | ! Quelques constantes et options: |
---|
49 | ! |
---|
50 | ! RKAR : constante de von Karman |
---|
51 | REAL, PARAMETER :: RKAR=0.40 |
---|
52 | ! niter : nombre iterations calcul "corrector" |
---|
53 | ! INTEGER, parameter :: niter=6, ncon=niter-1 |
---|
54 | INTEGER, parameter :: niter=2, ncon=niter-1 |
---|
55 | ! |
---|
56 | ! Variables locales |
---|
57 | INTEGER :: i, n |
---|
58 | REAL :: zref |
---|
59 | REAL, dimension(klon) :: speed |
---|
60 | ! tpot : temperature potentielle |
---|
61 | REAL, dimension(klon) :: tpot |
---|
62 | REAL, dimension(klon) :: zri1, cdran |
---|
63 | REAL, dimension(klon) :: cdram, cdrah |
---|
64 | ! ri1 : nb. de Richardson entre la surface --> la 1ere couche |
---|
65 | REAL, dimension(klon) :: ri1 |
---|
66 | REAL, dimension(klon) :: ustar, testar, qstar |
---|
67 | REAL, dimension(klon) :: zdte, zdq |
---|
68 | ! lmon : longueur de Monin-Obukhov selon Hess, Colman and McAvaney |
---|
69 | DOUBLE PRECISION, dimension(klon) :: lmon |
---|
70 | DOUBLE PRECISION, parameter :: eps=1.0D-20 |
---|
71 | REAL, dimension(klon) :: delu, delte, delq |
---|
72 | REAL, dimension(klon) :: u_zref, te_zref, q_zref |
---|
73 | REAL, dimension(klon) :: temp, pref |
---|
74 | LOGICAL :: okri |
---|
75 | REAL, dimension(klon) :: u_zref_p, te_zref_p, temp_p, q_zref_p |
---|
76 | !convertgence |
---|
77 | REAL, dimension(klon) :: te_zref_con, q_zref_con |
---|
78 | REAL, dimension(klon) :: u_zref_c, te_zref_c, temp_c, q_zref_c |
---|
79 | REAL, dimension(klon) :: ok_pred, ok_corr |
---|
80 | ! REAL, dimension(klon) :: conv_te, conv_q |
---|
81 | !------------------------------------------------------------------------- |
---|
82 | DO i=1, knon |
---|
83 | speed(i)=SQRT(u1(i)**2+v1(i)**2) |
---|
84 | ri1(i) = 0.0 |
---|
85 | ENDDO |
---|
86 | ! |
---|
87 | okri=.FALSE. |
---|
88 | CALL coefcdrag(klon, knon, nsrf, zxli, & |
---|
89 | & speed, t1, q1, z1, psol, & |
---|
90 | & ts1, qsurf, rugos, okri, ri1, & |
---|
91 | & cdram, cdrah, cdran, zri1, pref) |
---|
92 | ! |
---|
93 | !---------Star variables---------------------------------------------------- |
---|
94 | ! |
---|
95 | DO i = 1, knon |
---|
96 | ri1(i) = zri1(i) |
---|
97 | tpot(i) = t1(i)* (psol(i)/pat1(i))**RKAPPA |
---|
98 | ustar(i) = sqrt(cdram(i) * speed(i) * speed(i)) |
---|
99 | zdte(i) = tpot(i) - ts1(i) |
---|
100 | !IM cf FH : on prend le max : pour eviter le plantage sur SUN |
---|
101 | zdte(i) = max(zdte(i),1.e-10) |
---|
102 | zdq(i) = max(q1(i),0.0) - max(qsurf(i),0.0) |
---|
103 | ! |
---|
104 | testar(i) = (cdrah(i) * zdte(i) * speed(i))/ustar(i) |
---|
105 | qstar(i) = (cdrah(i) * zdq(i) * speed(i))/ustar(i) |
---|
106 | lmon(i) = (ustar(i) * ustar(i) * tpot(i))/ & |
---|
107 | & (RKAR * RG * testar(i)) |
---|
108 | ENDDO |
---|
109 | ! |
---|
110 | !----------First aproximation of variables at zref -------------------------- |
---|
111 | zref = 2.0 |
---|
112 | CALL screenp(klon, knon, nsrf, speed, tpot, q1, & |
---|
113 | & ts1, qsurf, rugos, lmon, & |
---|
114 | & ustar, testar, qstar, zref, & |
---|
115 | & delu, delte, delq) |
---|
116 | ! |
---|
117 | DO i = 1, knon |
---|
118 | u_zref(i) = delu(i) |
---|
119 | q_zref(i) = max(qsurf(i),0.0) + delq(i) |
---|
120 | te_zref(i) = ts1(i) + delte(i) |
---|
121 | temp(i) = te_zref(i) * (psol(i)/pat1(i))**(-RKAPPA) |
---|
122 | q_zref_p(i) = q_zref(i) |
---|
123 | ! te_zref_p(i) = te_zref(i) |
---|
124 | temp_p(i) = temp(i) |
---|
125 | ENDDO |
---|
126 | ! |
---|
127 | ! Iteration of the variables at the reference level zref : corrector calculation ; see Hess & McAvaney, 1995 |
---|
128 | ! |
---|
129 | DO n = 1, niter |
---|
130 | ! |
---|
131 | okri=.TRUE. |
---|
132 | CALL screenc(klon, knon, nsrf, zxli, & |
---|
133 | & u_zref, temp, q_zref, zref, & |
---|
134 | & ts1, qsurf, rugos, psol, & |
---|
135 | & ustar, testar, qstar, okri, ri1, & |
---|
136 | & pref, delu, delte, delq) |
---|
137 | ! |
---|
138 | DO i = 1, knon |
---|
139 | u_zref(i) = delu(i) |
---|
140 | q_zref(i) = delq(i) + max(qsurf(i),0.0) |
---|
141 | te_zref(i) = delte(i) + ts1(i) |
---|
142 | ! |
---|
143 | ! return to normal temperature |
---|
144 | ! |
---|
145 | temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA) |
---|
146 | ! temp(i) = te_zref(i) - (zref* RG)/RCPD/ & |
---|
147 | ! (1 + RVTMP2 * max(q_zref(i),0.0)) |
---|
148 | ! |
---|
149 | !IM +++ |
---|
150 | ! IF(temp(i).GT.350.) THEN |
---|
151 | ! WRITE(*,*) 'temp(i) GT 350 K !!',i,nsrf,temp(i) |
---|
152 | ! ENDIF |
---|
153 | !IM --- |
---|
154 | ! |
---|
155 | IF(n.EQ.ncon) THEN |
---|
156 | te_zref_con(i) = te_zref(i) |
---|
157 | q_zref_con(i) = q_zref(i) |
---|
158 | ENDIF |
---|
159 | ! |
---|
160 | ENDDO |
---|
161 | ! |
---|
162 | ENDDO |
---|
163 | ! |
---|
164 | ! verifier le critere de convergence : 0.25% pour te_zref et 5% pour qe_zref |
---|
165 | ! |
---|
166 | ! DO i = 1, knon |
---|
167 | ! conv_te(i) = (te_zref(i) - te_zref_con(i))/te_zref_con(i) |
---|
168 | ! conv_q(i) = (q_zref(i) - q_zref_con(i))/q_zref_con(i) |
---|
169 | !IM +++ |
---|
170 | ! IF(abs(conv_te(i)).GE.0.0025.AND.abs(conv_q(i)).GE.0.05) THEN |
---|
171 | ! PRINT*,'DIV','i=',i,te_zref_con(i),te_zref(i),conv_te(i), & |
---|
172 | ! q_zref_con(i),q_zref(i),conv_q(i) |
---|
173 | ! ENDIF |
---|
174 | !IM --- |
---|
175 | ! ENDDO |
---|
176 | ! |
---|
177 | DO i = 1, knon |
---|
178 | q_zref_c(i) = q_zref(i) |
---|
179 | temp_c(i) = temp(i) |
---|
180 | ! |
---|
181 | ! IF(zri1(i).LT.0.) THEN |
---|
182 | ! IF(nsrf.EQ.1) THEN |
---|
183 | ! ok_pred(i)=1. |
---|
184 | ! ok_corr(i)=0. |
---|
185 | ! ELSE |
---|
186 | ! ok_pred(i)=0. |
---|
187 | ! ok_corr(i)=1. |
---|
188 | ! ENDIF |
---|
189 | ! ELSE |
---|
190 | ! ok_pred(i)=0. |
---|
191 | ! ok_corr(i)=1. |
---|
192 | ! ENDIF |
---|
193 | ! |
---|
194 | ok_pred(i)=0. |
---|
195 | ok_corr(i)=1. |
---|
196 | ! |
---|
197 | t_2m(i) = temp_p(i) * ok_pred(i) + temp_c(i) * ok_corr(i) |
---|
198 | q_2m(i) = q_zref_p(i) * ok_pred(i) + q_zref_c(i) * ok_corr(i) |
---|
199 | !IM +++ |
---|
200 | ! IF(n.EQ.niter) THEN |
---|
201 | ! IF(t_2m(i).LT.t1(i).AND.t_2m(i).LT.ts1(i)) THEN |
---|
202 | ! PRINT*,' BAD t2m LT ',i,nsrf,t_2m(i),t1(i),ts1(i) |
---|
203 | ! ELSEIF(t_2m(i).GT.t1(i).AND.t_2m(i).GT.ts1(i)) THEN |
---|
204 | ! PRINT*,' BAD t2m GT ',i,nsrf,t_2m(i),t1(i),ts1(i) |
---|
205 | ! ENDIF |
---|
206 | ! ENDIF |
---|
207 | !IM --- |
---|
208 | ENDDO |
---|
209 | ! |
---|
210 | ! |
---|
211 | !----------First aproximation of variables at zref -------------------------- |
---|
212 | ! |
---|
213 | zref = 10.0 |
---|
214 | CALL screenp(klon, knon, nsrf, speed, tpot, q1, & |
---|
215 | & ts1, qsurf, rugos, lmon, & |
---|
216 | & ustar, testar, qstar, zref, & |
---|
217 | & delu, delte, delq) |
---|
218 | ! |
---|
219 | DO i = 1, knon |
---|
220 | u_zref(i) = delu(i) |
---|
221 | q_zref(i) = max(qsurf(i),0.0) + delq(i) |
---|
222 | te_zref(i) = ts1(i) + delte(i) |
---|
223 | temp(i) = te_zref(i) * (psol(i)/pat1(i))**(-RKAPPA) |
---|
224 | ! temp(i) = te_zref(i) - (zref* RG)/RCPD/ & |
---|
225 | ! (1 + RVTMP2 * max(q_zref(i),0.0)) |
---|
226 | u_zref_p(i) = u_zref(i) |
---|
227 | ENDDO |
---|
228 | ! |
---|
229 | ! Iteration of the variables at the reference level zref : corrector ; see Hess & McAvaney, 1995 |
---|
230 | ! |
---|
231 | DO n = 1, niter |
---|
232 | ! |
---|
233 | okri=.TRUE. |
---|
234 | CALL screenc(klon, knon, nsrf, zxli, & |
---|
235 | & u_zref, temp, q_zref, zref, & |
---|
236 | & ts1, qsurf, rugos, psol, & |
---|
237 | & ustar, testar, qstar, okri, ri1, & |
---|
238 | & pref, delu, delte, delq) |
---|
239 | ! |
---|
240 | DO i = 1, knon |
---|
241 | u_zref(i) = delu(i) |
---|
242 | q_zref(i) = delq(i) + max(qsurf(i),0.0) |
---|
243 | te_zref(i) = delte(i) + ts1(i) |
---|
244 | temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA) |
---|
245 | ! temp(i) = te_zref(i) - (zref* RG)/RCPD/ & |
---|
246 | ! (1 + RVTMP2 * max(q_zref(i),0.0)) |
---|
247 | ENDDO |
---|
248 | ! |
---|
249 | ENDDO |
---|
250 | ! |
---|
251 | DO i = 1, knon |
---|
252 | u_zref_c(i) = u_zref(i) |
---|
253 | ! |
---|
254 | u_10m(i) = u_zref_p(i) * ok_pred(i) + u_zref_c(i) * ok_corr(i) |
---|
255 | ENDDO |
---|
256 | ! |
---|
257 | RETURN |
---|
258 | END subroutine stdlevvar |
---|