1 | MODULE land_surface_model_mod |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: land_surface_model.f90 1497 2014-12-02 17:28:07Z maronga $ |
---|
27 | ! |
---|
28 | ! 1496 2014-12-02 17:25:50Z maronga |
---|
29 | ! Initial revision |
---|
30 | ! |
---|
31 | ! |
---|
32 | ! Description: |
---|
33 | ! ------------ |
---|
34 | ! Land surface model, consisting of a solver for the energy balance at the |
---|
35 | ! surface and a four layer soil scheme. The scheme is similar to the TESSEL |
---|
36 | ! scheme implemented in the ECMWF IFS model, with modifications according to |
---|
37 | ! H-TESSEL. The implementation is based on the formulation implemented in the |
---|
38 | ! DALES model. |
---|
39 | !------------------------------------------------------------------------------! |
---|
40 | USE arrays_3d, & |
---|
41 | ONLY: pt, pt_p, q, q_p, qsws, rif, shf, ts, us, z0, z0h |
---|
42 | |
---|
43 | USE cloud_parameters, & |
---|
44 | ONLY: cp, l_d_r, l_v, rho_l, r_d, r_v |
---|
45 | |
---|
46 | USE control_parameters, & |
---|
47 | ONLY: dt_3d, humidity, intermediate_timestep_count, & |
---|
48 | intermediate_timestep_count_max, pt_surface, rho_surface, & |
---|
49 | surface_pressure, timestep_scheme, tsc |
---|
50 | |
---|
51 | USE indices, & |
---|
52 | ONLY: nxlg, nxrg, nyng, nysg, nzb_s_inner |
---|
53 | |
---|
54 | USE kinds |
---|
55 | |
---|
56 | USE radiation_model_mod, & |
---|
57 | ONLY: Rn, SW_in, sigma_SB |
---|
58 | |
---|
59 | |
---|
60 | IMPLICIT NONE |
---|
61 | |
---|
62 | ! |
---|
63 | !-- LSM model constants |
---|
64 | INTEGER(iwp), PARAMETER :: soil_layers = 4 !: number of soil layers (fixed for now) |
---|
65 | |
---|
66 | REAL(wp), PARAMETER :: & |
---|
67 | b_CH = 6.04_wp, & ! Clapp & Hornberger exponent |
---|
68 | lambda_h_dry = 0.19_wp, & ! heat conductivity for dry soil |
---|
69 | lambda_h_sm = 3.44_wp, & ! heat conductivity of the soil matrix |
---|
70 | lambda_h_water = 0.57_wp, & ! heat conductivity of water |
---|
71 | psi_sat = -0.388_wp, & ! soil matrix potential at saturation |
---|
72 | rhoC_soil = 2.19E6_wp, & ! volumetric heat capacity of soil |
---|
73 | rhoC_water = 4.20E6_wp, & ! volumetric heat capacity of water |
---|
74 | m_max_depth = 0.0002_wp ! Maximum capacity of the water reservoir (m) |
---|
75 | |
---|
76 | |
---|
77 | ! |
---|
78 | !-- LSM variables |
---|
79 | INTEGER(iwp) :: veg_type = 2, & !: vegetation type, 0: user-defined, 1-19: generic (see list) |
---|
80 | soil_type = 3 !: soil type, 0: user-defined, 1-6: generic (see list) |
---|
81 | |
---|
82 | LOGICAL :: conserve_water_content = .TRUE., & !: open or closed bottom surface for the soil model |
---|
83 | land_surface = .FALSE. !: flag parameter indicating wheather the lsm is used |
---|
84 | |
---|
85 | ! value 9999999.9_wp -> generic available or user-defined value must be set |
---|
86 | ! otherwise -> no generic variable and user setting is optional |
---|
87 | REAL(wp) :: alpha_VanGenuchten = 0.0_wp, & !: NAMELIST alpha_VG |
---|
88 | canopy_resistance_coefficient = 0.0_wp, & !: NAMELIST gD |
---|
89 | C_skin = 20000.0_wp, & !: Skin heat capacity |
---|
90 | drho_l_lv, & !: (rho_l * l_v)**-1 |
---|
91 | exn, & !: value of the Exner function |
---|
92 | e_s = 0.0_wp, & !: saturation water vapour pressure |
---|
93 | field_capacity = 0.0_wp, & !: NAMELIST m_fc |
---|
94 | f_shortwave_incoming = 9999999.9_wp, & !: NAMELIST f_SW_in |
---|
95 | hydraulic_conductivity = 0.0_wp, & !: NAMELIST gamma_w_sat |
---|
96 | Ke = 0.0_wp, & !: Kersten number |
---|
97 | lambda_skin_stable = 9999999.9_wp, & !: NAMELIST lambda_skin_s |
---|
98 | lambda_skin_unstable = 9999999.9_wp, & !: NAMELIST lambda_skin_u |
---|
99 | leaf_area_index = 9999999.9_wp, & !: NAMELIST LAI |
---|
100 | l_VanGenuchten = 0.0_WP, & !: NAMELIST l_VG |
---|
101 | min_canopy_resistance = 110.0_wp, & !: NAMELIST r_s_min |
---|
102 | m_total = 0.0_wp, & !: weighed total water content of the soil (m3/m3) |
---|
103 | n_VanGenuchten = 0.0_WP, & !: NAMELIST n_VG |
---|
104 | q_s = 0.0_wp, & !: saturation specific humidity |
---|
105 | residual_moisture = 0.0_wp, & !: NAMELIST m_res |
---|
106 | rho_cp, & !: rho_surface * cp |
---|
107 | rho_lv, & !: rho * l_v |
---|
108 | rd_d_rv, & !: r_d / r_v |
---|
109 | saturation_moisture = 0.0_wp, & !: NAMELIST m_sat |
---|
110 | vegetation_coverage = 9999999.9_wp, & !: NAMELIST c_veg |
---|
111 | wilting_point = 0.0_wp !: NAMELIST m_wilt |
---|
112 | |
---|
113 | REAL(wp), DIMENSION(0:soil_layers-1) :: & |
---|
114 | ddz_soil, & !: 1/dz_soil |
---|
115 | ddz_soil_stag, & !: 1/dz_soil_stag |
---|
116 | dz_soil, & !: soil grid spacing (center-center) |
---|
117 | dz_soil_stag, & !: soil grid spacing (edge-edge) |
---|
118 | root_extr = 0.0_wp, & !: root extraction |
---|
119 | root_fraction = (/0.35_wp, 0.38_wp, 0.23_wp, 0.04_wp/), & !: distribution of root surface area to the individual soil layers |
---|
120 | soil_level = (/0.07_wp, 0.28_wp, 1.00_wp, 2.89_wp/), & !: soil layer depths (m) |
---|
121 | soil_moisture = 0.0_wp !: soil moisture content (m3/m3) |
---|
122 | |
---|
123 | REAL(wp), DIMENSION(0:soil_layers) :: & |
---|
124 | soil_temperature = 9999999.9_wp !: soil temperature (K) |
---|
125 | |
---|
126 | #if defined( __nopointer ) |
---|
127 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: T_0, & !: skin temperature (K) |
---|
128 | T_0_p, & !: progn. skin temperature (K) |
---|
129 | m_liq, & !: liquid water reservoir (m) |
---|
130 | m_liq_p !: progn. liquid water reservoir (m) |
---|
131 | #else |
---|
132 | REAL(wp), DIMENSION(:,:), POINTER :: T_0, & |
---|
133 | T_0_p, & |
---|
134 | m_liq, & |
---|
135 | m_liq_p |
---|
136 | |
---|
137 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: T_0_1, T_0_2, & |
---|
138 | m_liq_1, m_liq_2 |
---|
139 | #endif |
---|
140 | |
---|
141 | ! |
---|
142 | !-- Temporal tendencies for time stepping |
---|
143 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tT_0_m, & !: skin temperature tendency (K) |
---|
144 | tm_liq_m !: liquid water reservoir tendency (m) |
---|
145 | |
---|
146 | ! |
---|
147 | !-- Energy balance variables |
---|
148 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: & |
---|
149 | alpha_VG, & !: coef. of Van Genuchten |
---|
150 | c_liq, & !: liquid water coverage (of vegetated area) |
---|
151 | c_veg, & !: vegetation coverage |
---|
152 | f_SW_in, & !: ? |
---|
153 | G, & !: surface soil heat flux |
---|
154 | H, & !: surface flux of sensible heat |
---|
155 | gamma_w_sat, & !: hydraulic conductivity at saturation |
---|
156 | gD, & !: coefficient for dependence of r_canopy on water vapour pressure deficit |
---|
157 | LAI, & !: leaf area index |
---|
158 | LE, & !: surface flux of latent heat (total) |
---|
159 | LE_veg, & !: surface flux of latent heat (vegetation portion) |
---|
160 | LE_soil, & !: surface flux of latent heat (soil portion) |
---|
161 | LE_liq, & !: surface flux of latent heat (liquid water portion) |
---|
162 | lambda_h_sat, & !: heat conductivity for dry soil |
---|
163 | lambda_skin_s, & !: coupling between skin and soil (depends on vegetation type) |
---|
164 | lambda_skin_u, & !: coupling between skin and soil (depends on vegetation type) |
---|
165 | l_VG, & !: coef. of Van Genuchten |
---|
166 | m_fc, & !: soil moisture at field capacity (m3/m3) |
---|
167 | m_res, & !: residual soil moisture |
---|
168 | m_sat, & !: saturation soil moisture (m3/m3) |
---|
169 | m_wilt, & !: soil moisture at permanent wilting point (m3/m3) |
---|
170 | n_VG, & !: coef. Van Genuchten |
---|
171 | r_a, & !: aerodynamic resistance |
---|
172 | r_canopy, & !: canopy resistance |
---|
173 | r_soil, & !: soil resitance |
---|
174 | r_soil_min, & !: minimum soil resistance |
---|
175 | r_s, & !: total surface resistance (combination of r_soil and r_canopy) |
---|
176 | r_s_min !: minimum canopy resistance |
---|
177 | |
---|
178 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: & |
---|
179 | lambda_h, & !: heat conductivity of soil (?) |
---|
180 | lambda_w, & !: hydraulic diffusivity of soil (?) |
---|
181 | gamma_w, & !: hydraulic conductivity of soil (?) |
---|
182 | rhoC_total !: volumetric heat capacity of the actual soil matrix (?) |
---|
183 | |
---|
184 | #if defined( __nopointer ) |
---|
185 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: & |
---|
186 | T_soil, & !: Soil temperature (K) |
---|
187 | T_soil_p, & !: Prog. soil temperature (K) |
---|
188 | m_soil, & !: Soil moisture (m3/m3) |
---|
189 | m_soil_p !: Prog. soil moisture (m3/m3) |
---|
190 | #else |
---|
191 | REAL(wp), DIMENSION(:,:,:), POINTER :: & |
---|
192 | T_soil, T_soil_p, & |
---|
193 | m_soil, m_soil_p |
---|
194 | |
---|
195 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: & |
---|
196 | T_soil_1, T_soil_2, & |
---|
197 | m_soil_1, m_soil_2 |
---|
198 | |
---|
199 | |
---|
200 | #endif |
---|
201 | |
---|
202 | |
---|
203 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: & |
---|
204 | tT_soil_m, & !: T_soil storage array |
---|
205 | tm_soil_m, & !: m_soil storage array |
---|
206 | root_fr !: root fraction (sum=1) |
---|
207 | |
---|
208 | ! |
---|
209 | !-- Land surface parameters according to the following classes (veg_type) |
---|
210 | !-- (0 user defined) |
---|
211 | !-- 1 crops, mixed farming |
---|
212 | !-- 2 short grass |
---|
213 | !-- 3 evergreen needleleaf trees |
---|
214 | !-- 4 deciduous needleleaf trees |
---|
215 | !-- 5 evergreen broadleaf trees |
---|
216 | !-- 6 deciduous broadleaf trees |
---|
217 | !-- 7 tall grass |
---|
218 | !-- 8 desert |
---|
219 | !-- 9 tundra |
---|
220 | !-- 10 irrigated crops |
---|
221 | !-- 11 semidesert |
---|
222 | !-- 12 ice caps and glaciers |
---|
223 | !-- 13 bogs and marshes |
---|
224 | !-- 14 inland water |
---|
225 | !-- 15 ocean |
---|
226 | !-- 16 evergreen shrubs |
---|
227 | !-- 17 deciduous shrubs |
---|
228 | !-- 18 mixed forest/woodland |
---|
229 | !-- 19 interrupted forest |
---|
230 | |
---|
231 | ! |
---|
232 | !-- Land surface parameters I r_s_min, LAI, c_veg, gD |
---|
233 | REAL(wp), DIMENSION(0:3,1:19) :: veg_pars = RESHAPE( (/ & |
---|
234 | 180.0_wp, 3.00_wp, 0.90_wp, 0.00_wp, & ! 1 |
---|
235 | 110.0_wp, 2.00_wp, 0.85_wp, 0.00_wp, & ! 2 |
---|
236 | 500.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 3 |
---|
237 | 500.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 4 |
---|
238 | 175.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 5 |
---|
239 | 240.0_wp, 6.00_wp, 0.99_wp, 0.13_wp, & ! 6 |
---|
240 | 100.0_wp, 2.00_wp, 0.70_wp, 0.00_wp, & ! 7 |
---|
241 | 250.0_wp, 0.50_wp, 0.00_wp, 0.00_wp, & ! 8 |
---|
242 | 80.0_wp, 1.00_wp, 0.50_wp, 0.00_wp, & ! 9 |
---|
243 | 180.0_wp, 3.00_wp, 0.90_wp, 0.00_wp, & ! 10 |
---|
244 | 150.0_wp, 0.50_wp, 0.10_wp, 0.00_wp, & ! 11 |
---|
245 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 12 |
---|
246 | 240.0_wp, 4.00_wp, 0.60_wp, 0.00_wp, & ! 13 |
---|
247 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 14 |
---|
248 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 15 |
---|
249 | 225.0_wp, 3.00_wp, 0.50_wp, 0.00_wp, & ! 16 |
---|
250 | 225.0_wp, 1.50_wp, 0.50_wp, 0.00_wp, & ! 17 |
---|
251 | 250.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 18 |
---|
252 | 175.0_wp, 2.50_wp, 0.90_wp, 0.03_wp & ! 19 |
---|
253 | /), (/ 4, 19 /) ) |
---|
254 | |
---|
255 | ! |
---|
256 | !-- Land surface parameters II z0, z0h |
---|
257 | REAL(wp), DIMENSION(0:1,1:19) :: roughness_par = RESHAPE( (/ & |
---|
258 | 0.25_wp, 0.25E-2_wp, & ! 1 |
---|
259 | 0.20_wp, 0.20E-2_wp, & ! 2 |
---|
260 | 2.00_wp, 2.00_wp, & ! 3 |
---|
261 | 2.00_wp, 2.00_wp, & ! 4 |
---|
262 | 2.00_wp, 2.00_wp, & ! 5 |
---|
263 | 2.00_wp, 2.00_wp, & ! 6 |
---|
264 | 0.47_wp, 0.47E-2_wp, & ! 7 |
---|
265 | 0.013_wp, 0.013E-2_wp, & ! 8 |
---|
266 | 0.034_wp, 0.034E-2_wp, & ! 9 |
---|
267 | 0.5_wp, 0.50E-2_wp, & ! 10 |
---|
268 | 0.17_wp, 0.17E-2_wp, & ! 11 |
---|
269 | 1.3E-3_wp, 1.3E-4_wp, & ! 12 |
---|
270 | 0.83_wp, 0.83E-2_wp, & ! 13 |
---|
271 | 0.00_wp, 0.00E-2_wp, & ! 14 |
---|
272 | 0.00_wp, 0.00E-2_wp, & ! 15 |
---|
273 | 0.10_wp, 0.10E-2_wp, & ! 16 |
---|
274 | 0.25_wp, 0.25E-2_wp, & ! 17 |
---|
275 | 2.00_wp, 2.00E-2_wp, & ! 18 |
---|
276 | 1.10_wp, 1.10E-2_wp & ! 19 |
---|
277 | /), (/ 2, 19 /) ) |
---|
278 | |
---|
279 | ! |
---|
280 | !-- Land surface parameters III lambda_skin_s, lambda_skin_u, f_SW_in |
---|
281 | REAL(wp), DIMENSION(0:2,1:19) :: skin_pars = RESHAPE( (/ & |
---|
282 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 1 |
---|
283 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 2 |
---|
284 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 3 |
---|
285 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 4 |
---|
286 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 5 |
---|
287 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 6 |
---|
288 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 7 |
---|
289 | 15.0_wp, 15.0_wp, 0.00_wp, & ! 8 |
---|
290 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 9 |
---|
291 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 10 |
---|
292 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 11 |
---|
293 | 58.0_wp, 58.0_wp, 0.00_wp, & ! 12 |
---|
294 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 13 |
---|
295 | 1.0E20_wp, 1.0E20_wp, 0.00_wp, & ! 14 |
---|
296 | 1.0E20_wp, 1.0E20_wp, 0.00_wp, & ! 15 |
---|
297 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 16 |
---|
298 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 17 |
---|
299 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 18 |
---|
300 | 20.0_wp, 15.0_wp, 0.03_wp & ! 19 |
---|
301 | /), (/ 3, 19 /) ) |
---|
302 | |
---|
303 | ! |
---|
304 | !-- Root distribution (sum = 1) level 1, level 2, level 3, level 4, |
---|
305 | REAL(wp), DIMENSION(0:3,1:19) :: root_distribution = RESHAPE( (/ & |
---|
306 | 0.24_wp, 0.41_wp, 0.31_wp, 0.04_wp, & ! 1 |
---|
307 | 0.35_wp, 0.38_wp, 0.23_wp, 0.04_wp, & ! 2 |
---|
308 | 0.26_wp, 0.39_wp, 0.29_wp, 0.06_wp, & ! 3 |
---|
309 | 0.26_wp, 0.38_wp, 0.29_wp, 0.07_wp, & ! 4 |
---|
310 | 0.24_wp, 0.38_wp, 0.31_wp, 0.07_wp, & ! 5 |
---|
311 | 0.25_wp, 0.34_wp, 0.27_wp, 0.14_wp, & ! 6 |
---|
312 | 0.27_wp, 0.27_wp, 0.27_wp, 0.09_wp, & ! 7 |
---|
313 | 1.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 8 |
---|
314 | 0.47_wp, 0.45_wp, 0.08_wp, 0.00_wp, & ! 9 |
---|
315 | 0.24_wp, 0.41_wp, 0.31_wp, 0.04_wp, & ! 10 |
---|
316 | 0.17_wp, 0.31_wp, 0.33_wp, 0.19_wp, & ! 11 |
---|
317 | 0.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 12 |
---|
318 | 0.25_wp, 0.34_wp, 0.27_wp, 0.11_wp, & ! 13 |
---|
319 | 0.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 14 |
---|
320 | 0.00_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 15 |
---|
321 | 0.23_wp, 0.36_wp, 0.30_wp, 0.11_wp, & ! 16 |
---|
322 | 0.23_wp, 0.36_wp, 0.30_wp, 0.11_wp, & ! 17 |
---|
323 | 0.19_wp, 0.35_wp, 0.36_wp, 0.10_wp, & ! 18 |
---|
324 | 0.19_wp, 0.35_wp, 0.36_wp, 0.10_wp & ! 19 |
---|
325 | /), (/ 4, 19 /) ) |
---|
326 | |
---|
327 | ! |
---|
328 | !-- Soil parameters according to the following porosity classes (soil_type) |
---|
329 | !-- (0 user defined) |
---|
330 | !-- 1 coarse |
---|
331 | !-- 2 medium |
---|
332 | !-- 3 medium-fine |
---|
333 | !-- 4 fine |
---|
334 | !-- 5 very fine |
---|
335 | !-- 6 organic |
---|
336 | ! |
---|
337 | !-- Soil parameters I alpha_VG, l_VG, n_VG, gamma_w_sat |
---|
338 | REAL(wp), DIMENSION(0:3,1:6) :: soil_pars = RESHAPE( (/ & |
---|
339 | 3.83_wp, 1.250_wp, 1.38_wp, 6.94E-6_wp, & ! 1 |
---|
340 | 3.14_wp, -2.342_wp, 1.28_wp, 1.16E-6_wp, & ! 2 |
---|
341 | 0.83_wp, -0.588_wp, 1.25_wp, 0.26E-6_wp, & ! 3 |
---|
342 | 3.67_wp, -1.977_wp, 1.10_wp, 2.87E-6_wp, & ! 4 |
---|
343 | 2.65_wp, 2.500_wp, 1.10_wp, 1.74E-6_wp, & ! 5 |
---|
344 | 1.30_wp, 0.400_wp, 1.20_wp, 0.93E-6_wp & ! 6 |
---|
345 | /), (/ 4, 6 /) ) |
---|
346 | |
---|
347 | ! |
---|
348 | !-- Soil parameters II m_sat, m_fc, m_wilt, m_res |
---|
349 | REAL(wp), DIMENSION(0:3,1:6) :: m_soil_pars = RESHAPE( (/ & |
---|
350 | 0.403_wp, 0.244_wp, 0.059_wp, 0.025_wp, & ! 1 |
---|
351 | 0.439_wp, 0.347_wp, 0.151_wp, 0.010_wp, & ! 2 |
---|
352 | 0.430_wp, 0.383_wp, 0.133_wp, 0.010_wp, & ! 3 |
---|
353 | 0.520_wp, 0.448_wp, 0.279_wp, 0.010_wp, & ! 4 |
---|
354 | 0.614_wp, 0.541_wp, 0.335_wp, 0.010_wp, & ! 5 |
---|
355 | 0.766_wp, 0.663_wp, 0.267_wp, 0.010_wp & ! 6 |
---|
356 | /), (/ 4, 6 /) ) |
---|
357 | |
---|
358 | |
---|
359 | SAVE |
---|
360 | |
---|
361 | |
---|
362 | PRIVATE |
---|
363 | |
---|
364 | |
---|
365 | PUBLIC alpha_VanGenuchten, C_skin, canopy_resistance_coefficient, & |
---|
366 | conserve_water_content, field_capacity, f_shortwave_incoming, & |
---|
367 | hydraulic_conductivity, init_lsm, lambda_skin_stable, & |
---|
368 | lambda_skin_unstable, land_surface, leaf_area_index, & |
---|
369 | lsm_energy_balance, lsm_soil_model, l_VanGenuchten, & |
---|
370 | min_canopy_resistance, n_VanGenuchten, residual_moisture, & |
---|
371 | root_fraction, saturation_moisture, soil_level, soil_moisture, & |
---|
372 | soil_temperature, soil_type, vegetation_coverage, veg_type, & |
---|
373 | wilting_point |
---|
374 | |
---|
375 | #if defined( __nopointer ) |
---|
376 | PUBLIC m_liq, m_liq_p, m_soil, m_soil_p, T_0, T_0_p, T_soil, T_soil_p |
---|
377 | #else |
---|
378 | PUBLIC m_liq, m_liq_1, m_liq_2, m_liq_p, m_soil, m_soil_1, m_soil_2, & |
---|
379 | m_soil_p, T_0, T_0_1, T_0_2, T_0_p, T_soil, T_soil_1, T_soil_2, & |
---|
380 | T_soil_p |
---|
381 | #endif |
---|
382 | |
---|
383 | |
---|
384 | INTERFACE init_lsm |
---|
385 | MODULE PROCEDURE init_lsm |
---|
386 | END INTERFACE init_lsm |
---|
387 | |
---|
388 | INTERFACE lsm_energy_balance |
---|
389 | MODULE PROCEDURE lsm_energy_balance |
---|
390 | END INTERFACE lsm_energy_balance |
---|
391 | |
---|
392 | INTERFACE lsm_soil_model |
---|
393 | MODULE PROCEDURE lsm_soil_model |
---|
394 | END INTERFACE lsm_soil_model |
---|
395 | |
---|
396 | |
---|
397 | CONTAINS |
---|
398 | |
---|
399 | |
---|
400 | !------------------------------------------------------------------------------! |
---|
401 | ! Description: |
---|
402 | ! ------------ |
---|
403 | !-- Initialization of the land surface model |
---|
404 | !------------------------------------------------------------------------------! |
---|
405 | SUBROUTINE init_lsm |
---|
406 | |
---|
407 | |
---|
408 | IMPLICIT NONE |
---|
409 | |
---|
410 | INTEGER(iwp) :: i !: running index |
---|
411 | INTEGER(iwp) :: j !: running index |
---|
412 | INTEGER(iwp) :: k !: running index |
---|
413 | |
---|
414 | |
---|
415 | ! |
---|
416 | !-- Calculate frequently used parameters |
---|
417 | rho_cp = cp * rho_surface |
---|
418 | rd_d_rv = r_d / r_v |
---|
419 | rho_lv = rho_surface * l_v |
---|
420 | drho_l_lv = 1.0 / (rho_l * l_v) |
---|
421 | |
---|
422 | ! |
---|
423 | !-- Allocate skin and soil temperature / humidity |
---|
424 | #if defined( __nopointer ) |
---|
425 | ALLOCATE ( T_0(nysg:nyng,nxlg:nxrg) ) |
---|
426 | ALLOCATE ( T_0_p(nysg:nyng,nxlg:nxrg) ) |
---|
427 | #else |
---|
428 | ALLOCATE ( T_0_1(nysg:nyng,nxlg:nxrg) ) |
---|
429 | ALLOCATE ( T_0_2(nysg:nyng,nxlg:nxrg) ) |
---|
430 | #endif |
---|
431 | |
---|
432 | ALLOCATE ( tT_0_m(nysg:nyng,nxlg:nxrg) ) |
---|
433 | |
---|
434 | #if defined( __nopointer ) |
---|
435 | ALLOCATE ( T_soil(0:soil_layers,nysg:nyng,nxlg:nxrg) ) |
---|
436 | ALLOCATE ( T_soil_p(0:soil_layers,nysg:nyng,nxlg:nxrg) ) |
---|
437 | #else |
---|
438 | ALLOCATE ( T_soil_1(0:soil_layers,nysg:nyng,nxlg:nxrg) ) |
---|
439 | ALLOCATE ( T_soil_2(0:soil_layers,nysg:nyng,nxlg:nxrg) ) |
---|
440 | #endif |
---|
441 | |
---|
442 | ALLOCATE ( tT_soil_m(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
443 | |
---|
444 | #if defined( __nopointer ) |
---|
445 | ALLOCATE ( m_liq(nysg:nyng,nxlg:nxrg) ) |
---|
446 | ALLOCATE ( m_liq_p(nysg:nyng,nxlg:nxrg) ) |
---|
447 | #else |
---|
448 | ALLOCATE ( m_liq_1(nysg:nyng,nxlg:nxrg) ) |
---|
449 | ALLOCATE ( m_liq_2(nysg:nyng,nxlg:nxrg) ) |
---|
450 | #endif |
---|
451 | |
---|
452 | ALLOCATE ( tm_liq_m(nysg:nyng,nxlg:nxrg) ) |
---|
453 | |
---|
454 | #if defined( __nopointer ) |
---|
455 | ALLOCATE ( m_soil(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
456 | ALLOCATE ( m_soil_p(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
457 | #else |
---|
458 | ALLOCATE ( m_soil_1(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
459 | ALLOCATE ( m_soil_2(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
460 | #endif |
---|
461 | |
---|
462 | ALLOCATE ( tm_soil_m(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
463 | |
---|
464 | |
---|
465 | #if ! defined( __nopointer ) |
---|
466 | ! |
---|
467 | !-- Initial assignment of the pointers |
---|
468 | T_soil => T_soil_1; T_soil_p => T_soil_2 |
---|
469 | T_0 => T_0_1; T_0_p => T_0_2 |
---|
470 | m_soil => m_soil_1; m_soil_p => m_soil_2 |
---|
471 | m_liq => m_liq_1; m_liq_p => m_liq_2 |
---|
472 | #endif |
---|
473 | |
---|
474 | T_0 = 0.0_wp |
---|
475 | T_0_p = 0.0_wp |
---|
476 | tT_0_m = 0.0_wp |
---|
477 | |
---|
478 | T_soil = 0.0_wp |
---|
479 | T_soil_p = 0.0_wp |
---|
480 | tT_soil_m = 0.0_wp |
---|
481 | |
---|
482 | m_liq = 0.0_wp |
---|
483 | m_liq_p = 0.0_wp |
---|
484 | tm_liq_m = 0.0_wp |
---|
485 | |
---|
486 | m_soil = 0.0_wp |
---|
487 | m_soil_p = 0.0_wp |
---|
488 | tm_soil_m = 0.0_wp |
---|
489 | |
---|
490 | ! |
---|
491 | !-- Allocate 2D vegetation model arrays |
---|
492 | ALLOCATE ( alpha_VG(nysg:nyng,nxlg:nxrg) ) |
---|
493 | ALLOCATE ( c_liq(nysg:nyng,nxlg:nxrg) ) |
---|
494 | ALLOCATE ( c_veg(nysg:nyng,nxlg:nxrg) ) |
---|
495 | ALLOCATE ( f_SW_in(nysg:nyng,nxlg:nxrg) ) |
---|
496 | ALLOCATE ( G(nysg:nyng,nxlg:nxrg) ) |
---|
497 | ALLOCATE ( H(nysg:nyng,nxlg:nxrg) ) |
---|
498 | ALLOCATE ( gamma_w_sat(nysg:nyng,nxlg:nxrg) ) |
---|
499 | ALLOCATE ( gD(nysg:nyng,nxlg:nxrg) ) |
---|
500 | ALLOCATE ( LAI(nysg:nyng,nxlg:nxrg) ) |
---|
501 | ALLOCATE ( LE(nysg:nyng,nxlg:nxrg) ) |
---|
502 | ALLOCATE ( LE_veg(nysg:nyng,nxlg:nxrg) ) |
---|
503 | ALLOCATE ( LE_soil(nysg:nyng,nxlg:nxrg) ) |
---|
504 | ALLOCATE ( LE_liq(nysg:nyng,nxlg:nxrg) ) |
---|
505 | ALLOCATE ( l_VG(nysg:nyng,nxlg:nxrg) ) |
---|
506 | ALLOCATE ( lambda_h_sat(nysg:nyng,nxlg:nxrg) ) |
---|
507 | ALLOCATE ( lambda_skin_u(nysg:nyng,nxlg:nxrg) ) |
---|
508 | ALLOCATE ( lambda_skin_s(nysg:nyng,nxlg:nxrg) ) |
---|
509 | ALLOCATE ( m_fc(nysg:nyng,nxlg:nxrg) ) |
---|
510 | ALLOCATE ( m_res(nysg:nyng,nxlg:nxrg) ) |
---|
511 | ALLOCATE ( m_sat(nysg:nyng,nxlg:nxrg) ) |
---|
512 | ALLOCATE ( m_wilt(nysg:nyng,nxlg:nxrg) ) |
---|
513 | ALLOCATE ( n_VG(nysg:nyng,nxlg:nxrg) ) |
---|
514 | ALLOCATE ( r_a(nysg:nyng,nxlg:nxrg) ) |
---|
515 | ALLOCATE ( r_canopy(nysg:nyng,nxlg:nxrg) ) |
---|
516 | ALLOCATE ( r_soil(nysg:nyng,nxlg:nxrg) ) |
---|
517 | ALLOCATE ( r_soil_min(nysg:nyng,nxlg:nxrg) ) |
---|
518 | ALLOCATE ( r_s(nysg:nyng,nxlg:nxrg) ) |
---|
519 | ALLOCATE ( r_s_min(nysg:nyng,nxlg:nxrg) ) |
---|
520 | |
---|
521 | ! |
---|
522 | !-- Set initial and default values |
---|
523 | c_liq = 0.0_wp |
---|
524 | c_veg = 0.0_wp |
---|
525 | f_SW_in = 0.05_wp |
---|
526 | gD = 0.0_wp |
---|
527 | LAI = 0.0_wp |
---|
528 | lambda_skin_u = 10.0_wp |
---|
529 | lambda_skin_s = 10.0_wp |
---|
530 | |
---|
531 | |
---|
532 | G = 0.0_wp |
---|
533 | H = rho_cp * shf |
---|
534 | LE = rho_l * l_v * qsws |
---|
535 | LE_veg = 0.0_wp |
---|
536 | LE_soil = LE |
---|
537 | LE_liq = 0.0_wp |
---|
538 | |
---|
539 | r_a = 50.0_wp |
---|
540 | r_canopy = 0.0_wp |
---|
541 | r_soil = 0.0_wp |
---|
542 | r_soil_min = 50.0_wp |
---|
543 | r_s = 110.0_wp |
---|
544 | r_s_min = min_canopy_resistance |
---|
545 | |
---|
546 | ! |
---|
547 | !-- Allocate 3D soil model arrays |
---|
548 | ALLOCATE ( root_fr(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
549 | ALLOCATE ( lambda_h(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
550 | ALLOCATE ( rhoC_total(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
551 | |
---|
552 | lambda_h = 0.0_wp |
---|
553 | ! |
---|
554 | !-- If required, allocate humidity-related variables for the soil model |
---|
555 | IF ( humidity ) THEN |
---|
556 | ALLOCATE ( lambda_w(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
557 | ALLOCATE ( gamma_w(0:soil_layers-1,nysg:nyng,nxlg:nxrg) ) |
---|
558 | |
---|
559 | lambda_w = 0.0_wp |
---|
560 | ENDIF |
---|
561 | |
---|
562 | ! |
---|
563 | !-- Calculate grid spacings. Temperature and moisture are defined at |
---|
564 | !-- the center of the soil layers, whereas gradients/fluxes are defined |
---|
565 | !-- at the edges (_stag) |
---|
566 | dz_soil_stag(0) = soil_level(0) |
---|
567 | |
---|
568 | DO k = 1, soil_layers-1 |
---|
569 | dz_soil_stag(k) = soil_level(k) - soil_level(k-1) |
---|
570 | ENDDO |
---|
571 | |
---|
572 | DO k = 0, soil_layers-2 |
---|
573 | dz_soil(k) = 0.5 * (dz_soil_stag(k+1) + dz_soil_stag(k)) |
---|
574 | ENDDO |
---|
575 | dz_soil(soil_layers-1) = dz_soil_stag(soil_layers-1) |
---|
576 | |
---|
577 | ddz_soil = 1.0 / dz_soil |
---|
578 | ddz_soil_stag = 1.0 / dz_soil_stag |
---|
579 | ! |
---|
580 | !-- Initialize soil |
---|
581 | IF ( soil_type .NE. 0 ) THEN |
---|
582 | alpha_VG = soil_pars(0,soil_type) |
---|
583 | l_VG = soil_pars(1,soil_type) |
---|
584 | n_VG = soil_pars(2,soil_type) |
---|
585 | gamma_w_sat = soil_pars(3,soil_type) |
---|
586 | m_sat = m_soil_pars(0,soil_type) |
---|
587 | m_fc = m_soil_pars(1,soil_type) |
---|
588 | m_wilt = m_soil_pars(2,soil_type) |
---|
589 | m_res = m_soil_pars(3,soil_type) |
---|
590 | ELSE |
---|
591 | alpha_VG = alpha_VanGenuchten |
---|
592 | l_VG = l_VanGenuchten |
---|
593 | n_VG = n_VanGenuchten |
---|
594 | gamma_w_sat = hydraulic_conductivity |
---|
595 | m_sat = saturation_moisture |
---|
596 | m_fc = field_capacity |
---|
597 | m_wilt = wilting_point |
---|
598 | m_res = residual_moisture |
---|
599 | ENDIF |
---|
600 | |
---|
601 | ! |
---|
602 | !-- Map user settings of T and q for each soil layer |
---|
603 | !-- (make sure that the soil moisture does not drop below the permanent |
---|
604 | !-- wilting point) -> problems with devision by zero) |
---|
605 | DO k = 0, soil_layers-1 |
---|
606 | T_soil(k,:,:) = soil_temperature(k) |
---|
607 | m_soil(k,:,:) = MAX(soil_moisture(k),m_wilt(:,:)) |
---|
608 | ENDDO |
---|
609 | T_soil(soil_layers,:,:) = soil_temperature(soil_layers) |
---|
610 | |
---|
611 | |
---|
612 | exn = ( surface_pressure / 1000.0_wp )**0.286_wp |
---|
613 | T_0 = pt_surface * exn |
---|
614 | |
---|
615 | T_soil_p = T_soil |
---|
616 | m_soil_p = m_soil |
---|
617 | |
---|
618 | ! |
---|
619 | !-- Calculate saturation soil heat conductivity |
---|
620 | lambda_h_sat(:,:) = lambda_h_sm ** (1.0_wp - m_sat(:,:)) * & |
---|
621 | lambda_h_water ** m_sat(:,:) |
---|
622 | |
---|
623 | ! |
---|
624 | !-- Initialize vegetation |
---|
625 | IF ( veg_type .NE. 0 ) THEN |
---|
626 | |
---|
627 | r_s_min = veg_pars(0,veg_type) |
---|
628 | LAI = veg_pars(1,veg_type) |
---|
629 | c_veg = veg_pars(2,veg_type) |
---|
630 | gD = veg_pars(3,veg_type) |
---|
631 | lambda_skin_s = skin_pars(0,veg_type) |
---|
632 | lambda_skin_u = skin_pars(1,veg_type) |
---|
633 | f_SW_in = skin_pars(2,veg_type) |
---|
634 | z0 = roughness_par(0,veg_type) |
---|
635 | z0h = roughness_par(1,veg_type) |
---|
636 | |
---|
637 | |
---|
638 | DO k = 0, soil_layers-1 |
---|
639 | root_fr(k,:,:) = root_distribution(k,veg_type) |
---|
640 | ENDDO |
---|
641 | |
---|
642 | ELSE |
---|
643 | |
---|
644 | DO k = 0, soil_layers-1 |
---|
645 | root_fr(k,:,:) = root_fraction(k) |
---|
646 | ENDDO |
---|
647 | |
---|
648 | ENDIF |
---|
649 | |
---|
650 | ! |
---|
651 | !-- Possibly do user-defined actions (e.g. define heterogeneous land surface) |
---|
652 | CALL user_init_land_surface |
---|
653 | |
---|
654 | ! |
---|
655 | !-- Set artifical values for ts and us so that r_a has its initial value for |
---|
656 | !-- the first time step |
---|
657 | DO i = nxlg, nxrg |
---|
658 | DO j = nysg, nyng |
---|
659 | k = nzb_s_inner(j,i) |
---|
660 | us(j,i) = 0.1_wp |
---|
661 | ts(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / r_a(j,i) |
---|
662 | shf(j,i) = - us(j,i) * ts(j,i) |
---|
663 | ENDDO |
---|
664 | ENDDO |
---|
665 | |
---|
666 | ! |
---|
667 | !-- Calculate humidity at the surface |
---|
668 | IF ( humidity ) THEN |
---|
669 | CALL calc_q0 |
---|
670 | ENDIF |
---|
671 | |
---|
672 | RETURN |
---|
673 | |
---|
674 | END SUBROUTINE init_lsm |
---|
675 | |
---|
676 | |
---|
677 | |
---|
678 | !------------------------------------------------------------------------------! |
---|
679 | ! Description: |
---|
680 | ! ------------ |
---|
681 | ! |
---|
682 | !------------------------------------------------------------------------------! |
---|
683 | SUBROUTINE lsm_energy_balance |
---|
684 | |
---|
685 | |
---|
686 | IMPLICIT NONE |
---|
687 | |
---|
688 | INTEGER(iwp) :: i !: running index |
---|
689 | INTEGER(iwp) :: j !: running index |
---|
690 | INTEGER(iwp) :: k, ks !: running index |
---|
691 | |
---|
692 | REAL(wp) :: f1, & !: resistance correction term 1 |
---|
693 | f2, & !: resistance correction term 2 |
---|
694 | f3, & !: resistance correction term 3 |
---|
695 | m_min, & !: minimum soil moisture |
---|
696 | T_1, & !: actual temperature at first grid point |
---|
697 | e, & !: water vapour pressure |
---|
698 | e_s, & !: water vapour saturation pressure |
---|
699 | e_s_dT, & !: derivate of e_s with respect to T |
---|
700 | tend, & !: tendency |
---|
701 | dq_s_dT, & !: derivate of q_s with respect to T |
---|
702 | coef_1, & !: coef. for prognostic equation |
---|
703 | coef_2, & !: coef. for prognostic equation |
---|
704 | f_LE, & !: factor for LE |
---|
705 | f_LE_veg, & !: factor for LE_veg |
---|
706 | f_LE_soil, & !: factor for LE_soil |
---|
707 | f_LE_liq, & !: factor for LE_liq |
---|
708 | f_H, & !: factor for H |
---|
709 | lambda_skin, & !: Current value of lambda_skin |
---|
710 | m_liq_max !: maxmimum value of the liquid water reservoir |
---|
711 | |
---|
712 | ! |
---|
713 | !-- Calculate the exner function for the current time step |
---|
714 | exn = ( surface_pressure / 1000.0_wp )**0.286_wp |
---|
715 | |
---|
716 | |
---|
717 | DO i = nxlg, nxrg |
---|
718 | DO j = nysg, nyng |
---|
719 | |
---|
720 | |
---|
721 | ! |
---|
722 | !-- Set lambda_skin according to stratification |
---|
723 | IF ( rif(j,i) >= 0.0_wp ) THEN |
---|
724 | lambda_skin = lambda_skin_s(j,i) |
---|
725 | ELSE |
---|
726 | lambda_skin = lambda_skin_u(j,i) |
---|
727 | ENDIF |
---|
728 | ! |
---|
729 | !-- First step: calculate aerodyamic resistance. As pt(0), us, ts |
---|
730 | !-- are not available for the current time step, data from the last |
---|
731 | !-- time step is used here. |
---|
732 | k = nzb_s_inner(j,i) |
---|
733 | |
---|
734 | ! r_a(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / (ts(j,i) * us(j,i) + 1.0E-20) |
---|
735 | r_a(j,i) = (pt(k+1,j,i) - pt(k,j,i)) / - (shf(j,i) + 1.0E-20) |
---|
736 | |
---|
737 | ! |
---|
738 | !-- Second step: calculate canopy resistance r_canopy |
---|
739 | !-- f1-f3 here are defined as 1/f1-f3 as in ECMWF documentation |
---|
740 | |
---|
741 | !-- f1: correction for incoming shortwave radiation |
---|
742 | f1 = MIN(1.0_wp, ( 0.004_wp * SW_in(j,i) + 0.05_wp ) / & |
---|
743 | (0.81_wp * (0.004_wp * SW_in(j,i) + 1.0_wp) ) ) |
---|
744 | |
---|
745 | ! |
---|
746 | !-- f2: correction for soil moisture f2=0 for very dry soil |
---|
747 | m_total = 0.0_wp |
---|
748 | DO ks = 0, soil_layers-1 |
---|
749 | m_total = m_total + root_fr(ks,j,i) * m_soil(ks,j,i) |
---|
750 | ENDDO |
---|
751 | |
---|
752 | IF ( m_total .GT. m_wilt(j,i) .AND. m_total .LE. m_fc(j,i) ) THEN |
---|
753 | f2 = ( m_total - m_wilt(j,i) ) / (m_fc(j,i) - m_wilt(j,i) ) |
---|
754 | ELSE |
---|
755 | f2 = 1.0E-20_wp |
---|
756 | ENDIF |
---|
757 | |
---|
758 | ! |
---|
759 | !-- Calculate water vapour pressure at saturation |
---|
760 | !-- (T_0 should be replaced by liquid water temp?!) |
---|
761 | e_s = 0.01 * 610.78_wp * EXP( 17.269_wp * ( T_0(j,i) - 273.16_wp )& |
---|
762 | / ( T_0(j,i) - 35.86_wp ) ) |
---|
763 | |
---|
764 | ! |
---|
765 | !-- f3: correction for vapour pressure deficit |
---|
766 | IF ( gD(j,i) .NE. 0.0_wp ) THEN |
---|
767 | ! |
---|
768 | !-- Calculate vapour pressure |
---|
769 | e = q_p(k+1,j,i) * surface_pressure / 0.622 |
---|
770 | f3 = EXP ( -gD(j,i) * (e_s - e) ) |
---|
771 | ELSE |
---|
772 | f3 = 1.0_wp |
---|
773 | ENDIF |
---|
774 | |
---|
775 | ! |
---|
776 | !-- To do: check for very dry soil -> r_canopy goes to infinity |
---|
777 | r_canopy(j,i) = r_s_min(j,i) / (LAI(j,i) * f1 * f2 * f3 + 1.0E-20) |
---|
778 | |
---|
779 | ! |
---|
780 | !-- Third step: calculate bare soil resistance r_soil |
---|
781 | m_min = c_veg(j,i) * m_wilt(j,i) + (1.0_wp - c_veg(j,i)) * & |
---|
782 | m_res(j,i) |
---|
783 | |
---|
784 | f2 = ( m_soil(0,j,i) - m_min ) / ( m_fc(j,i) - m_min ) |
---|
785 | f2 = MAX(f2,1.0E-20) |
---|
786 | |
---|
787 | r_soil(j,i) = r_soil_min(j,i) / f2 |
---|
788 | |
---|
789 | ! |
---|
790 | !-- Calculate fraction of liquid water reservoir |
---|
791 | m_liq_max = m_max_depth * LAI(j,i) |
---|
792 | c_liq(j,i) = MIN(1.0, m_liq(j,i)/m_liq_max) |
---|
793 | |
---|
794 | q_s = 0.622_wp * e_s / surface_pressure |
---|
795 | IF ( q_s .LE. q_p(k+1,j,i)) THEN |
---|
796 | ! PRINT*, "dew fall at (before)", time_since_reference_point |
---|
797 | r_canopy(j,i) = 0.0_wp |
---|
798 | r_soil(j,i) = 0.0_wp |
---|
799 | ENDIF |
---|
800 | |
---|
801 | |
---|
802 | ! |
---|
803 | !-- Calculate coefficients for the total evapotranspiration |
---|
804 | f_LE_veg = rho_lv * c_veg(j,i) * (1.0 - c_liq(j,i)) / (r_a(j,i) & |
---|
805 | + r_canopy(j,i)) |
---|
806 | f_LE_soil = rho_lv * (1.0 - c_veg(j,i)) / (r_a(j,i) + r_soil(j,i)) |
---|
807 | f_LE_liq = rho_lv * c_veg(j,i) * c_liq(j,i) / r_a(j,i) |
---|
808 | |
---|
809 | |
---|
810 | ! Plant cannot transpirate below wilting point. here, r_canopy |
---|
811 | ! should go to infinity |
---|
812 | ! IF ( m_soil(k,j,i) .LT. m_wilt(j,i) ) THEN |
---|
813 | ! f_LE_veg(j,i) = 0.0 |
---|
814 | ! ENDIF |
---|
815 | |
---|
816 | f_H = rho_cp / r_a(j,i) |
---|
817 | f_LE = f_LE_veg + f_LE_soil + f_LE_liq |
---|
818 | |
---|
819 | ! |
---|
820 | !-- Calculate derivative of q_s for Taylor series expansion |
---|
821 | e_s_dT = e_s * ( 17.269_wp / (T_0(j,i) - 35.86_wp) - & |
---|
822 | 17.269_wp*(T_0(j,i) - 273.16_wp) / (T_0(j,i) & |
---|
823 | - 35.86_wp)**2 ) |
---|
824 | |
---|
825 | dq_s_dT = 0.622_wp * e_s_dT / surface_pressure |
---|
826 | |
---|
827 | T_1 = pt_p(k+1,j,i) * exn |
---|
828 | |
---|
829 | ! |
---|
830 | !-- Add LW up so that it can be removed in prognostic equation |
---|
831 | Rn(j,i) = Rn(j,i) + sigma_SB * T_0(j,i) ** 4 |
---|
832 | |
---|
833 | ! |
---|
834 | !-- Numerator of the prognostic equation |
---|
835 | coef_1 = Rn(j,i) + 3.0_wp * sigma_SB * T_0(j,i) ** 4 + f_H / exn & |
---|
836 | * T_1 + f_LE * ( q_p(k+1,j,i) - q_s + dq_s_dT * T_0(j,i) & |
---|
837 | ) + lambda_skin * T_soil(0,j,i) |
---|
838 | |
---|
839 | ! |
---|
840 | !-- Denominator of the prognostic equation |
---|
841 | coef_2 = 4.0_wp * sigma_SB * T_0(j,i) ** 3 + f_LE * dq_s_dT + & |
---|
842 | lambda_skin + f_H / exn |
---|
843 | |
---|
844 | tend = 0.0_wp |
---|
845 | |
---|
846 | ! |
---|
847 | !-- Implicit solution when the skin layer has no heat capacity, |
---|
848 | !-- otherwise use RK3 scheme. |
---|
849 | T_0_p(j,i) = ( coef_1 * dt_3d * tsc(2) + C_skin * T_0(j,i) ) / & |
---|
850 | ( C_skin + coef_2 * dt_3d * tsc(2) ) |
---|
851 | |
---|
852 | ! |
---|
853 | !-- Add RK3 term |
---|
854 | T_0_p(j,i) = T_0_p(j,i) + dt_3d * tsc(3) * tT_soil_m(0,j,i) |
---|
855 | |
---|
856 | ! |
---|
857 | !-- Calculate true tendency |
---|
858 | tend = (T_0_p(j,i) - T_0(j,i) - tsc(3) * tT_0_m(j,i)) / (dt_3d & |
---|
859 | * tsc(2)) |
---|
860 | |
---|
861 | ! |
---|
862 | !-- Calculate T_0 tendencies for the next Runge-Kutta step |
---|
863 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
864 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
865 | tT_0_m(j,i) = tend |
---|
866 | ELSEIF ( intermediate_timestep_count < & |
---|
867 | intermediate_timestep_count_max ) THEN |
---|
868 | tT_0_m(j,i) = -9.5625_wp * tend + 5.3125_wp * tT_0_m(j,i) |
---|
869 | ENDIF |
---|
870 | ENDIF |
---|
871 | |
---|
872 | pt_p(k,j,i) = T_0_p(j,i) / exn |
---|
873 | ! |
---|
874 | !-- Calculate fluxes |
---|
875 | Rn(j,i) = Rn(j,i) + 3.0_wp * sigma_SB * T_0(j,i)**4 & |
---|
876 | - 4.0_wp * sigma_SB * T_0(j,i)**3 * T_0_p(j,i) |
---|
877 | G(j,i) = lambda_skin * (T_0_p(j,i) - T_soil(0,j,i)) |
---|
878 | H(j,i) = - f_H * ( pt_p(k+1,j,i) - pt_p(k,j,i) ) |
---|
879 | LE(j,i) = - f_LE * ( q_p(k+1,j,i) - q_s + dq_s_dT * & |
---|
880 | T_0(j,i) - dq_s_dT * T_0_p(j,i) ) |
---|
881 | |
---|
882 | LE_veg(j,i) = - f_LE_veg * ( q_p(k+1,j,i) - q_s + dq_s_dT * & |
---|
883 | T_0(j,i) - dq_s_dT * T_0_p(j,i) ) |
---|
884 | LE_soil(j,i) = - f_LE_soil * ( q_p(k+1,j,i) - q_s + dq_s_dT * & |
---|
885 | T_0(j,i) - dq_s_dT * T_0_p(j,i) ) |
---|
886 | LE_liq(j,i) = - f_LE_liq * ( q_p(k+1,j,i) - q_s + dq_s_dT * & |
---|
887 | T_0(j,i) - dq_s_dT * T_0_p(j,i) ) |
---|
888 | |
---|
889 | |
---|
890 | ! IF ( i == 1 .AND. j == 1 ) THEN |
---|
891 | ! PRINT*, "Rn", Rn(j,i) |
---|
892 | ! PRINT*, "H", H(j,i) |
---|
893 | ! PRINT*, "LE", LE(j,i) |
---|
894 | ! PRINT*, "LE_liq", LE_liq(j,i) |
---|
895 | ! PRINT*, "LE_veg", LE_veg(j,i) |
---|
896 | ! PRINT*, "LE_soil", LE_soil(j,i) |
---|
897 | ! PRINT*, "G", G(j,i) |
---|
898 | ! ENDIF |
---|
899 | |
---|
900 | |
---|
901 | IF ( LE(j,i) .EQ. 0.0 ) THEN |
---|
902 | ! PRINT*, "+++ Evapotranspiration -> 0" |
---|
903 | r_s(j,i) = 1.0E10 |
---|
904 | ELSE |
---|
905 | r_s(j,i) = - rho_lv * ( q_p(k+1,j,i) - q_s + dq_s_dT * T_0(j,i)& |
---|
906 | - dq_s_dT * T_0_p(j,i) ) / LE(j,i) - r_a(j,i) |
---|
907 | ENDIF |
---|
908 | |
---|
909 | ! |
---|
910 | !-- Calculate change in liquid water reservoir due to dew fall or |
---|
911 | !-- evaporation of liquid water (to do: add interception from rainfall) |
---|
912 | IF ( q_s .LE. q_p(k+1,j,i)) THEN |
---|
913 | ! |
---|
914 | !-- Check if reservoir is full (avoid values > m_liq_max) |
---|
915 | !-- In that case, LE_liq goes to LE_soil. In this case |
---|
916 | !-- LE_veg is zero anyway (because c_liq = 1), so that tend is |
---|
917 | !-- zero and no further check is needed |
---|
918 | IF ( m_liq(j,i) .EQ. m_liq_max ) THEN |
---|
919 | LE_soil(j,i) = LE_soil(j,i) + LE_liq(j,i) |
---|
920 | LE_liq(j,i) = 0.0_wp |
---|
921 | ENDIF |
---|
922 | |
---|
923 | ! |
---|
924 | !-- In case LE_veg becomes negative (unphysical behavior), let |
---|
925 | !-- the water enter the liquid water reservoir as dew on the |
---|
926 | !-- plant |
---|
927 | IF ( LE_veg(j,i) .LT. 0.0_wp ) THEN |
---|
928 | LE_liq(j,i) = LE_liq(j,i) + LE_veg(j,i) |
---|
929 | LE_veg(j,i) = 0.0_wp |
---|
930 | ENDIF |
---|
931 | ENDIF |
---|
932 | |
---|
933 | tend = - LE_liq(j,i) * drho_l_lv |
---|
934 | |
---|
935 | |
---|
936 | m_liq_p(j,i) = m_liq(j,i) + dt_3d * ( tsc(2) * tend & |
---|
937 | + tsc(3) * tm_liq_m(j,i) ) |
---|
938 | |
---|
939 | ! |
---|
940 | !-- Check if reservoir is overfull -> reduce to maximum |
---|
941 | !-- (conservation of water is violated here) |
---|
942 | m_liq_p(j,i) = MIN(m_liq_p(j,i),m_liq_max) |
---|
943 | |
---|
944 | ! |
---|
945 | !-- Check if reservoir is empty (avoid values < 0.0) |
---|
946 | !-- (conservation of water is violated here) |
---|
947 | m_liq_p(j,i) = MAX(m_liq_p(j,i),0.0_wp) |
---|
948 | |
---|
949 | |
---|
950 | ! |
---|
951 | !-- Calculate m_liq tendencies for the next Runge-Kutta step |
---|
952 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
953 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
954 | tm_liq_m(j,i) = tend |
---|
955 | ELSEIF ( intermediate_timestep_count < & |
---|
956 | intermediate_timestep_count_max ) THEN |
---|
957 | tm_liq_m(j,i) = -9.5625_wp * tend + 5.3125_wp * tm_liq_m(j,i) |
---|
958 | ENDIF |
---|
959 | ENDIF |
---|
960 | |
---|
961 | ! |
---|
962 | !-- Calculate fluxes in the atmosphere |
---|
963 | shf(j,i) = H(j,i) / rho_cp |
---|
964 | qsws(j,i) = LE(j,i) / rho_lv |
---|
965 | |
---|
966 | ENDDO |
---|
967 | ENDDO |
---|
968 | |
---|
969 | |
---|
970 | |
---|
971 | END SUBROUTINE lsm_energy_balance |
---|
972 | |
---|
973 | |
---|
974 | !------------------------------------------------------------------------------! |
---|
975 | ! Description: |
---|
976 | ! ------------ |
---|
977 | ! |
---|
978 | !------------------------------------------------------------------------------! |
---|
979 | SUBROUTINE lsm_soil_model |
---|
980 | |
---|
981 | |
---|
982 | IMPLICIT NONE |
---|
983 | |
---|
984 | INTEGER(iwp) :: i !: running index |
---|
985 | INTEGER(iwp) :: j !: running index |
---|
986 | INTEGER(iwp) :: k !: running index |
---|
987 | |
---|
988 | REAL(wp) :: h_VG !: Van Genuchten coef. h |
---|
989 | |
---|
990 | REAL(wp), DIMENSION(0:soil_layers-1) :: gamma_temp, & !: temp. gamma |
---|
991 | lambda_temp, & !: temp. lambda |
---|
992 | tend !: tendency |
---|
993 | |
---|
994 | DO i = nxlg, nxrg |
---|
995 | DO j = nysg, nyng |
---|
996 | DO k = 0, soil_layers-1 |
---|
997 | ! |
---|
998 | !-- Calculate volumetric heat capacity of the soil, taking into |
---|
999 | !-- account water content |
---|
1000 | rhoC_total(k,j,i) = (rhoC_soil * (1.0 - m_sat(j,i)) & |
---|
1001 | + rhoC_water * m_soil(k,j,i)) |
---|
1002 | |
---|
1003 | ! |
---|
1004 | !-- Calculate soil heat conductivity at the center of the soil |
---|
1005 | !-- layers |
---|
1006 | Ke = 1.0 + LOG10(MAX(0.1,m_soil(k,j,i) / m_sat(j,i))) |
---|
1007 | lambda_temp(k) = Ke * (lambda_h_sat(j,i) + lambda_h_dry) + & |
---|
1008 | lambda_h_dry |
---|
1009 | |
---|
1010 | ENDDO |
---|
1011 | |
---|
1012 | ! |
---|
1013 | !-- Calculate soil heat conductivity (lambda_h) at the _stag level |
---|
1014 | !-- using linear interpolation |
---|
1015 | DO k = 0, soil_layers-2 |
---|
1016 | |
---|
1017 | lambda_h(k,j,i) = lambda_temp(k) + & |
---|
1018 | ( lambda_temp(k+1) - lambda_temp(k) ) & |
---|
1019 | * 0.5 * dz_soil_stag(k) * ddz_soil(k+1) |
---|
1020 | |
---|
1021 | ENDDO |
---|
1022 | lambda_h(soil_layers-1,j,i) = lambda_temp(soil_layers-1) |
---|
1023 | |
---|
1024 | ! |
---|
1025 | !-- Prognostic equation for soil temperature T_soil |
---|
1026 | tend(:) = 0.0_wp |
---|
1027 | tend(0) = (1.0/rhoC_total(0,j,i)) * & |
---|
1028 | ( lambda_h(0,j,i) * ( T_soil(1,j,i) - T_soil(0,j,i) ) & |
---|
1029 | * ddz_soil(0) + G(j,i) ) * ddz_soil_stag(0) |
---|
1030 | |
---|
1031 | DO k = 1, soil_layers-1 |
---|
1032 | tend(k) = (1.0/rhoC_total(k,j,i)) & |
---|
1033 | * ( lambda_h(k,j,i) & |
---|
1034 | * ( T_soil(k+1,j,i) - T_soil(k,j,i) ) & |
---|
1035 | * ddz_soil(k) & |
---|
1036 | - lambda_h(k-1,j,i) & |
---|
1037 | * ( T_soil(k,j,i) - T_soil(k-1,j,i) ) & |
---|
1038 | * ddz_soil(k-1) & |
---|
1039 | ) * ddz_soil_stag(k) |
---|
1040 | ENDDO |
---|
1041 | |
---|
1042 | T_soil_p(0:soil_layers-1,j,i) = T_soil(0:soil_layers-1,j,i) & |
---|
1043 | + dt_3d * ( tsc(2) & |
---|
1044 | * tend(:) + tsc(3) & |
---|
1045 | * tT_soil_m(:,j,i) ) |
---|
1046 | |
---|
1047 | ! |
---|
1048 | !-- Calculate T_soil tendencies for the next Runge-Kutta step |
---|
1049 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
1050 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
1051 | DO k = 0, soil_layers-1 |
---|
1052 | tT_soil_m(k,j,i) = tend(k) |
---|
1053 | ENDDO |
---|
1054 | ELSEIF ( intermediate_timestep_count < & |
---|
1055 | intermediate_timestep_count_max ) THEN |
---|
1056 | DO k = 0, soil_layers-1 |
---|
1057 | tT_soil_m(k,j,i) = -9.5625_wp * tend(k) + 5.3125_wp & |
---|
1058 | * tT_soil_m(k,j,i) |
---|
1059 | ENDDO |
---|
1060 | ENDIF |
---|
1061 | ENDIF |
---|
1062 | |
---|
1063 | |
---|
1064 | DO k = 0, soil_layers-1 |
---|
1065 | ! |
---|
1066 | !-- Calculate soil diffusivity at the center of the soil layers |
---|
1067 | lambda_temp(k) = (- b_CH * gamma_w_sat(j,i) * psi_sat & |
---|
1068 | / m_sat(j,i) ) * ( MAX(m_soil(k,j,i), & |
---|
1069 | m_wilt(j,i)) / m_sat(j,i) )**(b_CH + 2.0_wp) |
---|
1070 | |
---|
1071 | ! |
---|
1072 | !-- Calculate the hydraulic conductivity after Van Genuchten (1980) |
---|
1073 | h_VG = ( ( (m_res(j,i) - m_sat(j,i)) / ( m_res(j,i) - & |
---|
1074 | MAX(m_soil(k,j,i),m_wilt(j,i)) ) )**(n_VG(j,i) & |
---|
1075 | / (n_VG(j,i)-1.0_wp)) - 1.0_wp & |
---|
1076 | )**(1.0_wp/n_VG(j,i)) / alpha_VG(j,i) |
---|
1077 | |
---|
1078 | gamma_temp(k) = gamma_w_sat(j,i) * ( ( (1.0_wp + & |
---|
1079 | (alpha_VG(j,i)*h_VG)**n_VG(j,i))**(1.0_wp & |
---|
1080 | -1.0_wp/n_VG(j,i)) - (alpha_VG(j,i)*h_VG & |
---|
1081 | )**(n_VG(j,i)-1.0_wp))**2 ) & |
---|
1082 | / ( (1.0_wp + (alpha_VG(j,i)*h_VG)**n_VG(j,i) & |
---|
1083 | )**((1.0_wp - 1.0_wp/n_VG(j,i))*(l_VG(j,i) & |
---|
1084 | + 2.0)) ) |
---|
1085 | |
---|
1086 | ENDDO |
---|
1087 | |
---|
1088 | |
---|
1089 | IF ( humidity ) THEN |
---|
1090 | ! |
---|
1091 | !-- Calculate soil diffusivity (lambda_w) at the _stag level |
---|
1092 | !-- using linear interpolation |
---|
1093 | DO k = 0, soil_layers-2 |
---|
1094 | |
---|
1095 | lambda_w(k,j,i) = lambda_temp(k) + & |
---|
1096 | ( lambda_temp(k+1) - lambda_temp(k) ) & |
---|
1097 | * 0.5 * dz_soil_stag(k) * ddz_soil(k+1) |
---|
1098 | gamma_w(k,j,i) = gamma_temp(k) + & |
---|
1099 | ( gamma_temp(k+1) - gamma_temp(k) ) & |
---|
1100 | * 0.5 * dz_soil_stag(k) * ddz_soil(k+1) |
---|
1101 | |
---|
1102 | ENDDO |
---|
1103 | |
---|
1104 | ! |
---|
1105 | ! |
---|
1106 | !-- In case of a closed bottom (= water content is conserved), set |
---|
1107 | !-- hydraulic conductivity to zero to that no water will be lost |
---|
1108 | !-- in the bottom layer. |
---|
1109 | IF ( conserve_water_content ) THEN |
---|
1110 | gamma_w(soil_layers-1,j,i) = 0.0_wp |
---|
1111 | ELSE |
---|
1112 | gamma_w(soil_layers-1,j,i) = lambda_temp(soil_layers-1) |
---|
1113 | ENDIF |
---|
1114 | |
---|
1115 | !-- The root extraction (= root_extr * LE_veg / (rho_l * l_v)) |
---|
1116 | !-- ensures the mass conservation for water. The transpiration of |
---|
1117 | !-- plants equals the cumulative withdrawals by the roots in the |
---|
1118 | !-- soil. The scheme takes into account the availability of water |
---|
1119 | !-- in the soil layers as well as the root fraction in the |
---|
1120 | !-- respective layer |
---|
1121 | |
---|
1122 | ! |
---|
1123 | !-- Calculate the root extraction (ECMWF 7.69, with some |
---|
1124 | !-- modifications) |
---|
1125 | m_total = 0.0_wp |
---|
1126 | DO k = 0, soil_layers-1 |
---|
1127 | m_total = m_total + root_fr(k,j,i) * m_soil(k,j,i) * & |
---|
1128 | dz_soil_stag(k) |
---|
1129 | |
---|
1130 | ENDDO |
---|
1131 | |
---|
1132 | ! |
---|
1133 | !-- For conservation of mass, the sum of root_extr must be 1 |
---|
1134 | DO k = 0, soil_layers-1 |
---|
1135 | root_extr(k) = root_fr(k,j,i) * m_soil(k,j,i) & |
---|
1136 | * dz_soil_stag(k) / m_total |
---|
1137 | ENDDO |
---|
1138 | |
---|
1139 | |
---|
1140 | ! |
---|
1141 | !-- Prognostic equation for soil water content m_soil |
---|
1142 | tend(:) = 0.0_wp |
---|
1143 | tend(0) = ( lambda_w(0,j,i) * ( m_soil(1,j,i) - m_soil(0,j,i) )& |
---|
1144 | * ddz_soil(0) - gamma_w(0,j,i) - ( root_extr(0) & |
---|
1145 | * LE_veg(j,i) + LE_soil(j,i) ) * drho_l_lv & |
---|
1146 | ) * ddz_soil_stag(0) |
---|
1147 | |
---|
1148 | DO k = 1, soil_layers-2 |
---|
1149 | tend(k) = ( lambda_w(k,j,i) * ( m_soil(k+1,j,i) & |
---|
1150 | - m_soil(k,j,i) ) * ddz_soil(k) - gamma_w(k,j,i)& |
---|
1151 | - lambda_w(k-1,j,i) * (m_soil(k,j,i) - & |
---|
1152 | m_soil(k-1,j,i)) * ddz_soil(k-1) & |
---|
1153 | + gamma_w(k-1,j,i) - (root_extr(k) * LE_veg(j,i)& |
---|
1154 | * drho_l_lv) & |
---|
1155 | ) * ddz_soil_stag(k) |
---|
1156 | |
---|
1157 | ENDDO |
---|
1158 | tend(soil_layers-1) = ( - gamma_w(soil_layers-1,j,i) & |
---|
1159 | - lambda_w(soil_layers-2,j,i) & |
---|
1160 | * (m_soil(soil_layers-1,j,i) & |
---|
1161 | - m_soil(soil_layers-2,j,i)) & |
---|
1162 | * ddz_soil(soil_layers-2) & |
---|
1163 | + gamma_w(soil_layers-2,j,i) - ( & |
---|
1164 | root_extr(soil_layers-1) & |
---|
1165 | * LE_veg(j,i) * drho_l_lv ) & |
---|
1166 | ) * ddz_soil_stag(soil_layers-1) |
---|
1167 | |
---|
1168 | m_soil_p(0:soil_layers-1,j,i) = m_soil(0:soil_layers-1,j,i) & |
---|
1169 | + dt_3d * ( tsc(2) * tend(:) & |
---|
1170 | + tsc(3) * tm_soil_m(:,j,i) ) |
---|
1171 | |
---|
1172 | ! |
---|
1173 | !-- Account for dry soils (find a better solution here!) |
---|
1174 | m_soil_p(:,j,i) = MAX(m_soil_p(:,j,i),0.0_wp) |
---|
1175 | |
---|
1176 | ! |
---|
1177 | !-- Calculate m_soil tendencies for the next Runge-Kutta step |
---|
1178 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
1179 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
1180 | DO k = 0, soil_layers-1 |
---|
1181 | tm_soil_m(k,j,i) = tend(k) |
---|
1182 | ENDDO |
---|
1183 | ELSEIF ( intermediate_timestep_count < & |
---|
1184 | intermediate_timestep_count_max ) THEN |
---|
1185 | DO k = 0, soil_layers-1 |
---|
1186 | tm_soil_m(k,j,i) = -9.5625_wp * tend(k) + 5.3125_wp & |
---|
1187 | * tm_soil_m(k,j,i) |
---|
1188 | ENDDO |
---|
1189 | ENDIF |
---|
1190 | ENDIF |
---|
1191 | |
---|
1192 | ENDIF |
---|
1193 | |
---|
1194 | ENDDO |
---|
1195 | ENDDO |
---|
1196 | |
---|
1197 | ! |
---|
1198 | !-- Calculate surface specific humidity |
---|
1199 | IF ( humidity ) THEN |
---|
1200 | CALL calc_q0 |
---|
1201 | ENDIF |
---|
1202 | |
---|
1203 | |
---|
1204 | END SUBROUTINE lsm_soil_model |
---|
1205 | |
---|
1206 | |
---|
1207 | !------------------------------------------------------------------------------! |
---|
1208 | ! Description: |
---|
1209 | ! ------------ |
---|
1210 | ! |
---|
1211 | !------------------------------------------------------------------------------! |
---|
1212 | SUBROUTINE calc_q0 |
---|
1213 | |
---|
1214 | IMPLICIT NONE |
---|
1215 | |
---|
1216 | INTEGER :: i !: running index |
---|
1217 | INTEGER :: j !: running index |
---|
1218 | INTEGER :: k !: running index |
---|
1219 | REAL(wp) :: resistance !: aerodynamic and soil resistance term |
---|
1220 | |
---|
1221 | DO i = nxlg, nxrg |
---|
1222 | DO j = nysg, nyng |
---|
1223 | |
---|
1224 | k = nzb_s_inner(j,i) |
---|
1225 | ! |
---|
1226 | !-- Temporary solution as long as T_0 is prescribed |
---|
1227 | |
---|
1228 | pt_p(k,j,i) = T_0(j,i) / exn |
---|
1229 | ! |
---|
1230 | !-- Calculate water vapour pressure at saturation |
---|
1231 | e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * ( T_0(j,i) - & |
---|
1232 | 273.16_wp ) / ( T_0(j,i) - & |
---|
1233 | 35.86_wp ) ) |
---|
1234 | |
---|
1235 | ! |
---|
1236 | !-- Calculate specific humidity at saturation |
---|
1237 | q_s = 0.622_wp * e_s / surface_pressure |
---|
1238 | |
---|
1239 | |
---|
1240 | resistance = r_a(j,i) / (r_a(j,i) + r_s(j,i)) |
---|
1241 | |
---|
1242 | ! |
---|
1243 | !-- Calculate specific humidity at surface |
---|
1244 | q_p(k,j,i) = resistance * q_s + (1.0_wp - resistance) & |
---|
1245 | * q_p(k+1,j,i) |
---|
1246 | |
---|
1247 | ENDDO |
---|
1248 | ENDDO |
---|
1249 | |
---|
1250 | END SUBROUTINE calc_q0 |
---|
1251 | |
---|
1252 | |
---|
1253 | END MODULE land_surface_model_mod |
---|