1 |
guez |
54 |
module interfsurf_hq_m |
2 |
|
|
|
3 |
|
|
implicit none |
4 |
|
|
|
5 |
|
|
contains |
6 |
|
|
|
7 |
guez |
299 |
SUBROUTINE interfsurf_hq(julien, rmu0, nisurf, knindex, debut, tsoil, qsol, & |
8 |
|
|
u1_lay, v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, & |
9 |
|
|
qBcoef, precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, & |
10 |
|
|
p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, & |
11 |
|
|
albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0) |
12 |
guez |
54 |
|
13 |
guez |
150 |
! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface |
14 |
|
|
! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de |
15 |
|
|
! chaleur et d'humidit\'e. |
16 |
guez |
54 |
|
17 |
guez |
104 |
! Laurent Fairhead, February 2000 |
18 |
guez |
54 |
|
19 |
guez |
72 |
USE abort_gcm_m, ONLY: abort_gcm |
20 |
guez |
154 |
use alboc_cd_m, only: alboc_cd |
21 |
guez |
72 |
USE albsno_m, ONLY: albsno |
22 |
|
|
USE calcul_fluxs_m, ONLY: calcul_fluxs |
23 |
guez |
98 |
USE dimphy, ONLY: klon |
24 |
guez |
72 |
USE fonte_neige_m, ONLY: fonte_neige |
25 |
guez |
207 |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter |
26 |
guez |
297 |
USE conf_interface_m, ONLY: conf_interface |
27 |
guez |
72 |
USE interfsur_lim_m, ONLY: interfsur_lim |
28 |
guez |
293 |
use limit_read_sst_m, only: limit_read_sst |
29 |
guez |
101 |
use soil_m, only: soil |
30 |
guez |
178 |
USE suphec_m, ONLY: rcpd, rtt |
31 |
guez |
54 |
|
32 |
guez |
221 |
integer, intent(IN):: julien ! jour dans l'annee en cours |
33 |
guez |
99 |
real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal |
34 |
guez |
101 |
integer, intent(IN):: nisurf ! index de la surface a traiter |
35 |
|
|
|
36 |
guez |
106 |
integer, intent(in):: knindex(:) ! (knon) |
37 |
guez |
101 |
! index des points de la surface a traiter |
38 |
|
|
|
39 |
|
|
logical, intent(IN):: debut ! 1er appel a la physique |
40 |
guez |
54 |
! (si false calcul simplifie des fluxs sur les continents) |
41 |
guez |
101 |
|
42 |
guez |
208 |
REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx) |
43 |
guez |
101 |
|
44 |
guez |
225 |
REAL, intent(INOUT):: qsol(:) ! (knon) |
45 |
guez |
101 |
! column-density of water in soil, in kg m-2 |
46 |
|
|
|
47 |
guez |
225 |
real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche |
48 |
|
|
|
49 |
guez |
281 |
real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche |
50 |
|
|
real, intent(IN):: spechum(:) ! (knon) humidite specifique 1ere couche |
51 |
guez |
230 |
real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange |
52 |
guez |
215 |
|
53 |
guez |
299 |
real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon) |
54 |
guez |
215 |
! coefficients A de la r\'esolution de la couche limite pour t et q |
55 |
|
|
|
56 |
guez |
299 |
real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon) |
57 |
guez |
215 |
! coefficients B de la r\'esolution de la couche limite pour t et q |
58 |
guez |
101 |
|
59 |
|
|
real, intent(IN):: precip_rain(klon) |
60 |
guez |
175 |
! precipitation, liquid water mass flux (kg / m2 / s), positive down |
61 |
guez |
101 |
|
62 |
|
|
real, intent(IN):: precip_snow(klon) |
63 |
guez |
175 |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
64 |
guez |
101 |
|
65 |
guez |
282 |
real, intent(IN):: rugos(:) ! (knon) rugosite |
66 |
|
|
real, intent(IN):: rugoro(:) ! (knon) rugosite orographique |
67 |
guez |
215 |
real, intent(INOUT):: snow(:) ! (knon) |
68 |
guez |
283 |
real, intent(OUT):: qsurf(:) ! (knon) |
69 |
guez |
221 |
real, intent(IN):: ts(:) ! (knon) temp\'erature de surface |
70 |
guez |
281 |
real, intent(IN):: p1lay(:) ! (knon) pression 1er niveau (milieu de couche) |
71 |
guez |
280 |
real, intent(IN):: ps(:) ! (knon) pression au sol |
72 |
guez |
267 |
REAL, INTENT(IN):: radsol(:) ! (knon) rayonnement net au sol (LW + SW) |
73 |
guez |
206 |
real, intent(OUT):: evap(:) ! (knon) evaporation totale |
74 |
guez |
214 |
|
75 |
guez |
206 |
real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible |
76 |
guez |
214 |
! (Cp T) à la surface, positif vers le bas, W / m2 |
77 |
guez |
267 |
|
78 |
guez |
214 |
real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente |
79 |
guez |
222 |
real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon) |
80 |
guez |
207 |
real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol |
81 |
guez |
156 |
real, intent(OUT):: albedo(:) ! (knon) albedo |
82 |
guez |
282 |
real, intent(OUT):: z0_new(:) ! (knon) surface roughness |
83 |
guez |
202 |
|
84 |
|
|
real, intent(in):: pctsrf_new_sic(:) ! (klon) |
85 |
|
|
! nouvelle repartition des surfaces |
86 |
|
|
|
87 |
guez |
175 |
real, intent(INOUT):: agesno(:) ! (knon) |
88 |
guez |
54 |
|
89 |
guez |
282 |
real, intent(OUT):: fqcalving(:) ! (knon) |
90 |
guez |
215 |
! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la |
91 |
guez |
175 |
! hauteur de neige, en kg / m2 / s |
92 |
guez |
99 |
|
93 |
guez |
282 |
real, dimension(klon), intent(INOUT):: ffonte |
94 |
guez |
99 |
! Flux thermique utiliser pour fondre la neige |
95 |
|
|
|
96 |
|
|
real, dimension(klon), intent(INOUT):: run_off_lic_0 |
97 |
|
|
! run_off_lic_0 runoff glacier du pas de temps precedent |
98 |
|
|
|
99 |
|
|
! Local: |
100 |
guez |
222 |
integer knon ! nombre de points de la surface a traiter |
101 |
|
|
REAL soilcap(size(knindex)) ! (knon) |
102 |
|
|
REAL soilflux(size(knindex)) ! (knon) |
103 |
guez |
175 |
logical:: first_call = .true. |
104 |
|
|
integer ii |
105 |
guez |
222 |
real cal(size(knindex)) ! (knon) |
106 |
|
|
real beta(size(knindex)) ! (knon) evap reelle |
107 |
guez |
268 |
real dif_grnd(klon) |
108 |
guez |
222 |
real tsurf(size(knindex)) ! (knon) |
109 |
|
|
real alb_neig(size(knindex)) ! (knon) |
110 |
|
|
real zfra(size(knindex)) ! (knon) |
111 |
guez |
208 |
REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo |
112 |
guez |
268 |
REAL, PARAMETER:: max_eau_sol = 150. ! in kg m-2 |
113 |
guez |
269 |
REAL, PARAMETER:: tau_gl = 86400. * 5. |
114 |
guez |
54 |
|
115 |
|
|
!------------------------------------------------------------- |
116 |
|
|
|
117 |
guez |
222 |
knon = size(knindex) |
118 |
guez |
267 |
|
119 |
guez |
299 |
! On doit commencer par appeler les sch\'emas de surfaces |
120 |
|
|
! continentales car l'oc\'ean a besoin du ruissellement. |
121 |
guez |
54 |
|
122 |
|
|
if (first_call) then |
123 |
guez |
72 |
call conf_interface |
124 |
guez |
175 |
|
125 |
guez |
54 |
if (nisurf /= is_ter .and. klon > 1) then |
126 |
guez |
101 |
print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter |
127 |
|
|
print *, 'or on doit commencer par les surfaces continentales' |
128 |
guez |
175 |
call abort_gcm("interfsurf_hq", & |
129 |
guez |
299 |
'On doit commencer par les surfaces continentales.') |
130 |
guez |
54 |
endif |
131 |
guez |
175 |
|
132 |
guez |
101 |
if (is_oce > is_sic) then |
133 |
guez |
175 |
print *, 'is_oce = ', is_oce, '> is_sic = ', is_sic |
134 |
|
|
call abort_gcm("interfsurf_hq", & |
135 |
guez |
299 |
"L'oc\'ean doit \^etre trait\'e avant la banquise.") |
136 |
guez |
54 |
endif |
137 |
guez |
175 |
|
138 |
|
|
first_call = .false. |
139 |
guez |
54 |
endif |
140 |
|
|
|
141 |
|
|
! Initialisations diverses |
142 |
|
|
|
143 |
guez |
175 |
ffonte(1:knon) = 0. |
144 |
guez |
54 |
dif_grnd = 999999. |
145 |
|
|
|
146 |
|
|
! Aiguillage vers les differents schemas de surface |
147 |
|
|
|
148 |
guez |
104 |
select case (nisurf) |
149 |
|
|
case (is_ter) |
150 |
guez |
171 |
! Surface "terre", appel \`a l'interface avec les sols continentaux |
151 |
guez |
54 |
|
152 |
|
|
! Calcul age de la neige |
153 |
|
|
|
154 |
guez |
174 |
! Read albedo from the file containing boundary conditions then |
155 |
|
|
! add the albedo of snow: |
156 |
|
|
|
157 |
guez |
299 |
call interfsur_lim(julien, knindex, debut, albedo, z0_new) |
158 |
guez |
54 |
|
159 |
guez |
268 |
beta = min(2. * qsol / max_eau_sol, 1.) |
160 |
|
|
dif_grnd(:knon) = 0. |
161 |
guez |
299 |
CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux) |
162 |
guez |
267 |
cal = RCPD / soilcap |
163 |
guez |
171 |
|
164 |
guez |
299 |
CALL calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
165 |
guez |
283 |
radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, & |
166 |
guez |
299 |
v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, & |
167 |
|
|
flux_t, dflux_s, dflux_l) |
168 |
|
|
CALL fonte_neige(is_ter, precip_rain(:knon), precip_snow(:knon), snow, & |
169 |
|
|
qsol, tsurf_new, evap, fqcalving, ffonte(:knon), & |
170 |
guez |
280 |
run_off_lic_0(:knon)) |
171 |
guez |
54 |
|
172 |
guez |
299 |
call albsno(agesno, alb_neig, precip_snow(:knon)) |
173 |
guez |
215 |
where (snow < 0.0001) agesno = 0. |
174 |
|
|
zfra = max(0., min(1., snow / (snow + 10.))) |
175 |
guez |
174 |
albedo = alb_neig * zfra + albedo * (1. - zfra) |
176 |
guez |
101 |
z0_new = sqrt(z0_new**2 + rugoro**2) |
177 |
guez |
104 |
case (is_oce) |
178 |
guez |
175 |
! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean |
179 |
|
|
|
180 |
guez |
293 |
call limit_read_sst(julien, knindex, tsurf) |
181 |
guez |
54 |
cal = 0. |
182 |
|
|
beta = 1. |
183 |
|
|
dif_grnd = 0. |
184 |
guez |
299 |
call calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, radsol, & |
185 |
|
|
dif_grnd(:knon), temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
186 |
|
|
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
187 |
|
|
dflux_l) |
188 |
guez |
54 |
agesno = 0. |
189 |
guez |
209 |
albedo = alboc_cd(rmu0(knindex)) * fmagic |
190 |
guez |
54 |
z0_new = sqrt(rugos**2 + rugoro**2) |
191 |
guez |
279 |
fqcalving = 0. |
192 |
guez |
104 |
case (is_sic) |
193 |
guez |
54 |
! Surface "glace de mer" appel a l'interface avec l'ocean |
194 |
|
|
|
195 |
guez |
99 |
DO ii = 1, knon |
196 |
guez |
202 |
IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then |
197 |
guez |
175 |
snow(ii) = 0. |
198 |
guez |
99 |
tsurf_new(ii) = RTT - 1.8 |
199 |
guez |
267 |
tsoil(ii, :) = RTT - 1.8 |
200 |
guez |
221 |
else |
201 |
|
|
tsurf_new(ii) = ts(ii) |
202 |
guez |
99 |
endif |
203 |
|
|
enddo |
204 |
guez |
54 |
|
205 |
guez |
299 |
CALL soil(is_sic, snow, tsurf_new, tsoil, soilcap, soilflux) |
206 |
guez |
267 |
cal = RCPD / soilcap |
207 |
guez |
269 |
dif_grnd = 1. / tau_gl |
208 |
guez |
222 |
tsurf = tsurf_new |
209 |
guez |
175 |
beta = 1. |
210 |
guez |
54 |
|
211 |
guez |
299 |
CALL calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
212 |
guez |
283 |
radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, & |
213 |
guez |
299 |
v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, & |
214 |
|
|
flux_t, dflux_s, dflux_l) |
215 |
|
|
CALL fonte_neige(is_sic, precip_rain(:knon), precip_snow(:knon), snow, & |
216 |
|
|
qsol, tsurf_new, evap, fqcalving, ffonte(:knon), & |
217 |
|
|
run_off_lic_0(:knon)) |
218 |
guez |
54 |
|
219 |
guez |
174 |
! Compute the albedo: |
220 |
guez |
54 |
|
221 |
guez |
299 |
CALL albsno(agesno, alb_neig, precip_snow(:knon)) |
222 |
guez |
215 |
WHERE (snow < 0.0001) agesno = 0. |
223 |
|
|
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
224 |
guez |
175 |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
225 |
guez |
54 |
|
226 |
guez |
191 |
z0_new = SQRT(0.002**2 + rugoro**2) |
227 |
guez |
104 |
case (is_lic) |
228 |
guez |
54 |
! Surface "glacier continentaux" appel a l'interface avec le sol |
229 |
|
|
|
230 |
guez |
299 |
CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux) |
231 |
guez |
267 |
cal = RCPD / soilcap |
232 |
guez |
175 |
beta = 1. |
233 |
|
|
dif_grnd = 0. |
234 |
guez |
54 |
|
235 |
guez |
299 |
call calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
236 |
guez |
283 |
radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, & |
237 |
guez |
299 |
v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, & |
238 |
|
|
flux_t, dflux_s, dflux_l) |
239 |
|
|
call fonte_neige(is_lic, precip_rain(:knon), precip_snow(:knon), snow, & |
240 |
|
|
qsol, tsurf_new, evap, fqcalving, ffonte(:knon), & |
241 |
|
|
run_off_lic_0(:knon)) |
242 |
guez |
54 |
|
243 |
|
|
! calcul albedo |
244 |
guez |
299 |
CALL albsno(agesno, alb_neig, precip_snow(:knon)) |
245 |
guez |
215 |
WHERE (snow < 0.0001) agesno = 0. |
246 |
guez |
156 |
albedo = 0.77 |
247 |
guez |
54 |
|
248 |
|
|
! Rugosite |
249 |
|
|
z0_new = rugoro |
250 |
guez |
104 |
case default |
251 |
guez |
101 |
print *, 'Index surface = ', nisurf |
252 |
guez |
175 |
call abort_gcm("interfsurf_hq", 'Index surface non valable') |
253 |
guez |
104 |
end select |
254 |
guez |
54 |
|
255 |
|
|
END SUBROUTINE interfsurf_hq |
256 |
|
|
|
257 |
|
|
end module interfsurf_hq_m |