1 |
module calcul_fluxs_m |
2 |
|
3 |
implicit none |
4 |
|
5 |
contains |
6 |
|
7 |
SUBROUTINE calcul_fluxs(tsurf, p1lay, cal, beta, cdragh, ps, qsurf, radsol, & |
8 |
t1lay, q1lay, u1lay, v1lay, tAcoef, qAcoef, tBcoef, qBcoef, tsurf_new, & |
9 |
evap, fluxlat, flux_t, dflux_s, dflux_l, dif_grnd) |
10 |
|
11 |
! Cette routine calcule les flux en h et q à l'interface et une |
12 |
! température de surface. |
13 |
|
14 |
! L. Fairhead, April 2000 |
15 |
|
16 |
! Note that, if cal = 0, beta = 1 and dif_grnd = 0, then tsurf_new |
17 |
! = tsurf and qsurf = qsat. |
18 |
|
19 |
! Libraries: |
20 |
use nr_util, only: assert_eq |
21 |
|
22 |
use comconst, only: dtphys |
23 |
USE fcttre, ONLY: foede, foeew |
24 |
USE suphec_m, ONLY: rcpd, rd, retv, rlstt, rlvtt, rtt |
25 |
USE yoethf_m, ONLY: r2es, r5ies, r5les, rvtmp2 |
26 |
|
27 |
real, intent(IN):: tsurf(:) ! (knon) température de surface |
28 |
|
29 |
real, intent(IN):: p1lay(:) ! (knon) |
30 |
! pression première couche (milieu de couche) |
31 |
|
32 |
real, intent(IN):: cal(:) ! (knon) capacité calorifique du sol |
33 |
real, intent(IN):: beta(:) ! (knon) évaporation réelle |
34 |
real, intent(IN):: cdragh(:) ! (knon) coefficient d'échange |
35 |
real, intent(IN):: ps(:) ! (knon) pression au sol, en Pa |
36 |
real, intent(OUT):: qsurf(:) ! (knon) humidité de l'air au-dessus du sol |
37 |
|
38 |
real, intent(IN):: radsol(:) ! (knon) |
39 |
! net downward radiative (longwave + shortwave) flux at the surface |
40 |
|
41 |
real, intent(IN):: dif_grnd ! coefficient de diffusion vers le sol profond |
42 |
real, intent(IN):: t1lay(:), q1lay(:), u1lay(:), v1lay(:) ! (knon) |
43 |
|
44 |
real, intent(IN):: tAcoef(:), qAcoef(:) ! (knon) |
45 |
! coefficients A de la résolution de la couche limite pour T et q |
46 |
|
47 |
real, intent(IN):: tBcoef(:), qBcoef(:) ! (knon) |
48 |
! coefficients B de la résolution de la couche limite pour t et q |
49 |
|
50 |
real, intent(OUT):: tsurf_new(:) ! (knon) température au sol |
51 |
real, intent(OUT):: evap(:) ! (knon) |
52 |
|
53 |
real, intent(OUT):: fluxlat(:), flux_t(:) ! (knon) |
54 |
! flux de chaleurs latente et sensible, en W m-2 |
55 |
|
56 |
real, intent(OUT):: dflux_s(:), dflux_l(:) ! (knon) |
57 |
! dérivées des flux de chaleurs sensible et latente par rapport à |
58 |
! Ts (W m-2 K-1) |
59 |
|
60 |
! Local: |
61 |
integer i |
62 |
integer knon ! nombre de points \`a traiter |
63 |
real, dimension(size(ps)):: mh, oh, mq, nq, oq, dq_s_dt, coef ! (knon) |
64 |
real qsat(size(ps)) ! (knon) mass fraction |
65 |
real sl(size(ps)) ! (knon) chaleur latente d'évaporation ou de sublimation |
66 |
logical delta |
67 |
real zcor |
68 |
real, parameter:: t_grnd = 271.35 |
69 |
real, parameter:: min_wind_speed = 1. ! in m s-1 |
70 |
|
71 |
!--------------------------------------------------------------------- |
72 |
|
73 |
knon = assert_eq([size(tsurf), size(p1lay), size(cal), size(beta), & |
74 |
size(cdragh), size(ps), size(qsurf), size(radsol), size(t1lay), & |
75 |
size(q1lay), size(u1lay), size(v1lay), size(tAcoef), size(qAcoef), & |
76 |
size(tBcoef), size(qBcoef), size(tsurf_new), size(evap), & |
77 |
size(fluxlat), size(flux_t), size(dflux_s), size(dflux_l)], & |
78 |
"calcul_fluxs knon") |
79 |
|
80 |
! Traitement de l'humidité du sol |
81 |
|
82 |
DO i = 1, knon |
83 |
delta = rtt >= tsurf(i) |
84 |
qsat(i) = MIN(0.5, r2es * FOEEW(tsurf(i), delta) / ps(i)) |
85 |
zcor = 1. / (1. - retv * qsat(i)) |
86 |
qsat(i) = qsat(i) * zcor |
87 |
dq_s_dt(i) = RCPD * FOEDE(tsurf(i), delta, merge(R5IES * RLSTT, & |
88 |
R5LES * RLVTT, delta) / RCPD / (1. + RVTMP2 * q1lay(i)), qsat(i), & |
89 |
zcor) / RLVTT |
90 |
ENDDO |
91 |
|
92 |
coef = cdragh * (min_wind_speed + SQRT(u1lay**2 + v1lay**2)) * p1lay & |
93 |
/ (RD * t1lay) |
94 |
sl = merge(RLSTT, RLVTT, tsurf < RTT) |
95 |
|
96 |
! Q |
97 |
oq = 1. - beta * coef * qBcoef * dtphys |
98 |
mq = beta * coef * (qAcoef - qsat + dq_s_dt * tsurf) / oq |
99 |
nq = - beta * coef * dq_s_dt / oq |
100 |
|
101 |
! H |
102 |
oh = 1. - coef * tBcoef * dtphys |
103 |
mh = coef * tAcoef / oh |
104 |
dflux_s = - coef * RCPD / oh |
105 |
|
106 |
tsurf_new = (tsurf + cal / RCPD * dtphys * (radsol + mh + sl * mq) & |
107 |
+ dif_grnd * t_grnd * dtphys) / (1. - dtphys * cal / RCPD * (dflux_s & |
108 |
+ sl * nq) + dtphys * dif_grnd) |
109 |
evap = - mq - nq * tsurf_new |
110 |
fluxlat = - evap * sl |
111 |
flux_t = mh + dflux_s * tsurf_new |
112 |
dflux_l = sl * nq |
113 |
qsurf = (qAcoef - qBcoef * evap * dtphys) * (1. - beta) + beta * (qsat & |
114 |
+ dq_s_dt * (tsurf_new - tsurf)) |
115 |
|
116 |
END SUBROUTINE calcul_fluxs |
117 |
|
118 |
end module calcul_fluxs_m |