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