4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE soil(dtime, nisurf, snow, tsurf, tsoil, soilcap, soilflux) |
SUBROUTINE soil(nisurf, snow, tsurf, tsoil, soilcap, soilflux) |
8 |
|
|
9 |
! From LMDZ4/libf/phylmd/soil.F, version 1.1.1.1, 2004/05/19 |
! From LMDZ4/libf/phylmd/soil.F, version 1.1.1.1, 2004/05/19 |
10 |
|
|
31 |
! F0 = A + B (Ts(t)) |
! F0 = A + B (Ts(t)) |
32 |
! Soilcap = B * dt |
! Soilcap = B * dt |
33 |
|
|
34 |
|
use comconst, only: dtphys |
35 |
USE indicesol, only: nbsrf, is_lic, is_oce, is_sic, is_ter |
USE indicesol, only: nbsrf, is_lic, is_oce, is_sic, is_ter |
36 |
USE dimphy, only: klon |
USE dimphy, only: klon |
37 |
USE dimsoil, only: nsoilmx |
USE dimsoil, only: nsoilmx |
38 |
USE suphec_m, only: rtt |
USE suphec_m, only: rtt |
39 |
|
|
|
REAL, intent(in):: dtime ! physical timestep (s) |
|
40 |
INTEGER, intent(in):: nisurf ! sub-surface index |
INTEGER, intent(in):: nisurf ! sub-surface index |
41 |
REAL, intent(in):: snow(:) ! (knon) |
REAL, intent(in):: snow(:) ! (knon) |
42 |
REAL, intent(in):: tsurf(:) ! (knon) surface temperature at time-step t (K) |
REAL, intent(in):: tsurf(:) ! (knon) surface temperature at time-step t (K) |
139 |
! PB |
! PB |
140 |
firstsurf(nisurf) = .FALSE. |
firstsurf(nisurf) = .FALSE. |
141 |
ELSE |
ELSE |
142 |
! Computation of the soil temperatures using the Cgrd and Dgrd |
! Computation of the soil temperatures using the Zc and Zd |
143 |
! coefficient computed at the previous time-step: |
! coefficient computed at the previous time-step: |
144 |
|
|
145 |
! surface temperature |
! surface temperature |
157 |
END DO |
END DO |
158 |
END IF |
END IF |
159 |
|
|
160 |
! Computation of the Cgrd and Dgrd coefficient for the next step: |
! Computation of the Zc and Zd coefficient for the next step: |
161 |
|
|
162 |
IF (nisurf==is_sic) THEN |
IF (nisurf==is_sic) THEN |
163 |
DO ig = 1, knon |
DO ig = 1, knon |
166 |
END IF |
END IF |
167 |
|
|
168 |
DO jk = 1, nsoilmx |
DO jk = 1, nsoilmx |
169 |
zdz2(jk) = dz2(jk) / dtime |
zdz2(jk) = dz2(jk) / dtphys |
170 |
END DO |
END DO |
171 |
|
|
172 |
DO ig = 1, knon |
DO ig = 1, knon |
193 |
soilflux(ig) = ztherm_i(ig) * dz1(1) * (zc(ig, 1, nisurf) + (zd(ig, 1, & |
soilflux(ig) = ztherm_i(ig) * dz1(1) * (zc(ig, 1, nisurf) + (zd(ig, 1, & |
194 |
nisurf) - 1.) * tsoil(ig, 1)) |
nisurf) - 1.) * tsoil(ig, 1)) |
195 |
soilcap(ig) = ztherm_i(ig) * (dz2(1) & |
soilcap(ig) = ztherm_i(ig) * (dz2(1) & |
196 |
+ dtime * (1. - zd(ig, 1, nisurf)) * dz1(1)) |
+ dtphys * (1. - zd(ig, 1, nisurf)) * dz1(1)) |
197 |
z1(ig, nisurf) = lambda * (1. - zd(ig, 1, nisurf)) + 1. |
z1(ig, nisurf) = lambda * (1. - zd(ig, 1, nisurf)) + 1. |
198 |
soilcap(ig) = soilcap(ig) / z1(ig, nisurf) |
soilcap(ig) = soilcap(ig) / z1(ig, nisurf) |
199 |
soilflux(ig) = soilflux(ig) + soilcap(ig) * (tsoil(ig, 1) & |
soilflux(ig) = soilflux(ig) + soilcap(ig) * (tsoil(ig, 1) & |
200 |
* z1(ig, nisurf) - lambda * zc(ig, 1, nisurf) - tsurf(ig)) / dtime |
* z1(ig, nisurf) - lambda * zc(ig, 1, nisurf) - tsurf(ig)) / dtphys |
201 |
END DO |
END DO |
202 |
|
|
203 |
contains |
contains |