1 | !> @file land_surface_model_mod.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of PALM. |
---|
4 | ! |
---|
5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
6 | ! terms of the GNU General Public License as published by the Free Software |
---|
7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
8 | ! 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-2017 Leibniz Universitaet Hannover |
---|
18 | !------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! Error no changed |
---|
23 | ! |
---|
24 | ! |
---|
25 | ! Former revisions: |
---|
26 | ! ----------------- |
---|
27 | ! $Id: land_surface_model_mod.f90 2248 2017-06-06 13:52:54Z sward $ |
---|
28 | ! |
---|
29 | ! 2246 2017-06-06 13:09:34Z sward |
---|
30 | ! Error no changed |
---|
31 | ! |
---|
32 | ! Changed soil configuration to 8 layers. The number of soil layers is now |
---|
33 | ! freely adjustable via the NAMELIST. |
---|
34 | ! |
---|
35 | ! 2237 2017-05-31 10:34:53Z suehring |
---|
36 | ! Bugfix in write restart data |
---|
37 | ! |
---|
38 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
39 | ! |
---|
40 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
41 | ! Adjustments to new topography and surface concept |
---|
42 | ! - now, also vertical walls are possible |
---|
43 | ! - for vertical walls, parametrization of r_a (aerodynamic resisistance) is |
---|
44 | ! implemented. |
---|
45 | ! |
---|
46 | ! Add check for soil moisture, it must not exceed its saturation value. |
---|
47 | ! |
---|
48 | ! 2149 2017-02-09 16:57:03Z scharf |
---|
49 | ! Land surface parameters II corrected for veg_type 18 and 19 |
---|
50 | ! |
---|
51 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
52 | ! renamed variable rho to rho_ocean |
---|
53 | ! |
---|
54 | ! 2000 2016-08-20 18:09:15Z knoop |
---|
55 | ! Forced header and separation lines into 80 columns |
---|
56 | ! |
---|
57 | ! 1978 2016-07-29 12:08:31Z maronga |
---|
58 | ! Bugfix: initial values of pave_surface and water_surface were not set. |
---|
59 | ! |
---|
60 | ! 1976 2016-07-27 13:28:04Z maronga |
---|
61 | ! Parts of the code have been reformatted. Use of radiation model output is |
---|
62 | ! generalized and simplified. Added more output quantities due to modularization |
---|
63 | ! |
---|
64 | ! 1972 2016-07-26 07:52:02Z maronga |
---|
65 | ! Further modularization: output of cross sections and 3D data is now done in this |
---|
66 | ! module. Moreover, restart data is written and read directly within this module. |
---|
67 | ! |
---|
68 | ! |
---|
69 | ! 1966 2016-07-18 11:54:18Z maronga |
---|
70 | ! Bugfix: calculation of m_total in soil model was not set to zero at model start |
---|
71 | ! |
---|
72 | ! 1949 2016-06-17 07:19:16Z maronga |
---|
73 | ! Bugfix: calculation of qsws_soil_eb with precipitation = .TRUE. gave |
---|
74 | ! qsws_soil_eb = 0 due to a typo |
---|
75 | ! |
---|
76 | ! 1856 2016-04-13 12:56:17Z maronga |
---|
77 | ! Bugfix: for water surfaces, the initial water surface temperature is set equal |
---|
78 | ! to the intital skin temperature. Moreover, the minimum value of r_a is now |
---|
79 | ! 1.0 to avoid too large fluxes at the first model time step |
---|
80 | ! |
---|
81 | ! 1849 2016-04-08 11:33:18Z hoffmann |
---|
82 | ! prr moved to arrays_3d |
---|
83 | ! |
---|
84 | ! 1826 2016-04-07 12:01:39Z maronga |
---|
85 | ! Cleanup after modularization |
---|
86 | ! |
---|
87 | ! 1817 2016-04-06 15:44:20Z maronga |
---|
88 | ! Added interface for lsm_init_arrays. Added subroutines for check_parameters, |
---|
89 | ! header, and parin. Renamed some subroutines. |
---|
90 | ! |
---|
91 | ! 1788 2016-03-10 11:01:04Z maronga |
---|
92 | ! Bugfix: calculate lambda_surface based on temperature gradient between skin |
---|
93 | ! layer and soil layer instead of Obukhov length |
---|
94 | ! Changed: moved calculation of surface specific humidity to energy balance solver |
---|
95 | ! New: water surfaces are available by using a fixed sea surface temperature. |
---|
96 | ! The roughness lengths are calculated dynamically using the Charnock |
---|
97 | ! parameterization. This involves the new roughness length for moisture z0q. |
---|
98 | ! New: modified solution of the energy balance solver and soil model for |
---|
99 | ! paved surfaces (i.e. asphalt concrete). |
---|
100 | ! Syntax layout improved. |
---|
101 | ! Changed: parameter dewfall removed. |
---|
102 | ! |
---|
103 | ! 1783 2016-03-06 18:36:17Z raasch |
---|
104 | ! netcdf variables moved to netcdf module |
---|
105 | ! |
---|
106 | ! 1757 2016-02-22 15:49:32Z maronga |
---|
107 | ! Bugfix: set tm_soil_m to zero after allocation. Added parameter |
---|
108 | ! unscheduled_radiation_calls to control calls of the radiation model based on |
---|
109 | ! the skin temperature change during one time step (preliminary version). Set |
---|
110 | ! qsws_soil_eb to zero at model start (previously set to qsws_eb). Removed MAX |
---|
111 | ! function as it cannot be vectorized. |
---|
112 | ! |
---|
113 | ! 1709 2015-11-04 14:47:01Z maronga |
---|
114 | ! Renamed pt_1 and qv_1 to pt1 and qv1. |
---|
115 | ! Bugfix: set initial values for t_surface_p in case of restart runs |
---|
116 | ! Bugfix: zero resistance caused crash when using radiation_scheme = 'clear-sky' |
---|
117 | ! Bugfix: calculation of rad_net when using radiation_scheme = 'clear-sky' |
---|
118 | ! Added todo action |
---|
119 | ! |
---|
120 | ! 1697 2015-10-28 17:14:10Z raasch |
---|
121 | ! bugfix: misplaced cpp-directive |
---|
122 | ! |
---|
123 | ! 1695 2015-10-27 10:03:11Z maronga |
---|
124 | ! Bugfix: REAL constants provided with KIND-attribute in call of |
---|
125 | ! Replaced rif with ol |
---|
126 | ! |
---|
127 | ! 1691 2015-10-26 16:17:44Z maronga |
---|
128 | ! Added skip_time_do_lsm to allow for spin-ups without LSM. Various bugfixes: |
---|
129 | ! Soil temperatures are now defined at the edges of the layers, calculation of |
---|
130 | ! shb_eb corrected, prognostic equation for skin temperature corrected. Surface |
---|
131 | ! fluxes are now directly transfered to atmosphere |
---|
132 | ! |
---|
133 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
134 | ! Code annotations made doxygen readable |
---|
135 | ! |
---|
136 | ! 1590 2015-05-08 13:56:27Z maronga |
---|
137 | ! Bugfix: definition of character strings requires same length for all elements |
---|
138 | ! |
---|
139 | ! 1585 2015-04-30 07:05:52Z maronga |
---|
140 | ! Modifications for RRTMG. Changed tables to PARAMETER type. |
---|
141 | ! |
---|
142 | ! 1571 2015-03-12 16:12:49Z maronga |
---|
143 | ! Removed upper-case variable names. Corrected distribution of precipitation to |
---|
144 | ! the liquid water reservoir and the bare soil fractions. |
---|
145 | ! |
---|
146 | ! 1555 2015-03-04 17:44:27Z maronga |
---|
147 | ! Added output of r_a and r_s |
---|
148 | ! |
---|
149 | ! 1553 2015-03-03 17:33:54Z maronga |
---|
150 | ! Improved better treatment of roughness lengths. Added default soil temperature |
---|
151 | ! profile |
---|
152 | ! |
---|
153 | ! 1551 2015-03-03 14:18:16Z maronga |
---|
154 | ! Flux calculation is now done in prandtl_fluxes. Added support for data output. |
---|
155 | ! Vertical indices have been replaced. Restart runs are now possible. Some |
---|
156 | ! variables have beem renamed. Bugfix in the prognostic equation for the surface |
---|
157 | ! temperature. Introduced z0_eb and z0h_eb, which overwrite the setting of |
---|
158 | ! roughness_length and z0_factor. Added Clapp & Hornberger parametrization for |
---|
159 | ! the hydraulic conductivity. Bugfix for root fraction and extraction |
---|
160 | ! calculation |
---|
161 | ! |
---|
162 | ! intrinsic function MAX and MIN |
---|
163 | ! |
---|
164 | ! 1500 2014-12-03 17:42:41Z maronga |
---|
165 | ! Corrected calculation of aerodynamic resistance (r_a). |
---|
166 | ! Precipitation is now added to liquid water reservoir using LE_liq. |
---|
167 | ! Added support for dry runs. |
---|
168 | ! |
---|
169 | ! 1496 2014-12-02 17:25:50Z maronga |
---|
170 | ! Initial revision |
---|
171 | ! |
---|
172 | ! |
---|
173 | ! Description: |
---|
174 | ! ------------ |
---|
175 | !> Land surface model, consisting of a solver for the energy balance at the |
---|
176 | !> surface and a four layer soil scheme. The scheme is similar to the TESSEL |
---|
177 | !> scheme implemented in the ECMWF IFS model, with modifications according to |
---|
178 | !> H-TESSEL. The implementation is based on the formulation implemented in the |
---|
179 | !> DALES and UCLA-LES models. |
---|
180 | !> |
---|
181 | !> @todo Restart data for vertical natural land-surfaces |
---|
182 | !> @todo Extensive verification energy-balance solver for vertical surfaces, |
---|
183 | !> e.g. parametrization of r_a |
---|
184 | !> @todo Revise single land-surface processes for vertical surfaces, e.g. |
---|
185 | !> treatment of humidity, etc. |
---|
186 | !> @todo Consider partial absorption of the net shortwave radiation by the |
---|
187 | !> skin layer. |
---|
188 | !> @todo Improve surface water parameterization |
---|
189 | !> @todo Invert indices (running from -3 to 0. Currently: nzb_soil=0, |
---|
190 | !> nzt_soil=3)). |
---|
191 | !> @todo Implement surface runoff model (required when performing long-term LES |
---|
192 | !> with considerable precipitation. |
---|
193 | !> @todo Fix crashes with radiation_scheme == 'constant' |
---|
194 | !> |
---|
195 | !> @note No time step criterion is required as long as the soil layers do not |
---|
196 | !> become too thin. |
---|
197 | !------------------------------------------------------------------------------! |
---|
198 | MODULE land_surface_model_mod |
---|
199 | |
---|
200 | USE arrays_3d, & |
---|
201 | ONLY: hyp, pt, pt_p, prr, q, q_p, ql, vpt, u, v, w |
---|
202 | |
---|
203 | USE cloud_parameters, & |
---|
204 | ONLY: cp, hyrho, l_d_cp, l_d_r, l_v, pt_d_t, rho_l, r_d, r_v |
---|
205 | |
---|
206 | USE control_parameters, & |
---|
207 | ONLY: cloud_physics, dt_3d, humidity, intermediate_timestep_count, & |
---|
208 | initializing_actions, intermediate_timestep_count_max, & |
---|
209 | land_surface, max_masks, precipitation, pt_surface, & |
---|
210 | rho_surface, roughness_length, surface_pressure, & |
---|
211 | timestep_scheme, tsc, z0h_factor, time_since_reference_point |
---|
212 | |
---|
213 | USE indices, & |
---|
214 | ONLY: nbgp, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb |
---|
215 | |
---|
216 | USE kinds |
---|
217 | |
---|
218 | USE pegrid |
---|
219 | |
---|
220 | USE radiation_model_mod, & |
---|
221 | ONLY: force_radiation_call, rad_net, rad_sw_in, rad_lw_out, & |
---|
222 | rad_lw_out_change_0, radiation_scheme, unscheduled_radiation_calls |
---|
223 | |
---|
224 | USE statistics, & |
---|
225 | ONLY: hom, statistic_regions |
---|
226 | |
---|
227 | USE surface_mod, & |
---|
228 | ONLY : surf_lsm_h, surf_lsm_v, surf_type |
---|
229 | |
---|
230 | IMPLICIT NONE |
---|
231 | |
---|
232 | TYPE surf_type_lsm |
---|
233 | REAL(wp), DIMENSION(:), ALLOCATABLE :: var_1D !< 1D prognostic variable |
---|
234 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: var_2D !< 2D prognostic variable |
---|
235 | END TYPE surf_type_lsm |
---|
236 | |
---|
237 | ! |
---|
238 | !-- LSM model constants |
---|
239 | |
---|
240 | REAL(wp), PARAMETER :: & |
---|
241 | b_ch = 6.04_wp, & ! Clapp & Hornberger exponent |
---|
242 | lambda_h_dry = 0.19_wp, & ! heat conductivity for dry soil |
---|
243 | lambda_h_sm = 3.44_wp, & ! heat conductivity of the soil matrix |
---|
244 | lambda_h_water = 0.57_wp, & ! heat conductivity of water |
---|
245 | psi_sat = -0.388_wp, & ! soil matrix potential at saturation |
---|
246 | rho_c_soil = 2.19E6_wp, & ! volumetric heat capacity of soil |
---|
247 | rho_c_water = 4.20E6_wp, & ! volumetric heat capacity of water |
---|
248 | m_max_depth = 0.0002_wp ! Maximum capacity of the water reservoir (m) |
---|
249 | |
---|
250 | |
---|
251 | REAL(wp), DIMENSION(0:7), PARAMETER :: zs_default = & ! default soil layer configuration |
---|
252 | (/ 0.005_wp, 0.02_wp, 0.04_wp, & |
---|
253 | 0.07_wp, 0.15_wp, 0.28_wp, & |
---|
254 | 1.00_wp, 2.89_wp /) |
---|
255 | |
---|
256 | |
---|
257 | ! |
---|
258 | !-- LSM variables |
---|
259 | INTEGER(iwp) :: nzb_soil = 0, & !< bottom of the soil model (Earth's surface) |
---|
260 | nzt_soil = 0, & !< top of the soil model |
---|
261 | nzs = 0, & !< number of soil layers |
---|
262 | veg_type = 2, & !< default NAMELIST veg_type_2d |
---|
263 | soil_type = 3 !< default NAMELIST soil_type_2d |
---|
264 | |
---|
265 | |
---|
266 | LOGICAL :: conserve_water_content = .TRUE., & !< open or closed bottom surface for the soil model |
---|
267 | force_radiation_call_l = .FALSE., & !< flag to force calling of radiation routine |
---|
268 | aero_resist_kray = .TRUE. !< flag to control parametrization of aerodynamic resistance at vertical surface elements |
---|
269 | |
---|
270 | ! value 9999999.9_wp -> generic available or user-defined value must be set |
---|
271 | ! otherwise -> no generic variable and user setting is optional |
---|
272 | REAL(wp) :: alpha_vangenuchten = 9999999.9_wp, & !< NAMELIST alpha_vg |
---|
273 | canopy_resistance_coefficient = 9999999.9_wp, & !< NAMELIST g_d |
---|
274 | c_surface = 20000.0_wp, & !< Surface (skin) heat capacity |
---|
275 | drho_l_lv, & !< (rho_l * l_v)**-1 |
---|
276 | exn, & !< value of the Exner function |
---|
277 | e_s = 0.0_wp, & !< saturation water vapour pressure |
---|
278 | field_capacity = 9999999.9_wp, & !< NAMELIST m_fc |
---|
279 | f_shortwave_incoming = 9999999.9_wp, & !< NAMELIST f_sw_in |
---|
280 | hydraulic_conductivity = 9999999.9_wp, & !< NAMELIST gamma_w_sat |
---|
281 | ke = 0.0_wp, & !< Kersten number |
---|
282 | lambda_h_sat = 0.0_wp, & !< heat conductivity for saturated soil |
---|
283 | lambda_surface_stable = 9999999.9_wp, & !< NAMELIST lambda_surface_s |
---|
284 | lambda_surface_unstable = 9999999.9_wp, & !< NAMELIST lambda_surface_u |
---|
285 | leaf_area_index = 9999999.9_wp, & !< NAMELIST lai |
---|
286 | l_vangenuchten = 9999999.9_wp, & !< NAMELIST l_vg |
---|
287 | min_canopy_resistance = 9999999.9_wp, & !< NAMELIST r_canopy_min |
---|
288 | min_soil_resistance = 50.0_wp, & !< NAMELIST r_soil_min |
---|
289 | m_total = 0.0_wp, & !< weighted total water content of the soil (m3/m3) |
---|
290 | n_vangenuchten = 9999999.9_wp, & !< NAMELIST n_vg |
---|
291 | pave_depth = 9999999.9_wp, & !< depth of the pavement |
---|
292 | pave_heat_capacity = 1.94E6_wp, & !< volumetric heat capacity of pavement (e.g. roads) |
---|
293 | pave_heat_conductivity = 1.00_wp, & !< heat conductivity for pavements (e.g. roads) |
---|
294 | q_s = 0.0_wp, & !< saturation specific humidity |
---|
295 | residual_moisture = 9999999.9_wp, & !< NAMELIST m_res |
---|
296 | rho_cp, & !< rho_surface * cp |
---|
297 | rho_lv, & !< rho_ocean * l_v |
---|
298 | rd_d_rv, & !< r_d / r_v |
---|
299 | saturation_moisture = 9999999.9_wp, & !< NAMELIST m_sat |
---|
300 | skip_time_do_lsm = 0.0_wp, & !< LSM is not called before this time |
---|
301 | vegetation_coverage = 9999999.9_wp, & !< NAMELIST c_veg |
---|
302 | wilting_point = 9999999.9_wp, & !< NAMELIST m_wilt |
---|
303 | z0_eb = 9999999.9_wp, & !< NAMELIST z0 (lsm_par) |
---|
304 | z0h_eb = 9999999.9_wp, & !< NAMELIST z0h (lsm_par) |
---|
305 | z0q_eb = 9999999.9_wp !< NAMELIST z0q (lsm_par) |
---|
306 | |
---|
307 | REAL(wp), DIMENSION(:), ALLOCATABLE :: ddz_soil, & !< 1/dz_soil |
---|
308 | ddz_soil_stag, & !< 1/dz_soil_stag |
---|
309 | dz_soil, & !< soil grid spacing (edge-edge) |
---|
310 | dz_soil_stag, & !< soil grid spacing (center-center) |
---|
311 | root_extr !< root extraction |
---|
312 | |
---|
313 | |
---|
314 | |
---|
315 | REAL(wp), DIMENSION(0:20) :: root_fraction = 9999999.9_wp, & !< distribution of root surface area to the individual soil layers |
---|
316 | soil_moisture = 0.0_wp, & !< NAMELIST soil moisture content (m3/m3) |
---|
317 | soil_temperature = 300.0_wp, & !< NAMELIST soil temperature (K) +1 |
---|
318 | zs = 9999999.9_wp !< soil layer depths |
---|
319 | |
---|
320 | #if defined( __nopointer ) |
---|
321 | TYPE(surf_type_lsm), TARGET :: t_soil_h, & !< Soil temperature (K), horizontal surface elements |
---|
322 | t_soil_h_p, & !< Prog. soil temperature (K), horizontal surface elements |
---|
323 | m_soil_h, & !< Soil moisture (m3/m3), horizontal surface elements |
---|
324 | m_soil_h_p !< Prog. soil moisture (m3/m3), horizontal surface elements |
---|
325 | |
---|
326 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: & |
---|
327 | t_soil_v, & !< Soil temperature (K), vertical surface elements |
---|
328 | t_soil_v_p, & !< Prog. soil temperature (K), vertical surface elements |
---|
329 | m_soil_v, & !< Soil moisture (m3/m3), vertical surface elements |
---|
330 | m_soil_v_p !< Prog. soil moisture (m3/m3), vertical surface elements |
---|
331 | #else |
---|
332 | TYPE(surf_type_lsm), POINTER :: t_soil_h, & !< Soil temperature (K), horizontal surface elements |
---|
333 | t_soil_h_p, & !< Prog. soil temperature (K), horizontal surface elements |
---|
334 | m_soil_h, & !< Soil moisture (m3/m3), horizontal surface elements |
---|
335 | m_soil_h_p !< Prog. soil moisture (m3/m3), horizontal surface elements |
---|
336 | |
---|
337 | TYPE(surf_type_lsm), TARGET :: t_soil_h_1, & !< |
---|
338 | t_soil_h_2, & !< |
---|
339 | m_soil_h_1, & !< |
---|
340 | m_soil_h_2 !< |
---|
341 | |
---|
342 | TYPE(surf_type_lsm), DIMENSION(:), POINTER :: & |
---|
343 | t_soil_v, & !< Soil temperature (K), vertical surface elements |
---|
344 | t_soil_v_p, & !< Prog. soil temperature (K), vertical surface elements |
---|
345 | m_soil_v, & !< Soil moisture (m3/m3), vertical surface elements |
---|
346 | m_soil_v_p !< Prog. soil moisture (m3/m3), vertical surface elements |
---|
347 | |
---|
348 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET ::& |
---|
349 | t_soil_v_1, & !< |
---|
350 | t_soil_v_2, & !< |
---|
351 | m_soil_v_1, & !< |
---|
352 | m_soil_v_2 !< |
---|
353 | #endif |
---|
354 | |
---|
355 | #if defined( __nopointer ) |
---|
356 | TYPE(surf_type_lsm), TARGET :: t_surface_h, & !< surface temperature (K), horizontal surface elements |
---|
357 | t_surface_h_p, & !< progn. surface temperature (K), horizontal surface elements |
---|
358 | m_liq_eb_h, & !< liquid water reservoir (m), horizontal surface elements |
---|
359 | m_liq_eb_h_p !< progn. liquid water reservoir (m), horizontal surface elements |
---|
360 | |
---|
361 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: & |
---|
362 | t_surface_v, & !< surface temperature (K), vertical surface elements |
---|
363 | t_surface_v_p, & !< progn. surface temperature (K), vertical surface elements |
---|
364 | m_liq_eb_v, & !< liquid water reservoir (m), vertical surface elements |
---|
365 | m_liq_eb_v_p !< progn. liquid water reservoir (m), vertical surface elements |
---|
366 | #else |
---|
367 | TYPE(surf_type_lsm), POINTER :: t_surface_h, & !< surface temperature (K), horizontal surface elements |
---|
368 | t_surface_h_p, & !< progn. surface temperature (K), horizontal surface elements |
---|
369 | m_liq_eb_h, & !< liquid water reservoir (m), horizontal surface elements |
---|
370 | m_liq_eb_h_p !< progn. liquid water reservoir (m), horizontal surface elements |
---|
371 | |
---|
372 | TYPE(surf_type_lsm), TARGET :: t_surface_h_1, & !< |
---|
373 | t_surface_h_2, & !< |
---|
374 | m_liq_eb_h_1, & !< |
---|
375 | m_liq_eb_h_2 !< |
---|
376 | |
---|
377 | TYPE(surf_type_lsm), DIMENSION(:), POINTER :: & |
---|
378 | t_surface_v, & !< surface temperature (K), vertical surface elements |
---|
379 | t_surface_v_p, & !< progn. surface temperature (K), vertical surface elements |
---|
380 | m_liq_eb_v, & !< liquid water reservoir (m), vertical surface elements |
---|
381 | m_liq_eb_v_p !< progn. liquid water reservoir (m), vertical surface elements |
---|
382 | |
---|
383 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: & |
---|
384 | t_surface_v_1, & !< |
---|
385 | t_surface_v_2, & !< |
---|
386 | m_liq_eb_v_1, & !< |
---|
387 | m_liq_eb_v_2 !< |
---|
388 | #endif |
---|
389 | |
---|
390 | #if defined( __nopointer ) |
---|
391 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: m_liq_eb_av |
---|
392 | #else |
---|
393 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: m_liq_eb_av |
---|
394 | #endif |
---|
395 | |
---|
396 | #if defined( __nopointer ) |
---|
397 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: t_soil_av, & !< Average of t_soil |
---|
398 | m_soil_av !< Average of m_soil |
---|
399 | #else |
---|
400 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: t_soil_av, & !< Average of t_soil |
---|
401 | m_soil_av !< Average of m_soil |
---|
402 | #endif |
---|
403 | |
---|
404 | TYPE(surf_type_lsm), TARGET :: tm_liq_eb_h_m !< liquid water reservoir tendency (m), horizontal surface elements |
---|
405 | TYPE(surf_type_lsm), TARGET :: tt_surface_h_m !< surface temperature tendency (K), horizontal surface elements |
---|
406 | TYPE(surf_type_lsm), TARGET :: tt_soil_h_m !< t_soil storage array, horizontal surface elements |
---|
407 | TYPE(surf_type_lsm), TARGET :: tm_soil_h_m !< m_soil storage array, horizontal surface elements |
---|
408 | |
---|
409 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: tm_liq_eb_v_m !< liquid water reservoir tendency (m), vertical surface elements |
---|
410 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: tt_surface_v_m !< surface temperature tendency (K), vertical surface elements |
---|
411 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: tt_soil_v_m !< t_soil storage array, vertical surface elements |
---|
412 | TYPE(surf_type_lsm), DIMENSION(0:3), TARGET :: tm_soil_v_m !< m_soil storage array, vertical surface elements |
---|
413 | |
---|
414 | ! |
---|
415 | !-- Energy balance variables |
---|
416 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: & |
---|
417 | c_liq_av, & !< average of c_liq |
---|
418 | c_soil_av, & !< average of c_soil |
---|
419 | c_veg_av, & !< average of c_veg |
---|
420 | ghf_eb_av, & !< average of ghf_eb |
---|
421 | lai_av, & !< average of lai |
---|
422 | qsws_eb_av, & !< average of qsws_eb |
---|
423 | qsws_liq_eb_av, & !< average of qsws_liq_eb |
---|
424 | qsws_soil_eb_av, & !< average of qsws_soil_eb |
---|
425 | qsws_veg_eb_av, & !< average of qsws_veg_eb |
---|
426 | r_a_av, & !< average of r_a |
---|
427 | r_s_av, & !< average of r_s |
---|
428 | shf_eb_av !< average of shf_eb |
---|
429 | |
---|
430 | |
---|
431 | ! |
---|
432 | !-- Predefined Land surface classes (veg_type) |
---|
433 | CHARACTER(26), DIMENSION(0:20), PARAMETER :: veg_type_name = (/ & |
---|
434 | 'user defined ', & ! 0 |
---|
435 | 'crops, mixed farming ', & ! 1 |
---|
436 | 'short grass ', & ! 2 |
---|
437 | 'evergreen needleleaf trees', & ! 3 |
---|
438 | 'deciduous needleleaf trees', & ! 4 |
---|
439 | 'evergreen broadleaf trees ', & ! 5 |
---|
440 | 'deciduous broadleaf trees ', & ! 6 |
---|
441 | 'tall grass ', & ! 7 |
---|
442 | 'desert ', & ! 8 |
---|
443 | 'tundra ', & ! 9 |
---|
444 | 'irrigated crops ', & ! 10 |
---|
445 | 'semidesert ', & ! 11 |
---|
446 | 'ice caps and glaciers ', & ! 12 |
---|
447 | 'bogs and marshes ', & ! 13 |
---|
448 | 'inland water ', & ! 14 |
---|
449 | 'ocean ', & ! 15 |
---|
450 | 'evergreen shrubs ', & ! 16 |
---|
451 | 'deciduous shrubs ', & ! 17 |
---|
452 | 'mixed forest/woodland ', & ! 18 |
---|
453 | 'interrupted forest ', & ! 19 |
---|
454 | 'pavements/roads ' & ! 20 |
---|
455 | /) |
---|
456 | |
---|
457 | ! |
---|
458 | !-- Soil model classes (soil_type) |
---|
459 | CHARACTER(12), DIMENSION(0:7), PARAMETER :: soil_type_name = (/ & |
---|
460 | 'user defined', & ! 0 |
---|
461 | 'coarse ', & ! 1 |
---|
462 | 'medium ', & ! 2 |
---|
463 | 'medium-fine ', & ! 3 |
---|
464 | 'fine ', & ! 4 |
---|
465 | 'very fine ', & ! 5 |
---|
466 | 'organic ', & ! 6 |
---|
467 | 'loamy (CH) ' & ! 7 |
---|
468 | /) |
---|
469 | ! |
---|
470 | !-- Land surface parameters according to the respective classes (veg_type) |
---|
471 | |
---|
472 | ! |
---|
473 | !-- Land surface parameters I |
---|
474 | !-- r_canopy_min, lai, c_veg, g_d |
---|
475 | REAL(wp), DIMENSION(0:3,1:20), PARAMETER :: veg_pars = RESHAPE( (/ & |
---|
476 | 180.0_wp, 3.00_wp, 0.90_wp, 0.00_wp, & ! 1 |
---|
477 | 110.0_wp, 2.00_wp, 0.85_wp, 0.00_wp, & ! 2 |
---|
478 | 500.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 3 |
---|
479 | 500.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 4 |
---|
480 | 175.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 5 |
---|
481 | 240.0_wp, 6.00_wp, 0.99_wp, 0.13_wp, & ! 6 |
---|
482 | 100.0_wp, 2.00_wp, 0.70_wp, 0.00_wp, & ! 7 |
---|
483 | 250.0_wp, 0.05_wp, 0.00_wp, 0.00_wp, & ! 8 |
---|
484 | 80.0_wp, 1.00_wp, 0.50_wp, 0.00_wp, & ! 9 |
---|
485 | 180.0_wp, 3.00_wp, 0.90_wp, 0.00_wp, & ! 10 |
---|
486 | 150.0_wp, 0.50_wp, 0.10_wp, 0.00_wp, & ! 11 |
---|
487 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 12 |
---|
488 | 240.0_wp, 4.00_wp, 0.60_wp, 0.00_wp, & ! 13 |
---|
489 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 14 |
---|
490 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp, & ! 15 |
---|
491 | 225.0_wp, 3.00_wp, 0.50_wp, 0.00_wp, & ! 16 |
---|
492 | 225.0_wp, 1.50_wp, 0.50_wp, 0.00_wp, & ! 17 |
---|
493 | 250.0_wp, 5.00_wp, 0.90_wp, 0.03_wp, & ! 18 |
---|
494 | 175.0_wp, 2.50_wp, 0.90_wp, 0.03_wp, & ! 19 |
---|
495 | 0.0_wp, 0.00_wp, 0.00_wp, 0.00_wp & ! 20 |
---|
496 | /), (/ 4, 20 /) ) |
---|
497 | |
---|
498 | ! |
---|
499 | !-- Land surface parameters II z0, z0h, z0q |
---|
500 | REAL(wp), DIMENSION(0:2,1:20), PARAMETER :: roughness_par = RESHAPE( (/ & |
---|
501 | 0.25_wp, 0.25E-2_wp, 0.25E-2_wp, & ! 1 |
---|
502 | 0.20_wp, 0.20E-2_wp, 0.20E-2_wp, & ! 2 |
---|
503 | 2.00_wp, 2.00_wp, 2.00_wp, & ! 3 |
---|
504 | 2.00_wp, 2.00_wp, 2.00_wp, & ! 4 |
---|
505 | 2.00_wp, 2.00_wp, 2.00_wp, & ! 5 |
---|
506 | 2.00_wp, 2.00_wp, 2.00_wp, & ! 6 |
---|
507 | 0.47_wp, 0.47E-2_wp, 0.47E-2_wp, & ! 7 |
---|
508 | 0.013_wp, 0.013E-2_wp, 0.013E-2_wp, & ! 8 |
---|
509 | 0.034_wp, 0.034E-2_wp, 0.034E-2_wp, & ! 9 |
---|
510 | 0.5_wp, 0.50E-2_wp, 0.50E-2_wp, & ! 10 |
---|
511 | 0.17_wp, 0.17E-2_wp, 0.17E-2_wp, & ! 11 |
---|
512 | 1.3E-3_wp, 1.3E-4_wp, 1.3E-4_wp, & ! 12 |
---|
513 | 0.83_wp, 0.83E-2_wp, 0.83E-2_wp, & ! 13 |
---|
514 | 0.00_wp, 0.00_wp, 0.00_wp, & ! 14 |
---|
515 | 0.00_wp, 0.00_wp, 0.00_wp, & ! 15 |
---|
516 | 0.10_wp, 0.10E-2_wp, 0.10E-2_wp, & ! 16 |
---|
517 | 0.25_wp, 0.25E-2_wp, 0.25E-2_wp, & ! 17 |
---|
518 | 2.00_wp, 2.00_wp, 2.00_wp, & ! 18 |
---|
519 | 1.10_wp, 1.10_wp, 1.10_wp, & ! 19 |
---|
520 | 1.0E-4_wp, 1.0E-5_wp, 1.0E-5_wp & ! 20 |
---|
521 | /), (/ 3, 20 /) ) |
---|
522 | |
---|
523 | ! |
---|
524 | !-- Land surface parameters III lambda_surface_s, lambda_surface_u, f_sw_in |
---|
525 | REAL(wp), DIMENSION(0:2,1:20), PARAMETER :: surface_pars = RESHAPE( (/ & |
---|
526 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 1 |
---|
527 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 2 |
---|
528 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 3 |
---|
529 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 4 |
---|
530 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 5 |
---|
531 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 6 |
---|
532 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 7 |
---|
533 | 15.0_wp, 15.0_wp, 0.00_wp, & ! 8 |
---|
534 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 9 |
---|
535 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 10 |
---|
536 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 11 |
---|
537 | 58.0_wp, 58.0_wp, 0.00_wp, & ! 12 |
---|
538 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 13 |
---|
539 | 1.0E10_wp, 1.0E10_wp, 0.00_wp, & ! 14 |
---|
540 | 1.0E10_wp, 1.0E10_wp, 0.00_wp, & ! 15 |
---|
541 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 16 |
---|
542 | 10.0_wp, 10.0_wp, 0.05_wp, & ! 17 |
---|
543 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 18 |
---|
544 | 20.0_wp, 15.0_wp, 0.03_wp, & ! 19 |
---|
545 | 0.0_wp, 0.0_wp, 0.00_wp & ! 20 |
---|
546 | /), (/ 3, 20 /) ) |
---|
547 | |
---|
548 | ! |
---|
549 | !-- Root distribution (sum = 1) level 1-8 |
---|
550 | !-- |
---|
551 | REAL(wp), DIMENSION(0:7,1:20), PARAMETER :: root_distribution = RESHAPE( (/& |
---|
552 | 0.035_wp, 0.069_wp, 0.069_wp, 0.108_wp, & |
---|
553 | 0.195_wp, 0.214_wp, 0.284_wp, 0.026_wp, & ! 1 |
---|
554 | 0.050_wp, 0.100_wp, 0.100_wp, 0.136_wp, & |
---|
555 | 0.181_wp, 0.192_wp, 0.215_wp, 0.026_wp, & ! 2 |
---|
556 | 0.038_wp, 0.075_wp, 0.075_wp, 0.111_wp, & |
---|
557 | 0.185_wp, 0.203_wp, 0.273_wp, 0.040_wp, & ! 3 |
---|
558 | 0.038_wp, 0.075_wp, 0.075_wp, 0.110_wp, & |
---|
559 | 0.180_wp, 0.199_wp, 0.277_wp, 0.046_wp, & ! 4 |
---|
560 | 0.035_wp, 0.069_wp, 0.069_wp, 0.105_wp, & |
---|
561 | 0.180_wp, 0.201_wp, 0.295_wp, 0.046_wp, & ! 5 |
---|
562 | 0.035_wp, 0.072_wp, 0.072_wp, 0.105_wp, & |
---|
563 | 0.161_wp, 0.180_wp, 0.282_wp, 0.093_wp, & ! 6 |
---|
564 | 0.040_wp, 0.077_wp, 0.077_wp, 0.112_wp, & |
---|
565 | 0.176_wp, 0.192_wp, 0.266_wp, 0.060_wp, & ! 7 |
---|
566 | 0.142_wp, 0.286_wp, 0.286_wp, 0.286_wp, & |
---|
567 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & ! 8 |
---|
568 | 0.068_wp, 0.134_wp, 0.134_wp, 0.177_wp, & |
---|
569 | 0.214_wp, 0.203_wp, 0.070_wp, 0.000_wp, & ! 9 |
---|
570 | 0.035_wp, 0.068_wp, 0.068_wp, 0.108_wp, & |
---|
571 | 0.195_wp, 0.215_wp, 0.285_wp, 0.026_wp, & ! 10 |
---|
572 | 0.025_wp, 0.048_wp, 0.048_wp, 0.078_wp, & |
---|
573 | 0.147_wp, 0.175_wp, 0.353_wp, 0.126_wp, & ! 11 |
---|
574 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & |
---|
575 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & ! 12 |
---|
576 | 0.036_wp, 0.072_wp, 0.072_wp, 0.103_wp, & |
---|
577 | 0.163_wp, 0.180_wp, 0.273_wp, 0.074_wp, & ! 13 |
---|
578 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & |
---|
579 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & ! 14 |
---|
580 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & |
---|
581 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & ! 15 |
---|
582 | 0.032_wp, 0.066_wp, 0.066_wp, 0.100_wp, & |
---|
583 | 0.172_wp, 0.192_wp, 0.299_wp, 0.073_wp, & ! 16 |
---|
584 | 0.032_wp, 0.066_wp, 0.066_wp, 0.100_wp, & |
---|
585 | 0.172_wp, 0.192_wp, 0.299_wp, 0.073_wp, & ! 17 |
---|
586 | 0.028_wp, 0.055_wp, 0.055_wp, 0.087_wp, & |
---|
587 | 0.166_wp, 0.195_wp, 0.348_wp, 0.066_wp, & ! 18 |
---|
588 | 0.028_wp, 0.055_wp, 0.055_wp, 0.087_wp, & |
---|
589 | 0.166_wp, 0.195_wp, 0.348_wp, 0.066_wp, & ! 19 |
---|
590 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp, & |
---|
591 | 0.000_wp, 0.000_wp, 0.000_wp, 0.000_wp & ! 20 |
---|
592 | /), (/ 8, 20 /) ) |
---|
593 | |
---|
594 | |
---|
595 | ! |
---|
596 | !-- Soil parameters according to the following porosity classes (soil_type) |
---|
597 | |
---|
598 | ! |
---|
599 | !-- Soil parameters I alpha_vg, l_vg, n_vg, gamma_w_sat |
---|
600 | REAL(wp), DIMENSION(0:3,1:7), PARAMETER :: soil_pars = RESHAPE( (/ & |
---|
601 | 3.83_wp, 1.250_wp, 1.38_wp, 6.94E-6_wp, & ! 1 |
---|
602 | 3.14_wp, -2.342_wp, 1.28_wp, 1.16E-6_wp, & ! 2 |
---|
603 | 0.83_wp, -0.588_wp, 1.25_wp, 0.26E-6_wp, & ! 3 |
---|
604 | 3.67_wp, -1.977_wp, 1.10_wp, 2.87E-6_wp, & ! 4 |
---|
605 | 2.65_wp, 2.500_wp, 1.10_wp, 1.74E-6_wp, & ! 5 |
---|
606 | 1.30_wp, 0.400_wp, 1.20_wp, 0.93E-6_wp, & ! 6 |
---|
607 | 0.00_wp, 0.00_wp, 0.00_wp, 0.57E-6_wp & ! 7 |
---|
608 | /), (/ 4, 7 /) ) |
---|
609 | |
---|
610 | ! |
---|
611 | !-- Soil parameters II m_sat, m_fc, m_wilt, m_res |
---|
612 | REAL(wp), DIMENSION(0:3,1:7), PARAMETER :: m_soil_pars = RESHAPE( (/ & |
---|
613 | 0.403_wp, 0.244_wp, 0.059_wp, 0.025_wp, & ! 1 |
---|
614 | 0.439_wp, 0.347_wp, 0.151_wp, 0.010_wp, & ! 2 |
---|
615 | 0.430_wp, 0.383_wp, 0.133_wp, 0.010_wp, & ! 3 |
---|
616 | 0.520_wp, 0.448_wp, 0.279_wp, 0.010_wp, & ! 4 |
---|
617 | 0.614_wp, 0.541_wp, 0.335_wp, 0.010_wp, & ! 5 |
---|
618 | 0.766_wp, 0.663_wp, 0.267_wp, 0.010_wp, & ! 6 |
---|
619 | 0.472_wp, 0.323_wp, 0.171_wp, 0.000_wp & ! 7 |
---|
620 | /), (/ 4, 7 /) ) |
---|
621 | |
---|
622 | |
---|
623 | SAVE |
---|
624 | |
---|
625 | |
---|
626 | PRIVATE |
---|
627 | |
---|
628 | |
---|
629 | ! |
---|
630 | !-- Public functions |
---|
631 | PUBLIC lsm_check_data_output, lsm_check_data_output_pr, & |
---|
632 | lsm_check_parameters, lsm_define_netcdf_grid, lsm_3d_data_averaging,& |
---|
633 | lsm_data_output_2d, lsm_data_output_3d, lsm_energy_balance, & |
---|
634 | lsm_header, lsm_init, lsm_init_arrays, lsm_parin, lsm_soil_model, & |
---|
635 | lsm_swap_timelevel, lsm_read_restart_data, lsm_last_actions |
---|
636 | ! |
---|
637 | !-- Public parameters, constants and initial values |
---|
638 | PUBLIC aero_resist_kray, skip_time_do_lsm |
---|
639 | |
---|
640 | ! |
---|
641 | !-- Public grid variables |
---|
642 | PUBLIC nzb_soil, nzs, nzt_soil, zs |
---|
643 | |
---|
644 | ! |
---|
645 | !-- Public prognostic variables |
---|
646 | PUBLIC m_soil_h, t_soil_h |
---|
647 | |
---|
648 | |
---|
649 | INTERFACE lsm_check_data_output |
---|
650 | MODULE PROCEDURE lsm_check_data_output |
---|
651 | END INTERFACE lsm_check_data_output |
---|
652 | |
---|
653 | INTERFACE lsm_check_data_output_pr |
---|
654 | MODULE PROCEDURE lsm_check_data_output_pr |
---|
655 | END INTERFACE lsm_check_data_output_pr |
---|
656 | |
---|
657 | INTERFACE lsm_check_parameters |
---|
658 | MODULE PROCEDURE lsm_check_parameters |
---|
659 | END INTERFACE lsm_check_parameters |
---|
660 | |
---|
661 | INTERFACE lsm_3d_data_averaging |
---|
662 | MODULE PROCEDURE lsm_3d_data_averaging |
---|
663 | END INTERFACE lsm_3d_data_averaging |
---|
664 | |
---|
665 | INTERFACE lsm_data_output_2d |
---|
666 | MODULE PROCEDURE lsm_data_output_2d |
---|
667 | END INTERFACE lsm_data_output_2d |
---|
668 | |
---|
669 | INTERFACE lsm_data_output_3d |
---|
670 | MODULE PROCEDURE lsm_data_output_3d |
---|
671 | END INTERFACE lsm_data_output_3d |
---|
672 | |
---|
673 | INTERFACE lsm_define_netcdf_grid |
---|
674 | MODULE PROCEDURE lsm_define_netcdf_grid |
---|
675 | END INTERFACE lsm_define_netcdf_grid |
---|
676 | |
---|
677 | INTERFACE lsm_energy_balance |
---|
678 | MODULE PROCEDURE lsm_energy_balance |
---|
679 | END INTERFACE lsm_energy_balance |
---|
680 | |
---|
681 | INTERFACE lsm_header |
---|
682 | MODULE PROCEDURE lsm_header |
---|
683 | END INTERFACE lsm_header |
---|
684 | |
---|
685 | INTERFACE lsm_init |
---|
686 | MODULE PROCEDURE lsm_init |
---|
687 | END INTERFACE lsm_init |
---|
688 | |
---|
689 | INTERFACE lsm_init_arrays |
---|
690 | MODULE PROCEDURE lsm_init_arrays |
---|
691 | END INTERFACE lsm_init_arrays |
---|
692 | |
---|
693 | INTERFACE lsm_parin |
---|
694 | MODULE PROCEDURE lsm_parin |
---|
695 | END INTERFACE lsm_parin |
---|
696 | |
---|
697 | INTERFACE lsm_soil_model |
---|
698 | MODULE PROCEDURE lsm_soil_model |
---|
699 | END INTERFACE lsm_soil_model |
---|
700 | |
---|
701 | INTERFACE lsm_swap_timelevel |
---|
702 | MODULE PROCEDURE lsm_swap_timelevel |
---|
703 | END INTERFACE lsm_swap_timelevel |
---|
704 | |
---|
705 | INTERFACE lsm_read_restart_data |
---|
706 | MODULE PROCEDURE lsm_read_restart_data |
---|
707 | END INTERFACE lsm_read_restart_data |
---|
708 | |
---|
709 | INTERFACE lsm_last_actions |
---|
710 | MODULE PROCEDURE lsm_last_actions |
---|
711 | END INTERFACE lsm_last_actions |
---|
712 | |
---|
713 | CONTAINS |
---|
714 | |
---|
715 | !------------------------------------------------------------------------------! |
---|
716 | ! Description: |
---|
717 | ! ------------ |
---|
718 | !> Check data output for land surface model |
---|
719 | !------------------------------------------------------------------------------! |
---|
720 | SUBROUTINE lsm_check_data_output( var, unit, i, ilen, k ) |
---|
721 | |
---|
722 | |
---|
723 | USE control_parameters, & |
---|
724 | ONLY: data_output, message_string |
---|
725 | |
---|
726 | IMPLICIT NONE |
---|
727 | |
---|
728 | CHARACTER (LEN=*) :: unit !< |
---|
729 | CHARACTER (LEN=*) :: var !< |
---|
730 | |
---|
731 | INTEGER(iwp) :: i |
---|
732 | INTEGER(iwp) :: ilen |
---|
733 | INTEGER(iwp) :: k |
---|
734 | |
---|
735 | SELECT CASE ( TRIM( var ) ) |
---|
736 | |
---|
737 | CASE ( 'm_soil' ) |
---|
738 | IF ( .NOT. land_surface ) THEN |
---|
739 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
740 | 'res land_surface = .TRUE.' |
---|
741 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
742 | ENDIF |
---|
743 | unit = 'm3/m3' |
---|
744 | |
---|
745 | CASE ( 't_soil' ) |
---|
746 | IF ( .NOT. land_surface ) THEN |
---|
747 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
748 | 'res land_surface = .TRUE.' |
---|
749 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
750 | ENDIF |
---|
751 | unit = 'K' |
---|
752 | |
---|
753 | CASE ( 'lai*', 'c_liq*', 'c_soil*', 'c_veg*', 'ghf_eb*', 'm_liq_eb*',& |
---|
754 | 'qsws_eb*', 'qsws_liq_eb*', 'qsws_soil_eb*', 'qsws_veg_eb*', & |
---|
755 | 'r_a*', 'r_s*', 'shf_eb*' ) |
---|
756 | IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN |
---|
757 | message_string = 'illegal value for data_output: "' // & |
---|
758 | TRIM( var ) // '" & only 2d-horizontal ' // & |
---|
759 | 'cross sections are allowed for this value' |
---|
760 | CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 ) |
---|
761 | ENDIF |
---|
762 | IF ( TRIM( var ) == 'lai*' .AND. .NOT. land_surface ) THEN |
---|
763 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
764 | 'res land_surface = .TRUE.' |
---|
765 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
766 | ENDIF |
---|
767 | IF ( TRIM( var ) == 'c_liq*' .AND. .NOT. land_surface ) THEN |
---|
768 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
769 | 'res land_surface = .TRUE.' |
---|
770 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
771 | ENDIF |
---|
772 | IF ( TRIM( var ) == 'c_soil*' .AND. .NOT. land_surface ) THEN |
---|
773 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
774 | 'res land_surface = .TRUE.' |
---|
775 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
776 | ENDIF |
---|
777 | IF ( TRIM( var ) == 'c_veg*' .AND. .NOT. land_surface ) THEN |
---|
778 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
779 | 'res land_surface = .TRUE.' |
---|
780 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
781 | ENDIF |
---|
782 | IF ( TRIM( var ) == 'ghf_eb*' .AND. .NOT. land_surface ) THEN |
---|
783 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
784 | 'res land_surface = .TRUE.' |
---|
785 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
786 | ENDIF |
---|
787 | IF ( TRIM( var ) == 'm_liq_eb*' .AND. .NOT. land_surface ) THEN |
---|
788 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
789 | 'res land_surface = .TRUE.' |
---|
790 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
791 | ENDIF |
---|
792 | IF ( TRIM( var ) == 'qsws_eb*' .AND. .NOT. land_surface ) THEN |
---|
793 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
794 | 'res land_surface = .TRUE.' |
---|
795 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
796 | ENDIF |
---|
797 | IF ( TRIM( var ) == 'qsws_liq_eb*' .AND. .NOT. land_surface ) & |
---|
798 | THEN |
---|
799 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
800 | 'res land_surface = .TRUE.' |
---|
801 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
802 | ENDIF |
---|
803 | IF ( TRIM( var ) == 'qsws_soil_eb*' .AND. .NOT. land_surface ) & |
---|
804 | THEN |
---|
805 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
806 | 'res land_surface = .TRUE.' |
---|
807 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
808 | ENDIF |
---|
809 | IF ( TRIM( var ) == 'qsws_veg_eb*' .AND. .NOT. land_surface ) & |
---|
810 | THEN |
---|
811 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
812 | 'res land_surface = .TRUE.' |
---|
813 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
814 | ENDIF |
---|
815 | IF ( TRIM( var ) == 'r_a*' .AND. .NOT. land_surface ) & |
---|
816 | THEN |
---|
817 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
818 | 'res land_surface = .TRUE.' |
---|
819 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
820 | ENDIF |
---|
821 | IF ( TRIM( var ) == 'r_s*' .AND. .NOT. land_surface ) & |
---|
822 | THEN |
---|
823 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
824 | 'res land_surface = .TRUE.' |
---|
825 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
826 | ENDIF |
---|
827 | |
---|
828 | IF ( TRIM( var ) == 'lai*' ) unit = 'none' |
---|
829 | IF ( TRIM( var ) == 'c_liq*' ) unit = 'none' |
---|
830 | IF ( TRIM( var ) == 'c_soil*') unit = 'none' |
---|
831 | IF ( TRIM( var ) == 'c_veg*' ) unit = 'none' |
---|
832 | IF ( TRIM( var ) == 'ghf_eb*') unit = 'W/m2' |
---|
833 | IF ( TRIM( var ) == 'm_liq_eb*' ) unit = 'm' |
---|
834 | IF ( TRIM( var ) == 'qsws_eb*' ) unit = 'W/m2' |
---|
835 | IF ( TRIM( var ) == 'qsws_liq_eb*' ) unit = 'W/m2' |
---|
836 | IF ( TRIM( var ) == 'qsws_soil_eb*' ) unit = 'W/m2' |
---|
837 | IF ( TRIM( var ) == 'qsws_veg_eb*' ) unit = 'W/m2' |
---|
838 | IF ( TRIM( var ) == 'r_a*') unit = 's/m' |
---|
839 | IF ( TRIM( var ) == 'r_s*') unit = 's/m' |
---|
840 | IF ( TRIM( var ) == 'shf_eb*') unit = 'W/m2' |
---|
841 | |
---|
842 | CASE DEFAULT |
---|
843 | unit = 'illegal' |
---|
844 | |
---|
845 | END SELECT |
---|
846 | |
---|
847 | |
---|
848 | END SUBROUTINE lsm_check_data_output |
---|
849 | |
---|
850 | |
---|
851 | !------------------------------------------------------------------------------! |
---|
852 | ! Description: |
---|
853 | ! ------------ |
---|
854 | !> Check data output of profiles for land surface model |
---|
855 | !------------------------------------------------------------------------------! |
---|
856 | SUBROUTINE lsm_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
857 | |
---|
858 | USE control_parameters, & |
---|
859 | ONLY: data_output_pr, message_string |
---|
860 | |
---|
861 | USE indices |
---|
862 | |
---|
863 | USE profil_parameter |
---|
864 | |
---|
865 | USE statistics |
---|
866 | |
---|
867 | IMPLICIT NONE |
---|
868 | |
---|
869 | CHARACTER (LEN=*) :: unit !< |
---|
870 | CHARACTER (LEN=*) :: variable !< |
---|
871 | CHARACTER (LEN=*) :: dopr_unit !< local value of dopr_unit |
---|
872 | |
---|
873 | INTEGER(iwp) :: user_pr_index !< |
---|
874 | INTEGER(iwp) :: var_count !< |
---|
875 | |
---|
876 | SELECT CASE ( TRIM( variable ) ) |
---|
877 | |
---|
878 | CASE ( 't_soil', '#t_soil' ) |
---|
879 | IF ( .NOT. land_surface ) THEN |
---|
880 | message_string = 'data_output_pr = ' // & |
---|
881 | TRIM( data_output_pr(var_count) ) // ' is' // & |
---|
882 | 'not implemented for land_surface = .FALSE.' |
---|
883 | CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 ) |
---|
884 | ELSE |
---|
885 | dopr_index(var_count) = 89 |
---|
886 | dopr_unit = 'K' |
---|
887 | hom(0:nzs-1,2,89,:) = SPREAD( - zs, 2, statistic_regions+1 ) |
---|
888 | IF ( data_output_pr(var_count)(1:1) == '#' ) THEN |
---|
889 | dopr_initial_index(var_count) = 90 |
---|
890 | hom(0:nzs-1,2,90,:) = SPREAD( - zs, 2, statistic_regions+1 ) |
---|
891 | data_output_pr(var_count) = data_output_pr(var_count)(2:) |
---|
892 | ENDIF |
---|
893 | unit = dopr_unit |
---|
894 | ENDIF |
---|
895 | |
---|
896 | CASE ( 'm_soil', '#m_soil' ) |
---|
897 | IF ( .NOT. land_surface ) THEN |
---|
898 | message_string = 'data_output_pr = ' // & |
---|
899 | TRIM( data_output_pr(var_count) ) // ' is' // & |
---|
900 | ' not implemented for land_surface = .FALSE.' |
---|
901 | CALL message( 'check_parameters', 'PA0402', 1, 2, 0, 6, 0 ) |
---|
902 | ELSE |
---|
903 | dopr_index(var_count) = 91 |
---|
904 | dopr_unit = 'm3/m3' |
---|
905 | hom(0:nzs-1,2,91,:) = SPREAD( - zs, 2, statistic_regions+1 ) |
---|
906 | IF ( data_output_pr(var_count)(1:1) == '#' ) THEN |
---|
907 | dopr_initial_index(var_count) = 92 |
---|
908 | hom(0:nzs-1,2,92,:) = SPREAD( - zs, 2, statistic_regions+1 ) |
---|
909 | data_output_pr(var_count) = data_output_pr(var_count)(2:) |
---|
910 | ENDIF |
---|
911 | unit = dopr_unit |
---|
912 | ENDIF |
---|
913 | |
---|
914 | |
---|
915 | CASE DEFAULT |
---|
916 | unit = 'illegal' |
---|
917 | |
---|
918 | END SELECT |
---|
919 | |
---|
920 | |
---|
921 | END SUBROUTINE lsm_check_data_output_pr |
---|
922 | |
---|
923 | |
---|
924 | !------------------------------------------------------------------------------! |
---|
925 | ! Description: |
---|
926 | ! ------------ |
---|
927 | !> Check parameters routine for land surface model |
---|
928 | !------------------------------------------------------------------------------! |
---|
929 | SUBROUTINE lsm_check_parameters |
---|
930 | |
---|
931 | USE control_parameters, & |
---|
932 | ONLY: bc_pt_b, bc_q_b, constant_flux_layer, message_string, & |
---|
933 | most_method |
---|
934 | |
---|
935 | USE radiation_model_mod, & |
---|
936 | ONLY: radiation |
---|
937 | |
---|
938 | |
---|
939 | IMPLICIT NONE |
---|
940 | |
---|
941 | INTEGER(iwp) :: k !< running index, z-dimension |
---|
942 | ! |
---|
943 | !-- Dirichlet boundary conditions are required as the surface fluxes are |
---|
944 | !-- calculated from the temperature/humidity gradients in the land surface |
---|
945 | !-- model |
---|
946 | IF ( bc_pt_b == 'neumann' .OR. bc_q_b == 'neumann' ) THEN |
---|
947 | message_string = 'lsm requires setting of'// & |
---|
948 | 'bc_pt_b = "dirichlet" and '// & |
---|
949 | 'bc_q_b = "dirichlet"' |
---|
950 | CALL message( 'check_parameters', 'PA0399', 1, 2, 0, 6, 0 ) |
---|
951 | ENDIF |
---|
952 | |
---|
953 | IF ( .NOT. constant_flux_layer ) THEN |
---|
954 | message_string = 'lsm requires '// & |
---|
955 | 'constant_flux_layer = .T.' |
---|
956 | CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 ) |
---|
957 | ENDIF |
---|
958 | |
---|
959 | IF ( ( veg_type == 14 .OR. veg_type == 15 ) .AND. & |
---|
960 | most_method == 'lookup' ) THEN |
---|
961 | WRITE( message_string, * ) 'veg_type = ', veg_type, ' is not ', & |
---|
962 | 'allowed in combination with ', & |
---|
963 | 'most_method = ', most_method |
---|
964 | CALL message( 'check_parameters', 'PA0417', 1, 2, 0, 6, 0 ) |
---|
965 | ENDIF |
---|
966 | |
---|
967 | IF ( veg_type == 0 ) THEN |
---|
968 | IF ( min_canopy_resistance == 9999999.9_wp ) THEN |
---|
969 | message_string = 'veg_type = 0 (user defined)'// & |
---|
970 | 'requires setting of min_canopy_resistance'// & |
---|
971 | '/= 9999999.9' |
---|
972 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
973 | ENDIF |
---|
974 | |
---|
975 | IF ( leaf_area_index == 9999999.9_wp ) THEN |
---|
976 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
977 | 'requires setting of leaf_area_index'// & |
---|
978 | '/= 9999999.9' |
---|
979 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
980 | ENDIF |
---|
981 | |
---|
982 | IF ( vegetation_coverage == 9999999.9_wp ) THEN |
---|
983 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
984 | 'requires setting of vegetation_coverage'// & |
---|
985 | '/= 9999999.9' |
---|
986 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
987 | ENDIF |
---|
988 | |
---|
989 | IF ( canopy_resistance_coefficient == 9999999.9_wp) THEN |
---|
990 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
991 | 'requires setting of'// & |
---|
992 | 'canopy_resistance_coefficient /= 9999999.9' |
---|
993 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
994 | ENDIF |
---|
995 | |
---|
996 | IF ( lambda_surface_stable == 9999999.9_wp ) THEN |
---|
997 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
998 | 'requires setting of lambda_surface_stable'// & |
---|
999 | '/= 9999999.9' |
---|
1000 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
1001 | ENDIF |
---|
1002 | |
---|
1003 | IF ( lambda_surface_unstable == 9999999.9_wp ) THEN |
---|
1004 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
1005 | 'requires setting of lambda_surface_unstable'// & |
---|
1006 | '/= 9999999.9' |
---|
1007 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
1008 | ENDIF |
---|
1009 | |
---|
1010 | IF ( f_shortwave_incoming == 9999999.9_wp ) THEN |
---|
1011 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
1012 | 'requires setting of f_shortwave_incoming'// & |
---|
1013 | '/= 9999999.9' |
---|
1014 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
1015 | ENDIF |
---|
1016 | |
---|
1017 | IF ( z0_eb == 9999999.9_wp ) THEN |
---|
1018 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
1019 | 'requires setting of z0_eb'// & |
---|
1020 | '/= 9999999.9' |
---|
1021 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
1022 | ENDIF |
---|
1023 | |
---|
1024 | IF ( z0h_eb == 9999999.9_wp ) THEN |
---|
1025 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
1026 | 'requires setting of z0h_eb'// & |
---|
1027 | '/= 9999999.9' |
---|
1028 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
1029 | ENDIF |
---|
1030 | |
---|
1031 | |
---|
1032 | ENDIF |
---|
1033 | |
---|
1034 | IF ( soil_type == 0 ) THEN |
---|
1035 | |
---|
1036 | IF ( alpha_vangenuchten == 9999999.9_wp ) THEN |
---|
1037 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1038 | 'requires setting of alpha_vangenuchten'// & |
---|
1039 | '/= 9999999.9' |
---|
1040 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1041 | ENDIF |
---|
1042 | |
---|
1043 | IF ( l_vangenuchten == 9999999.9_wp ) THEN |
---|
1044 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1045 | 'requires setting of l_vangenuchten'// & |
---|
1046 | '/= 9999999.9' |
---|
1047 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1048 | ENDIF |
---|
1049 | |
---|
1050 | IF ( n_vangenuchten == 9999999.9_wp ) THEN |
---|
1051 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1052 | 'requires setting of n_vangenuchten'// & |
---|
1053 | '/= 9999999.9' |
---|
1054 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1055 | ENDIF |
---|
1056 | |
---|
1057 | IF ( hydraulic_conductivity == 9999999.9_wp ) THEN |
---|
1058 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1059 | 'requires setting of hydraulic_conductivity'// & |
---|
1060 | '/= 9999999.9' |
---|
1061 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1062 | ENDIF |
---|
1063 | |
---|
1064 | IF ( saturation_moisture == 9999999.9_wp ) THEN |
---|
1065 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1066 | 'requires setting of saturation_moisture'// & |
---|
1067 | '/= 9999999.9' |
---|
1068 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1069 | ENDIF |
---|
1070 | |
---|
1071 | IF ( field_capacity == 9999999.9_wp ) THEN |
---|
1072 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1073 | 'requires setting of field_capacity'// & |
---|
1074 | '/= 9999999.9' |
---|
1075 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1076 | ENDIF |
---|
1077 | |
---|
1078 | IF ( wilting_point == 9999999.9_wp ) THEN |
---|
1079 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1080 | 'requires setting of wilting_point'// & |
---|
1081 | '/= 9999999.9' |
---|
1082 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1083 | ENDIF |
---|
1084 | |
---|
1085 | IF ( residual_moisture == 9999999.9_wp ) THEN |
---|
1086 | message_string = 'soil_type = 0 (user_defined)'// & |
---|
1087 | 'requires setting of residual_moisture'// & |
---|
1088 | '/= 9999999.9' |
---|
1089 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1090 | ENDIF |
---|
1091 | |
---|
1092 | ENDIF |
---|
1093 | ! |
---|
1094 | !-- Check for proper setting of soil moisture, must not be larger than its |
---|
1095 | !-- saturation value. |
---|
1096 | DO k = nzb_soil, nzt_soil |
---|
1097 | IF ( soil_moisture(k) > m_soil_pars(0,soil_type) ) THEN |
---|
1098 | message_string = 'soil_moisture must not exceed its saturation' // & |
---|
1099 | ' value' |
---|
1100 | CALL message( 'check_parameters', 'PA0403', 1, 2, 0, 6, 0 ) |
---|
1101 | ENDIF |
---|
1102 | ENDDO |
---|
1103 | |
---|
1104 | IF ( .NOT. radiation ) THEN |
---|
1105 | message_string = 'lsm requires '// & |
---|
1106 | 'radiation = .T.' |
---|
1107 | CALL message( 'check_parameters', 'PA0400', 1, 2, 0, 6, 0 ) |
---|
1108 | ENDIF |
---|
1109 | |
---|
1110 | |
---|
1111 | |
---|
1112 | ! |
---|
1113 | !-- Determine number of soil layers to be used and check whether an appropriate |
---|
1114 | !-- root fraction is prescribed |
---|
1115 | nzb_soil = 0 |
---|
1116 | nzt_soil = 0 |
---|
1117 | IF ( ALL( zs == 9999999.9_wp ) ) THEN |
---|
1118 | nzt_soil = 7 |
---|
1119 | zs(nzb_soil:nzt_soil) = zs_default |
---|
1120 | ELSE |
---|
1121 | DO k = 0, 19 |
---|
1122 | IF ( zs(k) /= 9999999.9_wp ) THEN |
---|
1123 | nzt_soil = nzt_soil + 1 |
---|
1124 | IF ( root_fraction(k) == 9999999.9_wp ) THEN |
---|
1125 | message_string = 'manual setting of zs '// & |
---|
1126 | 'requires adequate setting of root_fraction'//& |
---|
1127 | '/= 9999999.9 ' // & |
---|
1128 | 'and SUM(root_fraction) = 1' |
---|
1129 | CALL message( 'check_parameters', 'PA0452', 1, 2, 0, 6, 0 ) |
---|
1130 | ENDIF |
---|
1131 | ENDIF |
---|
1132 | ENDDO |
---|
1133 | ENDIF |
---|
1134 | |
---|
1135 | IF ( veg_type == 0 ) THEN |
---|
1136 | IF ( SUM( root_fraction(nzb_soil:nzt_soil) ) /= 1.0_wp ) THEN |
---|
1137 | message_string = 'veg_type = 0 (user_defined)'// & |
---|
1138 | 'requires setting of root_fraction'// & |
---|
1139 | '/= 9999999.9 and SUM(root_fraction) = 1' |
---|
1140 | CALL message( 'check_parameters', 'PA0401', 1, 2, 0, 6, 0 ) |
---|
1141 | ENDIF |
---|
1142 | ENDIF |
---|
1143 | |
---|
1144 | |
---|
1145 | END SUBROUTINE lsm_check_parameters |
---|
1146 | |
---|
1147 | !------------------------------------------------------------------------------! |
---|
1148 | ! Description: |
---|
1149 | ! ------------ |
---|
1150 | !> Solver for the energy balance at the surface. |
---|
1151 | !------------------------------------------------------------------------------! |
---|
1152 | SUBROUTINE lsm_energy_balance( horizontal, l ) |
---|
1153 | |
---|
1154 | |
---|
1155 | IMPLICIT NONE |
---|
1156 | |
---|
1157 | INTEGER(iwp) :: i !< running index |
---|
1158 | INTEGER(iwp) :: i_off !< offset to determine index of surface element, seen from atmospheric grid point, for x |
---|
1159 | INTEGER(iwp) :: j !< running index |
---|
1160 | INTEGER(iwp) :: j_off !< offset to determine index of surface element, seen from atmospheric grid point, for y |
---|
1161 | INTEGER(iwp) :: k !< running index |
---|
1162 | INTEGER(iwp) :: k_off !< offset to determine index of surface element, seen from atmospheric grid point, for z |
---|
1163 | INTEGER(iwp) :: k_rad !< index to access radiation array |
---|
1164 | INTEGER(iwp) :: ks !< running index |
---|
1165 | INTEGER(iwp) :: l !< surface-facing index |
---|
1166 | INTEGER(iwp) :: m !< running index concerning wall elements |
---|
1167 | |
---|
1168 | LOGICAL :: horizontal !< Flag indicating horizontal or vertical surfaces |
---|
1169 | |
---|
1170 | REAL(wp) :: c_surface_tmp,& !< temporary variable for storing the volumetric heat capacity of the surface |
---|
1171 | f1, & !< resistance correction term 1 |
---|
1172 | f2, & !< resistance correction term 2 |
---|
1173 | f3, & !< resistance correction term 3 |
---|
1174 | m_min, & !< minimum soil moisture |
---|
1175 | e, & !< water vapour pressure |
---|
1176 | e_s, & !< water vapour saturation pressure |
---|
1177 | e_s_dt, & !< derivate of e_s with respect to T |
---|
1178 | tend, & !< tendency |
---|
1179 | dq_s_dt, & !< derivate of q_s with respect to T |
---|
1180 | coef_1, & !< coef. for prognostic equation |
---|
1181 | coef_2, & !< coef. for prognostic equation |
---|
1182 | f_qsws, & !< factor for qsws_eb |
---|
1183 | f_qsws_veg, & !< factor for qsws_veg_eb |
---|
1184 | f_qsws_soil, & !< factor for qsws_soil_eb |
---|
1185 | f_qsws_liq, & !< factor for qsws_liq_eb |
---|
1186 | f_shf, & !< factor for shf_eb |
---|
1187 | lambda_surface, & !< Current value of lambda_surface |
---|
1188 | m_liq_eb_max, & !< maxmimum value of the liq. water reservoir |
---|
1189 | pt1, & !< potential temperature at first grid level |
---|
1190 | qv1 !< specific humidity at first grid level |
---|
1191 | |
---|
1192 | TYPE(surf_type_lsm), POINTER :: surf_t_surface |
---|
1193 | TYPE(surf_type_lsm), POINTER :: surf_t_surface_p |
---|
1194 | TYPE(surf_type_lsm), POINTER :: surf_tt_surface_m |
---|
1195 | TYPE(surf_type_lsm), POINTER :: surf_m_liq_eb |
---|
1196 | TYPE(surf_type_lsm), POINTER :: surf_m_liq_eb_p |
---|
1197 | TYPE(surf_type_lsm), POINTER :: surf_tm_liq_eb_m |
---|
1198 | |
---|
1199 | TYPE(surf_type_lsm), POINTER :: surf_m_soil |
---|
1200 | TYPE(surf_type_lsm), POINTER :: surf_t_soil |
---|
1201 | |
---|
1202 | TYPE(surf_type), POINTER :: surf !< surface-date type variable |
---|
1203 | |
---|
1204 | IF ( horizontal ) THEN |
---|
1205 | surf => surf_lsm_h |
---|
1206 | |
---|
1207 | surf_t_surface => t_surface_h |
---|
1208 | surf_t_surface_p => t_surface_h_p |
---|
1209 | surf_tt_surface_m => tt_surface_h_m |
---|
1210 | surf_m_liq_eb => m_liq_eb_h |
---|
1211 | surf_m_liq_eb_p => m_liq_eb_h_p |
---|
1212 | surf_tm_liq_eb_m => tm_liq_eb_h_m |
---|
1213 | surf_m_soil => m_soil_h |
---|
1214 | surf_t_soil => t_soil_h |
---|
1215 | |
---|
1216 | k_off = -1 |
---|
1217 | j_off = 0 |
---|
1218 | i_off = 0 |
---|
1219 | ELSE |
---|
1220 | surf => surf_lsm_v(l) |
---|
1221 | |
---|
1222 | surf_t_surface => t_surface_v(l) |
---|
1223 | surf_t_surface_p => t_surface_v_p(l) |
---|
1224 | surf_tt_surface_m => tt_surface_v_m(l) |
---|
1225 | surf_m_liq_eb => m_liq_eb_v(l) |
---|
1226 | surf_m_liq_eb_p => m_liq_eb_v_p(l) |
---|
1227 | surf_tm_liq_eb_m => tm_liq_eb_v_m(l) |
---|
1228 | surf_m_soil => m_soil_v(l) |
---|
1229 | surf_t_soil => t_soil_v(l) |
---|
1230 | |
---|
1231 | k_off = 0 |
---|
1232 | IF ( l == 0 ) THEN |
---|
1233 | j_off = -1 |
---|
1234 | i_off = 0 |
---|
1235 | ELSEIF ( l == 1 ) THEN |
---|
1236 | j_off = 1 |
---|
1237 | i_off = 0 |
---|
1238 | ELSEIF ( l == 2 ) THEN |
---|
1239 | j_off = 0 |
---|
1240 | i_off = -1 |
---|
1241 | ELSEIF ( l == 3 ) THEN |
---|
1242 | j_off = 0 |
---|
1243 | i_off = 1 |
---|
1244 | ENDIF |
---|
1245 | ENDIF |
---|
1246 | |
---|
1247 | ! |
---|
1248 | !-- Calculate the exner function for the current time step |
---|
1249 | exn = ( surface_pressure / 1000.0_wp )**0.286_wp |
---|
1250 | |
---|
1251 | DO m = 1, surf%ns |
---|
1252 | |
---|
1253 | i = surf%i(m) |
---|
1254 | j = surf%j(m) |
---|
1255 | k = surf%k(m) |
---|
1256 | ! |
---|
1257 | !-- Determine height index for radiation. Note, in clear-sky case radiation |
---|
1258 | !-- arrays have rank 0 in first dimensions, so index must be zero. In case |
---|
1259 | !-- of RRTMG radiation arrays have non-zero rank in first dimension, so that |
---|
1260 | !-- radiation can be obtained at respective height level |
---|
1261 | k_rad = MERGE( 0, k + k_off, radiation_scheme /= 'rrtmg' ) |
---|
1262 | ! |
---|
1263 | !-- Set lambda_surface according to stratification between skin layer and soil |
---|
1264 | IF ( .NOT. surf%pave_surface(m) ) THEN |
---|
1265 | |
---|
1266 | c_surface_tmp = c_surface |
---|
1267 | |
---|
1268 | IF ( surf_t_surface%var_1d(m) >= surf_t_soil%var_2d(nzb_soil,m)) THEN |
---|
1269 | lambda_surface = surf%lambda_surface_s(m) |
---|
1270 | ELSE |
---|
1271 | lambda_surface = surf%lambda_surface_u(m) |
---|
1272 | ENDIF |
---|
1273 | ELSE |
---|
1274 | |
---|
1275 | c_surface_tmp = pave_heat_capacity * dz_soil(nzb_soil) * 0.5_wp |
---|
1276 | lambda_surface = pave_heat_conductivity * ddz_soil(nzb_soil) |
---|
1277 | |
---|
1278 | ENDIF |
---|
1279 | |
---|
1280 | ! |
---|
1281 | !-- First step: calculate aerodyamic resistance. As pt, us, ts |
---|
1282 | !-- are not available for the prognostic time step, data from the last |
---|
1283 | !-- time step is used here. Note that this formulation is the |
---|
1284 | !-- equivalent to the ECMWF formulation using drag coefficients |
---|
1285 | IF ( cloud_physics ) THEN |
---|
1286 | pt1 = pt(k,j,i) + l_d_cp * pt_d_t(k) * ql(k,j,i) |
---|
1287 | qv1 = q(k,j,i) - ql(k,j,i) |
---|
1288 | ELSE |
---|
1289 | pt1 = pt(k,j,i) |
---|
1290 | IF ( humidity ) THEN |
---|
1291 | qv1 = q(k,j,i) |
---|
1292 | ELSE |
---|
1293 | qv1 = 0.0_wp |
---|
1294 | ENDIF |
---|
1295 | ENDIF |
---|
1296 | ! |
---|
1297 | !-- Calculate aerodynamical resistance. For horizontal and vertical |
---|
1298 | !-- surfaces MOST is applied. Moreover, for vertical surfaces, resistance |
---|
1299 | !-- can be obtain via parameterization of Mason (2000) / |
---|
1300 | !-- Krayenhoff and Voogt (2006). |
---|
1301 | !-- To do: detailed investigation which approach is better! |
---|
1302 | IF ( horizontal .OR. .NOT. aero_resist_kray ) THEN |
---|
1303 | surf%r_a(m) = ( pt1 - surf_lsm_h%pt_surface(m) ) / & |
---|
1304 | ( surf%ts(m) * surf%us(m) + 1.0E-20_wp ) |
---|
1305 | ELSE |
---|
1306 | surf%r_a(m) = 1.0_wp / ( 11.8_wp + 4.2_wp * & |
---|
1307 | SQRT( ( ( u(k,j,i) + u(k,j,i+1) ) * 0.5_wp )**2 + & |
---|
1308 | ( ( v(k,j,i) + v(k,j+1,i) ) * 0.5_wp )**2 + & |
---|
1309 | ( ( w(k,j,i) + w(k-1,j,i) ) * 0.5_wp )**2 ) & |
---|
1310 | ) |
---|
1311 | ENDIF |
---|
1312 | ! |
---|
1313 | !-- Make sure that the resistance does not drop to zero for neutral |
---|
1314 | !-- stratification |
---|
1315 | IF ( ABS( surf%r_a(m) ) < 1.0_wp ) surf%r_a(m) = 1.0_wp |
---|
1316 | ! |
---|
1317 | !-- Second step: calculate canopy resistance r_canopy |
---|
1318 | !-- f1-f3 here are defined as 1/f1-f3 as in ECMWF documentation |
---|
1319 | |
---|
1320 | !-- f1: correction for incoming shortwave radiation (stomata close at |
---|
1321 | !-- night) |
---|
1322 | f1 = MIN( 1.0_wp, ( 0.004_wp * rad_sw_in(k_rad,j+j_off,i+i_off) + 0.05_wp ) /& |
---|
1323 | (0.81_wp * (0.004_wp * rad_sw_in(k_rad,j+j_off,i+i_off)& |
---|
1324 | + 1.0_wp)) ) |
---|
1325 | ! |
---|
1326 | !-- f2: correction for soil moisture availability to plants (the |
---|
1327 | !-- integrated soil moisture must thus be considered here) |
---|
1328 | !-- f2 = 0 for very dry soils |
---|
1329 | m_total = 0.0_wp |
---|
1330 | DO ks = nzb_soil, nzt_soil |
---|
1331 | m_total = m_total + surf%root_fr(ks,m) & |
---|
1332 | * MAX( surf_m_soil%var_2d(ks,m), surf%m_wilt(m) ) |
---|
1333 | ENDDO |
---|
1334 | |
---|
1335 | IF ( m_total > surf%m_wilt(m) .AND. & |
---|
1336 | m_total < surf%m_fc(m) ) THEN |
---|
1337 | f2 = ( m_total - surf%m_wilt(m) ) / & |
---|
1338 | ( surf%m_fc(m) - surf%m_wilt(m) ) |
---|
1339 | ELSEIF ( m_total >= surf%m_fc(m) ) THEN |
---|
1340 | f2 = 1.0_wp |
---|
1341 | ELSE |
---|
1342 | f2 = 1.0E-20_wp |
---|
1343 | ENDIF |
---|
1344 | ! |
---|
1345 | !-- Calculate water vapour pressure at saturation |
---|
1346 | e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * ( surf_t_surface%var_1d(m) & |
---|
1347 | - 273.16_wp ) / ( surf_t_surface%var_1d(m) - 35.86_wp ) ) |
---|
1348 | ! |
---|
1349 | !-- f3: correction for vapour pressure deficit |
---|
1350 | IF ( surf%g_d(m) /= 0.0_wp ) THEN |
---|
1351 | ! |
---|
1352 | !-- Calculate vapour pressure |
---|
1353 | e = qv1 * surface_pressure / 0.622_wp |
---|
1354 | f3 = EXP ( - surf%g_d(m) * (e_s - e) ) |
---|
1355 | ELSE |
---|
1356 | f3 = 1.0_wp |
---|
1357 | ENDIF |
---|
1358 | ! |
---|
1359 | !-- Calculate canopy resistance. In case that c_veg is 0 (bare soils), |
---|
1360 | !-- this calculation is obsolete, as r_canopy is not used below. |
---|
1361 | !-- To do: check for very dry soil -> r_canopy goes to infinity |
---|
1362 | surf%r_canopy(m) = surf%r_canopy_min(m) / & |
---|
1363 | ( surf%lai(m) * f1 * f2 * f3 + 1.0E-20_wp ) |
---|
1364 | ! |
---|
1365 | !-- Third step: calculate bare soil resistance r_soil. The Clapp & |
---|
1366 | !-- Hornberger parametrization does not consider c_veg. |
---|
1367 | IF ( surf%soil_type_2d(m) /= 7 ) THEN |
---|
1368 | m_min = surf%c_veg(m) * surf%m_wilt(m) + & |
---|
1369 | ( 1.0_wp - surf%c_veg(m) ) * surf%m_res(m) |
---|
1370 | ELSE |
---|
1371 | m_min = surf%m_wilt(m) |
---|
1372 | ENDIF |
---|
1373 | |
---|
1374 | f2 = ( surf_m_soil%var_2d(nzb_soil,m) - m_min ) / ( surf%m_fc(m) - m_min ) |
---|
1375 | f2 = MAX( f2, 1.0E-20_wp ) |
---|
1376 | f2 = MIN( f2, 1.0_wp ) |
---|
1377 | |
---|
1378 | surf%r_soil(m) = surf%r_soil_min(m) / f2 |
---|
1379 | |
---|
1380 | ! |
---|
1381 | !-- Calculate the maximum possible liquid water amount on plants and |
---|
1382 | !-- bare surface. For vegetated surfaces, a maximum depth of 0.2 mm is |
---|
1383 | !-- assumed, while paved surfaces might hold up 1 mm of water. The |
---|
1384 | !-- liquid water fraction for paved surfaces is calculated after |
---|
1385 | !-- Noilhan & Planton (1989), while the ECMWF formulation is used for |
---|
1386 | !-- vegetated surfaces and bare soils. |
---|
1387 | IF ( surf%pave_surface(m) ) THEN |
---|
1388 | m_liq_eb_max = m_max_depth * 5.0_wp |
---|
1389 | surf%c_liq(m) = MIN( 1.0_wp, ( surf_m_liq_eb%var_1d(m) / m_liq_eb_max)**0.67 ) |
---|
1390 | ELSE |
---|
1391 | m_liq_eb_max = m_max_depth * ( surf%c_veg(m) * surf%lai(m)& |
---|
1392 | + ( 1.0_wp - surf%c_veg(m) ) ) |
---|
1393 | surf%c_liq(m) = MIN( 1.0_wp, surf_m_liq_eb%var_1d(m) / m_liq_eb_max ) |
---|
1394 | ENDIF |
---|
1395 | ! |
---|
1396 | !-- Calculate saturation specific humidity |
---|
1397 | q_s = 0.622_wp * e_s / surface_pressure |
---|
1398 | ! |
---|
1399 | !-- In case of dewfall, set evapotranspiration to zero |
---|
1400 | !-- All super-saturated water is then removed from the air |
---|
1401 | IF ( humidity .AND. q_s <= qv1 ) THEN |
---|
1402 | surf%r_canopy(m) = 0.0_wp |
---|
1403 | surf%r_soil(m) = 0.0_wp |
---|
1404 | ENDIF |
---|
1405 | |
---|
1406 | ! |
---|
1407 | !-- Calculate coefficients for the total evapotranspiration |
---|
1408 | !-- In case of water surface, set vegetation and soil fluxes to zero. |
---|
1409 | !-- For pavements, only evaporation of liquid water is possible. |
---|
1410 | IF ( surf%water_surface(m) ) THEN |
---|
1411 | f_qsws_veg = 0.0_wp |
---|
1412 | f_qsws_soil = 0.0_wp |
---|
1413 | f_qsws_liq = rho_lv / surf%r_a(m) |
---|
1414 | ELSEIF ( surf%pave_surface (m) ) THEN |
---|
1415 | f_qsws_veg = 0.0_wp |
---|
1416 | f_qsws_soil = 0.0_wp |
---|
1417 | f_qsws_liq = rho_lv * surf%c_liq(m) / surf%r_a(m) |
---|
1418 | ELSE |
---|
1419 | f_qsws_veg = rho_lv * surf%c_veg(m) * & |
---|
1420 | ( 1.0_wp - surf%c_liq(m) ) / & |
---|
1421 | ( surf%r_a(m) + surf%r_canopy(m) ) |
---|
1422 | f_qsws_soil = rho_lv * (1.0_wp - surf%c_veg(m) ) / & |
---|
1423 | ( surf%r_a(m) + surf%r_soil(m) ) |
---|
1424 | f_qsws_liq = rho_lv * surf%c_veg(m) * surf%c_liq(m) / & |
---|
1425 | surf%r_a(m) |
---|
1426 | ENDIF |
---|
1427 | ! |
---|
1428 | !-- If soil moisture is below wilting point, plants do no longer |
---|
1429 | !-- transpirate. |
---|
1430 | ! IF ( m_soil(k,j,i) < m_wilt(j,i) ) THEN |
---|
1431 | ! f_qsws_veg = 0.0_wp |
---|
1432 | ! ENDIF |
---|
1433 | |
---|
1434 | f_shf = rho_cp / surf%r_a(m) |
---|
1435 | f_qsws = f_qsws_veg + f_qsws_soil + f_qsws_liq |
---|
1436 | ! |
---|
1437 | !-- Calculate derivative of q_s for Taylor series expansion |
---|
1438 | e_s_dt = e_s * ( 17.269_wp / ( surf_t_surface%var_1d(m) - 35.86_wp) - & |
---|
1439 | 17.269_wp*( surf_t_surface%var_1d(m) - 273.16_wp) & |
---|
1440 | / ( surf_t_surface%var_1d(m) - 35.86_wp)**2 ) |
---|
1441 | |
---|
1442 | dq_s_dt = 0.622_wp * e_s_dt / surface_pressure |
---|
1443 | ! |
---|
1444 | !-- Add LW up so that it can be removed in prognostic equation |
---|
1445 | surf%rad_net_l(m) = rad_net(j,i) + rad_lw_out(nzb,j,i) |
---|
1446 | ! |
---|
1447 | !-- Calculate new skin temperature |
---|
1448 | IF ( humidity ) THEN |
---|
1449 | ! |
---|
1450 | !-- Numerator of the prognostic equation |
---|
1451 | coef_1 = surf%rad_net_l(m) + rad_lw_out_change_0(j,i) & |
---|
1452 | * surf_t_surface%var_1d(m) - rad_lw_out(nzb,j,i) & |
---|
1453 | + f_shf * pt1 + f_qsws * ( qv1 - q_s & |
---|
1454 | + dq_s_dt * surf_t_surface%var_1d(m) ) + lambda_surface & |
---|
1455 | * surf_t_soil%var_2d(nzb_soil,m) |
---|
1456 | ! |
---|
1457 | !-- Denominator of the prognostic equation |
---|
1458 | coef_2 = rad_lw_out_change_0(j,i) + f_qsws * dq_s_dt & |
---|
1459 | + lambda_surface + f_shf / exn |
---|
1460 | ELSE |
---|
1461 | ! |
---|
1462 | !-- Numerator of the prognostic equation |
---|
1463 | coef_1 = surf%rad_net_l(m) + rad_lw_out_change_0(j,i) & |
---|
1464 | * surf_t_surface%var_1d(m) - rad_lw_out(nzb,j,i) & |
---|
1465 | + f_shf * pt1 + lambda_surface & |
---|
1466 | * surf_t_soil%var_2d(nzb_soil,m) |
---|
1467 | ! |
---|
1468 | !-- Denominator of the prognostic equation |
---|
1469 | coef_2 = rad_lw_out_change_0(j,i) + lambda_surface + f_shf / exn |
---|
1470 | |
---|
1471 | ENDIF |
---|
1472 | |
---|
1473 | tend = 0.0_wp |
---|
1474 | |
---|
1475 | ! |
---|
1476 | !-- Implicit solution when the surface layer has no heat capacity, |
---|
1477 | !-- otherwise use RK3 scheme. |
---|
1478 | surf_t_surface_p%var_1d(m) = ( coef_1 * dt_3d * tsc(2) + c_surface_tmp *& |
---|
1479 | surf_t_surface%var_1d(m) ) / ( c_surface_tmp + coef_2& |
---|
1480 | * dt_3d * tsc(2) ) |
---|
1481 | |
---|
1482 | ! |
---|
1483 | !-- Add RK3 term |
---|
1484 | IF ( c_surface_tmp /= 0.0_wp ) THEN |
---|
1485 | |
---|
1486 | surf_t_surface_p%var_1d(m) = surf_t_surface_p%var_1d(m) + dt_3d * & |
---|
1487 | tsc(3) * surf_tt_surface_m%var_1d(m) |
---|
1488 | |
---|
1489 | ! |
---|
1490 | !-- Calculate true tendency |
---|
1491 | tend = ( surf_t_surface_p%var_1d(m) - surf_t_surface%var_1d(m) - & |
---|
1492 | dt_3d * tsc(3) * surf_tt_surface_m%var_1d(m)) / (dt_3d * tsc(2)) |
---|
1493 | ! |
---|
1494 | !-- Calculate t_surface tendencies for the next Runge-Kutta step |
---|
1495 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
1496 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
1497 | surf_tt_surface_m%var_1d(m) = tend |
---|
1498 | ELSEIF ( intermediate_timestep_count < & |
---|
1499 | intermediate_timestep_count_max ) THEN |
---|
1500 | surf_tt_surface_m%var_1d(m) = -9.5625_wp * tend + & |
---|
1501 | 5.3125_wp * surf_tt_surface_m%var_1d(m) |
---|
1502 | ENDIF |
---|
1503 | ENDIF |
---|
1504 | ENDIF |
---|
1505 | |
---|
1506 | ! |
---|
1507 | !-- In case of fast changes in the skin temperature, it is possible to |
---|
1508 | !-- update the radiative fluxes independently from the prescribed |
---|
1509 | !-- radiation call frequency. This effectively prevents oscillations, |
---|
1510 | !-- especially when setting skip_time_do_radiation /= 0. The threshold |
---|
1511 | !-- value of 0.2 used here is just a first guess. This method should be |
---|
1512 | !-- revised in the future as tests have shown that the threshold is |
---|
1513 | !-- often reached, when no oscillations would occur (causes immense |
---|
1514 | !-- computing time for the radiation code). |
---|
1515 | IF ( ABS( surf_t_surface_p%var_1d(m) - surf_t_surface%var_1d(m) ) > 0.2_wp .AND. & |
---|
1516 | unscheduled_radiation_calls ) THEN |
---|
1517 | force_radiation_call_l = .TRUE. |
---|
1518 | ENDIF |
---|
1519 | |
---|
1520 | pt(k+k_off,j+j_off,i+i_off) = surf_t_surface_p%var_1d(m) / exn !is actually no air temperature |
---|
1521 | surf%pt_surface(m) = surf_t_surface_p%var_1d(m) / exn |
---|
1522 | |
---|
1523 | ! |
---|
1524 | !-- Calculate fluxes |
---|
1525 | surf%rad_net_l(m) = surf%rad_net_l(m) + & |
---|
1526 | rad_lw_out_change_0(j,i) & |
---|
1527 | * surf_t_surface%var_1d(m) - rad_lw_out(nzb,j,i) & |
---|
1528 | - rad_lw_out_change_0(j,i) * surf_t_surface_p%var_1d(m) |
---|
1529 | |
---|
1530 | rad_net(j,i) = surf%rad_net_l(m) |
---|
1531 | rad_lw_out(nzb,j,i) = rad_lw_out(nzb,j,i) + rad_lw_out_change_0(j,i) * & |
---|
1532 | ( surf_t_surface_p%var_1d(m) - surf_t_surface%var_1d(m) ) |
---|
1533 | |
---|
1534 | surf%ghf_eb(m) = lambda_surface * ( surf_t_surface_p%var_1d(m) & |
---|
1535 | - surf_t_soil%var_2d(nzb_soil,m) ) |
---|
1536 | |
---|
1537 | surf%shf_eb(m) = - f_shf * ( pt1 - surf%pt_surface(m) ) |
---|
1538 | |
---|
1539 | surf%shf(m) = surf%shf_eb(m) / rho_cp |
---|
1540 | |
---|
1541 | IF ( humidity ) THEN |
---|
1542 | surf%qsws_eb(m) = - f_qsws * ( qv1 - q_s + dq_s_dt & |
---|
1543 | * surf_t_surface%var_1d(m) - dq_s_dt * & |
---|
1544 | surf_t_surface_p%var_1d(m) ) |
---|
1545 | |
---|
1546 | surf%qsws(m) = surf%qsws_eb(m) / rho_lv |
---|
1547 | |
---|
1548 | surf%qsws_veg_eb(m) = - f_qsws_veg * ( qv1 - q_s & |
---|
1549 | + dq_s_dt * surf_t_surface%var_1d(m) - dq_s_dt & |
---|
1550 | * surf_t_surface_p%var_1d(m) ) |
---|
1551 | |
---|
1552 | surf%qsws_soil_eb(m) = - f_qsws_soil * ( qv1 - q_s & |
---|
1553 | + dq_s_dt * surf_t_surface%var_1d(m) - dq_s_dt & |
---|
1554 | * surf_t_surface_p%var_1d(m) ) |
---|
1555 | |
---|
1556 | surf%qsws_liq_eb(m) = - f_qsws_liq * ( qv1 - q_s & |
---|
1557 | + dq_s_dt * surf_t_surface%var_1d(m) - dq_s_dt & |
---|
1558 | * surf_t_surface_p%var_1d(m) ) |
---|
1559 | ENDIF |
---|
1560 | |
---|
1561 | ! |
---|
1562 | !-- Calculate the true surface resistance |
---|
1563 | IF ( surf%qsws_eb(m) == 0.0_wp ) THEN |
---|
1564 | surf%r_s(m) = 1.0E10_wp |
---|
1565 | ELSE |
---|
1566 | surf%r_s(m) = - rho_lv * ( qv1 - q_s + dq_s_dt & |
---|
1567 | * surf_t_surface%var_1d(m) - dq_s_dt * & |
---|
1568 | surf_t_surface_p%var_1d(m) ) / & |
---|
1569 | surf%qsws_eb(m) - surf%r_a(m) |
---|
1570 | ENDIF |
---|
1571 | |
---|
1572 | ! |
---|
1573 | !-- Calculate change in liquid water reservoir due to dew fall or |
---|
1574 | !-- evaporation of liquid water |
---|
1575 | IF ( humidity ) THEN |
---|
1576 | ! |
---|
1577 | !-- If precipitation is activated, add rain water to qsws_liq_eb |
---|
1578 | !-- and qsws_soil_eb according the the vegetation coverage. |
---|
1579 | !-- precipitation_rate is given in mm. |
---|
1580 | IF ( precipitation ) THEN |
---|
1581 | |
---|
1582 | ! |
---|
1583 | !-- Add precipitation to liquid water reservoir, if possible. |
---|
1584 | !-- Otherwise, add the water to soil. In case of |
---|
1585 | !-- pavements, the exceeding water amount is implicitely removed |
---|
1586 | !-- as runoff as qsws_soil_eb is then not used in the soil model |
---|
1587 | IF ( surf_m_liq_eb%var_1d(m) /= m_liq_eb_max ) THEN |
---|
1588 | surf%qsws_liq_eb(m) = surf%qsws_liq_eb(m) & |
---|
1589 | + surf%c_veg(m) * prr(k+k_off,j+j_off,i+i_off)& |
---|
1590 | * hyrho(k+k_off) & |
---|
1591 | * 0.001_wp * rho_l * l_v |
---|
1592 | ELSE |
---|
1593 | surf%qsws_soil_eb(m) = surf%qsws_soil_eb(m) & |
---|
1594 | + surf%c_veg(m) * prr(k+k_off,j+j_off,i+i_off)& |
---|
1595 | * hyrho(k+k_off) & |
---|
1596 | * 0.001_wp * rho_l * l_v |
---|
1597 | ENDIF |
---|
1598 | |
---|
1599 | !-- Add precipitation to bare soil according to the bare soil |
---|
1600 | !-- coverage. |
---|
1601 | surf%qsws_soil_eb(m) = surf%qsws_soil_eb(m) + ( 1.0_wp & |
---|
1602 | - surf%c_veg(m) ) * prr(k+k_off,j+j_off,i+i_off)& |
---|
1603 | * hyrho(k+k_off) & |
---|
1604 | * 0.001_wp * rho_l * l_v |
---|
1605 | ENDIF |
---|
1606 | |
---|
1607 | ! |
---|
1608 | !-- If the air is saturated, check the reservoir water level |
---|
1609 | IF ( surf%qsws_eb(m) < 0.0_wp ) THEN |
---|
1610 | ! |
---|
1611 | !-- Check if reservoir is full (avoid values > m_liq_eb_max) |
---|
1612 | !-- In that case, qsws_liq_eb goes to qsws_soil_eb. In this |
---|
1613 | !-- case qsws_veg_eb is zero anyway (because c_liq = 1), |
---|
1614 | !-- so that tend is zero and no further check is needed |
---|
1615 | IF ( surf_m_liq_eb%var_1d(m) == m_liq_eb_max ) THEN |
---|
1616 | surf%qsws_soil_eb(m) = surf%qsws_soil_eb(m) + surf%qsws_liq_eb(m) |
---|
1617 | |
---|
1618 | surf%qsws_liq_eb(m) = 0.0_wp |
---|
1619 | ENDIF |
---|
1620 | |
---|
1621 | ! |
---|
1622 | !-- In case qsws_veg_eb becomes negative (unphysical behavior), |
---|
1623 | !-- let the water enter the liquid water reservoir as dew on the |
---|
1624 | !-- plant |
---|
1625 | IF ( surf%qsws_veg_eb(m) < 0.0_wp ) THEN |
---|
1626 | surf%qsws_liq_eb(m) = surf%qsws_liq_eb(m) + surf%qsws_veg_eb(m) |
---|
1627 | surf%qsws_veg_eb(m) = 0.0_wp |
---|
1628 | ENDIF |
---|
1629 | ENDIF |
---|
1630 | |
---|
1631 | tend = - surf%qsws_liq_eb(m) * drho_l_lv |
---|
1632 | surf_m_liq_eb_p%var_1d(m) = surf_m_liq_eb%var_1d(m) + dt_3d * & |
---|
1633 | ( tsc(2) * tend + & |
---|
1634 | tsc(3) * surf_tm_liq_eb_m%var_1d(m) ) |
---|
1635 | ! |
---|
1636 | !-- Check if reservoir is overfull -> reduce to maximum |
---|
1637 | !-- (conservation of water is violated here) |
---|
1638 | surf_m_liq_eb_p%var_1d(m) = MIN( surf_m_liq_eb_p%var_1d(m),m_liq_eb_max ) |
---|
1639 | |
---|
1640 | ! |
---|
1641 | !-- Check if reservoir is empty (avoid values < 0.0) |
---|
1642 | !-- (conservation of water is violated here) |
---|
1643 | surf_m_liq_eb_p%var_1d(m) = MAX( surf_m_liq_eb_p%var_1d(m), 0.0_wp ) |
---|
1644 | ! |
---|
1645 | !-- Calculate m_liq_eb tendencies for the next Runge-Kutta step |
---|
1646 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
1647 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
1648 | surf_tm_liq_eb_m%var_1d(m) = tend |
---|
1649 | ELSEIF ( intermediate_timestep_count < & |
---|
1650 | intermediate_timestep_count_max ) THEN |
---|
1651 | surf_tm_liq_eb_m%var_1d(m) = -9.5625_wp * tend + & |
---|
1652 | 5.3125_wp * surf_tm_liq_eb_m%var_1d(m) |
---|
1653 | ENDIF |
---|
1654 | ENDIF |
---|
1655 | |
---|
1656 | ENDIF |
---|
1657 | |
---|
1658 | ENDDO |
---|
1659 | |
---|
1660 | ! |
---|
1661 | !-- Make a logical OR for all processes. Force radiation call if at |
---|
1662 | !-- least one processor reached the threshold change in skin temperature |
---|
1663 | IF ( unscheduled_radiation_calls .AND. intermediate_timestep_count & |
---|
1664 | == intermediate_timestep_count_max-1 ) THEN |
---|
1665 | #if defined( __parallel ) |
---|
1666 | IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) |
---|
1667 | CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call, & |
---|
1668 | 1, MPI_LOGICAL, MPI_LOR, comm2d, ierr ) |
---|
1669 | #else |
---|
1670 | force_radiation_call = force_radiation_call_l |
---|
1671 | #endif |
---|
1672 | force_radiation_call_l = .FALSE. |
---|
1673 | ENDIF |
---|
1674 | |
---|
1675 | ! |
---|
1676 | !-- Calculate surface specific humidity |
---|
1677 | IF ( humidity ) THEN |
---|
1678 | CALL calc_q_surface |
---|
1679 | ENDIF |
---|
1680 | |
---|
1681 | ! |
---|
1682 | !-- Calculate new roughness lengths (for water surfaces only) |
---|
1683 | IF ( horizontal ) CALL calc_z0_water_surface |
---|
1684 | |
---|
1685 | CONTAINS |
---|
1686 | !------------------------------------------------------------------------------! |
---|
1687 | ! Description: |
---|
1688 | ! ------------ |
---|
1689 | !> Calculation of specific humidity of the skin layer (surface). It is assumend |
---|
1690 | !> that the skin is always saturated. |
---|
1691 | !------------------------------------------------------------------------------! |
---|
1692 | SUBROUTINE calc_q_surface |
---|
1693 | |
---|
1694 | IMPLICIT NONE |
---|
1695 | |
---|
1696 | REAL(wp) :: resistance !< aerodynamic and soil resistance term |
---|
1697 | |
---|
1698 | DO m = 1, surf%ns |
---|
1699 | |
---|
1700 | i = surf%i(m) |
---|
1701 | j = surf%j(m) |
---|
1702 | k = surf%k(m) |
---|
1703 | |
---|
1704 | ! |
---|
1705 | !-- Calculate water vapour pressure at saturation |
---|
1706 | e_s = 0.01_wp * 610.78_wp * EXP( 17.269_wp * & |
---|
1707 | ( surf_t_surface_p%var_1d(m) - 273.16_wp ) / & |
---|
1708 | ( surf_t_surface_p%var_1d(m) - 35.86_wp ) & |
---|
1709 | ) |
---|
1710 | |
---|
1711 | ! |
---|
1712 | !-- Calculate specific humidity at saturation |
---|
1713 | q_s = 0.622_wp * e_s / surface_pressure |
---|
1714 | |
---|
1715 | resistance = surf%r_a(m) / ( surf%r_a(m) + surf%r_s(m) ) |
---|
1716 | |
---|
1717 | ! |
---|
1718 | !-- Calculate specific humidity at surface |
---|
1719 | IF ( cloud_physics ) THEN |
---|
1720 | q(k+k_off,j+j_off,i+i_off) = resistance * q_s + & |
---|
1721 | ( 1.0_wp - resistance ) * & |
---|
1722 | ( q(k,j,i) - ql(k,j,i) ) |
---|
1723 | ELSE |
---|
1724 | q(k+k_off,j+j_off,i+i_off) = resistance * q_s + & |
---|
1725 | ( 1.0_wp - resistance ) * & |
---|
1726 | q(k,j,i) |
---|
1727 | ENDIF |
---|
1728 | |
---|
1729 | ! |
---|
1730 | !-- Update virtual potential temperature |
---|
1731 | vpt(k+k_off,j+j_off,i+i_off) = pt(k+k_off,j+j_off,i+i_off) * & |
---|
1732 | ( 1.0_wp + 0.61_wp * q(k+k_off,j+j_off,i+i_off) ) |
---|
1733 | |
---|
1734 | ENDDO |
---|
1735 | |
---|
1736 | END SUBROUTINE calc_q_surface |
---|
1737 | |
---|
1738 | |
---|
1739 | |
---|
1740 | END SUBROUTINE lsm_energy_balance |
---|
1741 | |
---|
1742 | |
---|
1743 | !------------------------------------------------------------------------------! |
---|
1744 | ! Description: |
---|
1745 | ! ------------ |
---|
1746 | !> Header output for land surface model |
---|
1747 | !------------------------------------------------------------------------------! |
---|
1748 | SUBROUTINE lsm_header ( io ) |
---|
1749 | |
---|
1750 | |
---|
1751 | IMPLICIT NONE |
---|
1752 | |
---|
1753 | CHARACTER (LEN=86) :: t_soil_chr !< String for soil temperature profile |
---|
1754 | CHARACTER (LEN=86) :: roots_chr !< String for root profile |
---|
1755 | CHARACTER (LEN=86) :: vertical_index_chr !< String for the vertical index |
---|
1756 | CHARACTER (LEN=86) :: m_soil_chr !< String for soil moisture |
---|
1757 | CHARACTER (LEN=86) :: soil_depth_chr !< String for soil depth |
---|
1758 | CHARACTER (LEN=10) :: coor_chr !< Temporary string |
---|
1759 | |
---|
1760 | INTEGER(iwp) :: i !< Loop index over soil layers |
---|
1761 | |
---|
1762 | INTEGER(iwp), INTENT(IN) :: io !< Unit of the output file |
---|
1763 | |
---|
1764 | t_soil_chr = '' |
---|
1765 | m_soil_chr = '' |
---|
1766 | soil_depth_chr = '' |
---|
1767 | roots_chr = '' |
---|
1768 | vertical_index_chr = '' |
---|
1769 | |
---|
1770 | i = 1 |
---|
1771 | DO i = nzb_soil, nzt_soil |
---|
1772 | WRITE (coor_chr,'(F10.2,7X)') soil_temperature(i) |
---|
1773 | t_soil_chr = TRIM( t_soil_chr ) // ' ' // TRIM( coor_chr ) |
---|
1774 | |
---|
1775 | WRITE (coor_chr,'(F10.2,7X)') soil_moisture(i) |
---|
1776 | m_soil_chr = TRIM( m_soil_chr ) // ' ' // TRIM( coor_chr ) |
---|
1777 | |
---|
1778 | WRITE (coor_chr,'(F10.2,7X)') - zs(i) |
---|
1779 | soil_depth_chr = TRIM( soil_depth_chr ) // ' ' // TRIM( coor_chr ) |
---|
1780 | |
---|
1781 | WRITE (coor_chr,'(F10.2,7X)') root_fraction(i) |
---|
1782 | roots_chr = TRIM( roots_chr ) // ' ' // TRIM( coor_chr ) |
---|
1783 | |
---|
1784 | WRITE (coor_chr,'(I10,7X)') i |
---|
1785 | vertical_index_chr = TRIM( vertical_index_chr ) // ' ' // & |
---|
1786 | TRIM( coor_chr ) |
---|
1787 | ENDDO |
---|
1788 | |
---|
1789 | ! |
---|
1790 | !-- Write land surface model header |
---|
1791 | WRITE( io, 1 ) |
---|
1792 | IF ( conserve_water_content ) THEN |
---|
1793 | WRITE( io, 2 ) |
---|
1794 | ELSE |
---|
1795 | WRITE( io, 3 ) |
---|
1796 | ENDIF |
---|
1797 | |
---|
1798 | WRITE( io, 4 ) TRIM( veg_type_name(veg_type) ), & |
---|
1799 | TRIM (soil_type_name(soil_type) ) |
---|
1800 | WRITE( io, 5 ) TRIM( soil_depth_chr ), TRIM( t_soil_chr ), & |
---|
1801 | TRIM( m_soil_chr ), TRIM( roots_chr ), & |
---|
1802 | TRIM( vertical_index_chr ) |
---|
1803 | |
---|
1804 | 1 FORMAT (//' Land surface model information:'/ & |
---|
1805 | ' ------------------------------'/) |
---|
1806 | 2 FORMAT (' --> Soil bottom is closed (water content is conserved', & |
---|
1807 | ', default)') |
---|
1808 | 3 FORMAT (' --> Soil bottom is open (water content is not conserved)') |
---|
1809 | 4 FORMAT (' --> Land surface type : ',A,/ & |
---|
1810 | ' --> Soil porosity type : ',A) |
---|
1811 | 5 FORMAT (/' Initial soil temperature and moisture profile:'// & |
---|
1812 | ' Height: ',A,' m'/ & |
---|
1813 | ' Temperature: ',A,' K'/ & |
---|
1814 | ' Moisture: ',A,' m**3/m**3'/ & |
---|
1815 | ' Root fraction: ',A,' '/ & |
---|
1816 | ' Grid point: ',A) |
---|
1817 | |
---|
1818 | END SUBROUTINE lsm_header |
---|
1819 | |
---|
1820 | |
---|
1821 | !------------------------------------------------------------------------------! |
---|
1822 | ! Description: |
---|
1823 | ! ------------ |
---|
1824 | !> Initialization of the land surface model |
---|
1825 | !------------------------------------------------------------------------------! |
---|
1826 | SUBROUTINE lsm_init |
---|
1827 | |
---|
1828 | |
---|
1829 | IMPLICIT NONE |
---|
1830 | |
---|
1831 | INTEGER(iwp) :: i !< running index |
---|
1832 | INTEGER(iwp) :: i_off !< index offset of surface element, seen from atmospheric grid point |
---|
1833 | INTEGER(iwp) :: j !< running index |
---|
1834 | INTEGER(iwp) :: j_off !< index offset of surface element, seen from atmospheric grid point |
---|
1835 | INTEGER(iwp) :: k !< running index |
---|
1836 | INTEGER(iwp) :: l !< running index surface facing |
---|
1837 | INTEGER(iwp) :: m !< running index |
---|
1838 | |
---|
1839 | REAL(wp) :: pt1 !< potential temperature at first grid level |
---|
1840 | |
---|
1841 | ! |
---|
1842 | !-- Calculate Exner function |
---|
1843 | exn = ( surface_pressure / 1000.0_wp )**0.286_wp |
---|
1844 | ! |
---|
1845 | !-- If no cloud physics is used, rho_surface has not been calculated before |
---|
1846 | IF ( .NOT. cloud_physics ) THEN |
---|
1847 | rho_surface = surface_pressure * 100.0_wp / ( r_d * pt_surface * exn ) |
---|
1848 | ENDIF |
---|
1849 | |
---|
1850 | ! |
---|
1851 | !-- Calculate frequently used parameters |
---|
1852 | rho_cp = cp * rho_surface |
---|
1853 | rd_d_rv = r_d / r_v |
---|
1854 | rho_lv = rho_surface * l_v |
---|
1855 | drho_l_lv = 1.0_wp / (rho_l * l_v) |
---|
1856 | |
---|
1857 | ! |
---|
1858 | !-- Set initial values for prognostic quantities |
---|
1859 | !-- Horizontal surfaces |
---|
1860 | tt_surface_h_m%var_1d = 0.0_wp |
---|
1861 | tt_soil_h_m%var_2d = 0.0_wp |
---|
1862 | tm_soil_h_m%var_2d = 0.0_wp |
---|
1863 | tm_liq_eb_h_m%var_1d = 0.0_wp |
---|
1864 | surf_lsm_h%c_liq = 0.0_wp |
---|
1865 | |
---|
1866 | surf_lsm_h%ghf_eb = 0.0_wp |
---|
1867 | surf_lsm_h%shf_eb = rho_cp * surf_lsm_h%shf |
---|
1868 | |
---|
1869 | IF ( humidity ) THEN |
---|
1870 | surf_lsm_h%qsws_eb = rho_lv * surf_lsm_h%qsws |
---|
1871 | ELSE |
---|
1872 | surf_lsm_h%qsws_eb = 0.0_wp |
---|
1873 | ENDIF |
---|
1874 | |
---|
1875 | surf_lsm_h%qsws_liq_eb = 0.0_wp |
---|
1876 | surf_lsm_h%qsws_soil_eb = 0.0_wp |
---|
1877 | surf_lsm_h%qsws_veg_eb = 0.0_wp |
---|
1878 | |
---|
1879 | surf_lsm_h%r_a = 50.0_wp |
---|
1880 | surf_lsm_h%r_s = 50.0_wp |
---|
1881 | surf_lsm_h%r_canopy = 0.0_wp |
---|
1882 | surf_lsm_h%r_soil = 0.0_wp |
---|
1883 | ! |
---|
1884 | !-- Do the same for vertical surfaces |
---|
1885 | DO l = 0, 3 |
---|
1886 | tt_surface_v_m(l)%var_1d = 0.0_wp |
---|
1887 | tt_soil_v_m(l)%var_2d = 0.0_wp |
---|
1888 | tm_soil_v_m(l)%var_2d = 0.0_wp |
---|
1889 | tm_liq_eb_v_m(l)%var_1d = 0.0_wp |
---|
1890 | surf_lsm_v(l)%c_liq = 0.0_wp |
---|
1891 | |
---|
1892 | surf_lsm_v(l)%ghf_eb = 0.0_wp |
---|
1893 | surf_lsm_v(l)%shf_eb = rho_cp * surf_lsm_v(l)%shf |
---|
1894 | |
---|
1895 | IF ( humidity ) THEN |
---|
1896 | surf_lsm_v(l)%qsws_eb = rho_lv * surf_lsm_v(l)%qsws |
---|
1897 | ELSE |
---|
1898 | surf_lsm_v(l)%qsws_eb = 0.0_wp |
---|
1899 | ENDIF |
---|
1900 | |
---|
1901 | surf_lsm_v(l)%qsws_liq_eb = 0.0_wp |
---|
1902 | surf_lsm_v(l)%qsws_soil_eb = 0.0_wp |
---|
1903 | surf_lsm_v(l)%qsws_veg_eb = 0.0_wp |
---|
1904 | |
---|
1905 | surf_lsm_v(l)%r_a = 50.0_wp |
---|
1906 | surf_lsm_v(l)%r_s = 50.0_wp |
---|
1907 | surf_lsm_v(l)%r_canopy = 0.0_wp |
---|
1908 | surf_lsm_v(l)%r_soil = 0.0_wp |
---|
1909 | ENDDO |
---|
1910 | |
---|
1911 | |
---|
1912 | ! |
---|
1913 | !-- Allocate 3D soil model arrays |
---|
1914 | !-- First, for horizontal surfaces |
---|
1915 | ALLOCATE ( surf_lsm_h%root_fr(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
1916 | ALLOCATE ( surf_lsm_h%lambda_h(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
1917 | ALLOCATE ( surf_lsm_h%rho_c_total(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
1918 | |
---|
1919 | surf_lsm_h%lambda_h = 0.0_wp |
---|
1920 | ! |
---|
1921 | !-- If required, allocate humidity-related variables for the soil model |
---|
1922 | IF ( humidity ) THEN |
---|
1923 | ALLOCATE ( surf_lsm_h%lambda_w(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
1924 | ALLOCATE ( surf_lsm_h%gamma_w(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
1925 | |
---|
1926 | surf_lsm_h%lambda_w = 0.0_wp |
---|
1927 | ENDIF |
---|
1928 | ! |
---|
1929 | !-- For vertical surfaces |
---|
1930 | DO l = 0, 3 |
---|
1931 | ALLOCATE ( surf_lsm_v(l)%root_fr(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
1932 | ALLOCATE ( surf_lsm_v(l)%lambda_h(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
1933 | ALLOCATE ( surf_lsm_v(l)%rho_c_total(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
1934 | |
---|
1935 | surf_lsm_v(l)%lambda_h = 0.0_wp |
---|
1936 | ! |
---|
1937 | !-- If required, allocate humidity-related variables for the soil model |
---|
1938 | IF ( humidity ) THEN |
---|
1939 | ALLOCATE ( surf_lsm_v(l)%lambda_w(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
1940 | ALLOCATE ( surf_lsm_v(l)%gamma_w(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
1941 | |
---|
1942 | surf_lsm_v(l)%lambda_w = 0.0_wp |
---|
1943 | ENDIF |
---|
1944 | ENDDO |
---|
1945 | |
---|
1946 | ! |
---|
1947 | !-- Calculate grid spacings. Temperature and moisture are defined at |
---|
1948 | !-- the edges of the soil layers (_stag), whereas gradients/fluxes are defined |
---|
1949 | !-- at the centers |
---|
1950 | dz_soil(nzb_soil) = zs(nzb_soil) |
---|
1951 | |
---|
1952 | DO k = nzb_soil+1, nzt_soil |
---|
1953 | dz_soil(k) = zs(k) - zs(k-1) |
---|
1954 | ENDDO |
---|
1955 | dz_soil(nzt_soil+1) = dz_soil(nzt_soil) |
---|
1956 | |
---|
1957 | DO k = nzb_soil, nzt_soil-1 |
---|
1958 | dz_soil_stag(k) = 0.5_wp * (dz_soil(k+1) + dz_soil(k)) |
---|
1959 | ENDDO |
---|
1960 | dz_soil_stag(nzt_soil) = dz_soil(nzt_soil) |
---|
1961 | |
---|
1962 | ddz_soil = 1.0_wp / dz_soil |
---|
1963 | ddz_soil_stag = 1.0_wp / dz_soil_stag |
---|
1964 | |
---|
1965 | ! |
---|
1966 | !-- Initialize standard soil types. It is possible to overwrite each |
---|
1967 | !-- parameter by setting the respecticy NAMELIST variable to a |
---|
1968 | !-- value /= 9999999.9. |
---|
1969 | IF ( soil_type /= 0 ) THEN |
---|
1970 | |
---|
1971 | IF ( alpha_vangenuchten == 9999999.9_wp ) THEN |
---|
1972 | alpha_vangenuchten = soil_pars(0,soil_type) |
---|
1973 | ENDIF |
---|
1974 | |
---|
1975 | IF ( l_vangenuchten == 9999999.9_wp ) THEN |
---|
1976 | l_vangenuchten = soil_pars(1,soil_type) |
---|
1977 | ENDIF |
---|
1978 | |
---|
1979 | IF ( n_vangenuchten == 9999999.9_wp ) THEN |
---|
1980 | n_vangenuchten = soil_pars(2,soil_type) |
---|
1981 | ENDIF |
---|
1982 | |
---|
1983 | IF ( hydraulic_conductivity == 9999999.9_wp ) THEN |
---|
1984 | hydraulic_conductivity = soil_pars(3,soil_type) |
---|
1985 | ENDIF |
---|
1986 | |
---|
1987 | IF ( saturation_moisture == 9999999.9_wp ) THEN |
---|
1988 | saturation_moisture = m_soil_pars(0,soil_type) |
---|
1989 | ENDIF |
---|
1990 | |
---|
1991 | IF ( field_capacity == 9999999.9_wp ) THEN |
---|
1992 | field_capacity = m_soil_pars(1,soil_type) |
---|
1993 | ENDIF |
---|
1994 | |
---|
1995 | IF ( wilting_point == 9999999.9_wp ) THEN |
---|
1996 | wilting_point = m_soil_pars(2,soil_type) |
---|
1997 | ENDIF |
---|
1998 | |
---|
1999 | IF ( residual_moisture == 9999999.9_wp ) THEN |
---|
2000 | residual_moisture = m_soil_pars(3,soil_type) |
---|
2001 | ENDIF |
---|
2002 | |
---|
2003 | ENDIF |
---|
2004 | |
---|
2005 | ! |
---|
2006 | !-- Map values to the respective 2D arrays |
---|
2007 | !-- Horizontal surfaces |
---|
2008 | surf_lsm_h%alpha_vg = alpha_vangenuchten |
---|
2009 | surf_lsm_h%l_vg = l_vangenuchten |
---|
2010 | surf_lsm_h%n_vg = n_vangenuchten |
---|
2011 | surf_lsm_h%gamma_w_sat = hydraulic_conductivity |
---|
2012 | surf_lsm_h%m_sat = saturation_moisture |
---|
2013 | surf_lsm_h%m_fc = field_capacity |
---|
2014 | surf_lsm_h%m_wilt = wilting_point |
---|
2015 | surf_lsm_h%m_res = residual_moisture |
---|
2016 | surf_lsm_h%r_soil_min = min_soil_resistance |
---|
2017 | ! |
---|
2018 | !-- Vertical surfaces |
---|
2019 | DO l = 0, 3 |
---|
2020 | surf_lsm_v(l)%alpha_vg = alpha_vangenuchten |
---|
2021 | surf_lsm_v(l)%l_vg = l_vangenuchten |
---|
2022 | surf_lsm_v(l)%n_vg = n_vangenuchten |
---|
2023 | surf_lsm_v(l)%gamma_w_sat = hydraulic_conductivity |
---|
2024 | surf_lsm_v(l)%m_sat = saturation_moisture |
---|
2025 | surf_lsm_v(l)%m_fc = field_capacity |
---|
2026 | surf_lsm_v(l)%m_wilt = wilting_point |
---|
2027 | surf_lsm_v(l)%m_res = residual_moisture |
---|
2028 | surf_lsm_v(l)%r_soil_min = min_soil_resistance |
---|
2029 | ENDDO |
---|
2030 | |
---|
2031 | |
---|
2032 | |
---|
2033 | ! |
---|
2034 | !-- Initial run actions |
---|
2035 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN |
---|
2036 | ! |
---|
2037 | !-- First, for horizontal surfaces |
---|
2038 | t_soil_h%var_2d = 0.0_wp |
---|
2039 | m_soil_h%var_2d = 0.0_wp |
---|
2040 | m_liq_eb_h%var_1d = 0.0_wp |
---|
2041 | |
---|
2042 | ! |
---|
2043 | !-- Map user settings of T and q for each soil layer |
---|
2044 | !-- (make sure that the soil moisture does not drop below the permanent |
---|
2045 | !-- wilting point) -> problems with devision by zero) |
---|
2046 | DO k = nzb_soil, nzt_soil |
---|
2047 | t_soil_h%var_2d(k,:) = soil_temperature(k) |
---|
2048 | m_soil_h%var_2d(k,:) = MAX(soil_moisture(k),surf_lsm_h%m_wilt(:)) |
---|
2049 | soil_moisture(k) = MAX(soil_moisture(k),wilting_point) |
---|
2050 | ENDDO |
---|
2051 | t_soil_h%var_2d(nzt_soil+1,:) = soil_temperature(nzt_soil+1) |
---|
2052 | |
---|
2053 | ! |
---|
2054 | !-- Calculate surface temperature |
---|
2055 | t_surface_h%var_1d(:) = pt_surface * exn |
---|
2056 | surf_lsm_h%pt_surface(:) = pt_surface |
---|
2057 | |
---|
2058 | ! |
---|
2059 | !-- Set artifical values for ts and us so that r_a has its initial value |
---|
2060 | !-- for the first time step. Only for interior core domain, not for ghost points |
---|
2061 | DO m = 1, surf_lsm_h%ns |
---|
2062 | i = surf_lsm_h%i(m) |
---|
2063 | j = surf_lsm_h%j(m) |
---|
2064 | k = surf_lsm_h%k(m) |
---|
2065 | |
---|
2066 | IF ( cloud_physics ) THEN |
---|
2067 | pt1 = pt(k,j,i) + l_d_cp * pt_d_t(k) * ql(k,j,i) |
---|
2068 | ELSE |
---|
2069 | pt1 = pt(k,j,i) |
---|
2070 | ENDIF |
---|
2071 | |
---|
2072 | ! |
---|
2073 | !-- Assure that r_a cannot be zero at model start |
---|
2074 | IF ( pt1 == surf_lsm_h%pt_surface(m) ) pt1 = pt1 + 1.0E-10_wp |
---|
2075 | |
---|
2076 | surf_lsm_h%us(m) = 0.1_wp |
---|
2077 | surf_lsm_h%ts(m) = ( pt1 - surf_lsm_h%pt_surface(m) ) / surf_lsm_h%r_a(m) |
---|
2078 | surf_lsm_h%shf(m) = - surf_lsm_h%us(m) * surf_lsm_h%ts(m) |
---|
2079 | ENDDO |
---|
2080 | ! |
---|
2081 | !-- Vertical surfaces |
---|
2082 | DO l = 0, 3 |
---|
2083 | |
---|
2084 | t_soil_v(l)%var_2d = 0.0_wp |
---|
2085 | m_soil_v(l)%var_2d = 0.0_wp |
---|
2086 | m_liq_eb_v(l)%var_1d = 0.0_wp |
---|
2087 | |
---|
2088 | ! |
---|
2089 | !-- Map user settings of T and q for each soil layer |
---|
2090 | !-- (make sure that the soil moisture does not drop below the permanent |
---|
2091 | !-- wilting point) -> problems with devision by zero) |
---|
2092 | DO k = nzb_soil, nzt_soil |
---|
2093 | t_soil_v(l)%var_2d(k,:) = soil_temperature(k) |
---|
2094 | m_soil_v(l)%var_2d(k,:) = MAX(soil_moisture(k),surf_lsm_v(l)%m_wilt(:)) |
---|
2095 | soil_moisture(k) = MAX(soil_moisture(k),wilting_point) |
---|
2096 | ENDDO |
---|
2097 | t_soil_v(l)%var_2d(nzt_soil+1,:) = soil_temperature(nzt_soil+1) |
---|
2098 | |
---|
2099 | ! |
---|
2100 | !-- Calculate surface temperature |
---|
2101 | t_surface_v(l)%var_1d(:) = pt_surface * exn |
---|
2102 | surf_lsm_h%pt_surface(:) = pt_surface |
---|
2103 | |
---|
2104 | ! |
---|
2105 | !-- Set artifical values for ts and us so that r_a has its initial value |
---|
2106 | !-- for the first time step. Only for interior core domain, not for ghost points |
---|
2107 | DO m = 1, surf_lsm_v(l)%ns |
---|
2108 | i = surf_lsm_v(l)%i(m) |
---|
2109 | j = surf_lsm_v(l)%j(m) |
---|
2110 | k = surf_lsm_v(l)%k(m) |
---|
2111 | |
---|
2112 | IF ( cloud_physics ) THEN |
---|
2113 | pt1 = pt(k,j,i) + l_d_cp * pt_d_t(k) * ql(k,j,i) |
---|
2114 | ELSE |
---|
2115 | pt1 = pt(k,j,i) |
---|
2116 | ENDIF |
---|
2117 | |
---|
2118 | ! |
---|
2119 | !-- Assure that r_a cannot be zero at model start |
---|
2120 | IF ( pt1 == surf_lsm_h%pt_surface(m) ) pt1 = pt1 + 1.0E-10_wp |
---|
2121 | |
---|
2122 | surf_lsm_v(l)%us(m) = 0.1_wp |
---|
2123 | surf_lsm_v(l)%ts(m) = ( pt1 - surf_lsm_h%pt_surface(m) ) / surf_lsm_v(l)%r_a(m) |
---|
2124 | surf_lsm_v(l)%shf(m) = - surf_lsm_v(l)%us(m) * surf_lsm_v(l)%ts(m) |
---|
2125 | ENDDO |
---|
2126 | ENDDO |
---|
2127 | |
---|
2128 | ! |
---|
2129 | !-- Actions for restart runs |
---|
2130 | ELSE |
---|
2131 | ! |
---|
2132 | !-- Horizontal surfaces |
---|
2133 | DO m = 1, surf_lsm_h%ns |
---|
2134 | i = surf_lsm_h%i(m) |
---|
2135 | j = surf_lsm_h%j(m) |
---|
2136 | k = surf_lsm_h%k(m) |
---|
2137 | t_surface_h%var_1d(m) = pt(k-1,j,i) * exn |
---|
2138 | ENDDO |
---|
2139 | ! |
---|
2140 | !-- Vertical surfaces |
---|
2141 | DO l = 0, 3 |
---|
2142 | ! |
---|
2143 | !-- Set index offset of surface element, seen from atmospheric grid point |
---|
2144 | IF ( l == 0 ) THEN |
---|
2145 | j_off = -1 |
---|
2146 | i_off = 0 |
---|
2147 | ELSEIF ( l == 1 ) THEN |
---|
2148 | j_off = 1 |
---|
2149 | i_off = 0 |
---|
2150 | ELSEIF ( l == 2 ) THEN |
---|
2151 | j_off = 0 |
---|
2152 | i_off = -1 |
---|
2153 | ELSEIF ( l == 3 ) THEN |
---|
2154 | j_off = 0 |
---|
2155 | i_off = 1 |
---|
2156 | ENDIF |
---|
2157 | DO m = 1, surf_lsm_v(l)%ns |
---|
2158 | i = surf_lsm_v(l)%i(m) |
---|
2159 | j = surf_lsm_v(l)%j(m) |
---|
2160 | k = surf_lsm_v(l)%k(m) |
---|
2161 | t_surface_v(l)%var_1d(m) = pt(k,j+j_off,i+i_off) * exn |
---|
2162 | ENDDO |
---|
2163 | ENDDO |
---|
2164 | |
---|
2165 | ENDIF |
---|
2166 | ! |
---|
2167 | !-- Initialize root fraction |
---|
2168 | !-- Horizontal surfaces |
---|
2169 | DO m = 1, surf_lsm_h%ns |
---|
2170 | i = surf_lsm_h%i(m) |
---|
2171 | j = surf_lsm_h%j(m) |
---|
2172 | |
---|
2173 | DO k = nzb_soil, nzt_soil |
---|
2174 | surf_lsm_h%root_fr(k,m) = root_fraction(k) |
---|
2175 | ENDDO |
---|
2176 | ENDDO |
---|
2177 | ! |
---|
2178 | !-- Vertical surfaces |
---|
2179 | DO l = 0, 3 |
---|
2180 | DO m = 1, surf_lsm_v(l)%ns |
---|
2181 | i = surf_lsm_v(l)%i(m) |
---|
2182 | j = surf_lsm_v(l)%j(m) |
---|
2183 | |
---|
2184 | DO k = nzb_soil, nzt_soil |
---|
2185 | surf_lsm_v(l)%root_fr(k,m) = root_fraction(k) |
---|
2186 | ENDDO |
---|
2187 | ENDDO |
---|
2188 | ENDDO |
---|
2189 | |
---|
2190 | IF ( veg_type /= 0 ) THEN |
---|
2191 | IF ( min_canopy_resistance == 9999999.9_wp ) THEN |
---|
2192 | min_canopy_resistance = veg_pars(0,veg_type) |
---|
2193 | ENDIF |
---|
2194 | IF ( leaf_area_index == 9999999.9_wp ) THEN |
---|
2195 | leaf_area_index = veg_pars(1,veg_type) |
---|
2196 | ENDIF |
---|
2197 | IF ( vegetation_coverage == 9999999.9_wp ) THEN |
---|
2198 | vegetation_coverage = veg_pars(2,veg_type) |
---|
2199 | ENDIF |
---|
2200 | IF ( canopy_resistance_coefficient == 9999999.9_wp ) THEN |
---|
2201 | canopy_resistance_coefficient= veg_pars(3,veg_type) |
---|
2202 | ENDIF |
---|
2203 | IF ( lambda_surface_stable == 9999999.9_wp ) THEN |
---|
2204 | lambda_surface_stable = surface_pars(0,veg_type) |
---|
2205 | ENDIF |
---|
2206 | IF ( lambda_surface_unstable == 9999999.9_wp ) THEN |
---|
2207 | lambda_surface_unstable = surface_pars(1,veg_type) |
---|
2208 | ENDIF |
---|
2209 | IF ( f_shortwave_incoming == 9999999.9_wp ) THEN |
---|
2210 | f_shortwave_incoming = surface_pars(2,veg_type) |
---|
2211 | ENDIF |
---|
2212 | IF ( z0_eb == 9999999.9_wp ) THEN |
---|
2213 | roughness_length = roughness_par(0,veg_type) |
---|
2214 | z0_eb = roughness_par(0,veg_type) |
---|
2215 | ENDIF |
---|
2216 | IF ( z0h_eb == 9999999.9_wp ) THEN |
---|
2217 | z0h_eb = roughness_par(1,veg_type) |
---|
2218 | ENDIF |
---|
2219 | IF ( z0q_eb == 9999999.9_wp ) THEN |
---|
2220 | z0q_eb = roughness_par(2,veg_type) |
---|
2221 | ENDIF |
---|
2222 | z0h_factor = z0h_eb / ( z0_eb + 1.0E-20_wp ) |
---|
2223 | |
---|
2224 | IF ( ALL( root_fraction == 9999999.9_wp ) ) THEN |
---|
2225 | DO m = 1, surf_lsm_h%ns |
---|
2226 | i = surf_lsm_h%i(m) |
---|
2227 | j = surf_lsm_h%j(m) |
---|
2228 | |
---|
2229 | |
---|
2230 | DO k = nzb_soil, nzt_soil |
---|
2231 | surf_lsm_h%root_fr(k,m) = root_distribution(k,veg_type) |
---|
2232 | root_fraction(k) = root_distribution(k,veg_type) |
---|
2233 | ENDDO |
---|
2234 | ENDDO |
---|
2235 | DO l = 0, 3 |
---|
2236 | DO m = 1, surf_lsm_v(l)%ns |
---|
2237 | i = surf_lsm_v(l)%i(m) |
---|
2238 | j = surf_lsm_v(l)%j(m) |
---|
2239 | |
---|
2240 | DO k = nzb_soil, nzt_soil |
---|
2241 | surf_lsm_v(l)%root_fr(k,m) = root_distribution(k,veg_type) |
---|
2242 | root_fraction(k) = root_distribution(k,veg_type) |
---|
2243 | ENDDO |
---|
2244 | ENDDO |
---|
2245 | ENDDO |
---|
2246 | ENDIF |
---|
2247 | |
---|
2248 | ELSE |
---|
2249 | |
---|
2250 | IF ( z0_eb == 9999999.9_wp ) THEN |
---|
2251 | z0_eb = roughness_length |
---|
2252 | ENDIF |
---|
2253 | IF ( z0h_eb == 9999999.9_wp ) THEN |
---|
2254 | z0h_eb = z0_eb * z0h_factor |
---|
2255 | ENDIF |
---|
2256 | IF ( z0q_eb == 9999999.9_wp ) THEN |
---|
2257 | z0q_eb = z0_eb * z0h_factor |
---|
2258 | ENDIF |
---|
2259 | |
---|
2260 | ENDIF |
---|
2261 | |
---|
2262 | ! |
---|
2263 | !-- For surfaces covered with pavement, set depth of the pavement (with dry |
---|
2264 | !-- soil below). The depth must be greater than the first soil layer depth |
---|
2265 | IF ( veg_type == 20 ) THEN |
---|
2266 | IF ( pave_depth == 9999999.9_wp ) THEN |
---|
2267 | pave_depth = zs(nzb_soil) |
---|
2268 | ELSE |
---|
2269 | pave_depth = MAX( zs(nzb_soil), pave_depth ) |
---|
2270 | ENDIF |
---|
2271 | ENDIF |
---|
2272 | |
---|
2273 | ! |
---|
2274 | !-- Map vegetation and soil types to 2D array to allow for heterogeneous |
---|
2275 | !-- surfaces via user interface see below |
---|
2276 | !-- First for horizontal surfaces |
---|
2277 | surf_lsm_h%veg_type_2d = veg_type |
---|
2278 | surf_lsm_h%soil_type_2d = soil_type |
---|
2279 | |
---|
2280 | ! |
---|
2281 | !-- Map vegetation parameters to the respective 2D arrays |
---|
2282 | surf_lsm_h%r_canopy_min = min_canopy_resistance |
---|
2283 | surf_lsm_h%lai = leaf_area_index |
---|
2284 | surf_lsm_h%c_veg = vegetation_coverage |
---|
2285 | surf_lsm_h%g_d = canopy_resistance_coefficient |
---|
2286 | surf_lsm_h%lambda_surface_s = lambda_surface_stable |
---|
2287 | surf_lsm_h%lambda_surface_u = lambda_surface_unstable |
---|
2288 | surf_lsm_h%f_sw_in = f_shortwave_incoming |
---|
2289 | surf_lsm_h%z0 = z0_eb |
---|
2290 | surf_lsm_h%z0h = z0h_eb |
---|
2291 | surf_lsm_h%z0q = z0q_eb |
---|
2292 | |
---|
2293 | !-- Vertical surfaces |
---|
2294 | DO l = 0, 3 |
---|
2295 | surf_lsm_v(l)%veg_type_2d = veg_type |
---|
2296 | surf_lsm_v(l)%soil_type_2d = soil_type |
---|
2297 | |
---|
2298 | ! |
---|
2299 | !-- Map vegetation parameters to the respective 2D arrays |
---|
2300 | surf_lsm_v(l)%r_canopy_min = min_canopy_resistance |
---|
2301 | surf_lsm_v(l)%lai = leaf_area_index |
---|
2302 | surf_lsm_v(l)%c_veg = vegetation_coverage |
---|
2303 | surf_lsm_v(l)%g_d = canopy_resistance_coefficient |
---|
2304 | surf_lsm_v(l)%lambda_surface_s = lambda_surface_stable |
---|
2305 | surf_lsm_v(l)%lambda_surface_u = lambda_surface_unstable |
---|
2306 | surf_lsm_v(l)%f_sw_in = f_shortwave_incoming |
---|
2307 | surf_lsm_v(l)%z0 = z0_eb |
---|
2308 | surf_lsm_v(l)%z0h = z0h_eb |
---|
2309 | surf_lsm_v(l)%z0q = z0q_eb |
---|
2310 | ENDDO |
---|
2311 | |
---|
2312 | ! |
---|
2313 | !-- Possibly do user-defined actions (e.g. define heterogeneous land surface) |
---|
2314 | CALL user_init_land_surface |
---|
2315 | |
---|
2316 | ! |
---|
2317 | !-- Set flag parameter if vegetation type was set to a water surface. Also |
---|
2318 | !-- set temperature to a constant value in all "soil" layers. |
---|
2319 | !-- For now, do not set water surface for vertical surfaces |
---|
2320 | DO m = 1, surf_lsm_h%ns |
---|
2321 | i = surf_lsm_h%i(m) |
---|
2322 | j = surf_lsm_h%j(m) |
---|
2323 | |
---|
2324 | IF ( surf_lsm_h%veg_type_2d(m) == 14 .OR. & |
---|
2325 | surf_lsm_h%veg_type_2d(m) == 15 ) THEN |
---|
2326 | surf_lsm_h%water_surface(m) = .TRUE. |
---|
2327 | t_soil_h%var_2d(:,m) = t_surface_h%var_1d(m) |
---|
2328 | ELSEIF ( surf_lsm_h%veg_type_2d(m) == 20 ) THEN |
---|
2329 | surf_lsm_h%pave_surface(m) = .TRUE. |
---|
2330 | m_soil_h%var_2d(:,m) = 0.0_wp |
---|
2331 | ENDIF |
---|
2332 | |
---|
2333 | ENDDO |
---|
2334 | |
---|
2335 | ! |
---|
2336 | !-- Calculate new roughness lengths (for water surfaces only, i.e. only |
---|
2337 | !- horizontal surfaces) |
---|
2338 | CALL calc_z0_water_surface |
---|
2339 | |
---|
2340 | t_soil_h_p = t_soil_h |
---|
2341 | m_soil_h_p = m_soil_h |
---|
2342 | m_liq_eb_h_p = m_liq_eb_h |
---|
2343 | t_surface_h_p = t_surface_h |
---|
2344 | |
---|
2345 | t_soil_v_p = t_soil_v |
---|
2346 | m_soil_v_p = m_soil_v |
---|
2347 | m_liq_eb_v_p = m_liq_eb_v |
---|
2348 | t_surface_v_p = t_surface_v |
---|
2349 | |
---|
2350 | |
---|
2351 | |
---|
2352 | !-- Store initial profiles of t_soil and m_soil (assuming they are |
---|
2353 | !-- horizontally homogeneous on this PE) |
---|
2354 | hom(nzb_soil:nzt_soil,1,90,:) = SPREAD( t_soil_h%var_2d(nzb_soil:nzt_soil,1), & |
---|
2355 | 2, statistic_regions+1 ) |
---|
2356 | hom(nzb_soil:nzt_soil,1,92,:) = SPREAD( m_soil_h%var_2d(nzb_soil:nzt_soil,1), & |
---|
2357 | 2, statistic_regions+1 ) |
---|
2358 | |
---|
2359 | END SUBROUTINE lsm_init |
---|
2360 | |
---|
2361 | |
---|
2362 | !------------------------------------------------------------------------------! |
---|
2363 | ! Description: |
---|
2364 | ! ------------ |
---|
2365 | !> Allocate land surface model arrays and define pointers |
---|
2366 | !------------------------------------------------------------------------------! |
---|
2367 | SUBROUTINE lsm_init_arrays |
---|
2368 | |
---|
2369 | |
---|
2370 | IMPLICIT NONE |
---|
2371 | |
---|
2372 | INTEGER(iwp) :: l !< index indicating facing of surface array |
---|
2373 | |
---|
2374 | ! |
---|
2375 | !-- Allocate global 1D arrays |
---|
2376 | ALLOCATE ( ddz_soil(nzb_soil:nzt_soil+1) ) |
---|
2377 | ALLOCATE ( ddz_soil_stag(nzb_soil:nzt_soil) ) |
---|
2378 | ALLOCATE ( dz_soil(nzb_soil:nzt_soil+1) ) |
---|
2379 | ALLOCATE ( dz_soil_stag(nzb_soil:nzt_soil) ) |
---|
2380 | ALLOCATE ( root_extr(nzb_soil:nzt_soil) ) |
---|
2381 | |
---|
2382 | root_extr = 0.0_wp |
---|
2383 | |
---|
2384 | ! |
---|
2385 | !-- Allocate surface and soil temperature / humidity. Please note, |
---|
2386 | !-- these arrays are allocated according to surface-data structure, |
---|
2387 | !-- even if they do not belong to the data type due to the |
---|
2388 | !-- pointer arithmetric (TARGET attribute is not allowed in a data-type). |
---|
2389 | #if defined( __nopointer ) |
---|
2390 | ! |
---|
2391 | !-- Horizontal surfaces |
---|
2392 | ALLOCATE ( m_liq_eb_h%var_1d(1:surf_lsm_h%ns) ) |
---|
2393 | ALLOCATE ( m_liq_eb_h_p%var_1d(1:surf_lsm_h%ns) ) |
---|
2394 | ALLOCATE ( t_surface_h%var_1d(1:surf_lsm_h%ns) ) |
---|
2395 | ALLOCATE ( t_surface_h_p%var_1d(1:surf_lsm_h%ns) ) |
---|
2396 | ALLOCATE ( m_soil_h%var_2d(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
2397 | ALLOCATE ( m_soil_h_p%var_2d(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
2398 | ALLOCATE ( t_soil_h%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_h%ns) ) |
---|
2399 | ALLOCATE ( t_soil_h_p%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_h%ns) ) |
---|
2400 | ! |
---|
2401 | !-- Vertical surfaces |
---|
2402 | DO l = 0, 3 |
---|
2403 | ALLOCATE ( m_liq_eb_v(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2404 | ALLOCATE ( m_liq_eb_v(l)_p%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2405 | ALLOCATE ( t_surface_v(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2406 | ALLOCATE ( t_surface_v(l)_p%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2407 | ALLOCATE ( m_soil_v(l)%var_2d(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
2408 | ALLOCATE ( m_soil_v(l)_p%var_2d(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
2409 | ALLOCATE ( t_soil_v(l)%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_v(l)%ns) ) |
---|
2410 | ALLOCATE ( t_soil_v(l)_p%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_v(l)%ns) ) |
---|
2411 | ENDDO |
---|
2412 | #else |
---|
2413 | ! |
---|
2414 | !-- Horizontal surfaces |
---|
2415 | ALLOCATE ( m_liq_eb_h_1%var_1d(1:surf_lsm_h%ns) ) |
---|
2416 | ALLOCATE ( m_liq_eb_h_2%var_1d(1:surf_lsm_h%ns) ) |
---|
2417 | ALLOCATE ( t_surface_h_1%var_1d(1:surf_lsm_h%ns) ) |
---|
2418 | ALLOCATE ( t_surface_h_2%var_1d(1:surf_lsm_h%ns) ) |
---|
2419 | ALLOCATE ( m_soil_h_1%var_2d(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
2420 | ALLOCATE ( m_soil_h_2%var_2d(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
2421 | ALLOCATE ( t_soil_h_1%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_h%ns) ) |
---|
2422 | ALLOCATE ( t_soil_h_2%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_h%ns) ) |
---|
2423 | ! |
---|
2424 | !-- Vertical surfaces |
---|
2425 | DO l = 0, 3 |
---|
2426 | ALLOCATE ( m_liq_eb_v_1(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2427 | ALLOCATE ( m_liq_eb_v_2(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2428 | ALLOCATE ( t_surface_v_1(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2429 | ALLOCATE ( t_surface_v_2(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2430 | ALLOCATE ( m_soil_v_1(l)%var_2d(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
2431 | ALLOCATE ( m_soil_v_2(l)%var_2d(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
2432 | ALLOCATE ( t_soil_v_1(l)%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_v(l)%ns) ) |
---|
2433 | ALLOCATE ( t_soil_v_2(l)%var_2d(nzb_soil:nzt_soil+1,1:surf_lsm_v(l)%ns) ) |
---|
2434 | ENDDO |
---|
2435 | #endif |
---|
2436 | |
---|
2437 | ! |
---|
2438 | !-- Allocate intermediate timestep arrays |
---|
2439 | !-- Horizontal surfaces |
---|
2440 | ALLOCATE ( tm_liq_eb_h_m%var_1d(1:surf_lsm_h%ns) ) |
---|
2441 | ALLOCATE ( tt_surface_h_m%var_1d(1:surf_lsm_h%ns) ) |
---|
2442 | ALLOCATE ( tm_soil_h_m%var_2d(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
2443 | ALLOCATE ( tt_soil_h_m%var_2d(nzb_soil:nzt_soil,1:surf_lsm_h%ns) ) |
---|
2444 | ! |
---|
2445 | !-- Horizontal surfaces |
---|
2446 | DO l = 0, 3 |
---|
2447 | ALLOCATE ( tm_liq_eb_v_m(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2448 | ALLOCATE ( tt_surface_v_m(l)%var_1d(1:surf_lsm_v(l)%ns) ) |
---|
2449 | ALLOCATE ( tm_soil_v_m(l)%var_2d(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
2450 | ALLOCATE ( tt_soil_v_m(l)%var_2d(nzb_soil:nzt_soil,1:surf_lsm_v(l)%ns) ) |
---|
2451 | ENDDO |
---|
2452 | ! |
---|
2453 | !-- Allocate skin-surface temperature |
---|
2454 | ALLOCATE ( surf_lsm_h%pt_surface(1:surf_lsm_h%ns) ) |
---|
2455 | DO l = 0, 3 |
---|
2456 | ALLOCATE ( surf_lsm_v(l)%pt_surface(1:surf_lsm_v(l)%ns) ) |
---|
2457 | ENDDO |
---|
2458 | |
---|
2459 | ! |
---|
2460 | !-- Allocate 2D vegetation model arrays |
---|
2461 | !-- Horizontal surfaces |
---|
2462 | ALLOCATE ( surf_lsm_h%alpha_vg(1:surf_lsm_h%ns) ) |
---|
2463 | ALLOCATE ( surf_lsm_h%building_surface(1:surf_lsm_h%ns) ) |
---|
2464 | ALLOCATE ( surf_lsm_h%c_liq(1:surf_lsm_h%ns) ) |
---|
2465 | ALLOCATE ( surf_lsm_h%c_veg(1:surf_lsm_h%ns) ) |
---|
2466 | ALLOCATE ( surf_lsm_h%f_sw_in(1:surf_lsm_h%ns) ) |
---|
2467 | ALLOCATE ( surf_lsm_h%ghf_eb(1:surf_lsm_h%ns) ) |
---|
2468 | ALLOCATE ( surf_lsm_h%gamma_w_sat(1:surf_lsm_h%ns) ) |
---|
2469 | ALLOCATE ( surf_lsm_h%g_d(1:surf_lsm_h%ns) ) |
---|
2470 | ALLOCATE ( surf_lsm_h%lai(1:surf_lsm_h%ns) ) |
---|
2471 | ALLOCATE ( surf_lsm_h%l_vg(1:surf_lsm_h%ns) ) |
---|
2472 | ALLOCATE ( surf_lsm_h%lambda_surface_u(1:surf_lsm_h%ns) ) |
---|
2473 | ALLOCATE ( surf_lsm_h%lambda_surface_s(1:surf_lsm_h%ns) ) |
---|
2474 | ALLOCATE ( surf_lsm_h%m_fc(1:surf_lsm_h%ns) ) |
---|
2475 | ALLOCATE ( surf_lsm_h%m_res(1:surf_lsm_h%ns) ) |
---|
2476 | ALLOCATE ( surf_lsm_h%m_sat(1:surf_lsm_h%ns) ) |
---|
2477 | ALLOCATE ( surf_lsm_h%m_wilt(1:surf_lsm_h%ns) ) |
---|
2478 | ALLOCATE ( surf_lsm_h%n_vg(1:surf_lsm_h%ns) ) |
---|
2479 | ALLOCATE ( surf_lsm_h%pave_surface(1:surf_lsm_h%ns) ) |
---|
2480 | ALLOCATE ( surf_lsm_h%qsws_eb(1:surf_lsm_h%ns) ) |
---|
2481 | ALLOCATE ( surf_lsm_h%qsws_soil_eb(1:surf_lsm_h%ns) ) |
---|
2482 | ALLOCATE ( surf_lsm_h%qsws_liq_eb(1:surf_lsm_h%ns) ) |
---|
2483 | ALLOCATE ( surf_lsm_h%qsws_veg_eb(1:surf_lsm_h%ns) ) |
---|
2484 | ALLOCATE ( surf_lsm_h%rad_net_l(1:surf_lsm_h%ns) ) |
---|
2485 | ALLOCATE ( surf_lsm_h%r_a(1:surf_lsm_h%ns) ) |
---|
2486 | ALLOCATE ( surf_lsm_h%r_canopy(1:surf_lsm_h%ns) ) |
---|
2487 | ALLOCATE ( surf_lsm_h%r_soil(1:surf_lsm_h%ns) ) |
---|
2488 | ALLOCATE ( surf_lsm_h%r_soil_min(1:surf_lsm_h%ns) ) |
---|
2489 | ALLOCATE ( surf_lsm_h%r_s(1:surf_lsm_h%ns) ) |
---|
2490 | ALLOCATE ( surf_lsm_h%r_canopy_min(1:surf_lsm_h%ns) ) |
---|
2491 | ALLOCATE ( surf_lsm_h%shf_eb(1:surf_lsm_h%ns) ) |
---|
2492 | ALLOCATE ( surf_lsm_h%soil_type_2d(1:surf_lsm_h%ns) ) |
---|
2493 | ALLOCATE ( surf_lsm_h%veg_type_2d(1:surf_lsm_h%ns) ) |
---|
2494 | ALLOCATE ( surf_lsm_h%water_surface(1:surf_lsm_h%ns) ) |
---|
2495 | |
---|
2496 | surf_lsm_h%water_surface = .FALSE. |
---|
2497 | surf_lsm_h%pave_surface = .FALSE. |
---|
2498 | ! |
---|
2499 | !-- Vertical surfaces |
---|
2500 | DO l = 0, 3 |
---|
2501 | ALLOCATE ( surf_lsm_v(l)%alpha_vg(1:surf_lsm_v(l)%ns) ) |
---|
2502 | ALLOCATE ( surf_lsm_v(l)%building_surface(1:surf_lsm_v(l)%ns) ) |
---|
2503 | ALLOCATE ( surf_lsm_v(l)%c_liq(1:surf_lsm_v(l)%ns) ) |
---|
2504 | ALLOCATE ( surf_lsm_v(l)%c_veg(1:surf_lsm_v(l)%ns) ) |
---|
2505 | ALLOCATE ( surf_lsm_v(l)%f_sw_in(1:surf_lsm_v(l)%ns) ) |
---|
2506 | ALLOCATE ( surf_lsm_v(l)%ghf_eb(1:surf_lsm_v(l)%ns) ) |
---|
2507 | ALLOCATE ( surf_lsm_v(l)%gamma_w_sat(1:surf_lsm_v(l)%ns) ) |
---|
2508 | ALLOCATE ( surf_lsm_v(l)%g_d(1:surf_lsm_v(l)%ns) ) |
---|
2509 | ALLOCATE ( surf_lsm_v(l)%lai(1:surf_lsm_v(l)%ns) ) |
---|
2510 | ALLOCATE ( surf_lsm_v(l)%l_vg(1:surf_lsm_v(l)%ns) ) |
---|
2511 | ALLOCATE ( surf_lsm_v(l)%lambda_surface_u(1:surf_lsm_v(l)%ns) ) |
---|
2512 | ALLOCATE ( surf_lsm_v(l)%lambda_surface_s(1:surf_lsm_v(l)%ns) ) |
---|
2513 | ALLOCATE ( surf_lsm_v(l)%m_fc(1:surf_lsm_v(l)%ns) ) |
---|
2514 | ALLOCATE ( surf_lsm_v(l)%m_res(1:surf_lsm_v(l)%ns) ) |
---|
2515 | ALLOCATE ( surf_lsm_v(l)%m_sat(1:surf_lsm_v(l)%ns) ) |
---|
2516 | ALLOCATE ( surf_lsm_v(l)%m_wilt(1:surf_lsm_v(l)%ns) ) |
---|
2517 | ALLOCATE ( surf_lsm_v(l)%n_vg(1:surf_lsm_v(l)%ns) ) |
---|
2518 | ALLOCATE ( surf_lsm_v(l)%pave_surface(1:surf_lsm_v(l)%ns) ) |
---|
2519 | ALLOCATE ( surf_lsm_v(l)%qsws_eb(1:surf_lsm_v(l)%ns) ) |
---|
2520 | ALLOCATE ( surf_lsm_v(l)%qsws_soil_eb(1:surf_lsm_v(l)%ns) ) |
---|
2521 | ALLOCATE ( surf_lsm_v(l)%qsws_liq_eb(1:surf_lsm_v(l)%ns) ) |
---|
2522 | ALLOCATE ( surf_lsm_v(l)%qsws_veg_eb(1:surf_lsm_v(l)%ns) ) |
---|
2523 | ALLOCATE ( surf_lsm_v(l)%rad_net_l(1:surf_lsm_v(l)%ns) ) |
---|
2524 | ALLOCATE ( surf_lsm_v(l)%r_a(1:surf_lsm_v(l)%ns) ) |
---|
2525 | ALLOCATE ( surf_lsm_v(l)%r_canopy(1:surf_lsm_v(l)%ns) ) |
---|
2526 | ALLOCATE ( surf_lsm_v(l)%r_soil(1:surf_lsm_v(l)%ns) ) |
---|
2527 | ALLOCATE ( surf_lsm_v(l)%r_soil_min(1:surf_lsm_v(l)%ns) ) |
---|
2528 | ALLOCATE ( surf_lsm_v(l)%r_s(1:surf_lsm_v(l)%ns) ) |
---|
2529 | ALLOCATE ( surf_lsm_v(l)%r_canopy_min(1:surf_lsm_v(l)%ns) ) |
---|
2530 | ALLOCATE ( surf_lsm_v(l)%shf_eb(1:surf_lsm_v(l)%ns) ) |
---|
2531 | ALLOCATE ( surf_lsm_v(l)%soil_type_2d(1:surf_lsm_v(l)%ns) ) |
---|
2532 | ALLOCATE ( surf_lsm_v(l)%veg_type_2d(1:surf_lsm_v(l)%ns) ) |
---|
2533 | ALLOCATE ( surf_lsm_v(l)%water_surface(1:surf_lsm_v(l)%ns) ) |
---|
2534 | |
---|
2535 | surf_lsm_v(l)%water_surface = .FALSE. |
---|
2536 | surf_lsm_v(l)%pave_surface = .FALSE. |
---|
2537 | ENDDO |
---|
2538 | |
---|
2539 | #if ! defined( __nopointer ) |
---|
2540 | ! |
---|
2541 | !-- Initial assignment of the pointers |
---|
2542 | !-- Horizontal surfaces |
---|
2543 | t_soil_h => t_soil_h_1; t_soil_h_p => t_soil_h_2 |
---|
2544 | t_surface_h => t_surface_h_1; t_surface_h_p => t_surface_h_2 |
---|
2545 | m_soil_h => m_soil_h_1; m_soil_h_p => m_soil_h_2 |
---|
2546 | m_liq_eb_h => m_liq_eb_h_1; m_liq_eb_h_p => m_liq_eb_h_2 |
---|
2547 | ! |
---|
2548 | !-- Vertical surfaces |
---|
2549 | t_soil_v => t_soil_v_1; t_soil_v_p => t_soil_v_2 |
---|
2550 | t_surface_v => t_surface_v_1; t_surface_v_p => t_surface_v_2 |
---|
2551 | m_soil_v => m_soil_v_1; m_soil_v_p => m_soil_v_2 |
---|
2552 | m_liq_eb_v => m_liq_eb_v_1; m_liq_eb_v_p => m_liq_eb_v_2 |
---|
2553 | #endif |
---|
2554 | |
---|
2555 | |
---|
2556 | END SUBROUTINE lsm_init_arrays |
---|
2557 | |
---|
2558 | |
---|
2559 | !------------------------------------------------------------------------------! |
---|
2560 | ! Description: |
---|
2561 | ! ------------ |
---|
2562 | !> Parin for &lsmpar for land surface model |
---|
2563 | !------------------------------------------------------------------------------! |
---|
2564 | SUBROUTINE lsm_parin |
---|
2565 | |
---|
2566 | |
---|
2567 | IMPLICIT NONE |
---|
2568 | |
---|
2569 | CHARACTER (LEN=80) :: line !< dummy string that contains the current line of the parameter file |
---|
2570 | |
---|
2571 | NAMELIST /lsm_par/ alpha_vangenuchten, c_surface, & |
---|
2572 | canopy_resistance_coefficient, & |
---|
2573 | conserve_water_content, & |
---|
2574 | f_shortwave_incoming, field_capacity, & |
---|
2575 | aero_resist_kray, hydraulic_conductivity, & |
---|
2576 | lambda_surface_stable, & |
---|
2577 | lambda_surface_unstable, leaf_area_index, & |
---|
2578 | l_vangenuchten, min_canopy_resistance, & |
---|
2579 | min_soil_resistance, n_vangenuchten, & |
---|
2580 | pave_depth, pave_heat_capacity, & |
---|
2581 | pave_heat_conductivity, & |
---|
2582 | residual_moisture, root_fraction, & |
---|
2583 | saturation_moisture, skip_time_do_lsm, & |
---|
2584 | soil_moisture, soil_temperature, soil_type, & |
---|
2585 | vegetation_coverage, veg_type, wilting_point,& |
---|
2586 | zs, z0_eb, z0h_eb, z0q_eb |
---|
2587 | |
---|
2588 | line = ' ' |
---|
2589 | |
---|
2590 | ! |
---|
2591 | !-- Try to find land surface model package |
---|
2592 | REWIND ( 11 ) |
---|
2593 | line = ' ' |
---|
2594 | DO WHILE ( INDEX( line, '&lsm_par' ) == 0 ) |
---|
2595 | READ ( 11, '(A)', END=10 ) line |
---|
2596 | ENDDO |
---|
2597 | BACKSPACE ( 11 ) |
---|
2598 | |
---|
2599 | ! |
---|
2600 | !-- Read user-defined namelist |
---|
2601 | READ ( 11, lsm_par ) |
---|
2602 | |
---|
2603 | ! |
---|
2604 | !-- Set flag that indicates that the land surface model is switched on |
---|
2605 | land_surface = .TRUE. |
---|
2606 | |
---|
2607 | 10 CONTINUE |
---|
2608 | |
---|
2609 | |
---|
2610 | END SUBROUTINE lsm_parin |
---|
2611 | |
---|
2612 | |
---|
2613 | !------------------------------------------------------------------------------! |
---|
2614 | ! Description: |
---|
2615 | ! ------------ |
---|
2616 | !> Soil model as part of the land surface model. The model predicts soil |
---|
2617 | !> temperature and water content. |
---|
2618 | !------------------------------------------------------------------------------! |
---|
2619 | SUBROUTINE lsm_soil_model( horizontal, l ) |
---|
2620 | |
---|
2621 | |
---|
2622 | IMPLICIT NONE |
---|
2623 | |
---|
2624 | INTEGER(iwp) :: k !< running index |
---|
2625 | INTEGER(iwp) :: l !< surface-data type index indication facing |
---|
2626 | INTEGER(iwp) :: m !< running index |
---|
2627 | |
---|
2628 | LOGICAL :: horizontal !< flag indication horizontal wall, required to set pointer accordingly |
---|
2629 | |
---|
2630 | REAL(wp) :: h_vg !< Van Genuchten coef. h |
---|
2631 | |
---|
2632 | REAL(wp), DIMENSION(nzb_soil:nzt_soil) :: gamma_temp, & !< temp. gamma |
---|
2633 | lambda_temp, & !< temp. lambda |
---|
2634 | tend !< tendency |
---|
2635 | |
---|
2636 | TYPE(surf_type_lsm), POINTER :: surf_m_soil |
---|
2637 | TYPE(surf_type_lsm), POINTER :: surf_m_soil_p |
---|
2638 | TYPE(surf_type_lsm), POINTER :: surf_t_soil |
---|
2639 | TYPE(surf_type_lsm), POINTER :: surf_t_soil_p |
---|
2640 | TYPE(surf_type_lsm), POINTER :: surf_tm_soil_m |
---|
2641 | TYPE(surf_type_lsm), POINTER :: surf_tt_soil_m |
---|
2642 | |
---|
2643 | TYPE(surf_type), POINTER :: surf !< surface-date type variable |
---|
2644 | |
---|
2645 | IF ( horizontal ) THEN |
---|
2646 | surf => surf_lsm_h |
---|
2647 | |
---|
2648 | surf_m_soil => m_soil_h |
---|
2649 | surf_m_soil_p => m_soil_h_p |
---|
2650 | surf_t_soil => t_soil_h |
---|
2651 | surf_t_soil_p => t_soil_h_p |
---|
2652 | surf_tm_soil_m => tm_soil_h_m |
---|
2653 | surf_tt_soil_m => tt_soil_h_m |
---|
2654 | ELSE |
---|
2655 | surf => surf_lsm_v(l) |
---|
2656 | |
---|
2657 | surf_m_soil => m_soil_v(l) |
---|
2658 | surf_m_soil_p => m_soil_v_p(l) |
---|
2659 | surf_t_soil => t_soil_v(l) |
---|
2660 | surf_t_soil_p => t_soil_v_p(l) |
---|
2661 | surf_tm_soil_m => tm_soil_v_m(l) |
---|
2662 | surf_tt_soil_m => tt_soil_v_m(l) |
---|
2663 | ENDIF |
---|
2664 | |
---|
2665 | DO m = 1, surf%ns |
---|
2666 | |
---|
2667 | IF ( surf%pave_surface(m) ) THEN |
---|
2668 | surf%rho_c_total(nzb_soil,m) = pave_heat_capacity |
---|
2669 | lambda_temp(nzb_soil) = pave_heat_conductivity |
---|
2670 | ENDIF |
---|
2671 | |
---|
2672 | IF ( .NOT. surf%water_surface(m) ) THEN |
---|
2673 | DO k = nzb_soil, nzt_soil |
---|
2674 | |
---|
2675 | IF ( surf%pave_surface(m) .AND. zs(k) <= pave_depth ) THEN |
---|
2676 | |
---|
2677 | surf%rho_c_total(k,m) = pave_heat_capacity |
---|
2678 | lambda_temp(k) = pave_heat_conductivity |
---|
2679 | |
---|
2680 | ELSE |
---|
2681 | ! |
---|
2682 | !-- Calculate volumetric heat capacity of the soil, taking |
---|
2683 | !-- into account water content |
---|
2684 | surf%rho_c_total(k,m) = (rho_c_soil * & |
---|
2685 | ( 1.0_wp - surf%m_sat(m) )& |
---|
2686 | + rho_c_water * surf_m_soil%var_2d(k,m) ) |
---|
2687 | |
---|
2688 | ! |
---|
2689 | !-- Calculate soil heat conductivity at the center of the soil |
---|
2690 | !-- layers |
---|
2691 | lambda_h_sat = lambda_h_sm**(1.0_wp - surf%m_sat(m)) *& |
---|
2692 | lambda_h_water ** surf_m_soil%var_2d(k,m) |
---|
2693 | |
---|
2694 | ke = 1.0_wp + LOG10( MAX( 0.1_wp, surf_m_soil%var_2d(k,m) / & |
---|
2695 | surf%m_sat(m) ) ) |
---|
2696 | |
---|
2697 | lambda_temp(k) = ke * (lambda_h_sat - lambda_h_dry) + & |
---|
2698 | lambda_h_dry |
---|
2699 | ENDIF |
---|
2700 | ENDDO |
---|
2701 | |
---|
2702 | ! |
---|
2703 | !-- Calculate soil heat conductivity (lambda_h) at the _stag level |
---|
2704 | !-- using linear interpolation. For pavement surface, the |
---|
2705 | !-- true pavement depth is considered |
---|
2706 | DO k = nzb_soil, nzt_soil-1 |
---|
2707 | IF ( surf%pave_surface(m) .AND. zs(k) < pave_depth & |
---|
2708 | .AND. zs(k+1) > pave_depth ) THEN |
---|
2709 | surf%lambda_h(k,m) = ( pave_depth - zs(k) ) / dz_soil(k+1)& |
---|
2710 | * lambda_temp(k) & |
---|
2711 | + ( 1.0_wp - ( pave_depth - zs(k) ) & |
---|
2712 | / dz_soil(k+1) ) * lambda_temp(k+1) |
---|
2713 | ELSE |
---|
2714 | surf%lambda_h(k,m) = ( lambda_temp(k+1) + lambda_temp(k) )& |
---|
2715 | * 0.5_wp |
---|
2716 | ENDIF |
---|
2717 | ENDDO |
---|
2718 | surf%lambda_h(nzt_soil,m) = lambda_temp(nzt_soil) |
---|
2719 | |
---|
2720 | ! |
---|
2721 | !-- Prognostic equation for soil temperature t_soil |
---|
2722 | tend(:) = 0.0_wp |
---|
2723 | |
---|
2724 | tend(nzb_soil) = ( 1.0_wp / surf%rho_c_total(nzb_soil,m) ) *& |
---|
2725 | ( surf%lambda_h(nzb_soil,m) * ( surf_t_soil%var_2d(nzb_soil+1,m) & |
---|
2726 | - surf_t_soil%var_2d(nzb_soil,m) ) * ddz_soil(nzb_soil+1) & |
---|
2727 | + surf%ghf_eb(m) ) * ddz_soil_stag(nzb_soil) |
---|
2728 | |
---|
2729 | DO k = nzb_soil+1, nzt_soil |
---|
2730 | tend(k) = ( 1.0_wp / surf%rho_c_total(k,m) ) & |
---|
2731 | * ( surf%lambda_h(k,m) & |
---|
2732 | * ( surf_t_soil%var_2d(k+1,m) - surf_t_soil%var_2d(k,m) ) & |
---|
2733 | * ddz_soil(k+1) & |
---|
2734 | - surf%lambda_h(k-1,m) & |
---|
2735 | * ( surf_t_soil%var_2d(k,m) - surf_t_soil%var_2d(k-1,m) ) & |
---|
2736 | * ddz_soil(k) & |
---|
2737 | ) * ddz_soil_stag(k) |
---|
2738 | |
---|
2739 | ENDDO |
---|
2740 | |
---|
2741 | surf_t_soil_p%var_2d(nzb_soil:nzt_soil,m) = surf_t_soil%var_2d(nzb_soil:nzt_soil,m) & |
---|
2742 | + dt_3d * ( tsc(2) & |
---|
2743 | * tend(nzb_soil:nzt_soil) & |
---|
2744 | + tsc(3) & |
---|
2745 | * surf_tt_soil_m%var_2d(nzb_soil:nzt_soil,m) ) |
---|
2746 | |
---|
2747 | ! |
---|
2748 | !-- Calculate t_soil tendencies for the next Runge-Kutta step |
---|
2749 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
2750 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
2751 | DO k = nzb_soil, nzt_soil |
---|
2752 | surf_tt_soil_m%var_2d(k,m) = tend(k) |
---|
2753 | ENDDO |
---|
2754 | ELSEIF ( intermediate_timestep_count < & |
---|
2755 | intermediate_timestep_count_max ) THEN |
---|
2756 | DO k = nzb_soil, nzt_soil |
---|
2757 | surf_tt_soil_m%var_2d(k,m) = -9.5625_wp * tend(k) + 5.3125_wp & |
---|
2758 | * surf_tt_soil_m%var_2d(k,m) |
---|
2759 | ENDDO |
---|
2760 | ENDIF |
---|
2761 | ENDIF |
---|
2762 | |
---|
2763 | |
---|
2764 | DO k = nzb_soil, nzt_soil |
---|
2765 | |
---|
2766 | ! |
---|
2767 | !-- Calculate soil diffusivity at the center of the soil layers |
---|
2768 | lambda_temp(k) = (- b_ch * surf%gamma_w_sat(m) * psi_sat & |
---|
2769 | / surf%m_sat(m) ) * ( MAX( surf_m_soil%var_2d(k,m), & |
---|
2770 | surf%m_wilt(m) ) / surf%m_sat(m) )**(& |
---|
2771 | b_ch + 2.0_wp ) |
---|
2772 | |
---|
2773 | ! |
---|
2774 | !-- Parametrization of Van Genuchten |
---|
2775 | IF ( soil_type /= 7 ) THEN |
---|
2776 | ! |
---|
2777 | !-- Calculate the hydraulic conductivity after Van Genuchten |
---|
2778 | !-- (1980) |
---|
2779 | h_vg = ( ( ( surf%m_res(m) - surf%m_sat(m) ) / & |
---|
2780 | ( surf%m_res(m) - & |
---|
2781 | MAX( surf_m_soil%var_2d(k,m), surf%m_wilt(m) ) & |
---|
2782 | ) & |
---|
2783 | )**( & |
---|
2784 | surf%n_vg(m) / ( surf%n_vg(m) - 1.0_wp ) & |
---|
2785 | ) - 1.0_wp & |
---|
2786 | )**( 1.0_wp / surf%n_vg(m) ) / surf%alpha_vg(m) |
---|
2787 | |
---|
2788 | gamma_temp(k) = surf%gamma_w_sat(m) * ( ( ( 1.0_wp + & |
---|
2789 | ( surf%alpha_vg(m) * h_vg )**surf%n_vg(m)& |
---|
2790 | )**( & |
---|
2791 | 1.0_wp - 1.0_wp / surf%n_vg(m)) - ( & |
---|
2792 | surf%alpha_vg(m) * h_vg )**( surf%n_vg(m)& |
---|
2793 | - 1.0_wp) )**2 ) & |
---|
2794 | / ( ( 1.0_wp + ( surf%alpha_vg(m) * h_vg & |
---|
2795 | )**surf%n_vg(m) )**( ( 1.0_wp - 1.0_wp & |
---|
2796 | / surf%n_vg(m) ) * & |
---|
2797 | ( surf%l_vg(m) + 2.0_wp) ) ) |
---|
2798 | ! |
---|
2799 | !-- Parametrization of Clapp & Hornberger |
---|
2800 | ELSE |
---|
2801 | gamma_temp(k) = surf%gamma_w_sat(m) * ( surf_m_soil%var_2d(k,m) & |
---|
2802 | / surf%m_sat(m) )**(2.0_wp * b_ch + 3.0_wp) |
---|
2803 | ENDIF |
---|
2804 | |
---|
2805 | ENDDO |
---|
2806 | |
---|
2807 | ! |
---|
2808 | !-- Prognostic equation for soil moisture content. Only performed, |
---|
2809 | !-- when humidity is enabled in the atmosphere and the surface type |
---|
2810 | !-- is not pavement (implies dry soil below). |
---|
2811 | IF ( humidity .AND. .NOT. surf%pave_surface(m) ) THEN |
---|
2812 | ! |
---|
2813 | !-- Calculate soil diffusivity (lambda_w) at the _stag level |
---|
2814 | !-- using linear interpolation. To do: replace this with |
---|
2815 | !-- ECMWF-IFS Eq. 8.81 |
---|
2816 | DO k = nzb_soil, nzt_soil-1 |
---|
2817 | |
---|
2818 | surf%lambda_w(k,m) = ( lambda_temp(k+1) + & |
---|
2819 | lambda_temp(k) ) * 0.5_wp |
---|
2820 | surf%gamma_w(k,m) = ( gamma_temp(k+1) + & |
---|
2821 | gamma_temp(k) ) * 0.5_wp |
---|
2822 | |
---|
2823 | ENDDO |
---|
2824 | |
---|
2825 | ! |
---|
2826 | ! |
---|
2827 | !-- In case of a closed bottom (= water content is conserved), |
---|
2828 | !-- set hydraulic conductivity to zero to that no water will be |
---|
2829 | !-- lost in the bottom layer. |
---|
2830 | IF ( conserve_water_content ) THEN |
---|
2831 | surf%gamma_w(nzt_soil,m) = 0.0_wp |
---|
2832 | ELSE |
---|
2833 | surf%gamma_w(nzt_soil,m) = gamma_temp(nzt_soil) |
---|
2834 | ENDIF |
---|
2835 | |
---|
2836 | !-- The root extraction (= root_extr * qsws_veg_eb / (rho_l |
---|
2837 | !-- * l_v)) ensures the mass conservation for water. The |
---|
2838 | !-- transpiration of plants equals the cumulative withdrawals by |
---|
2839 | !-- the roots in the soil. The scheme takes into account the |
---|
2840 | !-- availability of water in the soil layers as well as the root |
---|
2841 | !-- fraction in the respective layer. Layer with moisture below |
---|
2842 | !-- wilting point will not contribute, which reflects the |
---|
2843 | !-- preference of plants to take water from moister layers. |
---|
2844 | ! |
---|
2845 | !-- Calculate the root extraction (ECMWF 7.69, the sum of |
---|
2846 | !-- root_extr = 1). The energy balance solver guarantees a |
---|
2847 | !-- positive transpiration, so that there is no need for an |
---|
2848 | !-- additional check. |
---|
2849 | m_total = 0.0_wp |
---|
2850 | DO k = nzb_soil, nzt_soil |
---|
2851 | IF ( surf_m_soil%var_2d(k,m) > surf%m_wilt(m) ) THEN |
---|
2852 | m_total = m_total + surf%root_fr(k,m) * surf_m_soil%var_2d(k,m) |
---|
2853 | ENDIF |
---|
2854 | ENDDO |
---|
2855 | IF ( m_total > 0.0_wp ) THEN |
---|
2856 | DO k = nzb_soil, nzt_soil |
---|
2857 | IF ( surf_m_soil%var_2d(k,m) > surf%m_wilt(m) ) THEN |
---|
2858 | root_extr(k) = surf%root_fr(k,m) * surf_m_soil%var_2d(k,m) & |
---|
2859 | / m_total |
---|
2860 | ELSE |
---|
2861 | root_extr(k) = 0.0_wp |
---|
2862 | ENDIF |
---|
2863 | ENDDO |
---|
2864 | ENDIF |
---|
2865 | ! |
---|
2866 | !-- Prognostic equation for soil water content m_soil_h. |
---|
2867 | tend(:) = 0.0_wp |
---|
2868 | |
---|
2869 | tend(nzb_soil) = ( surf%lambda_w(nzb_soil,m) * ( & |
---|
2870 | surf_m_soil%var_2d(nzb_soil+1,m) - surf_m_soil%var_2d(nzb_soil,m) ) & |
---|
2871 | * ddz_soil(nzb_soil+1) - surf%gamma_w(nzb_soil,m) - & |
---|
2872 | ( & |
---|
2873 | root_extr(nzb_soil) * surf%qsws_veg_eb(m) & |
---|
2874 | + surf%qsws_soil_eb(m) ) * drho_l_lv ) & |
---|
2875 | * ddz_soil_stag(nzb_soil) |
---|
2876 | |
---|
2877 | DO k = nzb_soil+1, nzt_soil-1 |
---|
2878 | tend(k) = ( surf%lambda_w(k,m) * ( surf_m_soil%var_2d(k+1,m) & |
---|
2879 | - surf_m_soil%var_2d(k,m) ) * ddz_soil(k+1) & |
---|
2880 | - surf%gamma_w(k,m) & |
---|
2881 | - surf%lambda_w(k-1,m) * ( surf_m_soil%var_2d(k,m) - & |
---|
2882 | surf_m_soil%var_2d(k-1,m)) * ddz_soil(k) & |
---|
2883 | + surf%gamma_w(k-1,m) - (root_extr(k) & |
---|
2884 | * surf%qsws_veg_eb(m) * drho_l_lv) & |
---|
2885 | ) * ddz_soil_stag(k) |
---|
2886 | ENDDO |
---|
2887 | tend(nzt_soil) = ( - surf%gamma_w(nzt_soil,m) & |
---|
2888 | - surf%lambda_w(nzt_soil-1,m) & |
---|
2889 | * ( surf_m_soil%var_2d(nzt_soil,m) & |
---|
2890 | - surf_m_soil%var_2d(nzt_soil-1,m)) & |
---|
2891 | * ddz_soil(nzt_soil) & |
---|
2892 | + surf%gamma_w(nzt_soil-1,m) - ( & |
---|
2893 | root_extr(nzt_soil) & |
---|
2894 | * surf%qsws_veg_eb(m) * drho_l_lv ) & |
---|
2895 | ) * ddz_soil_stag(nzt_soil) |
---|
2896 | |
---|
2897 | surf_m_soil_p%var_2d(nzb_soil:nzt_soil,m) = surf_m_soil%var_2d(nzb_soil:nzt_soil,m) & |
---|
2898 | + dt_3d * ( tsc(2) * tend(:) & |
---|
2899 | + tsc(3) * surf_tm_soil_m%var_2d(:,m) ) |
---|
2900 | |
---|
2901 | ! |
---|
2902 | !-- Account for dry soils (find a better solution here!) |
---|
2903 | DO k = nzb_soil, nzt_soil |
---|
2904 | IF ( surf_m_soil_p%var_2d(k,m) < 0.0_wp ) surf_m_soil_p%var_2d(k,m) = 0.0_wp |
---|
2905 | ENDDO |
---|
2906 | |
---|
2907 | ! |
---|
2908 | !-- Calculate m_soil tendencies for the next Runge-Kutta step |
---|
2909 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
2910 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
2911 | DO k = nzb_soil, nzt_soil |
---|
2912 | surf_tm_soil_m%var_2d(k,m) = tend(k) |
---|
2913 | ENDDO |
---|
2914 | ELSEIF ( intermediate_timestep_count < & |
---|
2915 | intermediate_timestep_count_max ) THEN |
---|
2916 | DO k = nzb_soil, nzt_soil |
---|
2917 | surf_tm_soil_m%var_2d(k,m) = -9.5625_wp * tend(k) + 5.3125_wp & |
---|
2918 | * surf_tm_soil_m%var_2d(k,m) |
---|
2919 | ENDDO |
---|
2920 | ENDIF |
---|
2921 | ENDIF |
---|
2922 | ENDIF |
---|
2923 | |
---|
2924 | ENDIF |
---|
2925 | |
---|
2926 | ENDDO |
---|
2927 | |
---|
2928 | END SUBROUTINE lsm_soil_model |
---|
2929 | |
---|
2930 | |
---|
2931 | !------------------------------------------------------------------------------! |
---|
2932 | ! Description: |
---|
2933 | ! ------------ |
---|
2934 | !> Swapping of timelevels |
---|
2935 | !------------------------------------------------------------------------------! |
---|
2936 | SUBROUTINE lsm_swap_timelevel ( mod_count ) |
---|
2937 | |
---|
2938 | IMPLICIT NONE |
---|
2939 | |
---|
2940 | INTEGER, INTENT(IN) :: mod_count |
---|
2941 | |
---|
2942 | #if defined( __nopointer ) |
---|
2943 | ! |
---|
2944 | !-- Horizontal surfaces |
---|
2945 | t_surface_h = t_surface_h_p |
---|
2946 | t_soil_h = t_soil_h_p |
---|
2947 | IF ( humidity ) THEN |
---|
2948 | m_soil_h = m_soil_h_p |
---|
2949 | m_liq_eb_h = m_liq_eb_h_p |
---|
2950 | ENDIF |
---|
2951 | ! |
---|
2952 | !-- Vertical surfaces |
---|
2953 | t_surface_v = t_surface_v_p |
---|
2954 | t_soil_v = t_soil_v_p |
---|
2955 | IF ( humidity ) THEN |
---|
2956 | m_soil_v = m_soil_v_p |
---|
2957 | m_liq_eb_v = m_liq_eb_v_p |
---|
2958 | ENDIF |
---|
2959 | |
---|
2960 | #else |
---|
2961 | |
---|
2962 | SELECT CASE ( mod_count ) |
---|
2963 | |
---|
2964 | CASE ( 0 ) |
---|
2965 | ! |
---|
2966 | !-- Horizontal surfaces |
---|
2967 | t_surface_h => t_surface_h_1; t_surface_h_p => t_surface_h_2 |
---|
2968 | t_soil_h => t_soil_h_1; t_soil_h_p => t_soil_h_2 |
---|
2969 | IF ( humidity ) THEN |
---|
2970 | m_soil_h => m_soil_h_1; m_soil_h_p => m_soil_h_2 |
---|
2971 | m_liq_eb_h => m_liq_eb_h_1; m_liq_eb_h_p => m_liq_eb_h_2 |
---|
2972 | ENDIF |
---|
2973 | ! |
---|
2974 | !-- Vertical surfaces |
---|
2975 | t_surface_v => t_surface_v_1; t_surface_v_p => t_surface_v_2 |
---|
2976 | t_soil_v => t_soil_v_1; t_soil_v_p => t_soil_v_2 |
---|
2977 | IF ( humidity ) THEN |
---|
2978 | m_soil_v => m_soil_v_1; m_soil_v_p => m_soil_v_2 |
---|
2979 | m_liq_eb_v => m_liq_eb_v_1; m_liq_eb_v_p => m_liq_eb_v_2 |
---|
2980 | ENDIF |
---|
2981 | |
---|
2982 | |
---|
2983 | |
---|
2984 | CASE ( 1 ) |
---|
2985 | ! |
---|
2986 | !-- Horizontal surfaces |
---|
2987 | t_surface_h => t_surface_h_2; t_surface_h_p => t_surface_h_1 |
---|
2988 | t_soil_h => t_soil_h_2; t_soil_h_p => t_soil_h_1 |
---|
2989 | IF ( humidity ) THEN |
---|
2990 | m_soil_h => m_soil_h_2; m_soil_h_p => m_soil_h_1 |
---|
2991 | m_liq_eb_h => m_liq_eb_h_2; m_liq_eb_h_p => m_liq_eb_h_1 |
---|
2992 | ENDIF |
---|
2993 | ! |
---|
2994 | !-- Vertical surfaces |
---|
2995 | t_surface_v => t_surface_v_2; t_surface_v_p => t_surface_v_1 |
---|
2996 | t_soil_v => t_soil_v_2; t_soil_v_p => t_soil_v_1 |
---|
2997 | IF ( humidity ) THEN |
---|
2998 | m_soil_v => m_soil_v_2; m_soil_v_p => m_soil_v_1 |
---|
2999 | m_liq_eb_v => m_liq_eb_v_2; m_liq_eb_v_p => m_liq_eb_v_1 |
---|
3000 | ENDIF |
---|
3001 | |
---|
3002 | END SELECT |
---|
3003 | #endif |
---|
3004 | |
---|
3005 | END SUBROUTINE lsm_swap_timelevel |
---|
3006 | |
---|
3007 | |
---|
3008 | |
---|
3009 | |
---|
3010 | !------------------------------------------------------------------------------! |
---|
3011 | ! |
---|
3012 | ! Description: |
---|
3013 | ! ------------ |
---|
3014 | !> Subroutine for averaging 3D data |
---|
3015 | !------------------------------------------------------------------------------! |
---|
3016 | SUBROUTINE lsm_3d_data_averaging( mode, variable ) |
---|
3017 | |
---|
3018 | |
---|
3019 | USE control_parameters |
---|
3020 | |
---|
3021 | USE indices |
---|
3022 | |
---|
3023 | USE kinds |
---|
3024 | |
---|
3025 | IMPLICIT NONE |
---|
3026 | |
---|
3027 | CHARACTER (LEN=*) :: mode !< |
---|
3028 | CHARACTER (LEN=*) :: variable !< |
---|
3029 | |
---|
3030 | INTEGER(iwp) :: i !< |
---|
3031 | INTEGER(iwp) :: j !< |
---|
3032 | INTEGER(iwp) :: k !< |
---|
3033 | INTEGER(iwp) :: m !< running index |
---|
3034 | |
---|
3035 | IF ( mode == 'allocate' ) THEN |
---|
3036 | |
---|
3037 | SELECT CASE ( TRIM( variable ) ) |
---|
3038 | |
---|
3039 | CASE ( 'c_liq*' ) |
---|
3040 | IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN |
---|
3041 | ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) |
---|
3042 | ENDIF |
---|
3043 | c_liq_av = 0.0_wp |
---|
3044 | |
---|
3045 | CASE ( 'c_soil*' ) |
---|
3046 | IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN |
---|
3047 | ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) |
---|
3048 | ENDIF |
---|
3049 | c_soil_av = 0.0_wp |
---|
3050 | |
---|
3051 | CASE ( 'c_veg*' ) |
---|
3052 | IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN |
---|
3053 | ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) |
---|
3054 | ENDIF |
---|
3055 | c_veg_av = 0.0_wp |
---|
3056 | |
---|
3057 | CASE ( 'ghf_eb*' ) |
---|
3058 | IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN |
---|
3059 | ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3060 | ENDIF |
---|
3061 | ghf_eb_av = 0.0_wp |
---|
3062 | |
---|
3063 | CASE ( 'lai*' ) |
---|
3064 | IF ( .NOT. ALLOCATED( lai_av ) ) THEN |
---|
3065 | ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) |
---|
3066 | ENDIF |
---|
3067 | lai_av = 0.0_wp |
---|
3068 | |
---|
3069 | CASE ( 'm_liq_eb*' ) |
---|
3070 | IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN |
---|
3071 | ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3072 | ENDIF |
---|
3073 | m_liq_eb_av = 0.0_wp |
---|
3074 | |
---|
3075 | CASE ( 'm_soil' ) |
---|
3076 | IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN |
---|
3077 | ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
3078 | ENDIF |
---|
3079 | m_soil_av = 0.0_wp |
---|
3080 | |
---|
3081 | CASE ( 'qsws_eb*' ) |
---|
3082 | IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN |
---|
3083 | ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3084 | ENDIF |
---|
3085 | qsws_eb_av = 0.0_wp |
---|
3086 | |
---|
3087 | CASE ( 'qsws_liq_eb*' ) |
---|
3088 | IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN |
---|
3089 | ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3090 | ENDIF |
---|
3091 | qsws_liq_eb_av = 0.0_wp |
---|
3092 | |
---|
3093 | CASE ( 'qsws_soil_eb*' ) |
---|
3094 | IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN |
---|
3095 | ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3096 | ENDIF |
---|
3097 | qsws_soil_eb_av = 0.0_wp |
---|
3098 | |
---|
3099 | CASE ( 'qsws_veg_eb*' ) |
---|
3100 | IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN |
---|
3101 | ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3102 | ENDIF |
---|
3103 | qsws_veg_eb_av = 0.0_wp |
---|
3104 | |
---|
3105 | CASE ( 'r_a*' ) |
---|
3106 | IF ( .NOT. ALLOCATED( r_a_av ) ) THEN |
---|
3107 | ALLOCATE( r_a_av(nysg:nyng,nxlg:nxrg) ) |
---|
3108 | ENDIF |
---|
3109 | r_a_av = 0.0_wp |
---|
3110 | |
---|
3111 | CASE ( 'r_s*' ) |
---|
3112 | IF ( .NOT. ALLOCATED( r_s_av ) ) THEN |
---|
3113 | ALLOCATE( r_s_av(nysg:nyng,nxlg:nxrg) ) |
---|
3114 | ENDIF |
---|
3115 | r_s_av = 0.0_wp |
---|
3116 | |
---|
3117 | CASE ( 'shf_eb*' ) |
---|
3118 | IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN |
---|
3119 | ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
3120 | ENDIF |
---|
3121 | shf_eb_av = 0.0_wp |
---|
3122 | |
---|
3123 | CASE ( 't_soil' ) |
---|
3124 | IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN |
---|
3125 | ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
3126 | ENDIF |
---|
3127 | t_soil_av = 0.0_wp |
---|
3128 | |
---|
3129 | CASE DEFAULT |
---|
3130 | CONTINUE |
---|
3131 | |
---|
3132 | END SELECT |
---|
3133 | |
---|
3134 | ELSEIF ( mode == 'sum' ) THEN |
---|
3135 | |
---|
3136 | SELECT CASE ( TRIM( variable ) ) |
---|
3137 | |
---|
3138 | CASE ( 'c_liq*' ) |
---|
3139 | DO m = 1, surf_lsm_h%ns |
---|
3140 | i = surf_lsm_h%i(m) |
---|
3141 | j = surf_lsm_h%j(m) |
---|
3142 | c_liq_av(j,i) = c_liq_av(j,i) + surf_lsm_h%c_liq(m) |
---|
3143 | ENDDO |
---|
3144 | |
---|
3145 | CASE ( 'c_soil*' ) |
---|
3146 | DO m = 1, surf_lsm_h%ns |
---|
3147 | i = surf_lsm_h%i(m) |
---|
3148 | j = surf_lsm_h%j(m) |
---|
3149 | c_soil_av(j,i) = c_soil_av(j,i) + (1.0 - surf_lsm_h%c_veg(m)) |
---|
3150 | ENDDO |
---|
3151 | |
---|
3152 | CASE ( 'c_veg*' ) |
---|
3153 | DO m = 1, surf_lsm_h%ns |
---|
3154 | i = surf_lsm_h%i(m) |
---|
3155 | j = surf_lsm_h%j(m) |
---|
3156 | c_veg_av(j,i) = c_veg_av(j,i) + surf_lsm_h%c_veg(m) |
---|
3157 | ENDDO |
---|
3158 | |
---|
3159 | CASE ( 'ghf_eb*' ) |
---|
3160 | DO m = 1, surf_lsm_h%ns |
---|
3161 | i = surf_lsm_h%i(m) |
---|
3162 | j = surf_lsm_h%j(m) |
---|
3163 | ghf_eb_av(j,i) = ghf_eb_av(j,i) + surf_lsm_h%ghf_eb(m) |
---|
3164 | ENDDO |
---|
3165 | |
---|
3166 | CASE ( 'lai*' ) |
---|
3167 | DO m = 1, surf_lsm_h%ns |
---|
3168 | i = surf_lsm_h%i(m) |
---|
3169 | j = surf_lsm_h%j(m) |
---|
3170 | lai_av(j,i) = lai_av(j,i) + surf_lsm_h%lai(m) |
---|
3171 | ENDDO |
---|
3172 | |
---|
3173 | CASE ( 'm_liq_eb*' ) |
---|
3174 | DO m = 1, surf_lsm_h%ns |
---|
3175 | i = surf_lsm_h%i(m) |
---|
3176 | j = surf_lsm_h%j(m) |
---|
3177 | m_liq_eb_av(j,i) = m_liq_eb_av(j,i) + m_liq_eb_h%var_1d(m) |
---|
3178 | ENDDO |
---|
3179 | |
---|
3180 | CASE ( 'm_soil' ) |
---|
3181 | DO m = 1, surf_lsm_h%ns |
---|
3182 | i = surf_lsm_h%i(m) |
---|
3183 | j = surf_lsm_h%j(m) |
---|
3184 | DO k = nzb_soil, nzt_soil |
---|
3185 | m_soil_av(k,j,i) = m_soil_av(k,j,i) + m_soil_h%var_2d(k,m) |
---|
3186 | ENDDO |
---|
3187 | ENDDO |
---|
3188 | |
---|
3189 | CASE ( 'qsws_eb*' ) |
---|
3190 | DO m = 1, surf_lsm_h%ns |
---|
3191 | i = surf_lsm_h%i(m) |
---|
3192 | j = surf_lsm_h%j(m) |
---|
3193 | qsws_eb_av(j,i) = qsws_eb_av(j,i) + surf_lsm_h%qsws_eb(m) |
---|
3194 | ENDDO |
---|
3195 | |
---|
3196 | CASE ( 'qsws_liq_eb*' ) |
---|
3197 | DO m = 1, surf_lsm_h%ns |
---|
3198 | i = surf_lsm_h%i(m) |
---|
3199 | j = surf_lsm_h%j(m) |
---|
3200 | qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) + & |
---|
3201 | surf_lsm_h%qsws_liq_eb(m) |
---|
3202 | ENDDO |
---|
3203 | |
---|
3204 | CASE ( 'qsws_soil_eb*' ) |
---|
3205 | DO m = 1, surf_lsm_h%ns |
---|
3206 | i = surf_lsm_h%i(m) |
---|
3207 | j = surf_lsm_h%j(m) |
---|
3208 | qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) + & |
---|
3209 | surf_lsm_h%qsws_soil_eb(m) |
---|
3210 | ENDDO |
---|
3211 | |
---|
3212 | CASE ( 'qsws_veg_eb*' ) |
---|
3213 | DO m = 1, surf_lsm_h%ns |
---|
3214 | i = surf_lsm_h%i(m) |
---|
3215 | j = surf_lsm_h%j(m) |
---|
3216 | qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) + & |
---|
3217 | surf_lsm_h%qsws_veg_eb(m) |
---|
3218 | ENDDO |
---|
3219 | |
---|
3220 | CASE ( 'r_a*' ) |
---|
3221 | DO m = 1, surf_lsm_h%ns |
---|
3222 | i = surf_lsm_h%i(m) |
---|
3223 | j = surf_lsm_h%j(m) |
---|
3224 | r_a_av(j,i) = r_a_av(j,i) + surf_lsm_h%r_a(m) |
---|
3225 | ENDDO |
---|
3226 | |
---|
3227 | CASE ( 'r_s*' ) |
---|
3228 | DO m = 1, surf_lsm_h%ns |
---|
3229 | i = surf_lsm_h%i(m) |
---|
3230 | j = surf_lsm_h%j(m) |
---|
3231 | r_s_av(j,i) = r_s_av(j,i) + surf_lsm_h%r_s(m) |
---|
3232 | ENDDO |
---|
3233 | |
---|
3234 | CASE ( 'shf_eb*' ) |
---|
3235 | DO m = 1, surf_lsm_h%ns |
---|
3236 | i = surf_lsm_h%i(m) |
---|
3237 | j = surf_lsm_h%j(m) |
---|
3238 | shf_eb_av(j,i) = shf_eb_av(j,i) + surf_lsm_h%shf_eb(m) |
---|
3239 | ENDDO |
---|
3240 | |
---|
3241 | CASE ( 't_soil' ) |
---|
3242 | DO m = 1, surf_lsm_h%ns |
---|
3243 | i = surf_lsm_h%i(m) |
---|
3244 | j = surf_lsm_h%j(m) |
---|
3245 | DO k = nzb_soil, nzt_soil |
---|
3246 | t_soil_av(k,j,i) = t_soil_av(k,j,i) + t_soil_h%var_2d(k,m) |
---|
3247 | ENDDO |
---|
3248 | ENDDO |
---|
3249 | |
---|
3250 | CASE DEFAULT |
---|
3251 | CONTINUE |
---|
3252 | |
---|
3253 | END SELECT |
---|
3254 | |
---|
3255 | ELSEIF ( mode == 'average' ) THEN |
---|
3256 | |
---|
3257 | SELECT CASE ( TRIM( variable ) ) |
---|
3258 | |
---|
3259 | CASE ( 'c_liq*' ) |
---|
3260 | DO i = nxl, nxr |
---|
3261 | DO j = nys, nyn |
---|
3262 | c_liq_av(j,i) = c_liq_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3263 | ENDDO |
---|
3264 | ENDDO |
---|
3265 | |
---|
3266 | CASE ( 'c_soil*' ) |
---|
3267 | DO i = nxl, nxr |
---|
3268 | DO j = nys, nyn |
---|
3269 | c_soil_av(j,i) = c_soil_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3270 | ENDDO |
---|
3271 | ENDDO |
---|
3272 | |
---|
3273 | CASE ( 'c_veg*' ) |
---|
3274 | DO i = nxl, nxr |
---|
3275 | DO j = nys, nyn |
---|
3276 | c_veg_av(j,i) = c_veg_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3277 | ENDDO |
---|
3278 | ENDDO |
---|
3279 | |
---|
3280 | CASE ( 'ghf_eb*' ) |
---|
3281 | DO i = nxl, nxr |
---|
3282 | DO j = nys, nyn |
---|
3283 | ghf_eb_av(j,i) = ghf_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3284 | ENDDO |
---|
3285 | ENDDO |
---|
3286 | |
---|
3287 | CASE ( 'lai*' ) |
---|
3288 | DO i = nxl, nxr |
---|
3289 | DO j = nys, nyn |
---|
3290 | lai_av(j,i) = lai_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3291 | ENDDO |
---|
3292 | ENDDO |
---|
3293 | |
---|
3294 | CASE ( 'm_liq_eb*' ) |
---|
3295 | DO i = nxl, nxr |
---|
3296 | DO j = nys, nyn |
---|
3297 | m_liq_eb_av(j,i) = m_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3298 | ENDDO |
---|
3299 | ENDDO |
---|
3300 | |
---|
3301 | CASE ( 'm_soil' ) |
---|
3302 | DO i = nxl, nxr |
---|
3303 | DO j = nys, nyn |
---|
3304 | DO k = nzb_soil, nzt_soil |
---|
3305 | m_soil_av(k,j,i) = m_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3306 | ENDDO |
---|
3307 | ENDDO |
---|
3308 | ENDDO |
---|
3309 | |
---|
3310 | CASE ( 'qsws_eb*' ) |
---|
3311 | DO i = nxl, nxr |
---|
3312 | DO j = nys, nyn |
---|
3313 | qsws_eb_av(j,i) = qsws_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3314 | ENDDO |
---|
3315 | ENDDO |
---|
3316 | |
---|
3317 | CASE ( 'qsws_liq_eb*' ) |
---|
3318 | DO i = nxl, nxr |
---|
3319 | DO j = nys, nyn |
---|
3320 | qsws_liq_eb_av(j,i) = qsws_liq_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3321 | ENDDO |
---|
3322 | ENDDO |
---|
3323 | |
---|
3324 | CASE ( 'qsws_soil_eb*' ) |
---|
3325 | DO i = nxl, nxr |
---|
3326 | DO j = nys, nyn |
---|
3327 | qsws_soil_eb_av(j,i) = qsws_soil_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3328 | ENDDO |
---|
3329 | ENDDO |
---|
3330 | |
---|
3331 | CASE ( 'qsws_veg_eb*' ) |
---|
3332 | DO i = nxl, nxr |
---|
3333 | DO j = nys, nyn |
---|
3334 | qsws_veg_eb_av(j,i) = qsws_veg_eb_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3335 | ENDDO |
---|
3336 | ENDDO |
---|
3337 | |
---|
3338 | CASE ( 'r_a*' ) |
---|
3339 | DO i = nxl, nxr |
---|
3340 | DO j = nys, nyn |
---|
3341 | r_a_av(j,i) = r_a_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3342 | ENDDO |
---|
3343 | ENDDO |
---|
3344 | |
---|
3345 | CASE ( 'r_s*' ) |
---|
3346 | DO i = nxl, nxr |
---|
3347 | DO j = nys, nyn |
---|
3348 | r_s_av(j,i) = r_s_av(j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3349 | ENDDO |
---|
3350 | ENDDO |
---|
3351 | |
---|
3352 | CASE ( 't_soil' ) |
---|
3353 | DO i = nxl, nxr |
---|
3354 | DO j = nys, nyn |
---|
3355 | DO k = nzb_soil, nzt_soil |
---|
3356 | t_soil_av(k,j,i) = t_soil_av(k,j,i) / REAL( average_count_3d, KIND=wp ) |
---|
3357 | ENDDO |
---|
3358 | ENDDO |
---|
3359 | ENDDO |
---|
3360 | ! |
---|
3361 | !-- |
---|
3362 | |
---|
3363 | END SELECT |
---|
3364 | |
---|
3365 | ENDIF |
---|
3366 | |
---|
3367 | END SUBROUTINE lsm_3d_data_averaging |
---|
3368 | |
---|
3369 | |
---|
3370 | !------------------------------------------------------------------------------! |
---|
3371 | ! |
---|
3372 | ! Description: |
---|
3373 | ! ------------ |
---|
3374 | !> Subroutine defining appropriate grid for netcdf variables. |
---|
3375 | !> It is called out from subroutine netcdf. |
---|
3376 | !------------------------------------------------------------------------------! |
---|
3377 | SUBROUTINE lsm_define_netcdf_grid( var, found, grid_x, grid_y, grid_z ) |
---|
3378 | |
---|
3379 | IMPLICIT NONE |
---|
3380 | |
---|
3381 | CHARACTER (LEN=*), INTENT(IN) :: var !< |
---|
3382 | LOGICAL, INTENT(OUT) :: found !< |
---|
3383 | CHARACTER (LEN=*), INTENT(OUT) :: grid_x !< |
---|
3384 | CHARACTER (LEN=*), INTENT(OUT) :: grid_y !< |
---|
3385 | CHARACTER (LEN=*), INTENT(OUT) :: grid_z !< |
---|
3386 | |
---|
3387 | found = .TRUE. |
---|
3388 | |
---|
3389 | ! |
---|
3390 | !-- Check for the grid |
---|
3391 | SELECT CASE ( TRIM( var ) ) |
---|
3392 | |
---|
3393 | CASE ( 'm_soil', 't_soil', 'm_soil_xy', 't_soil_xy', 'm_soil_xz', & |
---|
3394 | 't_soil_xz', 'm_soil_yz', 't_soil_yz' ) |
---|
3395 | grid_x = 'x' |
---|
3396 | grid_y = 'y' |
---|
3397 | grid_z = 'zs' |
---|
3398 | |
---|
3399 | CASE DEFAULT |
---|
3400 | found = .FALSE. |
---|
3401 | grid_x = 'none' |
---|
3402 | grid_y = 'none' |
---|
3403 | grid_z = 'none' |
---|
3404 | END SELECT |
---|
3405 | |
---|
3406 | END SUBROUTINE lsm_define_netcdf_grid |
---|
3407 | |
---|
3408 | !------------------------------------------------------------------------------! |
---|
3409 | ! |
---|
3410 | ! Description: |
---|
3411 | ! ------------ |
---|
3412 | !> Subroutine defining 3D output variables |
---|
3413 | !------------------------------------------------------------------------------! |
---|
3414 | SUBROUTINE lsm_data_output_2d( av, variable, found, grid, mode, local_pf, & |
---|
3415 | two_d, nzb_do, nzt_do ) |
---|
3416 | |
---|
3417 | USE indices |
---|
3418 | |
---|
3419 | USE kinds |
---|
3420 | |
---|
3421 | |
---|
3422 | IMPLICIT NONE |
---|
3423 | |
---|
3424 | CHARACTER (LEN=*) :: grid !< |
---|
3425 | CHARACTER (LEN=*) :: mode !< |
---|
3426 | CHARACTER (LEN=*) :: variable !< |
---|
3427 | |
---|
3428 | INTEGER(iwp) :: av !< |
---|
3429 | INTEGER(iwp) :: i !< running index |
---|
3430 | INTEGER(iwp) :: j !< running index |
---|
3431 | INTEGER(iwp) :: k !< running index |
---|
3432 | INTEGER(iwp) :: m !< running index |
---|
3433 | INTEGER(iwp) :: nzb_do !< |
---|
3434 | INTEGER(iwp) :: nzt_do !< |
---|
3435 | |
---|
3436 | LOGICAL :: found !< |
---|
3437 | LOGICAL :: two_d !< flag parameter that indicates 2D variables (horizontal cross sections) |
---|
3438 | |
---|
3439 | REAL(wp), DIMENSION(nxlg:nxrg,nysg:nyng,nzb:nzt+1) :: local_pf !< |
---|
3440 | |
---|
3441 | |
---|
3442 | found = .TRUE. |
---|
3443 | |
---|
3444 | SELECT CASE ( TRIM( variable ) ) |
---|
3445 | ! |
---|
3446 | !-- Before data is transfered to local_pf, transfer is it 2D dummy variable and exchange ghost points therein. |
---|
3447 | !-- However, at this point this is only required for instantaneous arrays, time-averaged quantities are already exchanged. |
---|
3448 | CASE ( 'c_liq*_xy' ) ! 2d-array |
---|
3449 | IF ( av == 0 ) THEN |
---|
3450 | DO m = 1, surf_lsm_h%ns |
---|
3451 | i = surf_lsm_h%i(m) |
---|
3452 | j = surf_lsm_h%j(m) |
---|
3453 | local_pf(i,j,nzb+1) = surf_lsm_h%c_liq(m) * surf_lsm_h%c_veg(m) |
---|
3454 | ENDDO |
---|
3455 | ELSE |
---|
3456 | DO i = nxlg, nxrg |
---|
3457 | DO j = nysg, nyng |
---|
3458 | local_pf(i,j,nzb+1) = c_liq_av(j,i) |
---|
3459 | ENDDO |
---|
3460 | ENDDO |
---|
3461 | ENDIF |
---|
3462 | |
---|
3463 | two_d = .TRUE. |
---|
3464 | grid = 'zu1' |
---|
3465 | |
---|
3466 | CASE ( 'c_soil*_xy' ) ! 2d-array |
---|
3467 | IF ( av == 0 ) THEN |
---|
3468 | DO m = 1, surf_lsm_h%ns |
---|
3469 | i = surf_lsm_h%i(m) |
---|
3470 | j = surf_lsm_h%j(m) |
---|
3471 | local_pf(i,j,nzb+1) = 1.0_wp - surf_lsm_h%c_veg(m) |
---|
3472 | ENDDO |
---|
3473 | ELSE |
---|
3474 | DO i = nxlg, nxrg |
---|
3475 | DO j = nysg, nyng |
---|
3476 | local_pf(i,j,nzb+1) = c_soil_av(j,i) |
---|
3477 | ENDDO |
---|
3478 | ENDDO |
---|
3479 | ENDIF |
---|
3480 | |
---|
3481 | two_d = .TRUE. |
---|
3482 | grid = 'zu1' |
---|
3483 | |
---|
3484 | CASE ( 'c_veg*_xy' ) ! 2d-array |
---|
3485 | IF ( av == 0 ) THEN |
---|
3486 | DO m = 1, surf_lsm_h%ns |
---|
3487 | i = surf_lsm_h%i(m) |
---|
3488 | j = surf_lsm_h%j(m) |
---|
3489 | local_pf(i,j,nzb+1) = surf_lsm_h%c_veg(m) |
---|
3490 | ENDDO |
---|
3491 | ELSE |
---|
3492 | DO i = nxlg, nxrg |
---|
3493 | DO j = nysg, nyng |
---|
3494 | local_pf(i,j,nzb+1) = c_veg_av(j,i) |
---|
3495 | ENDDO |
---|
3496 | ENDDO |
---|
3497 | ENDIF |
---|
3498 | |
---|
3499 | two_d = .TRUE. |
---|
3500 | grid = 'zu1' |
---|
3501 | |
---|
3502 | CASE ( 'ghf_eb*_xy' ) ! 2d-array |
---|
3503 | IF ( av == 0 ) THEN |
---|
3504 | DO m = 1, surf_lsm_h%ns |
---|
3505 | i = surf_lsm_h%i(m) |
---|
3506 | j = surf_lsm_h%j(m) |
---|
3507 | local_pf(i,j,nzb+1) = surf_lsm_h%ghf_eb(m) |
---|
3508 | ENDDO |
---|
3509 | ELSE |
---|
3510 | DO i = nxlg, nxrg |
---|
3511 | DO j = nysg, nyng |
---|
3512 | local_pf(i,j,nzb+1) = ghf_eb_av(j,i) |
---|
3513 | ENDDO |
---|
3514 | ENDDO |
---|
3515 | ENDIF |
---|
3516 | |
---|
3517 | two_d = .TRUE. |
---|
3518 | grid = 'zu1' |
---|
3519 | |
---|
3520 | CASE ( 'lai*_xy' ) ! 2d-array |
---|
3521 | IF ( av == 0 ) THEN |
---|
3522 | DO m = 1, surf_lsm_h%ns |
---|
3523 | i = surf_lsm_h%i(m) |
---|
3524 | j = surf_lsm_h%j(m) |
---|
3525 | local_pf(i,j,nzb+1) = surf_lsm_h%lai(m) |
---|
3526 | ENDDO |
---|
3527 | ELSE |
---|
3528 | DO i = nxlg, nxrg |
---|
3529 | DO j = nysg, nyng |
---|
3530 | local_pf(i,j,nzb+1) = lai_av(j,i) |
---|
3531 | ENDDO |
---|
3532 | ENDDO |
---|
3533 | ENDIF |
---|
3534 | |
---|
3535 | two_d = .TRUE. |
---|
3536 | grid = 'zu1' |
---|
3537 | |
---|
3538 | CASE ( 'm_liq_eb*_xy' ) ! 2d-array |
---|
3539 | IF ( av == 0 ) THEN |
---|
3540 | DO m = 1, surf_lsm_h%ns |
---|
3541 | i = surf_lsm_h%i(m) |
---|
3542 | j = surf_lsm_h%j(m) |
---|
3543 | local_pf(i,j,nzb+1) = m_liq_eb_h%var_1d(m) |
---|
3544 | ENDDO |
---|
3545 | ELSE |
---|
3546 | DO i = nxlg, nxrg |
---|
3547 | DO j = nysg, nyng |
---|
3548 | local_pf(i,j,nzb+1) = m_liq_eb_av(j,i) |
---|
3549 | ENDDO |
---|
3550 | ENDDO |
---|
3551 | ENDIF |
---|
3552 | |
---|
3553 | two_d = .TRUE. |
---|
3554 | grid = 'zu1' |
---|
3555 | |
---|
3556 | CASE ( 'm_soil_xy', 'm_soil_xz', 'm_soil_yz' ) |
---|
3557 | IF ( av == 0 ) THEN |
---|
3558 | DO m = 1, surf_lsm_h%ns |
---|
3559 | i = surf_lsm_h%i(m) |
---|
3560 | j = surf_lsm_h%j(m) |
---|
3561 | DO k = nzb_soil, nzt_soil |
---|
3562 | local_pf(i,j,k) = m_soil_h%var_2d(k,m) |
---|
3563 | ENDDO |
---|
3564 | ENDDO |
---|
3565 | ELSE |
---|
3566 | DO i = nxlg, nxrg |
---|
3567 | DO j = nysg, nyng |
---|
3568 | DO k = nzb_soil, nzt_soil |
---|
3569 | local_pf(i,j,k) = m_soil_av(k,j,i) |
---|
3570 | ENDDO |
---|
3571 | ENDDO |
---|
3572 | ENDDO |
---|
3573 | ENDIF |
---|
3574 | |
---|
3575 | nzb_do = nzb_soil |
---|
3576 | nzt_do = nzt_soil |
---|
3577 | |
---|
3578 | IF ( mode == 'xy' ) grid = 'zs' |
---|
3579 | |
---|
3580 | CASE ( 'qsws_eb*_xy' ) ! 2d-array |
---|
3581 | IF ( av == 0 ) THEN |
---|
3582 | DO m = 1, surf_lsm_h%ns |
---|
3583 | i = surf_lsm_h%i(m) |
---|
3584 | j = surf_lsm_h%j(m) |
---|
3585 | local_pf(i,j,nzb+1) = surf_lsm_h%qsws_eb(m) |
---|
3586 | ENDDO |
---|
3587 | ELSE |
---|
3588 | DO i = nxlg, nxrg |
---|
3589 | DO j = nysg, nyng |
---|
3590 | local_pf(i,j,nzb+1) = qsws_eb_av(j,i) |
---|
3591 | ENDDO |
---|
3592 | ENDDO |
---|
3593 | ENDIF |
---|
3594 | |
---|
3595 | two_d = .TRUE. |
---|
3596 | grid = 'zu1' |
---|
3597 | |
---|
3598 | CASE ( 'qsws_liq_eb*_xy' ) ! 2d-array |
---|
3599 | IF ( av == 0 ) THEN |
---|
3600 | DO m = 1, surf_lsm_h%ns |
---|
3601 | i = surf_lsm_h%i(m) |
---|
3602 | j = surf_lsm_h%j(m) |
---|
3603 | local_pf(i,j,nzb+1) = surf_lsm_h%qsws_liq_eb(m) |
---|
3604 | ENDDO |
---|
3605 | ELSE |
---|
3606 | DO i = nxlg, nxrg |
---|
3607 | DO j = nysg, nyng |
---|
3608 | local_pf(i,j,nzb+1) = qsws_liq_eb_av(j,i) |
---|
3609 | ENDDO |
---|
3610 | ENDDO |
---|
3611 | ENDIF |
---|
3612 | |
---|
3613 | two_d = .TRUE. |
---|
3614 | grid = 'zu1' |
---|
3615 | |
---|
3616 | CASE ( 'qsws_soil_eb*_xy' ) ! 2d-array |
---|
3617 | IF ( av == 0 ) THEN |
---|
3618 | DO m = 1, surf_lsm_h%ns |
---|
3619 | i = surf_lsm_h%i(m) |
---|
3620 | j = surf_lsm_h%j(m) |
---|
3621 | local_pf(i,j,nzb+1) = surf_lsm_h%qsws_soil_eb(m) |
---|
3622 | ENDDO |
---|
3623 | ELSE |
---|
3624 | DO i = nxlg, nxrg |
---|
3625 | DO j = nysg, nyng |
---|
3626 | local_pf(i,j,nzb+1) = qsws_soil_eb_av(j,i) |
---|
3627 | ENDDO |
---|
3628 | ENDDO |
---|
3629 | ENDIF |
---|
3630 | |
---|
3631 | two_d = .TRUE. |
---|
3632 | grid = 'zu1' |
---|
3633 | |
---|
3634 | CASE ( 'qsws_veg_eb*_xy' ) ! 2d-array |
---|
3635 | IF ( av == 0 ) THEN |
---|
3636 | DO m = 1, surf_lsm_h%ns |
---|
3637 | i = surf_lsm_h%i(m) |
---|
3638 | j = surf_lsm_h%j(m) |
---|
3639 | local_pf(i,j,nzb+1) = surf_lsm_h%qsws_veg_eb(m) |
---|
3640 | ENDDO |
---|
3641 | ELSE |
---|
3642 | DO i = nxlg, nxrg |
---|
3643 | DO j = nysg, nyng |
---|
3644 | local_pf(i,j,nzb+1) = qsws_veg_eb_av(j,i) |
---|
3645 | ENDDO |
---|
3646 | ENDDO |
---|
3647 | ENDIF |
---|
3648 | |
---|
3649 | two_d = .TRUE. |
---|
3650 | grid = 'zu1' |
---|
3651 | |
---|
3652 | |
---|
3653 | CASE ( 'r_a*_xy' ) ! 2d-array |
---|
3654 | IF ( av == 0 ) THEN |
---|
3655 | DO m = 1, surf_lsm_h%ns |
---|
3656 | i = surf_lsm_h%i(m) |
---|
3657 | j = surf_lsm_h%j(m) |
---|
3658 | local_pf(i,j,nzb+1) = surf_lsm_h%r_a(m) |
---|
3659 | ENDDO |
---|
3660 | ELSE |
---|
3661 | DO i = nxlg, nxrg |
---|
3662 | DO j = nysg, nyng |
---|
3663 | local_pf(i,j,nzb+1) = r_a_av(j,i) |
---|
3664 | ENDDO |
---|
3665 | ENDDO |
---|
3666 | ENDIF |
---|
3667 | |
---|
3668 | two_d = .TRUE. |
---|
3669 | grid = 'zu1' |
---|
3670 | |
---|
3671 | CASE ( 'r_s*_xy' ) ! 2d-array |
---|
3672 | IF ( av == 0 ) THEN |
---|
3673 | DO m = 1, surf_lsm_h%ns |
---|
3674 | i = surf_lsm_h%i(m) |
---|
3675 | j = surf_lsm_h%j(m) |
---|
3676 | local_pf(i,j,nzb+1) = surf_lsm_h%r_s(m) |
---|
3677 | ENDDO |
---|
3678 | ELSE |
---|
3679 | DO i = nxlg, nxrg |
---|
3680 | DO j = nysg, nyng |
---|
3681 | local_pf(i,j,nzb+1) = r_s_av(j,i) |
---|
3682 | ENDDO |
---|
3683 | ENDDO |
---|
3684 | ENDIF |
---|
3685 | |
---|
3686 | two_d = .TRUE. |
---|
3687 | grid = 'zu1' |
---|
3688 | |
---|
3689 | CASE ( 'shf_eb*_xy' ) ! 2d-array |
---|
3690 | IF ( av == 0 ) THEN |
---|
3691 | DO m = 1, surf_lsm_h%ns |
---|
3692 | i = surf_lsm_h%i(m) |
---|
3693 | j = surf_lsm_h%j(m) |
---|
3694 | local_pf(i,j,nzb+1) = surf_lsm_h%shf_eb(m) |
---|
3695 | ENDDO |
---|
3696 | ELSE |
---|
3697 | DO i = nxlg, nxrg |
---|
3698 | DO j = nysg, nyng |
---|
3699 | local_pf(i,j,nzb+1) = shf_eb_av(j,i) |
---|
3700 | ENDDO |
---|
3701 | ENDDO |
---|
3702 | ENDIF |
---|
3703 | |
---|
3704 | two_d = .TRUE. |
---|
3705 | grid = 'zu1' |
---|
3706 | |
---|
3707 | CASE ( 't_soil_xy', 't_soil_xz', 't_soil_yz' ) |
---|
3708 | IF ( av == 0 ) THEN |
---|
3709 | DO m = 1, surf_lsm_h%ns |
---|
3710 | i = surf_lsm_h%i(m) |
---|
3711 | j = surf_lsm_h%j(m) |
---|
3712 | DO k = nzb_soil, nzt_soil |
---|
3713 | local_pf(i,j,k) = t_soil_h%var_2d(k,m) |
---|
3714 | ENDDO |
---|
3715 | ENDDO |
---|
3716 | ELSE |
---|
3717 | DO i = nxlg, nxrg |
---|
3718 | DO j = nysg, nyng |
---|
3719 | DO k = nzb_soil, nzt_soil |
---|
3720 | local_pf(i,j,k) = t_soil_av(k,j,i) |
---|
3721 | ENDDO |
---|
3722 | ENDDO |
---|
3723 | ENDDO |
---|
3724 | ENDIF |
---|
3725 | |
---|
3726 | nzb_do = nzb_soil |
---|
3727 | nzt_do = nzt_soil |
---|
3728 | |
---|
3729 | IF ( mode == 'xy' ) grid = 'zs' |
---|
3730 | |
---|
3731 | CASE DEFAULT |
---|
3732 | found = .FALSE. |
---|
3733 | grid = 'none' |
---|
3734 | |
---|
3735 | END SELECT |
---|
3736 | |
---|
3737 | END SUBROUTINE lsm_data_output_2d |
---|
3738 | |
---|
3739 | |
---|
3740 | !------------------------------------------------------------------------------! |
---|
3741 | ! |
---|
3742 | ! Description: |
---|
3743 | ! ------------ |
---|
3744 | !> Subroutine defining 3D output variables |
---|
3745 | !------------------------------------------------------------------------------! |
---|
3746 | SUBROUTINE lsm_data_output_3d( av, variable, found, local_pf ) |
---|
3747 | |
---|
3748 | |
---|
3749 | USE indices |
---|
3750 | |
---|
3751 | USE kinds |
---|
3752 | |
---|
3753 | |
---|
3754 | IMPLICIT NONE |
---|
3755 | |
---|
3756 | CHARACTER (LEN=*) :: variable !< |
---|
3757 | |
---|
3758 | INTEGER(iwp) :: av !< |
---|
3759 | INTEGER(iwp) :: i !< |
---|
3760 | INTEGER(iwp) :: j !< |
---|
3761 | INTEGER(iwp) :: k !< |
---|
3762 | INTEGER(iwp) :: m !< running index |
---|
3763 | |
---|
3764 | LOGICAL :: found !< |
---|
3765 | |
---|
3766 | REAL(sp), DIMENSION(nxlg:nxrg,nysg:nyng,nzb_soil:nzt_soil) :: local_pf !< |
---|
3767 | |
---|
3768 | |
---|
3769 | found = .TRUE. |
---|
3770 | |
---|
3771 | |
---|
3772 | SELECT CASE ( TRIM( variable ) ) |
---|
3773 | ! |
---|
3774 | !-- Requires 3D exchange |
---|
3775 | |
---|
3776 | CASE ( 'm_soil' ) |
---|
3777 | |
---|
3778 | IF ( av == 0 ) THEN |
---|
3779 | DO m = 1, surf_lsm_h%ns |
---|
3780 | i = surf_lsm_h%i(m) |
---|
3781 | j = surf_lsm_h%j(m) |
---|
3782 | DO k = nzb_soil, nzt_soil |
---|
3783 | local_pf(i,j,k) = m_soil_h%var_2d(k,m) |
---|
3784 | ENDDO |
---|
3785 | ENDDO |
---|
3786 | ELSE |
---|
3787 | DO i = nxlg, nxrg |
---|
3788 | DO j = nysg, nyng |
---|
3789 | DO k = nzb_soil, nzt_soil |
---|
3790 | local_pf(i,j,k) = m_soil_av(k,j,i) |
---|
3791 | ENDDO |
---|
3792 | ENDDO |
---|
3793 | ENDDO |
---|
3794 | ENDIF |
---|
3795 | |
---|
3796 | CASE ( 't_soil' ) |
---|
3797 | |
---|
3798 | IF ( av == 0 ) THEN |
---|
3799 | DO m = 1, surf_lsm_h%ns |
---|
3800 | i = surf_lsm_h%i(m) |
---|
3801 | j = surf_lsm_h%j(m) |
---|
3802 | DO k = nzb_soil, nzt_soil |
---|
3803 | local_pf(i,j,k) = t_soil_h%var_2d(k,m) |
---|
3804 | ENDDO |
---|
3805 | ENDDO |
---|
3806 | ELSE |
---|
3807 | DO i = nxlg, nxrg |
---|
3808 | DO j = nysg, nyng |
---|
3809 | DO k = nzb_soil, nzt_soil |
---|
3810 | local_pf(i,j,k) = t_soil_av(k,j,i) |
---|
3811 | ENDDO |
---|
3812 | ENDDO |
---|
3813 | ENDDO |
---|
3814 | ENDIF |
---|
3815 | |
---|
3816 | |
---|
3817 | CASE DEFAULT |
---|
3818 | found = .FALSE. |
---|
3819 | |
---|
3820 | END SELECT |
---|
3821 | |
---|
3822 | |
---|
3823 | END SUBROUTINE lsm_data_output_3d |
---|
3824 | |
---|
3825 | |
---|
3826 | !------------------------------------------------------------------------------! |
---|
3827 | ! |
---|
3828 | ! Description: |
---|
3829 | ! ------------ |
---|
3830 | !> Write restart data for land surface model |
---|
3831 | !------------------------------------------------------------------------------! |
---|
3832 | SUBROUTINE lsm_last_actions |
---|
3833 | |
---|
3834 | |
---|
3835 | USE control_parameters |
---|
3836 | |
---|
3837 | USE kinds |
---|
3838 | |
---|
3839 | IMPLICIT NONE |
---|
3840 | |
---|
3841 | IF ( write_binary(1:4) == 'true' ) THEN |
---|
3842 | IF ( ALLOCATED( c_liq_av ) ) THEN |
---|
3843 | WRITE ( 14 ) 'c_liq_av '; WRITE ( 14 ) c_liq_av |
---|
3844 | ENDIF |
---|
3845 | IF ( ALLOCATED( c_soil_av ) ) THEN |
---|
3846 | WRITE ( 14 ) 'c_soil_av '; WRITE ( 14 ) c_soil_av |
---|
3847 | ENDIF |
---|
3848 | IF ( ALLOCATED( c_veg_av ) ) THEN |
---|
3849 | WRITE ( 14 ) 'c_veg_av '; WRITE ( 14 ) c_veg_av |
---|
3850 | ENDIF |
---|
3851 | IF ( ALLOCATED( ghf_eb_av ) ) THEN |
---|
3852 | WRITE ( 14 ) 'ghf_eb_av '; WRITE ( 14 ) ghf_eb_av |
---|
3853 | ENDIF |
---|
3854 | IF ( ALLOCATED( lai_av ) ) THEN |
---|
3855 | WRITE ( 14 ) 'lai_av '; WRITE ( 14 ) lai_av |
---|
3856 | ENDIF |
---|
3857 | WRITE ( 14 ) 'm_liq_eb '; WRITE ( 14 ) m_liq_eb_h%var_1d |
---|
3858 | IF ( ALLOCATED( m_liq_eb_av ) ) THEN |
---|
3859 | WRITE ( 14 ) 'm_liq_eb_av '; WRITE ( 14 ) m_liq_eb_av |
---|
3860 | ENDIF |
---|
3861 | WRITE ( 14 ) 'm_soil '; WRITE ( 14 ) m_soil_h%var_2d |
---|
3862 | IF ( ALLOCATED( m_soil_av ) ) THEN |
---|
3863 | WRITE ( 14 ) 'm_soil_av '; WRITE ( 14 ) m_soil_av |
---|
3864 | ENDIF |
---|
3865 | IF ( ALLOCATED( qsws_eb_av ) ) THEN |
---|
3866 | WRITE ( 14 ) 'qsws_eb_av '; WRITE ( 14 ) qsws_eb_av |
---|
3867 | ENDIF |
---|
3868 | IF ( ALLOCATED( qsws_liq_eb_av ) ) THEN |
---|
3869 | WRITE ( 14 ) 'qsws_liq_eb_av '; WRITE ( 14 ) qsws_liq_eb_av |
---|
3870 | ENDIF |
---|
3871 | IF ( ALLOCATED( qsws_soil_eb_av ) ) THEN |
---|
3872 | WRITE ( 14 ) 'qsws_soil_eb_av '; WRITE ( 14 ) qsws_soil_eb_av |
---|
3873 | ENDIF |
---|
3874 | IF ( ALLOCATED( qsws_veg_eb_av ) ) THEN |
---|
3875 | WRITE ( 14 ) 'qsws_veg_eb_av '; WRITE ( 14 ) qsws_veg_eb_av |
---|
3876 | ENDIF |
---|
3877 | IF ( ALLOCATED( shf_eb_av ) ) THEN |
---|
3878 | WRITE ( 14 ) 'shf_eb_av '; WRITE ( 14 ) shf_eb_av |
---|
3879 | ENDIF |
---|
3880 | WRITE ( 14 ) 't_soil '; WRITE ( 14 ) t_soil_h%var_2d |
---|
3881 | IF ( ALLOCATED( t_soil_av ) ) THEN |
---|
3882 | WRITE ( 14 ) 't_soil_av '; WRITE ( 14 ) t_soil_av |
---|
3883 | ENDIF |
---|
3884 | |
---|
3885 | WRITE ( 14 ) '*** end lsm *** ' |
---|
3886 | |
---|
3887 | ENDIF |
---|
3888 | |
---|
3889 | END SUBROUTINE lsm_last_actions |
---|
3890 | |
---|
3891 | |
---|
3892 | SUBROUTINE lsm_read_restart_data( i, nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
3893 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
3894 | offset_xa, offset_ya, overlap_count, & |
---|
3895 | tmp_2d ) |
---|
3896 | |
---|
3897 | |
---|
3898 | USE control_parameters |
---|
3899 | |
---|
3900 | USE indices |
---|
3901 | |
---|
3902 | USE kinds |
---|
3903 | |
---|
3904 | USE pegrid |
---|
3905 | |
---|
3906 | IMPLICIT NONE |
---|
3907 | |
---|
3908 | CHARACTER (LEN=20) :: field_char !< |
---|
3909 | |
---|
3910 | INTEGER(iwp) :: i !< |
---|
3911 | INTEGER(iwp) :: k !< |
---|
3912 | INTEGER(iwp) :: nxlc !< |
---|
3913 | INTEGER(iwp) :: nxlf !< |
---|
3914 | INTEGER(iwp) :: nxl_on_file !< |
---|
3915 | INTEGER(iwp) :: nxrc !< |
---|
3916 | INTEGER(iwp) :: nxrf !< |
---|
3917 | INTEGER(iwp) :: nxr_on_file !< |
---|
3918 | INTEGER(iwp) :: nync !< |
---|
3919 | INTEGER(iwp) :: nynf !< |
---|
3920 | INTEGER(iwp) :: nyn_on_file !< |
---|
3921 | INTEGER(iwp) :: nysc !< |
---|
3922 | INTEGER(iwp) :: nysf !< |
---|
3923 | INTEGER(iwp) :: nys_on_file !< |
---|
3924 | INTEGER(iwp) :: overlap_count !< |
---|
3925 | |
---|
3926 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxlfa !< |
---|
3927 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxrfa !< |
---|
3928 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nynfa !< |
---|
3929 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nysfa !< |
---|
3930 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_xa !< |
---|
3931 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_ya !< |
---|
3932 | |
---|
3933 | REAL(wp), & |
---|
3934 | DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& |
---|
3935 | tmp_2d !< |
---|
3936 | |
---|
3937 | REAL(wp), & |
---|
3938 | DIMENSION(nzb_soil:nzt_soil+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& |
---|
3939 | tmp_3d !< |
---|
3940 | |
---|
3941 | REAL(wp), & |
---|
3942 | DIMENSION(nzb_soil:nzt_soil,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::& |
---|
3943 | tmp_3d2 !< |
---|
3944 | |
---|
3945 | REAL(wp), & |
---|
3946 | DIMENSION(1:surf_lsm_h%ns) :: & |
---|
3947 | tmp_walltype_1d !< |
---|
3948 | |
---|
3949 | REAL(wp), & |
---|
3950 | DIMENSION(nzb_soil:nzt_soil+1,1:surf_lsm_h%ns) :: & |
---|
3951 | tmp_walltype_2d !< |
---|
3952 | |
---|
3953 | REAL(wp), & |
---|
3954 | DIMENSION(nzb_soil:nzt_soil,1:surf_lsm_h%ns) :: & |
---|
3955 | tmp_walltype_2d2 !< |
---|
3956 | |
---|
3957 | |
---|
3958 | IF ( initializing_actions == 'read_restart_data' ) THEN |
---|
3959 | READ ( 13 ) field_char |
---|
3960 | |
---|
3961 | DO WHILE ( TRIM( field_char ) /= '*** end lsm ***' ) |
---|
3962 | |
---|
3963 | DO k = 1, overlap_count |
---|
3964 | |
---|
3965 | nxlf = nxlfa(i,k) |
---|
3966 | nxlc = nxlfa(i,k) + offset_xa(i,k) |
---|
3967 | nxrf = nxrfa(i,k) |
---|
3968 | nxrc = nxrfa(i,k) + offset_xa(i,k) |
---|
3969 | nysf = nysfa(i,k) |
---|
3970 | nysc = nysfa(i,k) + offset_ya(i,k) |
---|
3971 | nynf = nynfa(i,k) |
---|
3972 | nync = nynfa(i,k) + offset_ya(i,k) |
---|
3973 | |
---|
3974 | SELECT CASE ( TRIM( field_char ) ) |
---|
3975 | |
---|
3976 | |
---|
3977 | CASE ( 'c_liq_av' ) |
---|
3978 | IF ( .NOT. ALLOCATED( c_liq_av ) ) THEN |
---|
3979 | ALLOCATE( c_liq_av(nysg:nyng,nxlg:nxrg) ) |
---|
3980 | ENDIF |
---|
3981 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
3982 | c_liq_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
3983 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
3984 | |
---|
3985 | CASE ( 'c_soil_av' ) |
---|
3986 | IF ( .NOT. ALLOCATED( c_soil_av ) ) THEN |
---|
3987 | ALLOCATE( c_soil_av(nysg:nyng,nxlg:nxrg) ) |
---|
3988 | ENDIF |
---|
3989 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
3990 | c_soil_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
3991 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
3992 | |
---|
3993 | CASE ( 'c_veg_av' ) |
---|
3994 | IF ( .NOT. ALLOCATED( c_veg_av ) ) THEN |
---|
3995 | ALLOCATE( c_veg_av(nysg:nyng,nxlg:nxrg) ) |
---|
3996 | ENDIF |
---|
3997 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
3998 | c_veg_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
3999 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4000 | |
---|
4001 | CASE ( 'ghf_eb_av' ) |
---|
4002 | IF ( .NOT. ALLOCATED( ghf_eb_av ) ) THEN |
---|
4003 | ALLOCATE( ghf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4004 | ENDIF |
---|
4005 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4006 | ghf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4007 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4008 | |
---|
4009 | CASE ( 'm_liq_eb' ) |
---|
4010 | IF ( k == 1 ) READ ( 13 ) tmp_walltype_1d !tmp_2d |
---|
4011 | m_liq_eb_h%var_1d(1:surf_lsm_h%ns) = & |
---|
4012 | tmp_walltype_1d(1:surf_lsm_h%ns) |
---|
4013 | |
---|
4014 | CASE ( 'lai_av' ) |
---|
4015 | IF ( .NOT. ALLOCATED( lai_av ) ) THEN |
---|
4016 | ALLOCATE( lai_av(nysg:nyng,nxlg:nxrg) ) |
---|
4017 | ENDIF |
---|
4018 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4019 | lai_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4020 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4021 | |
---|
4022 | CASE ( 'm_liq_eb_av' ) |
---|
4023 | IF ( .NOT. ALLOCATED( m_liq_eb_av ) ) THEN |
---|
4024 | ALLOCATE( m_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4025 | ENDIF |
---|
4026 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4027 | m_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4028 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4029 | |
---|
4030 | CASE ( 'm_soil' ) |
---|
4031 | IF ( k == 1 ) READ ( 13 ) tmp_walltype_2d2(:,:) |
---|
4032 | m_soil_h%var_2d(:,1:surf_lsm_h%ns) = & |
---|
4033 | tmp_walltype_2d2(:,1:surf_lsm_h%ns) |
---|
4034 | |
---|
4035 | CASE ( 'm_soil_av' ) |
---|
4036 | IF ( .NOT. ALLOCATED( m_soil_av ) ) THEN |
---|
4037 | ALLOCATE( m_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
4038 | ENDIF |
---|
4039 | IF ( k == 1 ) READ ( 13 ) tmp_3d2(:,:,:) |
---|
4040 | m_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4041 | tmp_3d2(nzb_soil:nzt_soil,nysf & |
---|
4042 | -nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4043 | |
---|
4044 | CASE ( 'qsws_eb_av' ) |
---|
4045 | IF ( .NOT. ALLOCATED( qsws_eb_av ) ) THEN |
---|
4046 | ALLOCATE( qsws_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4047 | ENDIF |
---|
4048 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4049 | qsws_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4050 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4051 | |
---|
4052 | CASE ( 'qsws_liq_eb_av' ) |
---|
4053 | IF ( .NOT. ALLOCATED( qsws_liq_eb_av ) ) THEN |
---|
4054 | ALLOCATE( qsws_liq_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4055 | ENDIF |
---|
4056 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4057 | qsws_liq_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4058 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4059 | CASE ( 'qsws_soil_eb_av' ) |
---|
4060 | IF ( .NOT. ALLOCATED( qsws_soil_eb_av ) ) THEN |
---|
4061 | ALLOCATE( qsws_soil_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4062 | ENDIF |
---|
4063 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4064 | qsws_soil_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4065 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4066 | |
---|
4067 | CASE ( 'qsws_veg_eb_av' ) |
---|
4068 | IF ( .NOT. ALLOCATED( qsws_veg_eb_av ) ) THEN |
---|
4069 | ALLOCATE( qsws_veg_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4070 | ENDIF |
---|
4071 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4072 | qsws_veg_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4073 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4074 | |
---|
4075 | CASE ( 'shf_eb_av' ) |
---|
4076 | IF ( .NOT. ALLOCATED( shf_eb_av ) ) THEN |
---|
4077 | ALLOCATE( shf_eb_av(nysg:nyng,nxlg:nxrg) ) |
---|
4078 | ENDIF |
---|
4079 | IF ( k == 1 ) READ ( 13 ) tmp_2d |
---|
4080 | shf_eb_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4081 | tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp) |
---|
4082 | |
---|
4083 | CASE ( 't_soil' ) |
---|
4084 | IF ( k == 1 ) READ ( 13 ) tmp_walltype_2d(:,:) |
---|
4085 | t_soil_h%var_2d(:,1:surf_lsm_h%ns) = & |
---|
4086 | tmp_walltype_2d(:,1:surf_lsm_h%ns) |
---|
4087 | |
---|
4088 | CASE ( 't_soil_av' ) |
---|
4089 | IF ( .NOT. ALLOCATED( t_soil_av ) ) THEN |
---|
4090 | ALLOCATE( t_soil_av(nzb_soil:nzt_soil,nysg:nyng,nxlg:nxrg) ) |
---|
4091 | ENDIF |
---|
4092 | IF ( k == 1 ) READ ( 13 ) tmp_3d2(:,:,:) |
---|
4093 | t_soil_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = & |
---|
4094 | tmp_3d2(:,nysf-nbgp:nynf+nbgp, & |
---|
4095 | nxlf-nbgp:nxrf+nbgp) |
---|
4096 | |
---|
4097 | |
---|
4098 | CASE DEFAULT |
---|
4099 | WRITE( message_string, * ) 'unknown variable named "', & |
---|
4100 | TRIM( field_char ), '" found in', & |
---|
4101 | '&data from prior run on PE ', myid |
---|
4102 | CALL message( 'lsm_read_restart_data', 'PA0302', 1, 2, 0, 6, & |
---|
4103 | 0 ) |
---|
4104 | |
---|
4105 | END SELECT |
---|
4106 | |
---|
4107 | ENDDO |
---|
4108 | |
---|
4109 | READ ( 13 ) field_char |
---|
4110 | |
---|
4111 | ENDDO |
---|
4112 | ENDIF |
---|
4113 | |
---|
4114 | END SUBROUTINE lsm_read_restart_data |
---|
4115 | |
---|
4116 | !------------------------------------------------------------------------------! |
---|
4117 | ! Description: |
---|
4118 | ! ------------ |
---|
4119 | !> Calculation of roughness length for open water (lakes, ocean). The |
---|
4120 | !> parameterization follows Charnock (1955). Two different implementations |
---|
4121 | !> are available: as in ECMWF-IFS (Beljaars 1994) or as in FLake (Subin et al. |
---|
4122 | !> 2012) |
---|
4123 | !------------------------------------------------------------------------------! |
---|
4124 | SUBROUTINE calc_z0_water_surface |
---|
4125 | |
---|
4126 | USE control_parameters, & |
---|
4127 | ONLY: g, kappa, molecular_viscosity |
---|
4128 | |
---|
4129 | IMPLICIT NONE |
---|
4130 | |
---|
4131 | INTEGER(iwp) :: i !< running index |
---|
4132 | INTEGER(iwp) :: j !< running index |
---|
4133 | INTEGER(iwp) :: m !< running index |
---|
4134 | |
---|
4135 | REAL(wp), PARAMETER :: alpha_ch = 0.018_wp !< Charnock constant (0.01-0.11). Use 0.01 for FLake and 0.018 for ECMWF |
---|
4136 | ! REAL(wp), PARAMETER :: pr_number = 0.71_wp !< molecular Prandtl number in the Charnock parameterization (differs from prandtl_number) |
---|
4137 | ! REAL(wp), PARAMETER :: sc_number = 0.66_wp !< molecular Schmidt number in the Charnock parameterization |
---|
4138 | ! REAL(wp) :: re_0 !< near-surface roughness Reynolds number |
---|
4139 | |
---|
4140 | DO m = 1, surf_lsm_h%ns |
---|
4141 | |
---|
4142 | i = surf_lsm_h%i(m) |
---|
4143 | j = surf_lsm_h%j(m) |
---|
4144 | |
---|
4145 | IF ( surf_lsm_h%water_surface(m) ) THEN |
---|
4146 | |
---|
4147 | ! |
---|
4148 | !-- Disabled: FLake parameterization. Ideally, the Charnock |
---|
4149 | !-- coefficient should depend on the water depth and the fetch |
---|
4150 | !-- length |
---|
4151 | ! re_0 = z0(j,i) * us(j,i) / molecular_viscosity |
---|
4152 | ! |
---|
4153 | ! z0(j,i) = MAX( 0.1_wp * molecular_viscosity / us(j,i), & |
---|
4154 | ! alpha_ch * us(j,i) / g ) |
---|
4155 | ! |
---|
4156 | ! z0h(j,i) = z0(j,i) * EXP( - kappa / pr_number * ( 4.0_wp * SQRT( re_0 ) - 3.2_wp ) ) |
---|
4157 | ! z0q(j,i) = z0(j,i) * EXP( - kappa / pr_number * ( 4.0_wp * SQRT( re_0 ) - 4.2_wp ) ) |
---|
4158 | |
---|
4159 | ! |
---|
4160 | !-- Set minimum roughness length for u* > 0.2 |
---|
4161 | ! IF ( us(j,i) > 0.2_wp ) THEN |
---|
4162 | ! z0h(j,i) = MAX( 1.0E-5_wp, z0h(j,i) ) |
---|
4163 | ! z0q(j,i) = MAX( 1.0E-5_wp, z0q(j,i) ) |
---|
4164 | ! ENDIF |
---|
4165 | |
---|
4166 | ! |
---|
4167 | !-- ECMWF IFS model parameterization after Beljaars (1994). At low |
---|
4168 | !-- wind speed, the sea surface becomes aerodynamically smooth and |
---|
4169 | !-- the roughness scales with the viscosity. At high wind speed, the |
---|
4170 | !-- Charnock relation is used. |
---|
4171 | surf_lsm_h%z0(m) = ( 0.11_wp * molecular_viscosity / & |
---|
4172 | surf_lsm_h%us(m) ) & |
---|
4173 | + ( alpha_ch * surf_lsm_h%us(m)**2 / g ) |
---|
4174 | |
---|
4175 | surf_lsm_h%z0h(m) = 0.40_wp * molecular_viscosity / & |
---|
4176 | surf_lsm_h%us(m) |
---|
4177 | surf_lsm_h%z0q(m) = 0.62_wp * molecular_viscosity / & |
---|
4178 | surf_lsm_h%us(m) |
---|
4179 | |
---|
4180 | ENDIF |
---|
4181 | ENDDO |
---|
4182 | |
---|
4183 | END SUBROUTINE calc_z0_water_surface |
---|
4184 | |
---|
4185 | |
---|
4186 | |
---|
4187 | END MODULE land_surface_model_mod |
---|