4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, debut, tsoil, qsol, & |
SUBROUTINE interfsurf_hq(julien, mu0, nisurf, knindex, tsoil, qsol, u1lay, & |
8 |
u1_lay, v1_lay, temp_air, spechum, tq_cdrag, tAcoef, qAcoef, tBcoef, & |
v1lay, temp_air, q1lay, cdragh, tAcoef, qAcoef, tBcoef, qBcoef, & |
9 |
qBcoef, precip_rain, precip_snow, rugos, rugoro, snow, qsurf, ts, & |
rain_fall, snow_fall, rugos, rugoro, snow, qsurf, ts, p1lay, ps, & |
10 |
p1lay, ps, radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, & |
radsol, evap, flux_t, fluxlat, dflux_l, dflux_s, tsurf_new, albedo, & |
11 |
albedo, z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0) |
z0_new, pctsrf_new_sic, agesno, fqcalving, ffonte, run_off_lic_0, & |
12 |
|
run_off_lic) |
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 |
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 |
23 |
USE calcul_fluxs_m, ONLY: calcul_fluxs |
USE calcul_fluxs_m, ONLY: calcul_fluxs |
|
USE dimphy, ONLY: klon |
|
24 |
USE fonte_neige_m, ONLY: fonte_neige |
USE fonte_neige_m, ONLY: fonte_neige |
25 |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter |
USE indicesol, ONLY: epsfra, is_lic, is_oce, is_sic, is_ter |
|
USE conf_interface_m, ONLY: conf_interface |
|
26 |
USE interfsur_lim_m, ONLY: interfsur_lim |
USE interfsur_lim_m, ONLY: interfsur_lim |
27 |
use limit_read_sst_m, only: limit_read_sst |
use limit_read_sst_m, only: limit_read_sst |
28 |
use soil_m, only: soil |
use soil_m, only: soil |
35 |
integer, intent(in):: knindex(:) ! (knon) |
integer, intent(in):: knindex(:) ! (knon) |
36 |
! index des points de la surface a traiter |
! index des points de la surface a traiter |
37 |
|
|
|
logical, intent(IN):: debut ! 1er appel a la physique |
|
|
! (si false calcul simplifie des fluxs sur les continents) |
|
|
|
|
38 |
REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx) |
REAL, intent(inout):: tsoil(:, :) ! (knon, nsoilmx) |
39 |
|
|
40 |
REAL, intent(INOUT):: qsol(:) ! (knon) |
REAL, intent(INOUT):: qsol(:) ! (knon) |
41 |
! column-density of water in soil, in kg m-2 |
! column-density of water in soil, in kg m-2 |
42 |
|
|
43 |
real, intent(IN):: u1_lay(:), v1_lay(:) ! (knon) vitesse 1ere couche |
real, intent(IN):: u1lay(:), v1lay(:) ! (knon) vitesse 1ere couche |
44 |
|
|
45 |
real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche |
real, intent(IN):: temp_air(:) ! (knon) temperature de l'air 1ere couche |
46 |
real, intent(IN):: spechum(:) ! (knon) humidite specifique 1ere couche |
|
47 |
real, intent(IN):: tq_cdrag(:) ! (knon) coefficient d'echange |
real, intent(IN):: q1lay(:) ! (knon) |
48 |
|
! humidit\'e sp\'ecifique de la premi\`ere couche |
49 |
|
|
50 |
|
real, intent(IN):: cdragh(:) ! (knon) coefficient d'echange |
51 |
|
|
52 |
real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon) |
real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon) |
53 |
! 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 |
55 |
real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon) |
real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon) |
56 |
! 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 |
57 |
|
|
58 |
real, intent(IN):: precip_rain(:) ! (knon) |
real, intent(IN):: rain_fall(:) ! (knon) |
59 |
! precipitation, liquid water mass flux (kg / m2 / s), positive down |
! precipitation, liquid water mass flux (kg / m2 / s), positive down |
60 |
|
|
61 |
real, intent(IN):: precip_snow(:) ! (knon) |
real, intent(IN):: snow_fall(:) ! (knon) |
62 |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
! precipitation, solid water mass flux (kg / m2 / s), positive down |
63 |
|
|
64 |
real, intent(IN):: rugos(:) ! (knon) rugosite |
real, intent(IN):: rugos(:) ! (knon) rugosite |
67 |
real, intent(OUT):: qsurf(:) ! (knon) |
real, intent(OUT):: qsurf(:) ! (knon) |
68 |
real, intent(IN):: ts(:) ! (knon) temp\'erature de surface |
real, intent(IN):: ts(:) ! (knon) temp\'erature de surface |
69 |
real, intent(IN):: p1lay(:) ! (knon) pression 1er niveau (milieu de couche) |
real, intent(IN):: p1lay(:) ! (knon) pression 1er niveau (milieu de couche) |
70 |
real, intent(IN):: ps(:) ! (knon) pression au sol |
real, intent(IN):: ps(:) ! (knon) pression au sol, en Pa |
71 |
REAL, INTENT(IN):: radsol(:) ! (knon) rayonnement net au sol (LW + SW) |
|
72 |
|
REAL, INTENT(IN):: radsol(:) ! (knon) |
73 |
|
! surface net downward radiative flux, in W / m2 |
74 |
|
|
75 |
real, intent(OUT):: evap(:) ! (knon) evaporation totale |
real, intent(OUT):: evap(:) ! (knon) evaporation totale |
76 |
|
|
77 |
real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible |
real, intent(OUT):: flux_t(:) ! (knon) flux de chaleur sensible |
78 |
! (Cp T) à la surface, positif vers le bas, W / m2 |
! (Cp T) à la surface, positif vers le bas, W / m2 |
79 |
|
|
80 |
real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente |
real, intent(OUT):: fluxlat(:) ! (knon) flux de chaleur latente, en W m-2 |
81 |
real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon) |
real, intent(OUT):: dflux_l(:), dflux_s(:) ! (knon) |
82 |
real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol |
real, intent(OUT):: tsurf_new(:) ! (knon) temp\'erature au sol |
83 |
real, intent(OUT):: albedo(:) ! (knon) albedo |
real, intent(OUT):: albedo(:) ! (knon) albedo |
98 |
real, intent(INOUT):: run_off_lic_0(:) ! (knon) |
real, intent(INOUT):: run_off_lic_0(:) ! (knon) |
99 |
! run_off_lic_0 runoff glacier du pas de temps precedent |
! run_off_lic_0 runoff glacier du pas de temps precedent |
100 |
|
|
101 |
|
REAL, intent(OUT):: run_off_lic(:) ! (knon) ruissellement total |
102 |
|
|
103 |
! Local: |
! Local: |
|
integer knon ! nombre de points de la surface a traiter |
|
104 |
REAL soilcap(size(knindex)) ! (knon) |
REAL soilcap(size(knindex)) ! (knon) |
105 |
REAL soilflux(size(knindex)) ! (knon) |
REAL soilflux(size(knindex)) ! (knon) |
|
logical:: first_call = .true. |
|
106 |
integer ii |
integer ii |
107 |
real cal(size(knindex)) ! (knon) |
real cal(size(knindex)) ! (knon) |
108 |
real beta(size(knindex)) ! (knon) evap reelle |
real beta(size(knindex)) ! (knon) evap reelle |
115 |
|
|
116 |
!------------------------------------------------------------- |
!------------------------------------------------------------- |
117 |
|
|
|
knon = size(knindex) |
|
|
|
|
|
! On doit commencer par appeler les sch\'emas de surfaces |
|
|
! continentales car l'oc\'ean a besoin du ruissellement. |
|
|
|
|
|
if (first_call) then |
|
|
call conf_interface |
|
|
|
|
|
if (nisurf /= is_ter .and. klon > 1) then |
|
|
print *, ' nisurf = ', nisurf, ' /= is_ter = ', is_ter |
|
|
call abort_gcm("interfsurf_hq", & |
|
|
'On doit commencer par les surfaces continentales.') |
|
|
endif |
|
|
|
|
|
if (is_oce > is_sic) then |
|
|
print *, 'is_oce = ', is_oce, '> is_sic = ', is_sic |
|
|
call abort_gcm("interfsurf_hq", & |
|
|
"L'oc\'ean doit \^etre trait\'e avant la banquise.") |
|
|
endif |
|
|
|
|
|
first_call = .false. |
|
|
endif |
|
|
|
|
|
! Aiguillage vers les differents schemas de surface |
|
|
|
|
118 |
select case (nisurf) |
select case (nisurf) |
119 |
case (is_ter) |
case (is_ter) |
120 |
! Surface "terre", appel \`a l'interface avec les sols continentaux |
! Surface "terre", appel \`a l'interface avec les sols continentaux |
124 |
! Read albedo from the file containing boundary conditions then |
! Read albedo from the file containing boundary conditions then |
125 |
! add the albedo of snow: |
! add the albedo of snow: |
126 |
|
|
127 |
call interfsur_lim(julien, knindex, debut, albedo, z0_new) |
call interfsur_lim(julien, knindex, albedo, z0_new) |
128 |
|
|
129 |
beta = min(2. * qsol / max_eau_sol, 1.) |
beta = min(2. * qsol / max_eau_sol, 1.) |
130 |
CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux) |
CALL soil(is_ter, snow, ts, tsoil, soilcap, soilflux) |
131 |
cal = RCPD / soilcap |
cal = RCPD / soilcap |
132 |
|
|
133 |
CALL calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
CALL calcul_fluxs(ts, p1lay, cal, beta, cdragh, ps, qsurf, & |
134 |
radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
radsol + soilflux, temp_air, q1lay, u1lay, v1lay, tAcoef, & |
135 |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
136 |
dflux_l, dif_grnd = 0.) |
dflux_l, dif_grnd = 0.) |
137 |
CALL fonte_neige(is_ter, precip_rain, precip_snow, snow, qsol, & |
CALL fonte_neige(is_ter, rain_fall, snow_fall, snow, qsol, & |
138 |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0) |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic) |
139 |
|
|
140 |
call albsno(agesno, alb_neig, precip_snow) |
call albsno(agesno, alb_neig, snow_fall) |
141 |
where (snow < 0.0001) agesno = 0. |
where (snow < 0.0001) agesno = 0. |
142 |
zfra = max(0., min(1., snow / (snow + 10.))) |
zfra = max(0., min(1., snow / (snow + 10.))) |
143 |
albedo = alb_neig * zfra + albedo * (1. - zfra) |
albedo = alb_neig * zfra + albedo * (1. - zfra) |
149 |
call limit_read_sst(julien, knindex, tsurf) |
call limit_read_sst(julien, knindex, tsurf) |
150 |
cal = 0. |
cal = 0. |
151 |
beta = 1. |
beta = 1. |
152 |
call calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, radsol, & |
call calcul_fluxs(tsurf, p1lay, cal, beta, cdragh, ps, qsurf, radsol, & |
153 |
temp_air, spechum, u1_lay, v1_lay, tAcoef, qAcoef, tBcoef, qBcoef, & |
temp_air, q1lay, u1lay, v1lay, tAcoef, qAcoef, tBcoef, qBcoef, & |
154 |
tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd = 0.) |
tsurf_new, evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd = 0.) |
155 |
agesno = 0. |
agesno = 0. |
156 |
albedo = alboc_cd(mu0) * fmagic |
albedo = alboc_cd(mu0) * fmagic |
159 |
case (is_sic) |
case (is_sic) |
160 |
! Surface "glace de mer" appel a l'interface avec l'ocean |
! Surface "glace de mer" appel a l'interface avec l'ocean |
161 |
|
|
162 |
DO ii = 1, knon |
DO ii = 1, size(knindex) |
163 |
IF (pctsrf_new_sic(ii) < EPSFRA) then |
IF (pctsrf_new_sic(ii) < EPSFRA) then |
164 |
snow(ii) = 0. |
snow(ii) = 0. |
165 |
tsurf_new(ii) = RTT - 1.8 |
tsurf_new(ii) = RTT - 1.8 |
173 |
cal = RCPD / soilcap |
cal = RCPD / soilcap |
174 |
tsurf = tsurf_new |
tsurf = tsurf_new |
175 |
beta = 1. |
beta = 1. |
176 |
CALL calcul_fluxs(tsurf, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
CALL calcul_fluxs(tsurf, p1lay, cal, beta, cdragh, ps, qsurf, & |
177 |
radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
radsol + soilflux, temp_air, q1lay, u1lay, v1lay, tAcoef, & |
178 |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
179 |
dflux_l, dif_grnd = 1. / tau_gl) |
dflux_l, dif_grnd = 1. / tau_gl) |
180 |
CALL fonte_neige(is_sic, precip_rain, precip_snow, snow, qsol, & |
CALL fonte_neige(is_sic, rain_fall, snow_fall, snow, qsol, & |
181 |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0) |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic) |
182 |
|
|
183 |
! Compute the albedo: |
! Compute the albedo: |
184 |
|
|
185 |
CALL albsno(agesno, alb_neig, precip_snow) |
CALL albsno(agesno, alb_neig, snow_fall) |
186 |
WHERE (snow < 0.0001) agesno = 0. |
WHERE (snow < 0.0001) agesno = 0. |
187 |
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
zfra = MAX(0., MIN(1., snow / (snow + 10.))) |
188 |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
albedo = alb_neig * zfra + 0.6 * (1. - zfra) |
194 |
CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux) |
CALL soil(is_lic, snow, ts, tsoil, soilcap, soilflux) |
195 |
cal = RCPD / soilcap |
cal = RCPD / soilcap |
196 |
beta = 1. |
beta = 1. |
197 |
call calcul_fluxs(ts, p1lay, cal, beta, tq_cdrag, ps, qsurf, & |
call calcul_fluxs(ts, p1lay, cal, beta, cdragh, ps, qsurf, & |
198 |
radsol + soilflux, temp_air, spechum, u1_lay, v1_lay, tAcoef, & |
radsol + soilflux, temp_air, q1lay, u1lay, v1lay, tAcoef, & |
199 |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
qAcoef, tBcoef, qBcoef, tsurf_new, evap, fluxlat, flux_t, dflux_s, & |
200 |
dflux_l, dif_grnd = 0.) |
dflux_l, dif_grnd = 0.) |
201 |
call fonte_neige(is_lic, precip_rain, precip_snow, snow, qsol, & |
call fonte_neige(is_lic, rain_fall, snow_fall, snow, qsol, & |
202 |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0) |
tsurf_new, evap, fqcalving, ffonte, run_off_lic_0, run_off_lic) |
203 |
|
|
204 |
! calcul albedo |
! calcul albedo |
205 |
CALL albsno(agesno, alb_neig, precip_snow) |
CALL albsno(agesno, alb_neig, snow_fall) |
206 |
WHERE (snow < 0.0001) agesno = 0. |
WHERE (snow < 0.0001) agesno = 0. |
207 |
albedo = 0.77 |
albedo = 0.77 |
208 |
|
|