4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE interfsurf_hq(dtime, jour, rmu0, nisurf, knon, knindex, debut, & |
SUBROUTINE interfsurf_hq(dtime, julien, rmu0, nisurf, knindex, debut, & |
8 |
tsoil, qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, & |
tsoil, qsol, u1_lay, v1_lay, temp_air, spechum, tq_cdrag, petAcoef, & |
9 |
peqAcoef, petBcoef, peqBcoef, precip_rain, precip_snow, fder, rugos, & |
peqAcoef, petBcoef, peqBcoef, precip_rain, precip_snow, rugos, rugoro, & |
10 |
rugoro, snow, qsurf, tsurf, p1lay, ps, radsol, evap, flux_t, fluxlat, & |
snow, qsurf, ts, p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, & |
11 |
dflux_l, dflux_s, tsurf_new, albedo, z0_new, pctsrf_new_sic, agesno, & |
dflux_s, tsurf_new, albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, & |
12 |
fqcalving, ffonte, run_off_lic_0) |
ffonte, run_off_lic_0) |
13 |
|
|
14 |
! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface |
! Cette routine sert d'aiguillage entre l'atmosph\`ere et la surface |
15 |
! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de |
! en g\'en\'eral (sols continentaux, oc\'eans, glaces) pour les flux de |
20 |
USE abort_gcm_m, ONLY: abort_gcm |
USE abort_gcm_m, ONLY: abort_gcm |
21 |
use alboc_cd_m, only: alboc_cd |
use alboc_cd_m, only: alboc_cd |
22 |
USE albsno_m, ONLY: albsno |
USE albsno_m, ONLY: albsno |
|
use calbeta_m, only: calbeta |
|
23 |
USE calcul_fluxs_m, ONLY: calcul_fluxs |
USE calcul_fluxs_m, ONLY: calcul_fluxs |
|
use clesphys2, only: soil_model |
|
24 |
USE dimphy, ONLY: klon |
USE dimphy, ONLY: klon |
25 |
USE fonte_neige_m, ONLY: fonte_neige |
USE fonte_neige_m, ONLY: fonte_neige |
26 |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter |
27 |
USE interface_surf, ONLY: run_off_lic, conf_interface |
USE interface_surf, ONLY: conf_interface |
28 |
USE interfsur_lim_m, ONLY: interfsur_lim |
USE interfsur_lim_m, ONLY: interfsur_lim |
29 |
use read_sst_m, only: read_sst |
use read_sst_m, only: read_sst |
30 |
use soil_m, only: soil |
use soil_m, only: soil |
31 |
USE suphec_m, ONLY: rcpd, rtt |
USE suphec_m, ONLY: rcpd, rtt |
32 |
|
|
33 |
real, intent(IN):: dtime ! pas de temps de la physique (en s) |
real, intent(IN):: dtime ! pas de temps de la physique (en s) |
34 |
integer, intent(IN):: jour ! jour dans l'annee en cours |
integer, intent(IN):: julien ! jour dans l'annee en cours |
35 |
real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal |
real, intent(IN):: rmu0(klon) ! cosinus de l'angle solaire zenithal |
36 |
integer, intent(IN):: nisurf ! index de la surface a traiter |
integer, intent(IN):: nisurf ! index de la surface a traiter |
|
integer, intent(IN):: knon ! nombre de points de la surface a traiter |
|
37 |
|
|
38 |
integer, intent(in):: knindex(:) ! (knon) |
integer, intent(in):: knindex(:) ! (knon) |
39 |
! index des points de la surface a traiter |
! index des points de la surface a traiter |
43 |
|
|
44 |
REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx) |
REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx) |
45 |
|
|
46 |
REAL, intent(INOUT):: qsol(klon) |
REAL, intent(INOUT):: qsol(:) ! (knon) |
47 |
! column-density of water in soil, in kg m-2 |
! column-density of water in soil, in kg m-2 |
48 |
|
|
49 |
real, dimension(klon), intent(IN):: u1_lay, v1_lay |
real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche |
50 |
! u1_lay vitesse u 1ere couche |
|
|
! v1_lay vitesse v 1ere couche |
|
51 |
real, dimension(klon), intent(IN):: temp_air, spechum |
real, dimension(klon), intent(IN):: temp_air, spechum |
52 |
! temp_air temperature de l'air 1ere couche |
! temp_air temperature de l'air 1ere couche |
53 |
! spechum humidite specifique 1ere couche |
! spechum humidite specifique 1ere couche |
54 |
real, dimension(klon), intent(INOUT):: tq_cdrag ! coefficient d'echange |
real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange |
55 |
|
|
56 |
real, dimension(klon), intent(IN):: petAcoef, peqAcoef |
real, dimension(klon), intent(IN):: petAcoef, peqAcoef |
57 |
! coefficients A de la r\'esolution de la couche limite pour t et q |
! coefficients A de la r\'esolution de la couche limite pour t et q |
65 |
real, intent(IN):: precip_snow(klon) |
real, intent(IN):: precip_snow(klon) |
66 |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
67 |
|
|
|
REAL, INTENT(INOUT):: fder(klon) ! derivee des flux (pour le couplage) |
|
68 |
real, intent(IN):: rugos(klon) ! rugosite |
real, intent(IN):: rugos(klon) ! rugosite |
69 |
real, intent(IN):: rugoro(klon) ! rugosite orographique |
real, intent(IN):: rugoro(klon) ! rugosite orographique |
70 |
real, intent(INOUT):: snow(:) ! (knon) |
real, intent(INOUT):: snow(:) ! (knon) |
71 |
real, intent(INOUT):: qsurf(klon) |
real, intent(INOUT):: qsurf(klon) |
72 |
real, intent(IN):: tsurf(:) ! (knon) temp\'erature de surface |
real, intent(IN):: ts(:) ! (knon) temp\'erature de surface |
73 |
real, intent(IN):: p1lay(klon) ! pression 1er niveau (milieu de couche) |
real, intent(IN):: p1lay(klon) ! pression 1er niveau (milieu de couche) |
74 |
real, dimension(klon), intent(IN):: ps ! pression au sol |
real, dimension(klon), intent(IN):: ps ! pression au sol |
75 |
|
REAL, INTENT(IN):: radsol(:) ! (knon) rayonnement net au sol (LW + SW) |
|
REAL, DIMENSION(klon), INTENT(INOUT):: radsol |
|
|
! rayonnement net au sol (LW + SW) |
|
|
|
|
76 |
real, intent(OUT):: evap(:) ! (knon) evaporation totale |
real, intent(OUT):: evap(:) ! (knon) evaporation totale |
77 |
|
|
78 |
real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible |
real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible |
79 |
! (Cp T) à la surface, positif vers le bas, W / m2 |
! (Cp T) à la surface, positif vers le bas, W / m2 |
80 |
|
|
81 |
real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente |
real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente |
82 |
real, dimension(klon), intent(OUT):: dflux_l, dflux_s |
real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon) |
83 |
real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol |
real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol |
84 |
real, intent(OUT):: albedo(:) ! (knon) albedo |
real, intent(OUT):: albedo(:) ! (knon) albedo |
85 |
real, intent(OUT):: z0_new(klon) ! surface roughness |
real, intent(OUT):: z0_new(klon) ! surface roughness |
100 |
! run_off_lic_0 runoff glacier du pas de temps precedent |
! run_off_lic_0 runoff glacier du pas de temps precedent |
101 |
|
|
102 |
! Local: |
! Local: |
103 |
REAL soilcap(knon) |
integer knon ! nombre de points de la surface a traiter |
104 |
REAL soilflux(knon) |
REAL soilcap(size(knindex)) ! (knon) |
105 |
|
REAL soilflux(size(knindex)) ! (knon) |
106 |
logical:: first_call = .true. |
logical:: first_call = .true. |
107 |
integer ii |
integer ii |
108 |
real cal(knon) |
real cal(size(knindex)) ! (knon) |
109 |
real beta(klon) ! evap reelle |
real beta(size(knindex)) ! (knon) evap reelle |
110 |
real dif_grnd(klon), capsol(klon) |
real dif_grnd(klon) |
111 |
real, parameter:: calice = 1. / (5.1444e6 * 0.15), tau_gl = 86400. * 5. |
real tsurf(size(knindex)) ! (knon) |
112 |
real, parameter:: calsno = 1. / (2.3867e6 * 0.15) |
real alb_neig(size(knindex)) ! (knon) |
113 |
real tsurf_temp(knon) |
real zfra(size(knindex)) ! (knon) |
|
real alb_neig(knon) |
|
|
real zfra(knon) |
|
114 |
REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo |
REAL, PARAMETER:: fmagic = 1. ! facteur magique pour r\'egler l'alb\'edo |
115 |
|
REAL, PARAMETER:: max_eau_sol = 150. ! in kg m-2 |
116 |
|
REAL, PARAMETER:: tau_gl = 86400. * 5. |
117 |
|
|
118 |
!------------------------------------------------------------- |
!------------------------------------------------------------- |
119 |
|
|
120 |
|
knon = size(knindex) |
121 |
|
|
122 |
! On doit commencer par appeler les schemas de surfaces continentales |
! On doit commencer par appeler les schemas de surfaces continentales |
123 |
! car l'ocean a besoin du ruissellement qui est y calcule |
! car l'ocean a besoin du ruissellement qui est y calcule |
124 |
|
|
145 |
|
|
146 |
ffonte(1:knon) = 0. |
ffonte(1:knon) = 0. |
147 |
fqcalving(1:knon) = 0. |
fqcalving(1:knon) = 0. |
|
cal = 999999. |
|
|
beta = 999999. |
|
148 |
dif_grnd = 999999. |
dif_grnd = 999999. |
|
capsol = 999999. |
|
149 |
z0_new = 999999. |
z0_new = 999999. |
|
tsurf_new = 999999. |
|
150 |
|
|
151 |
! Aiguillage vers les differents schemas de surface |
! Aiguillage vers les differents schemas de surface |
152 |
|
|
159 |
! Read albedo from the file containing boundary conditions then |
! Read albedo from the file containing boundary conditions then |
160 |
! add the albedo of snow: |
! add the albedo of snow: |
161 |
|
|
162 |
call interfsur_lim(dtime, jour, knindex, debut, albedo, z0_new) |
call interfsur_lim(dtime, julien, knindex, debut, albedo, z0_new) |
163 |
|
|
164 |
! Calcul de snow et qsurf, hydrologie adapt\'ee |
beta = min(2. * qsol / max_eau_sol, 1.) |
165 |
CALL calbeta(is_ter, snow, qsol(:knon), beta(:knon), & |
dif_grnd(:knon) = 0. |
166 |
capsol(:knon), dif_grnd(:knon)) |
CALL soil(dtime, is_ter, snow, ts, tsoil, soilcap, soilflux) |
167 |
|
cal = RCPD / soilcap |
168 |
IF (soil_model) THEN |
|
169 |
CALL soil(dtime, is_ter, snow, tsurf, tsoil, soilcap, soilflux) |
CALL calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag, & |
170 |
cal = RCPD / soilcap |
ps(:knon), qsurf(:knon), radsol + soilflux, dif_grnd(:knon), & |
171 |
radsol(1:knon) = radsol(1:knon) + soilflux |
temp_air(:knon), spechum(:knon), u1_lay, v1_lay, & |
172 |
ELSE |
petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), & |
173 |
cal = RCPD * capsol(:knon) |
peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l) |
|
ENDIF |
|
|
|
|
|
CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, & |
|
|
beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & |
|
|
radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & |
|
|
u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & |
|
|
petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, & |
|
|
fluxlat, flux_t, dflux_s(:knon), dflux_l(:knon)) |
|
174 |
CALL fonte_neige(is_ter, dtime, precip_rain(:knon), & |
CALL fonte_neige(is_ter, dtime, precip_rain(:knon), & |
175 |
precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, & |
precip_snow(:knon), snow, qsol, tsurf_new, evap, & |
176 |
fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) |
fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) |
177 |
|
|
178 |
call albsno(dtime, agesno, alb_neig, precip_snow(:knon)) |
call albsno(dtime, agesno, alb_neig, precip_snow(:knon)) |
183 |
case (is_oce) |
case (is_oce) |
184 |
! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean |
! Surface "oc\'ean", appel \`a l'interface avec l'oc\'ean |
185 |
|
|
186 |
call read_sst(dtime, jour, knindex, debut, tsurf_temp) |
call read_sst(julien, knindex, tsurf) |
187 |
cal = 0. |
cal = 0. |
188 |
beta = 1. |
beta = 1. |
189 |
dif_grnd = 0. |
dif_grnd = 0. |
190 |
|
call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, & |
191 |
|
tq_cdrag, ps(:knon), qsurf(:knon), radsol, & |
192 |
|
dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay, & |
193 |
|
v1_lay, petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), & |
194 |
|
peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l) |
195 |
agesno = 0. |
agesno = 0. |
|
call calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), cal, & |
|
|
beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & |
|
|
radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & |
|
|
u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & |
|
|
petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, & |
|
|
fluxlat, flux_t, dflux_s(:knon), dflux_l(:knon)) |
|
|
fder = fder + dflux_s + dflux_l |
|
196 |
albedo = alboc_cd(rmu0(knindex)) * fmagic |
albedo = alboc_cd(rmu0(knindex)) * fmagic |
197 |
z0_new = sqrt(rugos**2 + rugoro**2) |
z0_new = sqrt(rugos**2 + rugoro**2) |
198 |
case (is_sic) |
case (is_sic) |
199 |
! Surface "glace de mer" appel a l'interface avec l'ocean |
! Surface "glace de mer" appel a l'interface avec l'ocean |
200 |
|
|
201 |
DO ii = 1, knon |
DO ii = 1, knon |
|
tsurf_new(ii) = tsurf(ii) |
|
202 |
IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then |
IF (pctsrf_new_sic(knindex(ii)) < EPSFRA) then |
203 |
snow(ii) = 0. |
snow(ii) = 0. |
204 |
tsurf_new(ii) = RTT - 1.8 |
tsurf_new(ii) = RTT - 1.8 |
205 |
IF (soil_model) tsoil(ii, :) = RTT - 1.8 |
tsoil(ii, :) = RTT - 1.8 |
206 |
|
else |
207 |
|
tsurf_new(ii) = ts(ii) |
208 |
endif |
endif |
209 |
enddo |
enddo |
210 |
|
|
211 |
CALL calbeta(is_sic, snow, qsol(:knon), beta(:knon), & |
CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, soilflux) |
212 |
capsol(:knon), dif_grnd(:knon)) |
cal = RCPD / soilcap |
213 |
|
dif_grnd = 1. / tau_gl |
214 |
IF (soil_model) THEN |
tsurf = tsurf_new |
|
CALL soil(dtime, is_sic, snow, tsurf_new, tsoil, soilcap, & |
|
|
soilflux) |
|
|
cal = RCPD / soilcap |
|
|
radsol(1:knon) = radsol(1:knon) + soilflux |
|
|
dif_grnd = 0. |
|
|
ELSE |
|
|
dif_grnd = 1. / tau_gl |
|
|
cal = RCPD * calice |
|
|
WHERE (snow > 0.) cal = RCPD * calsno |
|
|
ENDIF |
|
|
tsurf_temp = tsurf_new |
|
215 |
beta = 1. |
beta = 1. |
216 |
|
|
217 |
CALL calcul_fluxs(dtime, tsurf_temp, p1lay(:knon), cal, & |
CALL calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, beta, & |
218 |
beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & |
tq_cdrag, ps(:knon), qsurf(:knon), radsol + soilflux, & |
219 |
radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & |
dif_grnd(:knon), temp_air(:knon), spechum(:knon), u1_lay, & |
220 |
u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & |
v1_lay, petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), & |
221 |
petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, & |
peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l) |
|
fluxlat, flux_t, dflux_s(:knon), dflux_l(:knon)) |
|
222 |
CALL fonte_neige(is_sic, dtime, precip_rain(:knon), & |
CALL fonte_neige(is_sic, dtime, precip_rain(:knon), & |
223 |
precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, & |
precip_snow(:knon), snow, qsol, tsurf_new, evap, & |
224 |
fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) |
fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) |
225 |
|
|
226 |
! Compute the albedo: |
! Compute the albedo: |
230 |
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
231 |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
232 |
|
|
|
fder = fder + dflux_s + dflux_l |
|
233 |
z0_new = SQRT(0.002**2 + rugoro**2) |
z0_new = SQRT(0.002**2 + rugoro**2) |
234 |
case (is_lic) |
case (is_lic) |
|
if (.not. allocated(run_off_lic)) then |
|
|
allocate(run_off_lic(knon)) |
|
|
run_off_lic = 0. |
|
|
endif |
|
|
|
|
235 |
! Surface "glacier continentaux" appel a l'interface avec le sol |
! Surface "glacier continentaux" appel a l'interface avec le sol |
236 |
|
|
237 |
IF (soil_model) THEN |
CALL soil(dtime, is_lic, snow, ts, tsoil, soilcap, soilflux) |
238 |
CALL soil(dtime, is_lic, snow, tsurf, tsoil, soilcap, soilflux) |
cal = RCPD / soilcap |
|
cal = RCPD / soilcap |
|
|
radsol(1:knon) = radsol(1:knon) + soilflux |
|
|
ELSE |
|
|
cal = RCPD * calice |
|
|
WHERE (snow > 0.) cal = RCPD * calsno |
|
|
ENDIF |
|
239 |
beta = 1. |
beta = 1. |
240 |
dif_grnd = 0. |
dif_grnd = 0. |
241 |
|
|
242 |
call calcul_fluxs(dtime, tsurf, p1lay(:knon), cal, & |
call calcul_fluxs(dtime, ts, p1lay(:knon), cal, beta, tq_cdrag, & |
243 |
beta(:knon), tq_cdrag(:knon), ps(:knon), qsurf(:knon), & |
ps(:knon), qsurf(:knon), radsol + soilflux, dif_grnd(:knon), & |
244 |
radsol(:knon), dif_grnd(:knon), temp_air(:knon), spechum(:knon), & |
temp_air(:knon), spechum(:knon), u1_lay, v1_lay, & |
245 |
u1_lay(:knon), v1_lay(:knon), petAcoef(:knon), peqAcoef(:knon), & |
petAcoef(:knon), peqAcoef(:knon), petBcoef(:knon), & |
246 |
petBcoef(:knon), peqBcoef(:knon), tsurf_new, evap, & |
peqBcoef(:knon), tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l) |
|
fluxlat, flux_t, dflux_s(:knon), dflux_l(:knon)) |
|
247 |
call fonte_neige(is_lic, dtime, precip_rain(:knon), & |
call fonte_neige(is_lic, dtime, precip_rain(:knon), & |
248 |
precip_snow(:knon), snow, qsol(:knon), tsurf_new, evap, & |
precip_snow(:knon), snow, qsol, tsurf_new, evap, & |
249 |
fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) |
fqcalving(:knon), ffonte(:knon), run_off_lic_0(:knon)) |
250 |
|
|
251 |
! calcul albedo |
! calcul albedo |