4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE interfsurf_hq(julien, rmu0, nisurf, knindex, debut, tsoil, qsol, & |
SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, debut, tsoil, qsol, & |
8 |
u1_lay, v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, & |
u1_lay, v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, & |
9 |
qBcoef, precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, & |
qBcoef, precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, & |
10 |
p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, & |
p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, & |
30 |
USE suphec_m, ONLY: rcpd, rtt |
USE suphec_m, ONLY: rcpd, rtt |
31 |
|
|
32 |
integer, intent(IN):: julien ! jour dans l'annee en cours |
integer, intent(IN):: julien ! jour dans l'annee en cours |
33 |
real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal |
real, intent(IN):: mu0(:) ! (knon) cosinus de l'angle solaire zenithal |
34 |
integer, intent(IN):: nisurf ! index de la surface a traiter |
integer, intent(IN):: nisurf ! index de la surface a traiter |
35 |
|
|
36 |
integer, intent(in):: knindex(:) ! (knon) |
integer, intent(in):: knindex(:) ! (knon) |
56 |
real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon) |
real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon) |
57 |
! coefficients B de la r\'esolution de la couche limite pour t et q |
! coefficients B de la r\'esolution de la couche limite pour t et q |
58 |
|
|
59 |
real, intent(IN):: precip_rain(klon) |
real, intent(IN):: precip_rain(:) ! (knon) |
60 |
! precipitation, liquid water mass flux (kg / m2 / s), positive down |
! precipitation, liquid water mass flux (kg / m2 / s), positive down |
61 |
|
|
62 |
real, intent(IN):: precip_snow(klon) |
real, intent(IN):: precip_snow(:) ! (knon) |
63 |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
64 |
|
|
65 |
real, intent(IN):: rugos(:) ! (knon) rugosite |
real, intent(IN):: rugos(:) ! (knon) rugosite |
81 |
real, intent(OUT):: albedo(:) ! (knon) albedo |
real, intent(OUT):: albedo(:) ! (knon) albedo |
82 |
real, intent(OUT):: z0_new(:) ! (knon) surface roughness |
real, intent(OUT):: z0_new(:) ! (knon) surface roughness |
83 |
|
|
84 |
real, intent(in):: pctsrf_new_sic(:) ! (klon) |
real, intent(in):: pctsrf_new_sic(:) ! (knon) |
85 |
! nouvelle repartition des surfaces |
! nouvelle repartition des surfaces |
86 |
|
|
87 |
real, intent(INOUT):: agesno(:) ! (knon) |
real, intent(INOUT):: agesno(:) ! (knon) |
90 |
! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la |
! Flux d'eau "perdue" par la surface et n\'ecessaire pour limiter la |
91 |
! hauteur de neige, en kg / m2 / s |
! hauteur de neige, en kg / m2 / s |
92 |
|
|
93 |
real, dimension(klon), intent(INOUT):: ffonte |
real, intent(OUT):: ffonte(:) ! (knon) |
94 |
! Flux thermique utiliser pour fondre la neige |
! flux thermique utilis\'e pour fondre la neige |
95 |
|
|
96 |
real, dimension(klon), intent(INOUT):: run_off_lic_0 |
real, intent(INOUT):: run_off_lic_0(:) ! (knon) |
97 |
! run_off_lic_0 runoff glacier du pas de temps precedent |
! run_off_lic_0 runoff glacier du pas de temps precedent |
98 |
|
|
99 |
! Local: |
! Local: |
104 |
integer ii |
integer ii |
105 |
real cal(size(knindex)) ! (knon) |
real cal(size(knindex)) ! (knon) |
106 |
real beta(size(knindex)) ! (knon) evap reelle |
real beta(size(knindex)) ! (knon) evap reelle |
|
real dif_grnd(klon) |
|
107 |
real tsurf(size(knindex)) ! (knon) |
real tsurf(size(knindex)) ! (knon) |
108 |
real alb_neig(size(knindex)) ! (knon) |
real alb_neig(size(knindex)) ! (knon) |
109 |
real zfra(size(knindex)) ! (knon) |
real zfra(size(knindex)) ! (knon) |
123 |
|
|
124 |
if (nisurf /= is_ter .and. klon > 1) then |
if (nisurf /= is_ter .and. klon > 1) then |
125 |
print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter |
print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter |
|
print *, 'or on doit commencer par les surfaces continentales' |
|
126 |
call abort_gcm("interfsurf_hq", & |
call abort_gcm("interfsurf_hq", & |
127 |
'On doit commencer par les surfaces continentales.') |
'On doit commencer par les surfaces continentales.') |
128 |
endif |
endif |
136 |
first_call = .false. |
first_call = .false. |
137 |
endif |
endif |
138 |
|
|
|
! Initialisations diverses |
|
|
|
|
|
ffonte(1:knon) = 0. |
|
|
dif_grnd = 999999. |
|
|
|
|
139 |
! Aiguillage vers les differents schemas de surface |
! Aiguillage vers les differents schemas de surface |
140 |
|
|
141 |
select case (nisurf) |
select case (nisurf) |
150 |
call interfsur_lim(julien, knindex, debut, albedo, z0_new) |
call interfsur_lim(julien, knindex, debut, albedo, z0_new) |
151 |
|
|
152 |
beta = min(2. * qsol / max_eau_sol, 1.) |
beta = min(2. * qsol / max_eau_sol, 1.) |
|
dif_grnd(:knon) = 0. |
|
153 |
CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux) |
CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux) |
154 |
cal = RCPD / soilcap |
cal = RCPD / soilcap |
155 |
|
|
156 |
CALL calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
CALL calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
157 |
radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, & |
radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
158 |
v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, & |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
159 |
flux_t, dflux_s, dflux_l) |
dflux_l, dif_grnd = 0.) |
160 |
CALL fonte_neige(is_ter, precip_rain(:knon), precip_snow(:knon), snow, & |
CALL fonte_neige(is_ter, precip_rain, precip_snow, snow, qsol, & |
161 |
qsol, tsurf_new, evap, fqcalving, ffonte(:knon), & |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0) |
|
run_off_lic_0(:knon)) |
|
162 |
|
|
163 |
call albsno(agesno, alb_neig, precip_snow(:knon)) |
call albsno(agesno, alb_neig, precip_snow) |
164 |
where (snow < 0.0001) agesno = 0. |
where (snow < 0.0001) agesno = 0. |
165 |
zfra = max(0., min(1., snow / (snow + 10.))) |
zfra = max(0., min(1., snow / (snow + 10.))) |
166 |
albedo = alb_neig * zfra + albedo * (1. - zfra) |
albedo = alb_neig * zfra + albedo * (1. - zfra) |
168 |
case (is_oce) |
case (is_oce) |
169 |
! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean |
! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean |
170 |
|
|
171 |
|
ffonte = 0. |
172 |
call limit_read_sst(julien, knindex, tsurf) |
call limit_read_sst(julien, knindex, tsurf) |
173 |
cal = 0. |
cal = 0. |
174 |
beta = 1. |
beta = 1. |
|
dif_grnd = 0. |
|
175 |
call calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, radsol, & |
call calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, radsol, & |
176 |
dif_grnd(:knon), temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
temp_air, spechum, u1_lay, v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, & |
177 |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd = 0.) |
|
dflux_l) |
|
178 |
agesno = 0. |
agesno = 0. |
179 |
albedo = alboc_cd(rmu0(knindex)) * fmagic |
albedo = alboc_cd(mu0) * fmagic |
180 |
z0_new = sqrt(rugos**2 + rugoro**2) |
z0_new = sqrt(rugos**2 + rugoro**2) |
181 |
fqcalving = 0. |
fqcalving = 0. |
182 |
case (is_sic) |
case (is_sic) |
183 |
! Surface "glace de mer" appel a l'interface avec l'ocean |
! Surface "glace de mer" appel a l'interface avec l'ocean |
184 |
|
|
185 |
DO ii = 1, knon |
DO ii = 1, knon |
186 |
IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then |
IF (pctsrf_new_sic(ii) < EPSFRA) then |
187 |
snow(ii) = 0. |
snow(ii) = 0. |
188 |
tsurf_new(ii) = RTT - 1.8 |
tsurf_new(ii) = RTT - 1.8 |
189 |
tsoil(ii, :) = RTT - 1.8 |
tsoil(ii, :) = RTT - 1.8 |
194 |
|
|
195 |
CALL soil(is_sic, snow, tsurf_new, tsoil, soilcap, soilflux) |
CALL soil(is_sic, snow, tsurf_new, tsoil, soilcap, soilflux) |
196 |
cal = RCPD / soilcap |
cal = RCPD / soilcap |
|
dif_grnd = 1. / tau_gl |
|
197 |
tsurf = tsurf_new |
tsurf = tsurf_new |
198 |
beta = 1. |
beta = 1. |
|
|
|
199 |
CALL calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
CALL calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
200 |
radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, & |
radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
201 |
v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, & |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
202 |
flux_t, dflux_s, dflux_l) |
dflux_l, dif_grnd = 1. / tau_gl) |
203 |
CALL fonte_neige(is_sic, precip_rain(:knon), precip_snow(:knon), snow, & |
CALL fonte_neige(is_sic, precip_rain, precip_snow, snow, qsol, & |
204 |
qsol, tsurf_new, evap, fqcalving, ffonte(:knon), & |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0) |
|
run_off_lic_0(:knon)) |
|
205 |
|
|
206 |
! Compute the albedo: |
! Compute the albedo: |
207 |
|
|
208 |
CALL albsno(agesno, alb_neig, precip_snow(:knon)) |
CALL albsno(agesno, alb_neig, precip_snow) |
209 |
WHERE (snow < 0.0001) agesno = 0. |
WHERE (snow < 0.0001) agesno = 0. |
210 |
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
211 |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
217 |
CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux) |
CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux) |
218 |
cal = RCPD / soilcap |
cal = RCPD / soilcap |
219 |
beta = 1. |
beta = 1. |
|
dif_grnd = 0. |
|
|
|
|
220 |
call calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
call calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
221 |
radsol + soilflux, dif_grnd(:knon), temp_air, spechum, u1_lay, & |
radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
222 |
v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, & |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
223 |
flux_t, dflux_s, dflux_l) |
dflux_l, dif_grnd = 0.) |
224 |
call fonte_neige(is_lic, precip_rain(:knon), precip_snow(:knon), snow, & |
call fonte_neige(is_lic, precip_rain, precip_snow, snow, qsol, & |
225 |
qsol, tsurf_new, evap, fqcalving, ffonte(:knon), & |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0) |
|
run_off_lic_0(:knon)) |
|
226 |
|
|
227 |
! calcul albedo |
! calcul albedo |
228 |
CALL albsno(agesno, alb_neig, precip_snow(:knon)) |
CALL albsno(agesno, alb_neig, precip_snow) |
229 |
WHERE (snow < 0.0001) agesno = 0. |
WHERE (snow < 0.0001) agesno = 0. |
230 |
albedo = 0.77 |
albedo = 0.77 |
231 |
|
|