1 | !> @file urban_surface_mod.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
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 2015-2018 Czech Technical University in Prague |
---|
18 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
19 | !--------------------------------------------------------------------------------! |
---|
20 | ! |
---|
21 | ! Current revisions: |
---|
22 | ! ------------------ |
---|
23 | ! |
---|
24 | ! |
---|
25 | ! Former revisions: |
---|
26 | ! ----------------- |
---|
27 | ! $Id: urban_surface_mod.f90 2718 2018-01-02 08:49:38Z maronga $ |
---|
28 | ! Corrected "Former revisions" section |
---|
29 | ! |
---|
30 | ! 2705 2017-12-18 11:26:23Z maronga |
---|
31 | ! Changes from last commit documented |
---|
32 | ! |
---|
33 | ! 2703 2017-12-15 20:12:38Z maronga |
---|
34 | ! Workaround for calculation of r_a |
---|
35 | ! |
---|
36 | ! 2696 2017-12-14 17:12:51Z kanani |
---|
37 | ! - Change in file header (GPL part) |
---|
38 | ! - Bugfix in calculation of pt_surface and related fluxes. (BM) |
---|
39 | ! - Do not write surface temperatures onto pt array as this might cause |
---|
40 | ! problems with nesting. (MS) |
---|
41 | ! - Revised calculation of pt1 (now done in surface_layer_fluxes). |
---|
42 | ! Bugfix, f_shf_window and f_shf_green were not set at vertical surface |
---|
43 | ! elements. (MS) |
---|
44 | ! - merged with branch ebsolver |
---|
45 | ! green building surfaces do not evaporate yet |
---|
46 | ! properties of green wall layers and window layers are taken from wall layers |
---|
47 | ! this input data is missing. (RvT) |
---|
48 | ! - Merged with branch radiation (developed by Mohamed Salim) |
---|
49 | ! - Revised initialization. (MS) |
---|
50 | ! - Rename emiss_surf into emissivity, roughness_wall into z0, albedo_surf into |
---|
51 | ! albedo. (MS) |
---|
52 | ! - Move first call of usm_radiatin from usm_init to init_3d_model |
---|
53 | ! - fixed problem with near surface temperature |
---|
54 | ! - added near surface temperature t_surf_10cm_h(m), t_surf_10cm_v(l)%t(m) |
---|
55 | ! - does not work with temp profile including stability, ol |
---|
56 | ! t_surf_10cm = pt1 now |
---|
57 | ! - merged with 2357 bugfix, error message for nopointer version |
---|
58 | ! - added indoor model coupling with wall heat flux |
---|
59 | ! - added green substrate/ dry vegetation layer for buildings |
---|
60 | ! - merged with 2232 new surface-type structure |
---|
61 | ! - added transmissivity of window tiles |
---|
62 | ! - added MOSAIK tile approach for 3 different surfaces (RvT) |
---|
63 | ! |
---|
64 | ! 2583 2017-10-26 13:58:38Z knoop |
---|
65 | ! Bugfix: reverted MPI_Win_allocate_cptr introduction in last commit |
---|
66 | ! |
---|
67 | ! 2582 2017-10-26 13:19:46Z hellstea |
---|
68 | ! Workaround for gnufortran compiler added in usm_calc_svf. CALL MPI_Win_allocate is |
---|
69 | ! replaced by CALL MPI_Win_allocate_cptr if defined ( __gnufortran ). |
---|
70 | ! |
---|
71 | ! 2544 2017-10-13 18:09:32Z maronga |
---|
72 | ! Date and time quantities are now read from date_and_time_mod. Solar constant is |
---|
73 | ! read from radiation_model_mod |
---|
74 | ! |
---|
75 | ! 2516 2017-10-04 11:03:04Z suehring |
---|
76 | ! Remove tabs |
---|
77 | ! |
---|
78 | ! 2514 2017-10-04 09:52:37Z suehring |
---|
79 | ! upper bounds of 3d output changed from nx+1,ny+1 to nx,ny |
---|
80 | ! no output of ghost layer data |
---|
81 | ! |
---|
82 | ! 2350 2017-08-15 11:48:26Z kanani |
---|
83 | ! Bugfix and error message for nopointer version. |
---|
84 | ! Additional "! defined(__nopointer)" as workaround to enable compilation of |
---|
85 | ! nopointer version. |
---|
86 | ! |
---|
87 | ! 2318 2017-07-20 17:27:44Z suehring |
---|
88 | ! Get topography top index via Function call |
---|
89 | ! |
---|
90 | ! 2317 2017-07-20 17:27:19Z suehring |
---|
91 | ! Bugfix: adjust output of shf. Added support for spinups |
---|
92 | ! |
---|
93 | ! 2287 2017-06-15 16:46:30Z suehring |
---|
94 | ! Bugfix in determination topography-top index |
---|
95 | ! |
---|
96 | ! 2269 2017-06-09 11:57:32Z suehring |
---|
97 | ! Enable restart runs with different number of PEs |
---|
98 | ! Bugfixes nopointer branch |
---|
99 | ! |
---|
100 | ! 2258 2017-06-08 07:55:13Z suehring |
---|
101 | ! Bugfix, add pre-preprocessor directives to enable non-parrallel mode |
---|
102 | ! |
---|
103 | ! 2233 2017-05-30 18:08:54Z suehring |
---|
104 | ! |
---|
105 | ! 2232 2017-05-30 17:47:52Z suehring |
---|
106 | ! Adjustments according to new surface-type structure. Remove usm_wall_heat_flux; |
---|
107 | ! insteat, heat fluxes are directly applied in diffusion_s. |
---|
108 | ! |
---|
109 | ! 2213 2017-04-24 15:10:35Z kanani |
---|
110 | ! Removal of output quantities usm_lad and usm_canopy_hr |
---|
111 | ! |
---|
112 | ! 2209 2017-04-19 09:34:46Z kanani |
---|
113 | ! cpp switch __mpi3 removed, |
---|
114 | ! minor formatting, |
---|
115 | ! small bugfix for division by zero (Krc) |
---|
116 | ! |
---|
117 | ! 2113 2017-01-12 13:40:46Z kanani |
---|
118 | ! cpp switch __mpi3 added for MPI-3 standard code (Ketelsen) |
---|
119 | ! |
---|
120 | ! 2071 2016-11-17 11:22:14Z maronga |
---|
121 | ! Small bugfix (Resler) |
---|
122 | ! |
---|
123 | ! 2031 2016-10-21 15:11:58Z knoop |
---|
124 | ! renamed variable rho to rho_ocean |
---|
125 | ! |
---|
126 | ! 2024 2016-10-12 16:42:37Z kanani |
---|
127 | ! Bugfixes in deallocation of array plantt and reading of csf/csfsurf, |
---|
128 | ! optimization of MPI-RMA operations, |
---|
129 | ! declaration of pcbl as integer, |
---|
130 | ! renamed usm_radnet -> usm_rad_net, usm_canopy_khf -> usm_canopy_hr, |
---|
131 | ! splitted arrays svf -> svf & csf, svfsurf -> svfsurf & csfsurf, |
---|
132 | ! use of new control parameter varnamelength, |
---|
133 | ! added output variables usm_rad_ressw, usm_rad_reslw, |
---|
134 | ! minor formatting changes, |
---|
135 | ! minor optimizations. |
---|
136 | ! |
---|
137 | ! 2011 2016-09-19 17:29:57Z kanani |
---|
138 | ! Major reformatting according to PALM coding standard (comments, blanks, |
---|
139 | ! alphabetical ordering, etc.), |
---|
140 | ! removed debug_prints, |
---|
141 | ! removed auxiliary SUBROUTINE get_usm_info, instead, USM flag urban_surface is |
---|
142 | ! defined in MODULE control_parameters (modules.f90) to avoid circular |
---|
143 | ! dependencies, |
---|
144 | ! renamed canopy_heat_flux to pc_heating_rate, as meaning of quantity changed. |
---|
145 | ! |
---|
146 | ! 2007 2016-08-24 15:47:17Z kanani |
---|
147 | ! Initial revision |
---|
148 | ! |
---|
149 | ! |
---|
150 | ! Description: |
---|
151 | ! ------------ |
---|
152 | ! 2016/6/9 - Initial version of the USM (Urban Surface Model) |
---|
153 | ! authors: Jaroslav Resler, Pavel Krc |
---|
154 | ! (Czech Technical University in Prague and Institute of |
---|
155 | ! Computer Science of the Czech Academy of Sciences, Prague) |
---|
156 | ! with contributions: Michal Belda, Nina Benesova, Ondrej Vlcek |
---|
157 | ! partly inspired by PALM LSM (B. Maronga) |
---|
158 | ! parameterizations of Ra checked with TUF3D (E. S. Krayenhoff) |
---|
159 | !> Module for Urban Surface Model (USM) |
---|
160 | !> The module includes: |
---|
161 | !> 1. radiation model with direct/diffuse radiation, shading, reflections |
---|
162 | !> and integration with plant canopy |
---|
163 | !> 2. wall and wall surface model |
---|
164 | !> 3. surface layer energy balance |
---|
165 | !> 4. anthropogenic heat (only from transportation so far) |
---|
166 | !> 5. necessary auxiliary subroutines (reading inputs, writing outputs, |
---|
167 | !> restart simulations, ...) |
---|
168 | !> It also make use of standard radiation and integrates it into |
---|
169 | !> urban surface model. |
---|
170 | !> |
---|
171 | !> Further work: |
---|
172 | !> ------------- |
---|
173 | !> 1. Reduce number of shape view factors by merging factors for distant surfaces |
---|
174 | !> under shallow angles. Idea: Iteratively select the smallest shape view |
---|
175 | !> factor by value (among all sources and targets) which has a similarly |
---|
176 | !> oriented source neighbor (or near enough) SVF and merge them by adding |
---|
177 | !> value of the smaller SVF to the larger one and deleting the smaller one. |
---|
178 | !> This will allow for better scaling at higher resolutions. |
---|
179 | !> |
---|
180 | !> 2. Remove global arrays surfouts, surfoutl and only keep track of radiosity |
---|
181 | !> from surfaces that are visible from local surfaces (i.e. there is a SVF |
---|
182 | !> where target is local). To do that, radiosity will be exchanged after each |
---|
183 | !> reflection step using MPI_Alltoall instead of current MPI_Allgather. |
---|
184 | !> |
---|
185 | !> 3. Temporarily large values of surface heat flux can be observed, up to |
---|
186 | !> 1.2 Km/s, which seem to be not realistic. |
---|
187 | !> |
---|
188 | !> @todo Output of _av variables in case of restarts |
---|
189 | !> @todo Revise flux conversion in energy-balance solver |
---|
190 | !> @todo Bugfixing in nopointer branch |
---|
191 | !> @todo Check optimizations for RMA operations |
---|
192 | !> @todo Alternatives for MPI_WIN_ALLOCATE? (causes problems with openmpi) |
---|
193 | !> @todo Check for load imbalances in CPU measures, e.g. for exchange_horiz_prog |
---|
194 | !> factor 3 between min and max time |
---|
195 | !> @todo Move setting of flag indoor_model to indoor_model_mod once available |
---|
196 | !> @todo Check divisions in wtend (etc.) calculations for possible division |
---|
197 | !> by zero, e.g. in case fraq(0,m) + fraq(1,m) = 0?! |
---|
198 | !> @todo Use unit 90 for OPEN/CLOSE of input files (FK) |
---|
199 | !------------------------------------------------------------------------------! |
---|
200 | MODULE urban_surface_mod |
---|
201 | |
---|
202 | #if ! defined( __nopointer ) |
---|
203 | USE arrays_3d, & |
---|
204 | ONLY: zu, pt, pt_1, pt_2, p, u, v, w, hyp, tend |
---|
205 | #endif |
---|
206 | |
---|
207 | USE cloud_parameters, & |
---|
208 | ONLY: cp, r_d |
---|
209 | |
---|
210 | USE constants, & |
---|
211 | ONLY: pi |
---|
212 | |
---|
213 | USE control_parameters, & |
---|
214 | ONLY: coupling_start_time, dz, topography, dt_3d, & |
---|
215 | intermediate_timestep_count, initializing_actions, & |
---|
216 | intermediate_timestep_count_max, simulated_time, end_time, & |
---|
217 | timestep_scheme, tsc, coupling_char, io_blocks, io_group, & |
---|
218 | message_string, time_since_reference_point, surface_pressure, & |
---|
219 | g, pt_surface, large_scale_forcing, lsf_surf, spinup, & |
---|
220 | spinup_pt_mean, spinup_time, time_do3d, dt_do3d, & |
---|
221 | average_count_3d, varnamelength, urban_surface, kappa |
---|
222 | |
---|
223 | USE cpulog, & |
---|
224 | ONLY: cpu_log, log_point, log_point_s |
---|
225 | |
---|
226 | USE date_and_time_mod, & |
---|
227 | ONLY: d_seconds_year, day_of_year_init, time_utc_init |
---|
228 | |
---|
229 | USE grid_variables, & |
---|
230 | ONLY: dx, dy, ddx, ddy, ddx2, ddy2 |
---|
231 | |
---|
232 | USE indices, & |
---|
233 | ONLY: nx, ny, nnx, nny, nnz, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, & |
---|
234 | nysg, nzb, nzt, nbgp, wall_flags_0 |
---|
235 | |
---|
236 | USE, INTRINSIC :: iso_c_binding |
---|
237 | |
---|
238 | USE kinds |
---|
239 | |
---|
240 | USE pegrid |
---|
241 | |
---|
242 | USE plant_canopy_model_mod, & |
---|
243 | ONLY: pc_heating_rate, plant_canopy, usm_lad_rma |
---|
244 | |
---|
245 | USE radiation_model_mod, & |
---|
246 | ONLY: albedo_type, radiation, calc_zenith, zenith, & |
---|
247 | rad_sw_in, rad_lw_in, rad_sw_out, rad_lw_out, & |
---|
248 | sigma_sb, solar_constant, sun_direction, sun_dir_lat, & |
---|
249 | sun_dir_lon, & |
---|
250 | force_radiation_call, surfinsw, surfinlw, surfinswdir, & |
---|
251 | surfinswdif, surfoutsw, surfoutlw, surfins,nsvfl, svf, svfsurf, & |
---|
252 | surfinl, surfinlwdif, energy_balance_surf_h, & |
---|
253 | energy_balance_surf_v, rad_sw_in_dir, rad_sw_in_diff, & |
---|
254 | rad_lw_in_diff, surfouts, surfoutl, surfoutsl, surfoutll, surf, & |
---|
255 | surfl, nsurfl, nsurfs, surfstart, pcbinsw, pcbinlw, pcbl, npcbl, startenergy, & |
---|
256 | endenergy, nenergy, iup_u, inorth_u, isouth_u, ieast_u, iwest_u, iup_l, & |
---|
257 | inorth_l, isouth_l, ieast_l, iwest_l, startsky, endsky,id, & |
---|
258 | iz, iy, ix, idir, jdir, kdir, startborder, endborder, nsurf_type, nzub, nzut, & |
---|
259 | isky, inorth_b,idown_a, isouth_b, ieast_b, iwest_b, nzu, pch, nsurf, & |
---|
260 | iup_a, inorth_a, isouth_a, ieast_a, iwest_a, idsvf, ndsvf, & |
---|
261 | idcsf, ndcsf, kdcsf, pct, startland, endland, startwall, endwall |
---|
262 | |
---|
263 | USE statistics, & |
---|
264 | ONLY: hom, statistic_regions |
---|
265 | |
---|
266 | USE surface_mod |
---|
267 | |
---|
268 | |
---|
269 | IMPLICIT NONE |
---|
270 | |
---|
271 | |
---|
272 | !-- configuration parameters (they can be setup in PALM config) |
---|
273 | LOGICAL :: usm_material_model = .TRUE. !< flag parameter indicating wheather the model of heat in materials is used |
---|
274 | LOGICAL :: usm_anthropogenic_heat = .FALSE. !< flag parameter indicating wheather the anthropogenic heat sources (e.g.transportation) are used |
---|
275 | LOGICAL :: force_radiation_call_l = .FALSE. !< flag parameter for unscheduled radiation model calls |
---|
276 | LOGICAL :: indoor_model = .FALSE. !< whether to use the indoor model |
---|
277 | |
---|
278 | |
---|
279 | INTEGER(iwp) :: building_type = 1 !< default building type (preleminary setting) |
---|
280 | INTEGER(iwp) :: land_category = 2 !< default category for land surface |
---|
281 | INTEGER(iwp) :: wall_category = 2 !< default category for wall surface over pedestrian zone |
---|
282 | INTEGER(iwp) :: pedestrant_category = 2 !< default category for wall surface in pedestrian zone |
---|
283 | INTEGER(iwp) :: roof_category = 2 !< default category for root surface |
---|
284 | |
---|
285 | ! |
---|
286 | !-- Indices of input attributes for (above) ground floor level |
---|
287 | INTEGER(iwp) :: ind_alb_wall = 38 !< index in input list for albedo_type of wall fraction |
---|
288 | INTEGER(iwp) :: ind_alb_green = 39 !< index in input list for albedo_type of green fraction |
---|
289 | INTEGER(iwp) :: ind_alb_win = 40 !< index in input list for albedo_type of window fraction |
---|
290 | INTEGER(iwp) :: ind_emis_wall_agfl = 14 !< index in input list for wall emissivity, above ground floor level |
---|
291 | INTEGER(iwp) :: ind_emis_wall_gfl = 32 !< index in input list for wall emissivity, ground floor level |
---|
292 | INTEGER(iwp) :: ind_emis_green_agfl = 15 !< index in input list for green emissivity, above ground floor level |
---|
293 | INTEGER(iwp) :: ind_emis_green_gfl = 33 !< index in input list for green emissivity, ground floor level |
---|
294 | INTEGER(iwp) :: ind_emis_win_agfl = 16 !< index in input list for window emissivity, above ground floor level |
---|
295 | INTEGER(iwp) :: ind_emis_win_gfl = 34 !< index in input list for window emissivity, ground floor level |
---|
296 | INTEGER(iwp) :: ind_green_frac_w_agfl = 2 !< index in input list for green fraction on wall, above ground floor level |
---|
297 | INTEGER(iwp) :: ind_green_frac_w_gfl = 23 !< index in input list for green fraction on wall, ground floor level |
---|
298 | INTEGER(iwp) :: ind_green_frac_r_agfl = 3 !< index in input list for green fraction on roof, above ground floor level |
---|
299 | INTEGER(iwp) :: ind_green_frac_r_gfl = 24 !< index in input list for green fraction on roof, ground floor level |
---|
300 | INTEGER(iwp) :: ind_hc1_agfl = 6 !< index in input list for heat capacity at first wall layer, above ground floor level |
---|
301 | INTEGER(iwp) :: ind_hc1_gfl = 26 !< index in input list for heat capacity at first wall layer, ground floor level |
---|
302 | INTEGER(iwp) :: ind_hc2_agfl = 7 !< index in input list for heat capacity at second wall layer, above ground floor level |
---|
303 | INTEGER(iwp) :: ind_hc2_gfl = 27 !< index in input list for heat capacity at second wall layer, ground floor level |
---|
304 | INTEGER(iwp) :: ind_hc3_agfl = 8 !< index in input list for heat capacity at third wall layer, above ground floor level |
---|
305 | INTEGER(iwp) :: ind_hc3_gfl = 28 !< index in input list for heat capacity at third wall layer, ground floor level |
---|
306 | INTEGER(iwp) :: ind_gflh = 20 !< index in input list for ground floor level height |
---|
307 | INTEGER(iwp) :: ind_lai_r_agfl = 4 !< index in input list for LAI on roof, above ground floor level |
---|
308 | INTEGER(iwp) :: ind_lai_r_gfl = 4 !< index in input list for LAI on roof, ground floor level |
---|
309 | INTEGER(iwp) :: ind_lai_w_agfl = 5 !< index in input list for LAI on wall, above ground floor level |
---|
310 | INTEGER(iwp) :: ind_lai_w_gfl = 25 !< index in input list for LAI on wall, ground floor level |
---|
311 | INTEGER(iwp) :: ind_tc1_agfl = 9 !< index in input list for thermal conductivity at first wall layer, above ground floor level |
---|
312 | INTEGER(iwp) :: ind_tc1_gfl = 29 !< index in input list for thermal conductivity at first wall layer, ground floor level |
---|
313 | INTEGER(iwp) :: ind_tc2_agfl = 10 !< index in input list for thermal conductivity at second wall layer, above ground floor level |
---|
314 | INTEGER(iwp) :: ind_tc2_gfl = 30 !< index in input list for thermal conductivity at second wall layer, ground floor level |
---|
315 | INTEGER(iwp) :: ind_tc3_agfl = 11 !< index in input list for thermal conductivity at third wall layer, above ground floor level |
---|
316 | INTEGER(iwp) :: ind_tc3_gfl = 31 !< index in input list for thermal conductivity at third wall layer, ground floor level |
---|
317 | INTEGER(iwp) :: ind_thick_1 = 41 !< index for wall layer thickness - 1st layer |
---|
318 | INTEGER(iwp) :: ind_thick_2 = 42 !< index for wall layer thickness - 2nd layer |
---|
319 | INTEGER(iwp) :: ind_thick_3 = 43 !< index for wall layer thickness - 3rd layer |
---|
320 | INTEGER(iwp) :: ind_thick_4 = 44 !< index for wall layer thickness - 4th layer |
---|
321 | INTEGER(iwp) :: ind_trans_agfl = 17 !< index in input list for window transmissivity, above ground floor level |
---|
322 | INTEGER(iwp) :: ind_trans_gfl = 35 !< index in input list for window transmissivity, ground floor level |
---|
323 | INTEGER(iwp) :: ind_wall_frac_agfl = 0 !< index in input list for wall fraction, above ground floor level |
---|
324 | INTEGER(iwp) :: ind_wall_frac_gfl = 21 !< index in input list for wall fraction, ground floor level |
---|
325 | INTEGER(iwp) :: ind_win_frac_agfl = 1 !< index in input list for window fraction, above ground floor level |
---|
326 | INTEGER(iwp) :: ind_win_frac_gfl = 22 !< index in input list for window fraction, ground floor level |
---|
327 | INTEGER(iwp) :: ind_z0_agfl = 18 !< index in input list for z0, above ground floor level |
---|
328 | INTEGER(iwp) :: ind_z0_gfl = 36 !< index in input list for z0, ground floor level |
---|
329 | INTEGER(iwp) :: ind_z0qh_agfl = 19 !< index in input list for z0h / z0q, above ground floor level |
---|
330 | INTEGER(iwp) :: ind_z0qh_gfl = 37 !< index in input list for z0h / z0q, ground floor level |
---|
331 | |
---|
332 | |
---|
333 | REAL(wp) :: roof_height_limit = 4._wp !< height for distinguish between land surfaces and roofs |
---|
334 | REAL(wp) :: ground_floor_level = 4.0_wp !< default ground floor level |
---|
335 | REAL(wp) :: ra_horiz_coef = 5.0_wp !< mysterious coefficient for correction of overestimation |
---|
336 | !< of r_a for horizontal surfaces -> TODO |
---|
337 | |
---|
338 | CHARACTER(37), DIMENSION(0:6), PARAMETER :: building_type_name = (/ & |
---|
339 | 'user-defined ', & ! 0 |
---|
340 | 'residential - 1950 ', & ! 1 |
---|
341 | 'residential 1951 - 2000 ', & ! 2 |
---|
342 | 'residential 2001 - ', & ! 3 |
---|
343 | 'office - 1950 ', & ! 4 |
---|
344 | 'office 1951 - 2000 ', & ! 5 |
---|
345 | 'office 2001 - ' & ! 6 |
---|
346 | /) |
---|
347 | ! |
---|
348 | !-- building parameters, 4 different types |
---|
349 | !-- 0 - wall fraction, 1- window fraction, 2 - green fraction on wall, 3- green fraction |
---|
350 | !-- at roof, 4 - lai of green fraction at roof, 5 - lai of green fraction at wall, |
---|
351 | !-- 6 - heat capacity of wall layer 1, 7 - heat capacity of wall layer 2, |
---|
352 | !-- 8 - heat capacity of wall layer 3, 9 - thermal conductivity of wall layer 1, |
---|
353 | !-- 10 - thermal conductivity of wall layer 2, 11 - thermal conductivity of wall layer 3, |
---|
354 | !-- 12 - indoor target summer temperature ( K ), 13 - indoor target winter temperature (K), |
---|
355 | !-- 14 - emissivity of wall fraction, 15 - emissivity of green fraction, 16 - emissivity of window fraction, |
---|
356 | !-- 17 - transmissivity of window fraction, 18 - z0, 19 - z0h/z0q, 20 - ground floor height, |
---|
357 | !-- 21 - ground floor wall fraction, 22 - ground floor window fraction, 23 ground floor green fraction, |
---|
358 | !-- 24 - ground floor green fraction on roof, 25 - ground floor lai of green fraction, |
---|
359 | !-- 26 - ground floor heat capacity of wall layer 1, 27 - ground floor heat capacity of wall layer 1, |
---|
360 | !-- 28 - ground floor heat capacity of wall layer 3, 29 - ground floor thermal conductivity of wall layer 1, |
---|
361 | !-- 30 - ground floor thermal conductivity of wall layer 2, 31 - ground floor thermal conductivity of wall layer 3, |
---|
362 | !-- 32 - ground floor emissivity of wall fraction, 33 - ground floor emissivity of green fraction, |
---|
363 | !-- 34 - ground floor emissivity of window fraction, 35 - ground floor transmissivity of window fraction, |
---|
364 | !-- 36 - ground floor z0, 37 - ground floor z0h/z0q, 38 - albedo type wall fraction |
---|
365 | !-- 39 - albedo type green fraction, 40 - albedo type window fraction |
---|
366 | !-- 41 - wall layer thickness - 1st layer, 42 - wall layer thickness - 2nd layer, |
---|
367 | !-- 43 - wall layer thickness - 3rd layer, 44 - wall layer thickness - 4th layer, |
---|
368 | !-- 45 - heat capacity of the wall surface, 46 - heat conductivity |
---|
369 | !-- Please note, only preleminary dummy values so far! |
---|
370 | REAL(wp), DIMENSION(0:46,1:6), PARAMETER :: building_pars = RESHAPE( (/ & |
---|
371 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, & !parameter 0-5 |
---|
372 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 6-11 |
---|
373 | 296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp, & !parameter 12-17 |
---|
374 | 0.01_wp, 0.001_wp, 4.0_wp, & !parameter 18-20 |
---|
375 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, & !parameter 21-25 |
---|
376 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, & !parameter 26-28 |
---|
377 | 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 29-31 |
---|
378 | 0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp, & !parameter 32-37 |
---|
379 | 24.0_wp, 24.0_wp, 24.0_wp, & !parameter 38-40 |
---|
380 | 0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp, & !parameter 41-44 |
---|
381 | 20000.0_wp, 10.0_wp, & !parameter 45-46 - end of type 1 |
---|
382 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, & !parameter 0-5 |
---|
383 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 6-11 |
---|
384 | 296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp, & !parameter 12-17 |
---|
385 | 0.01_wp, 0.001_wp, 4.0_wp, & !parameter 18-20 |
---|
386 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, & !parameter 21-25 |
---|
387 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, & !parameter 26-28 |
---|
388 | 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 29-31 |
---|
389 | 0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp, & !parameter 32-37 |
---|
390 | 24.0_wp, 24.0_wp, 24.0_wp, & !parameter 38-40 |
---|
391 | 0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp, & !parameter 41-44 |
---|
392 | 20000.0_wp, 10.0_wp, & !parameter 45-46 - end of type 2 |
---|
393 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, & !parameter 0-5 |
---|
394 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 6-11 |
---|
395 | 296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp, & !parameter 12-17 |
---|
396 | 0.01_wp, 0.001_wp, 4.0_wp, & !parameter 18-20 |
---|
397 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, & !parameter 21-25 |
---|
398 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, & !parameter 26-28 |
---|
399 | 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 29-31 |
---|
400 | 0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp, & !parameter 32-37 |
---|
401 | 24.0_wp, 24.0_wp, 24.0_wp, & !parameter 38-40 |
---|
402 | 0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp, & !parameter 41-44 |
---|
403 | 20000.0_wp, 10.0_wp, & !parameter 45-46 - end of type 3 |
---|
404 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, & !parameter 0-5 |
---|
405 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 6-11 |
---|
406 | 296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp, & !parameter 12-17 |
---|
407 | 0.01_wp, 0.001_wp, 4.0_wp, & !parameter 18-20 |
---|
408 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, & !parameter 21-25 |
---|
409 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, & !parameter 26-28 |
---|
410 | 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 29-31 |
---|
411 | 0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp, & !parameter 32-37 |
---|
412 | 24.0_wp, 24.0_wp, 24.0_wp, & !parameter 38-40 |
---|
413 | 0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp, & !parameter 41-44 |
---|
414 | 20000.0_wp, 10.0_wp, & !parameter 45-46 - end of type 4 |
---|
415 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, & !parameter 0-5 |
---|
416 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 6-11 |
---|
417 | 296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp, & !parameter 12-17 |
---|
418 | 0.01_wp, 0.001_wp, 4.0_wp, & !parameter 18-20 |
---|
419 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, & !parameter 21-25 |
---|
420 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, & !parameter 26-28 |
---|
421 | 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 29-31 |
---|
422 | 0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp, & !parameter 32-37 |
---|
423 | 24.0_wp, 24.0_wp, 24.0_wp, & !parameter 38-40 |
---|
424 | 0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp, & !parameter 41-44 |
---|
425 | 20000.0_wp, 10.0_wp, & !parameter 45-46 - end of type 5 |
---|
426 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 1.0_wp, 1.0_wp, & !parameter 0-5 |
---|
427 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 6-11 |
---|
428 | 296.15_wp, 293.15_wp, 0.9_wp, 0.9_wp, 0.01_wp, 0.99_wp, & !parameter 12-17 |
---|
429 | 0.01_wp, 0.001_wp, 4.0_wp, & !parameter 18-20 |
---|
430 | 1.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 3.0_wp, & !parameter 21-25 |
---|
431 | 1000000.0_wp, 1000000.0_wp, 1000000.0_wp, & !parameter 26-28 |
---|
432 | 0.3_wp, 0.3_wp, 0.3_wp, & !parameter 29-31 |
---|
433 | 0.4_wp, 0.4_wp, 0.4_wp, 0.4_wp, 0.01_wp, 0.001_wp, & !parameter 32-37 |
---|
434 | 24.0_wp, 24.0_wp, 24.0_wp, & !parameter 38-40 |
---|
435 | 0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp, & !parameter 41-44 |
---|
436 | 20000.0_wp, 10.0_wp & !parameter 45-46 - end of type 6 |
---|
437 | /), & |
---|
438 | (/47, 6/) ) |
---|
439 | |
---|
440 | ! |
---|
441 | !-- Type for surface temperatures at vertical walls. Is not necessary for horizontal walls. |
---|
442 | TYPE t_surf_vertical |
---|
443 | REAL(wp), DIMENSION(:), ALLOCATABLE :: t |
---|
444 | END TYPE t_surf_vertical |
---|
445 | ! |
---|
446 | !-- Type for wall temperatures at vertical walls. Is not necessary for horizontal walls. |
---|
447 | TYPE t_wall_vertical |
---|
448 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: t |
---|
449 | END TYPE t_wall_vertical |
---|
450 | |
---|
451 | |
---|
452 | !-- arrays for time averages |
---|
453 | !-- Attention: the variable rad_net_av is also used in the 3d field variable in radiation_model_mod.f90. It may be better to rename it |
---|
454 | REAL(wp), DIMENSION(:), ALLOCATABLE :: rad_net_av !< average of rad_net_l |
---|
455 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinsw_av !< average of sw radiation falling to local surface including radiation from reflections |
---|
456 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinlw_av !< average of lw radiation falling to local surface including radiation from reflections |
---|
457 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinswdir_av !< average of direct sw radiation falling to local surface |
---|
458 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinswdif_av !< average of diffuse sw radiation from sky and model boundary falling to local surface |
---|
459 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinlwdif_av !< average of diffuse lw radiation from sky and model boundary falling to local surface |
---|
460 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinswref_av !< average of sw radiation falling to surface from reflections |
---|
461 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinlwref_av !< average of lw radiation falling to surface from reflections |
---|
462 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfoutsw_av !< average of total sw radiation outgoing from nonvirtual surfaces surfaces after all reflection |
---|
463 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfoutlw_av !< average of total lw radiation outgoing from nonvirtual surfaces surfaces after all reflection |
---|
464 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfins_av !< average of array of residua of sw radiation absorbed in surface after last reflection |
---|
465 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfinl_av !< average of array of residua of lw radiation absorbed in surface after last reflection |
---|
466 | REAL(wp), DIMENSION(:), ALLOCATABLE :: surfhf_av !< average of total radiation flux incoming to minus outgoing from local surface |
---|
467 | REAL(wp), DIMENSION(:), ALLOCATABLE :: wghf_eb_av !< average of wghf_eb |
---|
468 | REAL(wp), DIMENSION(:), ALLOCATABLE :: wshf_eb_av !< average of wshf_eb |
---|
469 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: t_wall_av !< Average of t_wall |
---|
470 | REAL(wp), DIMENSION(:), ALLOCATABLE :: wghf_eb_green_av !< average of wghf_eb_green |
---|
471 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: t_green_av !< Average of t_green |
---|
472 | REAL(wp), DIMENSION(:), ALLOCATABLE :: wghf_eb_window_av !< average of wghf_eb_window |
---|
473 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: t_window_av !< Average of t_window |
---|
474 | |
---|
475 | |
---|
476 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
477 | !-- anthropogenic heat sources |
---|
478 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
479 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: aheat !< daily average of anthropogenic heat (W/m2) |
---|
480 | REAL(wp), DIMENSION(:), ALLOCATABLE :: aheatprof !< diurnal profile of anthropogenic heat |
---|
481 | |
---|
482 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
483 | !-- wall surface model |
---|
484 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
485 | !-- wall surface model constants |
---|
486 | INTEGER(iwp), PARAMETER :: nzb_wall = 0 !< inner side of the wall model (to be switched) |
---|
487 | INTEGER(iwp), PARAMETER :: nzt_wall = 3 !< outer side of the wall model (to be switched) |
---|
488 | INTEGER(iwp), PARAMETER :: nzw = 4 !< number of wall layers (fixed for now) |
---|
489 | |
---|
490 | REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default = (/0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp /) |
---|
491 | !< normalized soil, wall and roof layer depths (m/m) |
---|
492 | ! REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default = (/0.33_wp, 0.66_wp, 1.0_wp /) |
---|
493 | REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default_window = (/0.25_wp, 0.5_wp, 0.75_wp, 1.0_wp /) |
---|
494 | ! REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default_window = (/0.33_wp, 0.66_wp, 1.0_wp /) |
---|
495 | ! REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default_window = (/0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp /) |
---|
496 | !< normalized window layer depths (m/m) |
---|
497 | ! REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default_green = (/0.0242_wp, 0.0969_wp, 0.346_wp, 1.0_wp /) |
---|
498 | !< normalized green layer depths (m/m) |
---|
499 | REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default_green = (/0.25_wp, 0.5_wp, 0.75_wp, 1.0_wp /) |
---|
500 | ! REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: zwn_default_green = (/0.33_wp, 0.66_wp, 1.0_wp /) |
---|
501 | |
---|
502 | |
---|
503 | REAL(wp) :: wall_inner_temperature = 296.0_wp !< temperature of the inner wall surface (~23 degrees C) (K) |
---|
504 | REAL(wp) :: roof_inner_temperature = 296.0_wp !< temperature of the inner roof surface (~23 degrees C) (K) |
---|
505 | REAL(wp) :: soil_inner_temperature = 283.0_wp !< temperature of the deep soil (~10 degrees C) (K) |
---|
506 | REAL(wp) :: window_inner_temperature = 296.0_wp !< temperature of the inner window surface (~23 degrees C) (K) |
---|
507 | |
---|
508 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
509 | !-- surface and material model variables for walls, ground, roofs |
---|
510 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
511 | REAL(wp), DIMENSION(:), ALLOCATABLE :: zwn !< normalized wall layer depths (m) |
---|
512 | REAL(wp), DIMENSION(:), ALLOCATABLE :: zwn_window !< normalized window layer depths (m) |
---|
513 | REAL(wp), DIMENSION(:), ALLOCATABLE :: zwn_green !< normalized green layer depths (m) |
---|
514 | |
---|
515 | #if defined( __nopointer ) |
---|
516 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_h !< wall surface temperature (K) at horizontal walls |
---|
517 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_h_p !< progn. wall surface temperature (K) at horizontal walls |
---|
518 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_window_h !< window surface temperature (K) at horizontal walls |
---|
519 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_window_h_p !< progn. window surface temperature (K) at horizontal walls |
---|
520 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_green_h !< green surface temperature (K) at horizontal walls |
---|
521 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_green_h_p !< progn. green surface temperature (K) at horizontal walls |
---|
522 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_whole_h !< whole surface temperature (K) at horizontal walls |
---|
523 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_whole_h_p !< progn. whole surface temperature (K) at horizontal walls |
---|
524 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_10cm_h !< near surface temperature (10cm) (K) at horizontal walls |
---|
525 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_10cm_h_p !< progn. near surface temperature (10cm) (K) at horizontal walls |
---|
526 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_v |
---|
527 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_v_p |
---|
528 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_window_v |
---|
529 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_window_v_p |
---|
530 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_green_v |
---|
531 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_green_v_p |
---|
532 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_whole_v |
---|
533 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_whole_v_p |
---|
534 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_10cm_v |
---|
535 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_10cm_v_p |
---|
536 | #else |
---|
537 | REAL(wp), DIMENSION(:), POINTER :: t_surf_h |
---|
538 | REAL(wp), DIMENSION(:), POINTER :: t_surf_h_p |
---|
539 | REAL(wp), DIMENSION(:), POINTER :: t_surf_window_h |
---|
540 | REAL(wp), DIMENSION(:), POINTER :: t_surf_window_h_p |
---|
541 | REAL(wp), DIMENSION(:), POINTER :: t_surf_green_h |
---|
542 | REAL(wp), DIMENSION(:), POINTER :: t_surf_green_h_p |
---|
543 | REAL(wp), DIMENSION(:), POINTER :: t_surf_whole_h |
---|
544 | REAL(wp), DIMENSION(:), POINTER :: t_surf_whole_h_p |
---|
545 | REAL(wp), DIMENSION(:), POINTER :: t_surf_10cm_h |
---|
546 | REAL(wp), DIMENSION(:), POINTER :: t_surf_10cm_h_p |
---|
547 | |
---|
548 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_h_1 |
---|
549 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_h_2 |
---|
550 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_window_h_1 |
---|
551 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_window_h_2 |
---|
552 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_green_h_1 |
---|
553 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_green_h_2 |
---|
554 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_whole_h_1 |
---|
555 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_whole_h_2 |
---|
556 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_10cm_h_1 |
---|
557 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_10cm_h_2 |
---|
558 | |
---|
559 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_v |
---|
560 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_v_p |
---|
561 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_window_v |
---|
562 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_window_v_p |
---|
563 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_green_v |
---|
564 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_green_v_p |
---|
565 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_whole_v |
---|
566 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_whole_v_p |
---|
567 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_10cm_v |
---|
568 | TYPE(t_surf_vertical), DIMENSION(:), POINTER :: t_surf_10cm_v_p |
---|
569 | |
---|
570 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_v_1 |
---|
571 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_v_2 |
---|
572 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_window_v_1 |
---|
573 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_window_v_2 |
---|
574 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_green_v_1 |
---|
575 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_green_v_2 |
---|
576 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_whole_v_1 |
---|
577 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_whole_v_2 |
---|
578 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_10cm_v_1 |
---|
579 | TYPE(t_surf_vertical), DIMENSION(0:3), TARGET :: t_surf_10cm_v_2 |
---|
580 | |
---|
581 | #endif |
---|
582 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_av !< average of wall surface temperature (K) |
---|
583 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_window_av !< average of window surface temperature (K) |
---|
584 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_green_av !< average of green wall surface temperature (K) |
---|
585 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_whole_av !< average of whole wall surface temperature (K) |
---|
586 | REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET :: t_surf_10cm_av !< average of whole wall surface temperature (K) |
---|
587 | |
---|
588 | !-- Temporal tendencies for time stepping |
---|
589 | REAL(wp), DIMENSION(:), ALLOCATABLE :: tt_surface_m !< surface temperature tendency of wall (K) |
---|
590 | REAL(wp), DIMENSION(:), ALLOCATABLE :: tt_surface_window_m !< surface temperature tendency of window (K) |
---|
591 | REAL(wp), DIMENSION(:), ALLOCATABLE :: tt_surface_green_m !< surface temperature tendency of green wall (K) |
---|
592 | |
---|
593 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
594 | !-- Energy balance variables |
---|
595 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
596 | !-- parameters of the land, roof and wall surfaces |
---|
597 | |
---|
598 | #if defined( __nopointer ) |
---|
599 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_wall_h !< Wall temperature (K) |
---|
600 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_wall_h_av !< Average of t_wall |
---|
601 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_wall_h_p !< Prog. wall temperature (K) |
---|
602 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_window_h !< Window temperature (K) |
---|
603 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_window_h_av !< Average of t_window |
---|
604 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_window_h_p !< Prog. window temperature (K) |
---|
605 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_green_h !< Green temperature (K) |
---|
606 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_green_h_av !< Average of t_green |
---|
607 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_green_h_p !< Prog. green temperature (K) |
---|
608 | |
---|
609 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_wall_v !< Wall temperature (K) |
---|
610 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_wall_v_av !< Average of t_wall |
---|
611 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_wall_v_p !< Prog. wall temperature (K) |
---|
612 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_window_v !< Window temperature (K) |
---|
613 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_window_v_av !< Average of t_window |
---|
614 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_window_v_p !< Prog. window temperature (K) |
---|
615 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_green_v !< Green temperature (K) |
---|
616 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_green_v_av !< Average of t_green |
---|
617 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_green_v_p !< Prog. green temperature (K) |
---|
618 | #else |
---|
619 | REAL(wp), DIMENSION(:,:), POINTER :: t_wall_h, t_wall_h_p |
---|
620 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_wall_h_av, t_wall_h_1, t_wall_h_2 |
---|
621 | REAL(wp), DIMENSION(:,:), POINTER :: t_window_h, t_window_h_p |
---|
622 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_window_h_av, t_window_h_1, t_window_h_2 |
---|
623 | REAL(wp), DIMENSION(:,:), POINTER :: t_green_h, t_green_h_p |
---|
624 | REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET :: t_green_h_av, t_green_h_1, t_green_h_2 |
---|
625 | |
---|
626 | TYPE(t_wall_vertical), DIMENSION(:), POINTER :: t_wall_v, t_wall_v_p |
---|
627 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_wall_v_av, t_wall_v_1, t_wall_v_2 |
---|
628 | TYPE(t_wall_vertical), DIMENSION(:), POINTER :: t_window_v, t_window_v_p |
---|
629 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_window_v_av, t_window_v_1, t_window_v_2 |
---|
630 | TYPE(t_wall_vertical), DIMENSION(:), POINTER :: t_green_v, t_green_v_p |
---|
631 | TYPE(t_wall_vertical), DIMENSION(0:3), TARGET :: t_green_v_av, t_green_v_1, t_green_v_2 |
---|
632 | #endif |
---|
633 | |
---|
634 | !-- Wall temporal tendencies for time stepping |
---|
635 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tt_wall_m !< t_wall prognostic array |
---|
636 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tt_window_m !< t_window prognostic array |
---|
637 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tt_green_m !< t_green prognostic array |
---|
638 | |
---|
639 | !-- Surface and material parameters classes (surface_type) |
---|
640 | !-- albedo, emissivity, lambda_surf, roughness, thickness, volumetric heat capacity, thermal conductivity |
---|
641 | INTEGER(iwp) :: n_surface_types !< number of the wall type categories |
---|
642 | INTEGER(iwp), PARAMETER :: n_surface_params = 8 !< number of parameters for each type of the wall |
---|
643 | INTEGER(iwp), PARAMETER :: ialbedo = 1 !< albedo of the surface |
---|
644 | INTEGER(iwp), PARAMETER :: iemiss = 2 !< emissivity of the surface |
---|
645 | INTEGER(iwp), PARAMETER :: ilambdas = 3 !< heat conductivity λS between air and surface ( W mâ2 Kâ1 ) |
---|
646 | INTEGER(iwp), PARAMETER :: irough = 4 !< roughness relative to concrete |
---|
647 | INTEGER(iwp), PARAMETER :: icsurf = 5 !< Surface skin layer heat capacity (J mâ2 Kâ1 ) |
---|
648 | INTEGER(iwp), PARAMETER :: ithick = 6 !< thickness of the surface (wall, roof, land) ( m ) |
---|
649 | INTEGER(iwp), PARAMETER :: irhoC = 7 !< volumetric heat capacity rho*C of the material ( J mâ3 Kâ1 ) |
---|
650 | INTEGER(iwp), PARAMETER :: ilambdah = 8 !< thermal conductivity λH of the wall (W mâ1 Kâ1 ) |
---|
651 | CHARACTER(12), DIMENSION(:), ALLOCATABLE :: surface_type_names !< names of wall types (used only for reports) |
---|
652 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: surface_type_codes !< codes of wall types |
---|
653 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: surface_params !< parameters of wall types |
---|
654 | |
---|
655 | |
---|
656 | !-- interfaces of subroutines accessed from outside of this module |
---|
657 | INTERFACE usm_boundary_condition |
---|
658 | MODULE PROCEDURE usm_boundary_condition |
---|
659 | END INTERFACE usm_boundary_condition |
---|
660 | |
---|
661 | INTERFACE usm_check_data_output |
---|
662 | MODULE PROCEDURE usm_check_data_output |
---|
663 | END INTERFACE usm_check_data_output |
---|
664 | |
---|
665 | INTERFACE usm_check_parameters |
---|
666 | MODULE PROCEDURE usm_check_parameters |
---|
667 | END INTERFACE usm_check_parameters |
---|
668 | |
---|
669 | INTERFACE usm_data_output_3d |
---|
670 | MODULE PROCEDURE usm_data_output_3d |
---|
671 | END INTERFACE usm_data_output_3d |
---|
672 | |
---|
673 | INTERFACE usm_define_netcdf_grid |
---|
674 | MODULE PROCEDURE usm_define_netcdf_grid |
---|
675 | END INTERFACE usm_define_netcdf_grid |
---|
676 | |
---|
677 | INTERFACE usm_init_urban_surface |
---|
678 | MODULE PROCEDURE usm_init_urban_surface |
---|
679 | END INTERFACE usm_init_urban_surface |
---|
680 | |
---|
681 | INTERFACE usm_material_heat_model |
---|
682 | MODULE PROCEDURE usm_material_heat_model |
---|
683 | END INTERFACE usm_material_heat_model |
---|
684 | |
---|
685 | INTERFACE usm_green_heat_model |
---|
686 | MODULE PROCEDURE usm_green_heat_model |
---|
687 | END INTERFACE usm_green_heat_model |
---|
688 | |
---|
689 | INTERFACE usm_parin |
---|
690 | MODULE PROCEDURE usm_parin |
---|
691 | END INTERFACE usm_parin |
---|
692 | |
---|
693 | INTERFACE usm_temperature_near_surface |
---|
694 | MODULE PROCEDURE usm_temperature_near_surface |
---|
695 | END INTERFACE usm_temperature_near_surface |
---|
696 | |
---|
697 | INTERFACE usm_read_restart_data |
---|
698 | MODULE PROCEDURE usm_read_restart_data |
---|
699 | END INTERFACE usm_read_restart_data |
---|
700 | |
---|
701 | INTERFACE usm_surface_energy_balance |
---|
702 | MODULE PROCEDURE usm_surface_energy_balance |
---|
703 | END INTERFACE usm_surface_energy_balance |
---|
704 | |
---|
705 | INTERFACE usm_swap_timelevel |
---|
706 | MODULE PROCEDURE usm_swap_timelevel |
---|
707 | END INTERFACE usm_swap_timelevel |
---|
708 | |
---|
709 | INTERFACE usm_write_restart_data |
---|
710 | MODULE PROCEDURE usm_write_restart_data |
---|
711 | END INTERFACE usm_write_restart_data |
---|
712 | |
---|
713 | INTERFACE usm_allocate_surface |
---|
714 | MODULE PROCEDURE usm_allocate_surface |
---|
715 | END INTERFACE usm_allocate_surface |
---|
716 | |
---|
717 | INTERFACE usm_average_3d_data |
---|
718 | MODULE PROCEDURE usm_average_3d_data |
---|
719 | END INTERFACE usm_average_3d_data |
---|
720 | |
---|
721 | |
---|
722 | SAVE |
---|
723 | |
---|
724 | PRIVATE |
---|
725 | |
---|
726 | !-- Public functions |
---|
727 | PUBLIC usm_boundary_condition, usm_check_parameters, usm_init_urban_surface,& |
---|
728 | usm_read_restart_data, & |
---|
729 | usm_surface_energy_balance, usm_material_heat_model, & |
---|
730 | usm_swap_timelevel, usm_check_data_output, usm_average_3d_data, & |
---|
731 | usm_data_output_3d, usm_define_netcdf_grid, usm_parin, & |
---|
732 | usm_write_restart_data, usm_allocate_surface |
---|
733 | |
---|
734 | !-- Public parameters, constants and initial values |
---|
735 | PUBLIC usm_anthropogenic_heat, usm_material_model, ra_horiz_coef, & |
---|
736 | usm_green_heat_model, usm_temperature_near_surface |
---|
737 | |
---|
738 | |
---|
739 | |
---|
740 | CONTAINS |
---|
741 | |
---|
742 | !------------------------------------------------------------------------------! |
---|
743 | ! Description: |
---|
744 | ! ------------ |
---|
745 | !> This subroutine creates the necessary indices of the urban surfaces |
---|
746 | !> and plant canopy and it allocates the needed arrays for USM |
---|
747 | !------------------------------------------------------------------------------! |
---|
748 | SUBROUTINE usm_allocate_surface |
---|
749 | |
---|
750 | IMPLICIT NONE |
---|
751 | |
---|
752 | INTEGER(iwp) :: l |
---|
753 | |
---|
754 | ! |
---|
755 | !-- Allocate radiation arrays which are part of the new data type. |
---|
756 | !-- For horizontal surfaces. |
---|
757 | ALLOCATE( surf_usm_h%surfhf(1:surf_usm_h%ns) ) |
---|
758 | ALLOCATE( surf_usm_h%rad_net_l(1:surf_usm_h%ns) ) |
---|
759 | ! |
---|
760 | !-- For vertical surfaces |
---|
761 | DO l = 0, 3 |
---|
762 | ALLOCATE( surf_usm_v(l)%surfhf(1:surf_usm_v(l)%ns) ) |
---|
763 | ALLOCATE( surf_usm_v(l)%rad_net_l(1:surf_usm_v(l)%ns) ) |
---|
764 | ENDDO |
---|
765 | |
---|
766 | !-- Wall surface model |
---|
767 | !-- allocate arrays for wall surface model and define pointers |
---|
768 | |
---|
769 | !-- allocate array of wall types and wall parameters |
---|
770 | ALLOCATE ( surf_usm_h%surface_types(1:surf_usm_h%ns) ) |
---|
771 | DO l = 0, 3 |
---|
772 | ALLOCATE( surf_usm_v(l)%surface_types(1:surf_usm_v(l)%ns) ) |
---|
773 | ENDDO |
---|
774 | ! |
---|
775 | !-- Allocate albedo_type and albedo. Each surface element |
---|
776 | !-- has 3 values, 0: wall fraction, 1: green fraction, 2: window fraction. |
---|
777 | ALLOCATE( surf_usm_h%albedo_type(0:2,1:surf_usm_h%ns) ) |
---|
778 | ALLOCATE( surf_usm_h%albedo(0:2,1:surf_usm_h%ns) ) |
---|
779 | surf_usm_h%albedo_type = albedo_type |
---|
780 | DO l = 0, 3 |
---|
781 | ALLOCATE( surf_usm_v(l)%albedo_type(0:2,1:surf_usm_v(l)%ns) ) |
---|
782 | ALLOCATE( surf_usm_v(l)%albedo(0:2,1:surf_usm_v(l)%ns) ) |
---|
783 | surf_usm_v(l)%albedo_type = albedo_type |
---|
784 | ENDDO |
---|
785 | |
---|
786 | |
---|
787 | ! |
---|
788 | !-- Allocate indoor target temperature for summer and winter |
---|
789 | ALLOCATE( surf_usm_h%target_temp_summer(1:surf_usm_h%ns) ) |
---|
790 | ALLOCATE( surf_usm_h%target_temp_winter(1:surf_usm_h%ns) ) |
---|
791 | DO l = 0, 3 |
---|
792 | ALLOCATE( surf_usm_v(l)%target_temp_summer(1:surf_usm_v(l)%ns) ) |
---|
793 | ALLOCATE( surf_usm_v(l)%target_temp_winter(1:surf_usm_v(l)%ns) ) |
---|
794 | ENDDO |
---|
795 | ! |
---|
796 | !-- Allocate flag indicating ground floor level surface elements |
---|
797 | ALLOCATE ( surf_usm_h%ground_level(1:surf_usm_h%ns) ) |
---|
798 | DO l = 0, 3 |
---|
799 | ALLOCATE( surf_usm_v(l)%ground_level(1:surf_usm_v(l)%ns) ) |
---|
800 | ENDDO |
---|
801 | ! |
---|
802 | !-- Allocate arrays for relative surface fraction. |
---|
803 | !-- 0 - wall fraction, 1 - green fraction, 2 - window fraction |
---|
804 | ALLOCATE( surf_usm_h%frac(0:2,1:surf_usm_h%ns) ) |
---|
805 | surf_usm_h%frac = 0.0_wp |
---|
806 | DO l = 0, 3 |
---|
807 | ALLOCATE( surf_usm_v(l)%frac(0:2,1:surf_usm_v(l)%ns) ) |
---|
808 | surf_usm_v(l)%frac = 0.0_wp |
---|
809 | ENDDO |
---|
810 | |
---|
811 | !-- wall and roof surface parameters. First for horizontal surfaces |
---|
812 | ALLOCATE ( surf_usm_h%isroof_surf(1:surf_usm_h%ns) ) |
---|
813 | ALLOCATE ( surf_usm_h%lambda_surf(1:surf_usm_h%ns) ) |
---|
814 | ALLOCATE ( surf_usm_h%lambda_surf_window(1:surf_usm_h%ns) ) |
---|
815 | ALLOCATE ( surf_usm_h%lambda_surf_green(1:surf_usm_h%ns) ) |
---|
816 | ALLOCATE ( surf_usm_h%c_surface(1:surf_usm_h%ns) ) |
---|
817 | ALLOCATE ( surf_usm_h%c_surface_window(1:surf_usm_h%ns) ) |
---|
818 | ALLOCATE ( surf_usm_h%c_surface_green(1:surf_usm_h%ns) ) |
---|
819 | ALLOCATE ( surf_usm_h%transmissivity(1:surf_usm_h%ns) ) |
---|
820 | ALLOCATE ( surf_usm_h%lai(1:surf_usm_h%ns) ) |
---|
821 | ALLOCATE ( surf_usm_h%emissivity(0:2,1:surf_usm_h%ns) ) |
---|
822 | |
---|
823 | ! |
---|
824 | !-- For vertical surfaces. |
---|
825 | DO l = 0, 3 |
---|
826 | ALLOCATE ( surf_usm_v(l)%lambda_surf(1:surf_usm_v(l)%ns) ) |
---|
827 | ALLOCATE ( surf_usm_v(l)%c_surface(1:surf_usm_v(l)%ns) ) |
---|
828 | ALLOCATE ( surf_usm_v(l)%lambda_surf_window(1:surf_usm_v(l)%ns) ) |
---|
829 | ALLOCATE ( surf_usm_v(l)%c_surface_window(1:surf_usm_v(l)%ns) ) |
---|
830 | ALLOCATE ( surf_usm_v(l)%lambda_surf_green(1:surf_usm_v(l)%ns) ) |
---|
831 | ALLOCATE ( surf_usm_v(l)%c_surface_green(1:surf_usm_v(l)%ns) ) |
---|
832 | ALLOCATE ( surf_usm_v(l)%transmissivity(1:surf_usm_v(l)%ns) ) |
---|
833 | ALLOCATE ( surf_usm_v(l)%lai(1:surf_usm_v(l)%ns) ) |
---|
834 | |
---|
835 | ALLOCATE ( surf_usm_v(l)%emissivity(0:2,1:surf_usm_v(l)%ns) ) |
---|
836 | ENDDO |
---|
837 | |
---|
838 | ! |
---|
839 | !-- allocate wall and roof material parameters. First for horizontal surfaces |
---|
840 | ALLOCATE ( surf_usm_h%thickness_wall(1:surf_usm_h%ns) ) |
---|
841 | ALLOCATE ( surf_usm_h%thickness_window(1:surf_usm_h%ns) ) |
---|
842 | ALLOCATE ( surf_usm_h%thickness_green(1:surf_usm_h%ns) ) |
---|
843 | ALLOCATE ( surf_usm_h%lambda_h(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
844 | ALLOCATE ( surf_usm_h%rho_c_wall(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
845 | ALLOCATE ( surf_usm_h%lambda_h_window(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
846 | ALLOCATE ( surf_usm_h%rho_c_window(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
847 | ALLOCATE ( surf_usm_h%lambda_h_green(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
848 | ALLOCATE ( surf_usm_h%rho_c_green(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
849 | |
---|
850 | ! |
---|
851 | !-- For vertical surfaces. |
---|
852 | DO l = 0, 3 |
---|
853 | ALLOCATE ( surf_usm_v(l)%thickness_wall(1:surf_usm_v(l)%ns) ) |
---|
854 | ALLOCATE ( surf_usm_v(l)%thickness_window(1:surf_usm_v(l)%ns) ) |
---|
855 | ALLOCATE ( surf_usm_v(l)%thickness_green(1:surf_usm_v(l)%ns) ) |
---|
856 | ALLOCATE ( surf_usm_v(l)%lambda_h(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
857 | ALLOCATE ( surf_usm_v(l)%rho_c_wall(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
858 | ALLOCATE ( surf_usm_v(l)%lambda_h_window(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
859 | ALLOCATE ( surf_usm_v(l)%rho_c_window(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
860 | ALLOCATE ( surf_usm_v(l)%lambda_h_green(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
861 | ALLOCATE ( surf_usm_v(l)%rho_c_green(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
862 | ENDDO |
---|
863 | |
---|
864 | !-- allocate wall and roof layers sizes. For horizontal surfaces. |
---|
865 | ALLOCATE ( zwn(nzb_wall:nzt_wall) ) |
---|
866 | ALLOCATE ( surf_usm_h%dz_wall(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
867 | ALLOCATE ( zwn_window(nzb_wall:nzt_wall) ) |
---|
868 | ALLOCATE ( surf_usm_h%dz_window(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
869 | ALLOCATE ( zwn_green(nzb_wall:nzt_wall) ) |
---|
870 | ALLOCATE ( surf_usm_h%dz_green(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
871 | ALLOCATE ( surf_usm_h%ddz_wall(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
872 | ALLOCATE ( surf_usm_h%dz_wall_stag(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
873 | ALLOCATE ( surf_usm_h%ddz_wall_stag(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
874 | ALLOCATE ( surf_usm_h%zw(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
875 | ALLOCATE ( surf_usm_h%ddz_window(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
876 | ALLOCATE ( surf_usm_h%dz_window_stag(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
877 | ALLOCATE ( surf_usm_h%ddz_window_stag(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
878 | ALLOCATE ( surf_usm_h%zw_window(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
879 | ALLOCATE ( surf_usm_h%ddz_green(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
880 | ALLOCATE ( surf_usm_h%dz_green_stag(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
881 | ALLOCATE ( surf_usm_h%ddz_green_stag(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
882 | ALLOCATE ( surf_usm_h%zw_green(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
883 | ! |
---|
884 | !-- For vertical surfaces. |
---|
885 | DO l = 0, 3 |
---|
886 | ALLOCATE ( surf_usm_v(l)%dz_wall(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
887 | ALLOCATE ( surf_usm_v(l)%dz_window(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
888 | ALLOCATE ( surf_usm_v(l)%dz_green(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
889 | ALLOCATE ( surf_usm_v(l)%ddz_wall(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
890 | ALLOCATE ( surf_usm_v(l)%dz_wall_stag(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
891 | ALLOCATE ( surf_usm_v(l)%ddz_wall_stag(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
892 | ALLOCATE ( surf_usm_v(l)%zw(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
893 | ALLOCATE ( surf_usm_v(l)%ddz_window(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
894 | ALLOCATE ( surf_usm_v(l)%dz_window_stag(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
895 | ALLOCATE ( surf_usm_v(l)%ddz_window_stag(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
896 | ALLOCATE ( surf_usm_v(l)%zw_window(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
897 | ALLOCATE ( surf_usm_v(l)%ddz_green(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
898 | ALLOCATE ( surf_usm_v(l)%dz_green_stag(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
899 | ALLOCATE ( surf_usm_v(l)%ddz_green_stag(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
900 | ALLOCATE ( surf_usm_v(l)%zw_green(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
901 | ENDDO |
---|
902 | |
---|
903 | !-- allocate wall and roof temperature arrays, for horizontal walls |
---|
904 | #if defined( __nopointer ) |
---|
905 | IF ( .NOT. ALLOCATED( t_surf_h ) ) & |
---|
906 | ALLOCATE ( t_surf_h(1:surf_usm_h%ns) ) |
---|
907 | IF ( .NOT. ALLOCATED( t_surf_h_p ) ) & |
---|
908 | ALLOCATE ( t_surf_h_p(1:surf_usm_h%ns) ) |
---|
909 | IF ( .NOT. ALLOCATED( t_wall_h ) ) & |
---|
910 | ALLOCATE ( t_wall_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
911 | IF ( .NOT. ALLOCATED( t_wall_h_p ) ) & |
---|
912 | ALLOCATE ( t_wall_h_p(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
913 | IF ( .NOT. ALLOCATED( t_surf_window_h ) ) & |
---|
914 | ALLOCATE ( t_surf_window_h(1:surf_usm_h%ns) ) |
---|
915 | IF ( .NOT. ALLOCATED( t_surf_window_h_p ) ) & |
---|
916 | ALLOCATE ( t_surf_window_h_p(1:surf_usm_h%ns) ) |
---|
917 | IF ( .NOT. ALLOCATED( t_window_h ) ) & |
---|
918 | ALLOCATE ( t_window_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
919 | IF ( .NOT. ALLOCATED( t_window_h_p ) ) & |
---|
920 | ALLOCATE ( t_window_h_p(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
921 | IF ( .NOT. ALLOCATED( t_surf_green_h ) ) & |
---|
922 | ALLOCATE ( t_surf_green_h(1:surf_usm_h%ns) ) |
---|
923 | IF ( .NOT. ALLOCATED( t_surf_green_h_p ) ) & |
---|
924 | ALLOCATE ( t_surf_green_h_p(1:surf_usm_h%ns) ) |
---|
925 | IF ( .NOT. ALLOCATED( t_green_h ) ) & |
---|
926 | ALLOCATE ( t_green_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
927 | IF ( .NOT. ALLOCATED( t_green_h_p ) ) & |
---|
928 | ALLOCATE ( t_green_h_p(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
929 | IF ( .NOT. ALLOCATED( t_surf_whole_h ) ) & |
---|
930 | ALLOCATE ( t_surf_whole_h(1:surf_usm_h%ns) ) |
---|
931 | IF ( .NOT. ALLOCATED( t_surf_whole_h_p ) ) & |
---|
932 | ALLOCATE ( t_surf_whole_h_p(1:surf_usm_h%ns) ) |
---|
933 | IF ( .NOT. ALLOCATED( t_surf_10cm_h ) ) & |
---|
934 | ALLOCATE ( t_surf_10cm_h(1:surf_usm_h%ns) ) |
---|
935 | IF ( .NOT. ALLOCATED( t_surf_10cm_h_p ) ) & |
---|
936 | ALLOCATE ( t_surf_10cm_h_p(1:surf_usm_h%ns) ) |
---|
937 | #else |
---|
938 | ! |
---|
939 | !-- Allocate if required. Note, in case of restarts, some of these arrays |
---|
940 | !-- might be already allocated. |
---|
941 | IF ( .NOT. ALLOCATED( t_surf_h_1 ) ) & |
---|
942 | ALLOCATE ( t_surf_h_1(1:surf_usm_h%ns) ) |
---|
943 | IF ( .NOT. ALLOCATED( t_surf_h_2 ) ) & |
---|
944 | ALLOCATE ( t_surf_h_2(1:surf_usm_h%ns) ) |
---|
945 | IF ( .NOT. ALLOCATED( t_wall_h_1 ) ) & |
---|
946 | ALLOCATE ( t_wall_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
947 | IF ( .NOT. ALLOCATED( t_wall_h_2 ) ) & |
---|
948 | ALLOCATE ( t_wall_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
949 | IF ( .NOT. ALLOCATED( t_surf_window_h_1 ) ) & |
---|
950 | ALLOCATE ( t_surf_window_h_1(1:surf_usm_h%ns) ) |
---|
951 | IF ( .NOT. ALLOCATED( t_surf_window_h_2 ) ) & |
---|
952 | ALLOCATE ( t_surf_window_h_2(1:surf_usm_h%ns) ) |
---|
953 | IF ( .NOT. ALLOCATED( t_window_h_1 ) ) & |
---|
954 | ALLOCATE ( t_window_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
955 | IF ( .NOT. ALLOCATED( t_window_h_2 ) ) & |
---|
956 | ALLOCATE ( t_window_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
957 | IF ( .NOT. ALLOCATED( t_surf_green_h_1 ) ) & |
---|
958 | ALLOCATE ( t_surf_green_h_1(1:surf_usm_h%ns) ) |
---|
959 | IF ( .NOT. ALLOCATED( t_surf_green_h_2 ) ) & |
---|
960 | ALLOCATE ( t_surf_green_h_2(1:surf_usm_h%ns) ) |
---|
961 | IF ( .NOT. ALLOCATED( t_green_h_1 ) ) & |
---|
962 | ALLOCATE ( t_green_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
963 | IF ( .NOT. ALLOCATED( t_green_h_2 ) ) & |
---|
964 | ALLOCATE ( t_green_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
965 | IF ( .NOT. ALLOCATED( t_surf_whole_h_1 ) ) & |
---|
966 | ALLOCATE ( t_surf_whole_h_1(1:surf_usm_h%ns) ) |
---|
967 | IF ( .NOT. ALLOCATED( t_surf_whole_h_2 ) ) & |
---|
968 | ALLOCATE ( t_surf_whole_h_2(1:surf_usm_h%ns) ) |
---|
969 | IF ( .NOT. ALLOCATED( t_surf_10cm_h_1 ) ) & |
---|
970 | ALLOCATE ( t_surf_10cm_h_1(1:surf_usm_h%ns) ) |
---|
971 | IF ( .NOT. ALLOCATED( t_surf_10cm_h_2 ) ) & |
---|
972 | ALLOCATE ( t_surf_10cm_h_2(1:surf_usm_h%ns) ) |
---|
973 | ! |
---|
974 | !-- initial assignment of the pointers |
---|
975 | t_wall_h => t_wall_h_1; t_wall_h_p => t_wall_h_2 |
---|
976 | t_window_h => t_window_h_1; t_window_h_p => t_window_h_2 |
---|
977 | t_green_h => t_green_h_1; t_green_h_p => t_green_h_2 |
---|
978 | t_surf_h => t_surf_h_1; t_surf_h_p => t_surf_h_2 |
---|
979 | t_surf_window_h => t_surf_window_h_1; t_surf_window_h_p => t_surf_window_h_2 |
---|
980 | t_surf_green_h => t_surf_green_h_1; t_surf_green_h_p => t_surf_green_h_2 |
---|
981 | t_surf_whole_h => t_surf_whole_h_1; t_surf_whole_h_p => t_surf_whole_h_2 |
---|
982 | t_surf_10cm_h => t_surf_10cm_h_1; t_surf_10cm_h_p => t_surf_10cm_h_2 |
---|
983 | |
---|
984 | #endif |
---|
985 | |
---|
986 | !-- allocate wall and roof temperature arrays, for vertical walls if required |
---|
987 | #if defined( __nopointer ) |
---|
988 | DO l = 0, 3 |
---|
989 | IF ( .NOT. ALLOCATED( t_surf_v(l)%t ) ) & |
---|
990 | ALLOCATE ( t_surf_v(l)%t(1:surf_usm_v(l)%ns) ) |
---|
991 | IF ( .NOT. ALLOCATED( t_surf_v_p(l)%t ) ) & |
---|
992 | ALLOCATE ( t_surf_v_p(l)%t(1:surf_usm_v(l)%ns) ) |
---|
993 | IF ( .NOT. ALLOCATED( t_wall_v(l)%t ) ) & |
---|
994 | ALLOCATE ( t_wall_v(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
995 | IF ( .NOT. ALLOCATED( t_wall_v_p(l)%t ) ) & |
---|
996 | ALLOCATE ( t_wall_v_p(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
997 | IF ( .NOT. ALLOCATED( t_surf_window_v(l)%t ) ) & |
---|
998 | ALLOCATE ( t_surf_window_v(l)%t(1:surf_usm_v(l)%ns) ) |
---|
999 | IF ( .NOT. ALLOCATED( t_surf_window_v_p(l)%t ) ) & |
---|
1000 | ALLOCATE ( t_surf_window_v_p(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1001 | IF ( .NOT. ALLOCATED( t_window_v(l)%t ) ) & |
---|
1002 | ALLOCATE ( t_window_v(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1003 | IF ( .NOT. ALLOCATED( t_window_v_p(l)%t ) ) & |
---|
1004 | ALLOCATE ( t_window_v_p(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1005 | IF ( .NOT. ALLOCATED( t_green_v(l)%t ) ) & |
---|
1006 | ALLOCATE ( t_green_v(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1007 | IF ( .NOT. ALLOCATED( t_green_v_p(l)%t ) ) & |
---|
1008 | ALLOCATE ( t_green_v_p(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1009 | IF ( .NOT. ALLOCATED( t_surf_green_v(l)%t ) ) & |
---|
1010 | ALLOCATE ( t_surf_green_v(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1011 | IF ( .NOT. ALLOCATED( t_surf_green_v_p(l)%t ) ) & |
---|
1012 | ALLOCATE ( t_surf_green_v_p(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1013 | IF ( .NOT. ALLOCATED( t_surf_whole_v(l)%t ) ) & |
---|
1014 | ALLOCATE ( t_surf_whole_v(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1015 | IF ( .NOT. ALLOCATED( t_surf_whole_v_p(l)%t ) ) & |
---|
1016 | ALLOCATE ( t_surf_whole_v_p(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1017 | IF ( .NOT. ALLOCATED( t_surf_10cm_v(l)%t ) ) & |
---|
1018 | ALLOCATE ( t_surf_10cm_v(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1019 | IF ( .NOT. ALLOCATED( t_surf_10cm_v_p(l)%t ) ) & |
---|
1020 | ALLOCATE ( t_surf_10cm_v_p(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1021 | ENDDO |
---|
1022 | #else |
---|
1023 | ! |
---|
1024 | !-- Allocate if required. Note, in case of restarts, some of these arrays |
---|
1025 | !-- might be already allocated. |
---|
1026 | DO l = 0, 3 |
---|
1027 | IF ( .NOT. ALLOCATED( t_surf_v_1(l)%t ) ) & |
---|
1028 | ALLOCATE ( t_surf_v_1(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1029 | IF ( .NOT. ALLOCATED( t_surf_v_2(l)%t ) ) & |
---|
1030 | ALLOCATE ( t_surf_v_2(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1031 | IF ( .NOT. ALLOCATED( t_wall_v_1(l)%t ) ) & |
---|
1032 | ALLOCATE ( t_wall_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1033 | IF ( .NOT. ALLOCATED( t_wall_v_2(l)%t ) ) & |
---|
1034 | ALLOCATE ( t_wall_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1035 | IF ( .NOT. ALLOCATED( t_surf_window_v_1(l)%t ) ) & |
---|
1036 | ALLOCATE ( t_surf_window_v_1(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1037 | IF ( .NOT. ALLOCATED( t_surf_window_v_2(l)%t ) ) & |
---|
1038 | ALLOCATE ( t_surf_window_v_2(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1039 | IF ( .NOT. ALLOCATED( t_window_v_1(l)%t ) ) & |
---|
1040 | ALLOCATE ( t_window_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1041 | IF ( .NOT. ALLOCATED( t_window_v_2(l)%t ) ) & |
---|
1042 | ALLOCATE ( t_window_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1043 | IF ( .NOT. ALLOCATED( t_surf_green_v_1(l)%t ) ) & |
---|
1044 | ALLOCATE ( t_surf_green_v_1(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1045 | IF ( .NOT. ALLOCATED( t_surf_green_v_2(l)%t ) ) & |
---|
1046 | ALLOCATE ( t_surf_green_v_2(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1047 | IF ( .NOT. ALLOCATED( t_green_v_1(l)%t ) ) & |
---|
1048 | ALLOCATE ( t_green_v_1(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1049 | IF ( .NOT. ALLOCATED( t_green_v_2(l)%t ) ) & |
---|
1050 | ALLOCATE ( t_green_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1051 | IF ( .NOT. ALLOCATED( t_surf_whole_v_1(l)%t ) ) & |
---|
1052 | ALLOCATE ( t_surf_whole_v_1(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1053 | IF ( .NOT. ALLOCATED( t_surf_whole_v_2(l)%t ) ) & |
---|
1054 | ALLOCATE ( t_surf_whole_v_2(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1055 | IF ( .NOT. ALLOCATED( t_surf_10cm_v_1(l)%t ) ) & |
---|
1056 | ALLOCATE ( t_surf_10cm_v_1(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1057 | IF ( .NOT. ALLOCATED( t_surf_10cm_v_2(l)%t ) ) & |
---|
1058 | ALLOCATE ( t_surf_10cm_v_2(l)%t(1:surf_usm_v(l)%ns) ) |
---|
1059 | ENDDO |
---|
1060 | ! |
---|
1061 | !-- initial assignment of the pointers |
---|
1062 | t_wall_v => t_wall_v_1; t_wall_v_p => t_wall_v_2 |
---|
1063 | t_surf_v => t_surf_v_1; t_surf_v_p => t_surf_v_2 |
---|
1064 | t_window_v => t_window_v_1; t_window_v_p => t_window_v_2 |
---|
1065 | t_green_v => t_green_v_1; t_green_v_p => t_green_v_2 |
---|
1066 | t_surf_window_v => t_surf_window_v_1; t_surf_window_v_p => t_surf_window_v_2 |
---|
1067 | t_surf_green_v => t_surf_green_v_1; t_surf_green_v_p => t_surf_green_v_2 |
---|
1068 | t_surf_whole_v => t_surf_whole_v_1; t_surf_whole_v_p => t_surf_whole_v_2 |
---|
1069 | t_surf_10cm_v => t_surf_10cm_v_1; t_surf_10cm_v_p => t_surf_10cm_v_2 |
---|
1070 | |
---|
1071 | #endif |
---|
1072 | ! |
---|
1073 | !-- Allocate intermediate timestep arrays. For horizontal surfaces. |
---|
1074 | ALLOCATE ( surf_usm_h%tt_surface_m(1:surf_usm_h%ns) ) |
---|
1075 | ALLOCATE ( surf_usm_h%tt_wall_m(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
1076 | ALLOCATE ( surf_usm_h%tt_surface_window_m(1:surf_usm_h%ns) ) |
---|
1077 | ALLOCATE ( surf_usm_h%tt_window_m(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
1078 | ALLOCATE ( surf_usm_h%tt_green_m(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
1079 | ALLOCATE ( surf_usm_h%tt_surface_green_m(1:surf_usm_h%ns) ) |
---|
1080 | |
---|
1081 | ! |
---|
1082 | !-- Set inital values for prognostic quantities |
---|
1083 | IF ( ALLOCATED( surf_usm_h%tt_surface_m ) ) surf_usm_h%tt_surface_m = 0.0_wp |
---|
1084 | IF ( ALLOCATED( surf_usm_h%tt_wall_m ) ) surf_usm_h%tt_wall_m = 0.0_wp |
---|
1085 | IF ( ALLOCATED( surf_usm_h%tt_surface_window_m ) ) surf_usm_h%tt_surface_window_m = 0.0_wp |
---|
1086 | IF ( ALLOCATED( surf_usm_h%tt_window_m ) ) surf_usm_h%tt_window_m = 0.0_wp |
---|
1087 | IF ( ALLOCATED( surf_usm_h%tt_green_m ) ) surf_usm_h%tt_green_m = 0.0_wp |
---|
1088 | IF ( ALLOCATED( surf_usm_h%tt_surface_green_m ) ) surf_usm_h%tt_surface_green_m = 0.0_wp |
---|
1089 | ! |
---|
1090 | !-- Now, for vertical surfaces |
---|
1091 | DO l = 0, 3 |
---|
1092 | ALLOCATE ( surf_usm_v(l)%tt_surface_m(1:surf_usm_v(l)%ns) ) |
---|
1093 | ALLOCATE ( surf_usm_v(l)%tt_wall_m(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1094 | IF ( ALLOCATED( surf_usm_v(l)%tt_surface_m ) ) surf_usm_v(l)%tt_surface_m = 0.0_wp |
---|
1095 | IF ( ALLOCATED( surf_usm_v(l)%tt_wall_m ) ) surf_usm_v(l)%tt_wall_m = 0.0_wp |
---|
1096 | ALLOCATE ( surf_usm_v(l)%tt_surface_window_m(1:surf_usm_v(l)%ns) ) |
---|
1097 | ALLOCATE ( surf_usm_v(l)%tt_window_m(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1098 | IF ( ALLOCATED( surf_usm_v(l)%tt_surface_window_m ) ) surf_usm_v(l)%tt_surface_window_m = 0.0_wp |
---|
1099 | IF ( ALLOCATED( surf_usm_v(l)%tt_window_m ) ) surf_usm_v(l)%tt_window_m = 0.0_wp |
---|
1100 | ALLOCATE ( surf_usm_v(l)%tt_surface_green_m(1:surf_usm_v(l)%ns) ) |
---|
1101 | IF ( ALLOCATED( surf_usm_v(l)%tt_surface_green_m ) ) surf_usm_v(l)%tt_surface_green_m = 0.0_wp |
---|
1102 | ALLOCATE ( surf_usm_v(l)%tt_green_m(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) ) |
---|
1103 | IF ( ALLOCATED( surf_usm_v(l)%tt_green_m ) ) surf_usm_v(l)%tt_green_m = 0.0_wp |
---|
1104 | ENDDO |
---|
1105 | |
---|
1106 | !-- allocate wall heat flux output array and set initial values. For horizontal surfaces |
---|
1107 | ! ALLOCATE ( surf_usm_h%wshf(1:surf_usm_h%ns) ) !can be removed |
---|
1108 | ALLOCATE ( surf_usm_h%wshf_eb(1:surf_usm_h%ns) ) |
---|
1109 | ALLOCATE ( surf_usm_h%wghf_eb(1:surf_usm_h%ns) ) |
---|
1110 | ALLOCATE ( surf_usm_h%wghf_eb_window(1:surf_usm_h%ns) ) |
---|
1111 | ALLOCATE ( surf_usm_h%wghf_eb_green(1:surf_usm_h%ns) ) |
---|
1112 | ALLOCATE ( surf_usm_h%iwghf_eb(1:surf_usm_h%ns) ) |
---|
1113 | ALLOCATE ( surf_usm_h%iwghf_eb_window(1:surf_usm_h%ns) ) |
---|
1114 | IF ( ALLOCATED( surf_usm_h%wshf ) ) surf_usm_h%wshf = 0.0_wp |
---|
1115 | IF ( ALLOCATED( surf_usm_h%wshf_eb ) ) surf_usm_h%wshf_eb = 0.0_wp |
---|
1116 | IF ( ALLOCATED( surf_usm_h%wghf_eb ) ) surf_usm_h%wghf_eb = 0.0_wp |
---|
1117 | IF ( ALLOCATED( surf_usm_h%wghf_eb_window ) ) surf_usm_h%wghf_eb_window = 0.0_wp |
---|
1118 | IF ( ALLOCATED( surf_usm_h%wghf_eb_green ) ) surf_usm_h%wghf_eb_green = 0.0_wp |
---|
1119 | IF ( ALLOCATED( surf_usm_h%iwghf_eb ) ) surf_usm_h%iwghf_eb = 0.0_wp |
---|
1120 | IF ( ALLOCATED( surf_usm_h%iwghf_eb_window ) ) surf_usm_h%iwghf_eb_window = 0.0_wp |
---|
1121 | ! |
---|
1122 | !-- Now, for vertical surfaces |
---|
1123 | DO l = 0, 3 |
---|
1124 | ! ALLOCATE ( surf_usm_v(l)%wshf(1:surf_usm_v(l)%ns) ) ! can be removed |
---|
1125 | ALLOCATE ( surf_usm_v(l)%wshf_eb(1:surf_usm_v(l)%ns) ) |
---|
1126 | ALLOCATE ( surf_usm_v(l)%wghf_eb(1:surf_usm_v(l)%ns) ) |
---|
1127 | ALLOCATE ( surf_usm_v(l)%wghf_eb_window(1:surf_usm_v(l)%ns) ) |
---|
1128 | ALLOCATE ( surf_usm_v(l)%wghf_eb_green(1:surf_usm_v(l)%ns) ) |
---|
1129 | ALLOCATE ( surf_usm_v(l)%iwghf_eb(1:surf_usm_v(l)%ns) ) |
---|
1130 | ALLOCATE ( surf_usm_v(l)%iwghf_eb_window(1:surf_usm_v(l)%ns) ) |
---|
1131 | IF ( ALLOCATED( surf_usm_v(l)%wshf ) ) surf_usm_v(l)%wshf = 0.0_wp |
---|
1132 | IF ( ALLOCATED( surf_usm_v(l)%wshf_eb ) ) surf_usm_v(l)%wshf_eb = 0.0_wp |
---|
1133 | IF ( ALLOCATED( surf_usm_v(l)%wghf_eb ) ) surf_usm_v(l)%wghf_eb = 0.0_wp |
---|
1134 | IF ( ALLOCATED( surf_usm_v(l)%wghf_eb_window ) ) surf_usm_v(l)%wghf_eb_window = 0.0_wp |
---|
1135 | IF ( ALLOCATED( surf_usm_v(l)%wghf_eb_green ) ) surf_usm_v(l)%wghf_eb_green = 0.0_wp |
---|
1136 | IF ( ALLOCATED( surf_usm_v(l)%iwghf_eb ) ) surf_usm_v(l)%iwghf_eb = 0.0_wp |
---|
1137 | IF ( ALLOCATED( surf_usm_v(l)%iwghf_eb_window ) ) surf_usm_v(l)%iwghf_eb_window = 0.0_wp |
---|
1138 | ENDDO |
---|
1139 | |
---|
1140 | END SUBROUTINE usm_allocate_surface |
---|
1141 | |
---|
1142 | |
---|
1143 | !------------------------------------------------------------------------------! |
---|
1144 | ! Description: |
---|
1145 | ! ------------ |
---|
1146 | !> Sum up and time-average urban surface output quantities as well as allocate |
---|
1147 | !> the array necessary for storing the average. |
---|
1148 | !------------------------------------------------------------------------------! |
---|
1149 | SUBROUTINE usm_average_3d_data( mode, variable ) |
---|
1150 | |
---|
1151 | IMPLICIT NONE |
---|
1152 | |
---|
1153 | CHARACTER (len=*), INTENT(IN) :: mode |
---|
1154 | CHARACTER (len=*), INTENT(IN) :: variable |
---|
1155 | |
---|
1156 | INTEGER(iwp) :: i, j, k, l, m, ids, iwl,istat |
---|
1157 | CHARACTER (len=varnamelength) :: var, surfid |
---|
1158 | INTEGER(iwp), PARAMETER :: nd = 5 |
---|
1159 | CHARACTER(len=6), DIMENSION(0:nd-1), PARAMETER :: dirname = (/ '_roof ', '_south', '_north', '_west ', '_east ' /) |
---|
1160 | |
---|
1161 | !-- find the real name of the variable |
---|
1162 | var = TRIM(variable) |
---|
1163 | DO i = 0, nd-1 |
---|
1164 | k = len(TRIM(var)) |
---|
1165 | j = len(TRIM(dirname(i))) |
---|
1166 | IF ( var(k-j+1:k) == dirname(i) ) THEN |
---|
1167 | ids = i |
---|
1168 | var = var(:k-j) |
---|
1169 | EXIT |
---|
1170 | ENDIF |
---|
1171 | ENDDO |
---|
1172 | IF ( ids == -1 ) THEN |
---|
1173 | var = TRIM(variable) |
---|
1174 | ENDIF |
---|
1175 | IF ( var(1:11) == 'usm_t_wall_' .AND. len(TRIM(var)) >= 12 ) THEN |
---|
1176 | !-- wall layers |
---|
1177 | READ(var(12:12), '(I1)', iostat=istat ) iwl |
---|
1178 | IF ( istat == 0 .AND. iwl >= nzb_wall .AND. iwl <= nzt_wall ) THEN |
---|
1179 | var = var(1:10) |
---|
1180 | ELSE |
---|
1181 | !-- wrong wall layer index |
---|
1182 | RETURN |
---|
1183 | ENDIF |
---|
1184 | ENDIF |
---|
1185 | IF ( var(1:13) == 'usm_t_window_' .AND. len(TRIM(var)) >= 14 ) THEN |
---|
1186 | !-- wall layers |
---|
1187 | READ(var(14:14), '(I1)', iostat=istat ) iwl |
---|
1188 | IF ( istat == 0 .AND. iwl >= nzb_wall .AND. iwl <= nzt_wall ) THEN |
---|
1189 | var = var(1:12) |
---|
1190 | ELSE |
---|
1191 | !-- wrong window layer index |
---|
1192 | RETURN |
---|
1193 | ENDIF |
---|
1194 | ENDIF |
---|
1195 | IF ( var(1:12) == 'usm_t_green_' .AND. len(TRIM(var)) >= 13 ) THEN |
---|
1196 | !-- wall layers |
---|
1197 | READ(var(13:13), '(I1)', iostat=istat ) iwl |
---|
1198 | IF ( istat == 0 .AND. iwl >= nzb_wall .AND. iwl <= nzt_wall ) THEN |
---|
1199 | var = var(1:11) |
---|
1200 | ELSE |
---|
1201 | !-- wrong green layer index |
---|
1202 | RETURN |
---|
1203 | ENDIF |
---|
1204 | ENDIF |
---|
1205 | |
---|
1206 | IF ( mode == 'allocate' ) THEN |
---|
1207 | |
---|
1208 | SELECT CASE ( TRIM( var ) ) |
---|
1209 | |
---|
1210 | CASE ( 'usm_rad_net' ) |
---|
1211 | !-- array of complete radiation balance |
---|
1212 | IF ( .NOT. ALLOCATED(surf_usm_h%rad_net_av) ) THEN |
---|
1213 | ALLOCATE( surf_usm_h%rad_net_av(1:surf_usm_h%ns) ) |
---|
1214 | surf_usm_h%rad_net_av = 0.0_wp |
---|
1215 | ENDIF |
---|
1216 | DO l = 0, 3 |
---|
1217 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%rad_net_av) ) THEN |
---|
1218 | ALLOCATE( surf_usm_v(l)%rad_net_av(1:surf_usm_v(l)%ns) ) |
---|
1219 | surf_usm_v(l)%rad_net_av = 0.0_wp |
---|
1220 | ENDIF |
---|
1221 | ENDDO |
---|
1222 | |
---|
1223 | CASE ( 'usm_rad_insw' ) |
---|
1224 | !-- array of sw radiation falling to surface after i-th reflection |
---|
1225 | IF ( .NOT. ALLOCATED(surf_usm_h%surfinsw_av) ) THEN |
---|
1226 | ALLOCATE( surf_usm_h%surfinsw_av(1:surf_usm_h%ns) ) |
---|
1227 | surf_usm_h%surfinsw_av = 0.0_wp |
---|
1228 | ENDIF |
---|
1229 | DO l = 0, 3 |
---|
1230 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%surfinsw_av) ) THEN |
---|
1231 | ALLOCATE( surf_usm_v(l)%surfinsw_av(1:surf_usm_v(l)%ns) ) |
---|
1232 | surf_usm_v(l)%surfinsw_av = 0.0_wp |
---|
1233 | ENDIF |
---|
1234 | ENDDO |
---|
1235 | |
---|
1236 | CASE ( 'usm_rad_inlw' ) |
---|
1237 | !-- array of lw radiation falling to surface after i-th reflection |
---|
1238 | IF ( .NOT. ALLOCATED(surf_usm_h%surfinlw_av) ) THEN |
---|
1239 | ALLOCATE( surf_usm_h%surfinlw_av(1:surf_usm_h%ns) ) |
---|
1240 | surf_usm_h%surfinlw_av = 0.0_wp |
---|
1241 | ENDIF |
---|
1242 | DO l = 0, 3 |
---|
1243 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%surfinlw_av) ) THEN |
---|
1244 | ALLOCATE( surf_usm_v(l)%surfinlw_av(1:surf_usm_v(l)%ns) ) |
---|
1245 | surf_usm_v(l)%surfinlw_av = 0.0_wp |
---|
1246 | ENDIF |
---|
1247 | ENDDO |
---|
1248 | |
---|
1249 | CASE ( 'usm_rad_inswdir' ) |
---|
1250 | !-- array of direct sw radiation falling to surface from sun |
---|
1251 | IF ( .NOT. ALLOCATED(surfinswdir_av) ) THEN |
---|
1252 | ALLOCATE( surfinswdir_av(startenergy:endenergy) ) |
---|
1253 | surfinswdir_av = 0.0_wp |
---|
1254 | ENDIF |
---|
1255 | |
---|
1256 | CASE ( 'usm_rad_inswdif' ) |
---|
1257 | !-- array of difusion sw radiation falling to surface from sky and borders of the domain |
---|
1258 | IF ( .NOT. ALLOCATED(surfinswdif_av) ) THEN |
---|
1259 | ALLOCATE( surfinswdif_av(startenergy:endenergy) ) |
---|
1260 | surfinswdif_av = 0.0_wp |
---|
1261 | ENDIF |
---|
1262 | |
---|
1263 | CASE ( 'usm_rad_inswref' ) |
---|
1264 | !-- array of sw radiation falling to surface from reflections |
---|
1265 | IF ( .NOT. ALLOCATED(surfinswref_av) ) THEN |
---|
1266 | ALLOCATE( surfinswref_av(startenergy:endenergy) ) |
---|
1267 | surfinswref_av = 0.0_wp |
---|
1268 | ENDIF |
---|
1269 | |
---|
1270 | CASE ( 'usm_rad_inlwdif' ) |
---|
1271 | !-- array of sw radiation falling to surface after i-th reflection |
---|
1272 | IF ( .NOT. ALLOCATED(surfinlwdif_av) ) THEN |
---|
1273 | ALLOCATE( surfinlwdif_av(startenergy:endenergy) ) |
---|
1274 | surfinlwdif_av = 0.0_wp |
---|
1275 | ENDIF |
---|
1276 | |
---|
1277 | CASE ( 'usm_rad_inlwref' ) |
---|
1278 | !-- array of lw radiation falling to surface from reflections |
---|
1279 | IF ( .NOT. ALLOCATED(surfinlwref_av) ) THEN |
---|
1280 | ALLOCATE( surfinlwref_av(startenergy:endenergy) ) |
---|
1281 | surfinlwref_av = 0.0_wp |
---|
1282 | ENDIF |
---|
1283 | |
---|
1284 | CASE ( 'usm_rad_outsw' ) |
---|
1285 | !-- array of sw radiation emitted from surface after i-th reflection |
---|
1286 | IF ( .NOT. ALLOCATED(surfoutsw_av) ) THEN |
---|
1287 | ALLOCATE( surfoutsw_av(startenergy:endenergy) ) |
---|
1288 | surfoutsw_av = 0.0_wp |
---|
1289 | ENDIF |
---|
1290 | |
---|
1291 | CASE ( 'usm_rad_outlw' ) |
---|
1292 | !-- array of lw radiation emitted from surface after i-th reflection |
---|
1293 | IF ( .NOT. ALLOCATED(surfoutlw_av) ) THEN |
---|
1294 | ALLOCATE( surfoutlw_av(startenergy:endenergy) ) |
---|
1295 | surfoutlw_av = 0.0_wp |
---|
1296 | ENDIF |
---|
1297 | CASE ( 'usm_rad_ressw' ) |
---|
1298 | !-- array of residua of sw radiation absorbed in surface after last reflection |
---|
1299 | IF ( .NOT. ALLOCATED(surfins_av) ) THEN |
---|
1300 | ALLOCATE( surfins_av(startenergy:endenergy) ) |
---|
1301 | surfins_av = 0.0_wp |
---|
1302 | ENDIF |
---|
1303 | |
---|
1304 | CASE ( 'usm_rad_reslw' ) |
---|
1305 | !-- array of residua of lw radiation absorbed in surface after last reflection |
---|
1306 | IF ( .NOT. ALLOCATED(surfinl_av) ) THEN |
---|
1307 | ALLOCATE( surfinl_av(startenergy:endenergy) ) |
---|
1308 | surfinl_av = 0.0_wp |
---|
1309 | ENDIF |
---|
1310 | |
---|
1311 | CASE ( 'usm_rad_hf' ) |
---|
1312 | !-- array of heat flux from radiation for surfaces after i-th reflection |
---|
1313 | IF ( .NOT. ALLOCATED(surf_usm_h%surfhf_av) ) THEN |
---|
1314 | ALLOCATE( surf_usm_h%surfhf_av(1:surf_usm_h%ns) ) |
---|
1315 | surf_usm_h%surfhf_av = 0.0_wp |
---|
1316 | ENDIF |
---|
1317 | DO l = 0, 3 |
---|
1318 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%surfhf_av) ) THEN |
---|
1319 | ALLOCATE( surf_usm_v(l)%surfhf_av(1:surf_usm_v(l)%ns) ) |
---|
1320 | surf_usm_v(l)%surfhf_av = 0.0_wp |
---|
1321 | ENDIF |
---|
1322 | ENDDO |
---|
1323 | |
---|
1324 | CASE ( 'usm_wshf' ) |
---|
1325 | !-- array of sensible heat flux from surfaces |
---|
1326 | !-- land surfaces |
---|
1327 | IF ( .NOT. ALLOCATED(surf_usm_h%wshf_eb_av) ) THEN |
---|
1328 | ALLOCATE( surf_usm_h%wshf_eb_av(1:surf_usm_h%ns) ) |
---|
1329 | surf_usm_h%wshf_eb_av = 0.0_wp |
---|
1330 | ENDIF |
---|
1331 | DO l = 0, 3 |
---|
1332 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%wshf_eb_av) ) THEN |
---|
1333 | ALLOCATE( surf_usm_v(l)%wshf_eb_av(1:surf_usm_v(l)%ns) ) |
---|
1334 | surf_usm_v(l)%wshf_eb_av = 0.0_wp |
---|
1335 | ENDIF |
---|
1336 | ENDDO |
---|
1337 | |
---|
1338 | CASE ( 'usm_wghf' ) |
---|
1339 | !-- array of heat flux from ground (wall, roof, land) |
---|
1340 | IF ( .NOT. ALLOCATED(surf_usm_h%wghf_eb_av) ) THEN |
---|
1341 | ALLOCATE( surf_usm_h%wghf_eb_av(1:surf_usm_h%ns) ) |
---|
1342 | surf_usm_h%wghf_eb_av = 0.0_wp |
---|
1343 | ENDIF |
---|
1344 | DO l = 0, 3 |
---|
1345 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%wghf_eb_av) ) THEN |
---|
1346 | ALLOCATE( surf_usm_v(l)%wghf_eb_av(1:surf_usm_v(l)%ns) ) |
---|
1347 | surf_usm_v(l)%wghf_eb_av = 0.0_wp |
---|
1348 | ENDIF |
---|
1349 | ENDDO |
---|
1350 | |
---|
1351 | CASE ( 'usm_wghf_window' ) |
---|
1352 | !-- array of heat flux from window ground (wall, roof, land) |
---|
1353 | IF ( .NOT. ALLOCATED(surf_usm_h%wghf_eb_window_av) ) THEN |
---|
1354 | ALLOCATE( surf_usm_h%wghf_eb_window_av(1:surf_usm_h%ns) ) |
---|
1355 | surf_usm_h%wghf_eb_window_av = 0.0_wp |
---|
1356 | ENDIF |
---|
1357 | DO l = 0, 3 |
---|
1358 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%wghf_eb_window_av) ) THEN |
---|
1359 | ALLOCATE( surf_usm_v(l)%wghf_eb_window_av(1:surf_usm_v(l)%ns) ) |
---|
1360 | surf_usm_v(l)%wghf_eb_window_av = 0.0_wp |
---|
1361 | ENDIF |
---|
1362 | ENDDO |
---|
1363 | |
---|
1364 | CASE ( 'usm_wghf_green' ) |
---|
1365 | !-- array of heat flux from green ground (wall, roof, land) |
---|
1366 | IF ( .NOT. ALLOCATED(surf_usm_h%wghf_eb_green_av) ) THEN |
---|
1367 | ALLOCATE( surf_usm_h%wghf_eb_green_av(1:surf_usm_h%ns) ) |
---|
1368 | surf_usm_h%wghf_eb_green_av = 0.0_wp |
---|
1369 | ENDIF |
---|
1370 | DO l = 0, 3 |
---|
1371 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%wghf_eb_green_av) ) THEN |
---|
1372 | ALLOCATE( surf_usm_v(l)%wghf_eb_green_av(1:surf_usm_v(l)%ns) ) |
---|
1373 | surf_usm_v(l)%wghf_eb_green_av = 0.0_wp |
---|
1374 | ENDIF |
---|
1375 | ENDDO |
---|
1376 | |
---|
1377 | CASE ( 'usm_iwghf' ) |
---|
1378 | !-- array of heat flux from indoor ground (wall, roof, land) |
---|
1379 | IF ( .NOT. ALLOCATED(surf_usm_h%iwghf_eb_av) ) THEN |
---|
1380 | ALLOCATE( surf_usm_h%iwghf_eb_av(1:surf_usm_h%ns) ) |
---|
1381 | surf_usm_h%iwghf_eb_av = 0.0_wp |
---|
1382 | ENDIF |
---|
1383 | DO l = 0, 3 |
---|
1384 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%iwghf_eb_av) ) THEN |
---|
1385 | ALLOCATE( surf_usm_v(l)%iwghf_eb_av(1:surf_usm_v(l)%ns) ) |
---|
1386 | surf_usm_v(l)%iwghf_eb_av = 0.0_wp |
---|
1387 | ENDIF |
---|
1388 | ENDDO |
---|
1389 | |
---|
1390 | CASE ( 'usm_iwghf_window' ) |
---|
1391 | !-- array of heat flux from indoor window ground (wall, roof, land) |
---|
1392 | IF ( .NOT. ALLOCATED(surf_usm_h%iwghf_eb_window_av) ) THEN |
---|
1393 | ALLOCATE( surf_usm_h%iwghf_eb_window_av(1:surf_usm_h%ns) ) |
---|
1394 | surf_usm_h%iwghf_eb_window_av = 0.0_wp |
---|
1395 | ENDIF |
---|
1396 | DO l = 0, 3 |
---|
1397 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%iwghf_eb_window_av) ) THEN |
---|
1398 | ALLOCATE( surf_usm_v(l)%iwghf_eb_window_av(1:surf_usm_v(l)%ns) ) |
---|
1399 | surf_usm_v(l)%iwghf_eb_window_av = 0.0_wp |
---|
1400 | ENDIF |
---|
1401 | ENDDO |
---|
1402 | |
---|
1403 | CASE ( 'usm_t_surf' ) |
---|
1404 | !-- surface temperature for surfaces |
---|
1405 | IF ( .NOT. ALLOCATED(surf_usm_h%t_surf_av) ) THEN |
---|
1406 | ALLOCATE( surf_usm_h%t_surf_av(1:surf_usm_h%ns) ) |
---|
1407 | surf_usm_h%t_surf_av = 0.0_wp |
---|
1408 | ENDIF |
---|
1409 | DO l = 0, 3 |
---|
1410 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_surf_av) ) THEN |
---|
1411 | ALLOCATE( surf_usm_v(l)%t_surf_av(1:surf_usm_v(l)%ns) ) |
---|
1412 | surf_usm_v(l)%t_surf_av = 0.0_wp |
---|
1413 | ENDIF |
---|
1414 | ENDDO |
---|
1415 | |
---|
1416 | CASE ( 'usm_t_surf_window' ) |
---|
1417 | !-- surface temperature for window surfaces |
---|
1418 | IF ( .NOT. ALLOCATED(surf_usm_h%t_surf_window_av) ) THEN |
---|
1419 | ALLOCATE( surf_usm_h%t_surf_window_av(1:surf_usm_h%ns) ) |
---|
1420 | surf_usm_h%t_surf_window_av = 0.0_wp |
---|
1421 | ENDIF |
---|
1422 | DO l = 0, 3 |
---|
1423 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_surf_window_av) ) THEN |
---|
1424 | ALLOCATE( surf_usm_v(l)%t_surf_window_av(1:surf_usm_v(l)%ns) ) |
---|
1425 | surf_usm_v(l)%t_surf_window_av = 0.0_wp |
---|
1426 | ENDIF |
---|
1427 | ENDDO |
---|
1428 | |
---|
1429 | CASE ( 'usm_t_surf_green' ) |
---|
1430 | !-- surface temperature for green surfaces |
---|
1431 | IF ( .NOT. ALLOCATED(surf_usm_h%t_surf_green_av) ) THEN |
---|
1432 | ALLOCATE( surf_usm_h%t_surf_green_av(1:surf_usm_h%ns) ) |
---|
1433 | surf_usm_h%t_surf_green_av = 0.0_wp |
---|
1434 | ENDIF |
---|
1435 | DO l = 0, 3 |
---|
1436 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_surf_green_av) ) THEN |
---|
1437 | ALLOCATE( surf_usm_v(l)%t_surf_green_av(1:surf_usm_v(l)%ns) ) |
---|
1438 | surf_usm_v(l)%t_surf_green_av = 0.0_wp |
---|
1439 | ENDIF |
---|
1440 | ENDDO |
---|
1441 | |
---|
1442 | CASE ( 'usm_t_surf_whole' ) |
---|
1443 | !-- surface temperature for whole surfaces |
---|
1444 | IF ( .NOT. ALLOCATED(surf_usm_h%t_surf_whole_av) ) THEN |
---|
1445 | ALLOCATE( surf_usm_h%t_surf_whole_av(1:surf_usm_h%ns) ) |
---|
1446 | surf_usm_h%t_surf_whole_av = 0.0_wp |
---|
1447 | ENDIF |
---|
1448 | DO l = 0, 3 |
---|
1449 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_surf_whole_av) ) THEN |
---|
1450 | ALLOCATE( surf_usm_v(l)%t_surf_whole_av(1:surf_usm_v(l)%ns) ) |
---|
1451 | surf_usm_v(l)%t_surf_whole_av = 0.0_wp |
---|
1452 | ENDIF |
---|
1453 | ENDDO |
---|
1454 | |
---|
1455 | CASE ( 'usm_t_surf_10cm' ) |
---|
1456 | !-- near surface temperature for whole surfaces |
---|
1457 | IF ( .NOT. ALLOCATED(surf_usm_h%t_surf_10cm_av) ) THEN |
---|
1458 | ALLOCATE( surf_usm_h%t_surf_10cm_av(1:surf_usm_h%ns) ) |
---|
1459 | surf_usm_h%t_surf_10cm_av = 0.0_wp |
---|
1460 | ENDIF |
---|
1461 | DO l = 0, 3 |
---|
1462 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_surf_10cm_av) ) THEN |
---|
1463 | ALLOCATE( surf_usm_v(l)%t_surf_10cm_av(1:surf_usm_v(l)%ns) ) |
---|
1464 | surf_usm_v(l)%t_surf_10cm_av = 0.0_wp |
---|
1465 | ENDIF |
---|
1466 | ENDDO |
---|
1467 | |
---|
1468 | CASE ( 'usm_t_wall' ) |
---|
1469 | !-- wall temperature for iwl layer of walls and land |
---|
1470 | IF ( .NOT. ALLOCATED(surf_usm_h%t_wall_av) ) THEN |
---|
1471 | ALLOCATE( surf_usm_h%t_wall_av(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
1472 | surf_usm_h%t_wall_av = 0.0_wp |
---|
1473 | ENDIF |
---|
1474 | DO l = 0, 3 |
---|
1475 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_wall_av) ) THEN |
---|
1476 | ALLOCATE( surf_usm_v(l)%t_wall_av(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
1477 | surf_usm_v(l)%t_wall_av = 0.0_wp |
---|
1478 | ENDIF |
---|
1479 | ENDDO |
---|
1480 | |
---|
1481 | CASE ( 'usm_t_window' ) |
---|
1482 | !-- window temperature for iwl layer of walls and land |
---|
1483 | IF ( .NOT. ALLOCATED(surf_usm_h%t_window_av) ) THEN |
---|
1484 | ALLOCATE( surf_usm_h%t_window_av(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
1485 | surf_usm_h%t_window_av = 0.0_wp |
---|
1486 | ENDIF |
---|
1487 | DO l = 0, 3 |
---|
1488 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_window_av) ) THEN |
---|
1489 | ALLOCATE( surf_usm_v(l)%t_window_av(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
1490 | surf_usm_v(l)%t_window_av = 0.0_wp |
---|
1491 | ENDIF |
---|
1492 | ENDDO |
---|
1493 | |
---|
1494 | CASE ( 'usm_t_green' ) |
---|
1495 | !-- green temperature for iwl layer of walls and land |
---|
1496 | IF ( .NOT. ALLOCATED(surf_usm_h%t_green_av) ) THEN |
---|
1497 | ALLOCATE( surf_usm_h%t_green_av(nzb_wall:nzt_wall,1:surf_usm_h%ns) ) |
---|
1498 | surf_usm_h%t_green_av = 0.0_wp |
---|
1499 | ENDIF |
---|
1500 | DO l = 0, 3 |
---|
1501 | IF ( .NOT. ALLOCATED(surf_usm_v(l)%t_green_av) ) THEN |
---|
1502 | ALLOCATE( surf_usm_v(l)%t_green_av(nzb_wall:nzt_wall,1:surf_usm_v(l)%ns) ) |
---|
1503 | surf_usm_v(l)%t_green_av = 0.0_wp |
---|
1504 | ENDIF |
---|
1505 | ENDDO |
---|
1506 | |
---|
1507 | CASE DEFAULT |
---|
1508 | CONTINUE |
---|
1509 | |
---|
1510 | END SELECT |
---|
1511 | |
---|
1512 | ELSEIF ( mode == 'sum' ) THEN |
---|
1513 | |
---|
1514 | SELECT CASE ( TRIM( var ) ) |
---|
1515 | |
---|
1516 | CASE ( 'usm_rad_net' ) |
---|
1517 | !-- array of complete radiation balance |
---|
1518 | DO m = 1, surf_usm_h%ns |
---|
1519 | surf_usm_h%rad_net_av(m) = & |
---|
1520 | surf_usm_h%rad_net_av(m) + & |
---|
1521 | surf_usm_h%rad_net_l(m) |
---|
1522 | ENDDO |
---|
1523 | DO l = 0, 3 |
---|
1524 | DO m = 1, surf_usm_v(l)%ns |
---|
1525 | surf_usm_v(l)%rad_net_av(m) = & |
---|
1526 | surf_usm_v(l)%rad_net_av(m) + & |
---|
1527 | surf_usm_v(l)%rad_net_l(m) |
---|
1528 | ENDDO |
---|
1529 | ENDDO |
---|
1530 | |
---|
1531 | CASE ( 'usm_rad_insw' ) |
---|
1532 | !-- array of sw radiation falling to surface after i-th reflection |
---|
1533 | DO l = startenergy, endenergy |
---|
1534 | IF ( surfl(id,l) == ids ) THEN |
---|
1535 | surfinsw_av(l) = surfinsw_av(l) + surfinsw(l) |
---|
1536 | ENDIF |
---|
1537 | ENDDO |
---|
1538 | |
---|
1539 | CASE ( 'usm_rad_inlw' ) |
---|
1540 | !-- array of lw radiation falling to surface after i-th reflection |
---|
1541 | DO l = startenergy, endenergy |
---|
1542 | IF ( surfl(id,l) == ids ) THEN |
---|
1543 | surfinlw_av(l) = surfinlw_av(l) + surfinlw(l) |
---|
1544 | ENDIF |
---|
1545 | ENDDO |
---|
1546 | |
---|
1547 | CASE ( 'usm_rad_inswdir' ) |
---|
1548 | !-- array of direct sw radiation falling to surface from sun |
---|
1549 | DO l = startenergy, endenergy |
---|
1550 | IF ( surfl(id,l) == ids ) THEN |
---|
1551 | surfinswdir_av(l) = surfinswdir_av(l) + surfinswdir(l) |
---|
1552 | ENDIF |
---|
1553 | ENDDO |
---|
1554 | |
---|
1555 | CASE ( 'usm_rad_inswdif' ) |
---|
1556 | !-- array of difusion sw radiation falling to surface from sky and borders of the domain |
---|
1557 | DO l = startenergy, endenergy |
---|
1558 | IF ( surfl(id,l) == ids ) THEN |
---|
1559 | surfinswdif_av(l) = surfinswdif_av(l) + surfinswdif(l) |
---|
1560 | ENDIF |
---|
1561 | ENDDO |
---|
1562 | |
---|
1563 | CASE ( 'usm_rad_inswref' ) |
---|
1564 | !-- array of sw radiation falling to surface from reflections |
---|
1565 | DO l = startenergy, endenergy |
---|
1566 | IF ( surfl(id,l) == ids ) THEN |
---|
1567 | surfinswref_av(l) = surfinswref_av(l) + surfinsw(l) - & |
---|
1568 | surfinswdir(l) - surfinswdif(l) |
---|
1569 | ENDIF |
---|
1570 | ENDDO |
---|
1571 | |
---|
1572 | |
---|
1573 | CASE ( 'usm_rad_inlwdif' ) |
---|
1574 | !-- array of sw radiation falling to surface after i-th reflection |
---|
1575 | DO l = startenergy, endenergy |
---|
1576 | IF ( surfl(id,l) == ids ) THEN |
---|
1577 | surfinswref_av(l) = surfinswref_av(l) + surfinsw(l) - & |
---|
1578 | surfinswdir(l) - surfinswdif(l) |
---|
1579 | ENDIF |
---|
1580 | ENDDO |
---|
1581 | ! |
---|
1582 | CASE ( 'usm_rad_inlwref' ) |
---|
1583 | !-- array of lw radiation falling to surface from reflections |
---|
1584 | DO l = startenergy, endenergy |
---|
1585 | IF ( surfl(id,l) == ids ) THEN |
---|
1586 | surfinlwdif_av(l) = surfinlwdif_av(l) + surfinlwdif(l) |
---|
1587 | ENDIF |
---|
1588 | ENDDO |
---|
1589 | |
---|
1590 | CASE ( 'usm_rad_outsw' ) |
---|
1591 | !-- array of sw radiation emitted from surface after i-th reflection |
---|
1592 | DO l = startenergy, endenergy |
---|
1593 | IF ( surfl(id,l) == ids ) THEN |
---|
1594 | surfinlwref_av(l) = surfinlwref_av(l) + & |
---|
1595 | surfinlw(l) - surfinlwdif(l) |
---|
1596 | ENDIF |
---|
1597 | ENDDO |
---|
1598 | |
---|
1599 | CASE ( 'usm_rad_outlw' ) |
---|
1600 | !-- array of lw radiation emitted from surface after i-th reflection |
---|
1601 | DO l = startenergy, endenergy |
---|
1602 | IF ( surfl(id,l) == ids ) THEN |
---|
1603 | surfoutsw_av(l) = surfoutsw_av(l) + surfoutsw(l) |
---|
1604 | ENDIF |
---|
1605 | ENDDO |
---|
1606 | |
---|
1607 | CASE ( 'usm_rad_ressw' ) |
---|
1608 | !-- array of residua of sw radiation absorbed in surface after last reflection |
---|
1609 | DO l = startenergy, endenergy |
---|
1610 | IF ( surfl(id,l) == ids ) THEN |
---|
1611 | surfoutlw_av(l) = surfoutlw_av(l) + surfoutlw(l) |
---|
1612 | ENDIF |
---|
1613 | ENDDO |
---|
1614 | |
---|
1615 | CASE ( 'usm_rad_reslw' ) |
---|
1616 | !-- array of residua of lw radiation absorbed in surface after last reflection |
---|
1617 | DO l = startenergy, endenergy |
---|
1618 | IF ( surfl(id,l) == ids ) THEN |
---|
1619 | surfins_av(l) = surfins_av(l) + surfins(l) |
---|
1620 | ENDIF |
---|
1621 | ENDDO |
---|
1622 | |
---|
1623 | CASE ( 'usm_rad_hf' ) |
---|
1624 | !-- array of heat flux from radiation for surfaces after i-th reflection |
---|
1625 | DO m = 1, surf_usm_h%ns |
---|
1626 | surf_usm_h%surfhf_av(m) = & |
---|
1627 | surf_usm_h%surfhf_av(m) + & |
---|
1628 | surf_usm_h%surfhf(m) |
---|
1629 | ENDDO |
---|
1630 | DO l = 0, 3 |
---|
1631 | DO m = 1, surf_usm_v(l)%ns |
---|
1632 | surf_usm_v(l)%surfhf_av(m) = & |
---|
1633 | surf_usm_v(l)%surfhf_av(m) + & |
---|
1634 | surf_usm_v(l)%surfhf(m) |
---|
1635 | ENDDO |
---|
1636 | ENDDO |
---|
1637 | |
---|
1638 | CASE ( 'usm_wshf' ) |
---|
1639 | !-- array of sensible heat flux from surfaces (land, roof, wall) |
---|
1640 | DO m = 1, surf_usm_h%ns |
---|
1641 | surf_usm_h%wshf_eb_av(m) = & |
---|
1642 | surf_usm_h%wshf_eb_av(m) + & |
---|
1643 | surf_usm_h%wshf_eb(m) |
---|
1644 | ENDDO |
---|
1645 | DO l = 0, 3 |
---|
1646 | DO m = 1, surf_usm_v(l)%ns |
---|
1647 | surf_usm_v(l)%wshf_eb_av(m) = & |
---|
1648 | surf_usm_v(l)%wshf_eb_av(m) + & |
---|
1649 | surf_usm_v(l)%wshf_eb(m) |
---|
1650 | ENDDO |
---|
1651 | ENDDO |
---|
1652 | |
---|
1653 | CASE ( 'usm_wghf' ) |
---|
1654 | !-- array of heat flux from ground (wall, roof, land) |
---|
1655 | DO m = 1, surf_usm_h%ns |
---|
1656 | surf_usm_h%wghf_eb_av(m) = & |
---|
1657 | surf_usm_h%wghf_eb_av(m) + & |
---|
1658 | surf_usm_h%wghf_eb(m) |
---|
1659 | ENDDO |
---|
1660 | DO l = 0, 3 |
---|
1661 | DO m = 1, surf_usm_v(l)%ns |
---|
1662 | surf_usm_v(l)%wghf_eb_av(m) = & |
---|
1663 | surf_usm_v(l)%wghf_eb_av(m) + & |
---|
1664 | surf_usm_v(l)%wghf_eb(m) |
---|
1665 | ENDDO |
---|
1666 | ENDDO |
---|
1667 | |
---|
1668 | CASE ( 'usm_wghf_window' ) |
---|
1669 | !-- array of heat flux from window ground (wall, roof, land) |
---|
1670 | DO m = 1, surf_usm_h%ns |
---|
1671 | surf_usm_h%wghf_eb_window_av(m) = & |
---|
1672 | surf_usm_h%wghf_eb_window_av(m) + & |
---|
1673 | surf_usm_h%wghf_eb_window(m) |
---|
1674 | ENDDO |
---|
1675 | DO l = 0, 3 |
---|
1676 | DO m = 1, surf_usm_v(l)%ns |
---|
1677 | surf_usm_v(l)%wghf_eb_window_av(m) = & |
---|
1678 | surf_usm_v(l)%wghf_eb_window_av(m) + & |
---|
1679 | surf_usm_v(l)%wghf_eb_window(m) |
---|
1680 | ENDDO |
---|
1681 | ENDDO |
---|
1682 | |
---|
1683 | CASE ( 'usm_wghf_green' ) |
---|
1684 | !-- array of heat flux from green ground (wall, roof, land) |
---|
1685 | DO m = 1, surf_usm_h%ns |
---|
1686 | surf_usm_h%wghf_eb_green_av(m) = & |
---|
1687 | surf_usm_h%wghf_eb_green_av(m) + & |
---|
1688 | surf_usm_h%wghf_eb_green(m) |
---|
1689 | ENDDO |
---|
1690 | DO l = 0, 3 |
---|
1691 | DO m = 1, surf_usm_v(l)%ns |
---|
1692 | surf_usm_v(l)%wghf_eb_green_av(m) = & |
---|
1693 | surf_usm_v(l)%wghf_eb_green_av(m) + & |
---|
1694 | surf_usm_v(l)%wghf_eb_green(m) |
---|
1695 | ENDDO |
---|
1696 | ENDDO |
---|
1697 | |
---|
1698 | CASE ( 'usm_iwghf' ) |
---|
1699 | !-- array of heat flux from indoor ground (wall, roof, land) |
---|
1700 | DO m = 1, surf_usm_h%ns |
---|
1701 | surf_usm_h%iwghf_eb_av(m) = & |
---|
1702 | surf_usm_h%iwghf_eb_av(m) + & |
---|
1703 | surf_usm_h%iwghf_eb(m) |
---|
1704 | ENDDO |
---|
1705 | DO l = 0, 3 |
---|
1706 | DO m = 1, surf_usm_v(l)%ns |
---|
1707 | surf_usm_v(l)%iwghf_eb_av(m) = & |
---|
1708 | surf_usm_v(l)%iwghf_eb_av(m) + & |
---|
1709 | surf_usm_v(l)%iwghf_eb(m) |
---|
1710 | ENDDO |
---|
1711 | ENDDO |
---|
1712 | |
---|
1713 | CASE ( 'usm_iwghf_window' ) |
---|
1714 | !-- array of heat flux from indoor window ground (wall, roof, land) |
---|
1715 | DO m = 1, surf_usm_h%ns |
---|
1716 | surf_usm_h%iwghf_eb_window_av(m) = & |
---|
1717 | surf_usm_h%iwghf_eb_window_av(m) + & |
---|
1718 | surf_usm_h%iwghf_eb_window(m) |
---|
1719 | ENDDO |
---|
1720 | DO l = 0, 3 |
---|
1721 | DO m = 1, surf_usm_v(l)%ns |
---|
1722 | surf_usm_v(l)%iwghf_eb_window_av(m) = & |
---|
1723 | surf_usm_v(l)%iwghf_eb_window_av(m) + & |
---|
1724 | surf_usm_v(l)%iwghf_eb_window(m) |
---|
1725 | ENDDO |
---|
1726 | ENDDO |
---|
1727 | |
---|
1728 | CASE ( 'usm_t_surf' ) |
---|
1729 | !-- surface temperature for surfaces |
---|
1730 | DO m = 1, surf_usm_h%ns |
---|
1731 | surf_usm_h%t_surf_av(m) = & |
---|
1732 | surf_usm_h%t_surf_av(m) + & |
---|
1733 | t_surf_h(m) |
---|
1734 | ENDDO |
---|
1735 | DO l = 0, 3 |
---|
1736 | DO m = 1, surf_usm_v(l)%ns |
---|
1737 | surf_usm_v(l)%t_surf_av(m) = & |
---|
1738 | surf_usm_v(l)%t_surf_av(m) + & |
---|
1739 | t_surf_v(l)%t(m) |
---|
1740 | ENDDO |
---|
1741 | ENDDO |
---|
1742 | |
---|
1743 | CASE ( 'usm_t_surf_window' ) |
---|
1744 | !-- surface temperature for window surfaces |
---|
1745 | DO m = 1, surf_usm_h%ns |
---|
1746 | surf_usm_h%t_surf_window_av(m) = & |
---|
1747 | surf_usm_h%t_surf_window_av(m) + & |
---|
1748 | t_surf_window_h(m) |
---|
1749 | ENDDO |
---|
1750 | DO l = 0, 3 |
---|
1751 | DO m = 1, surf_usm_v(l)%ns |
---|
1752 | surf_usm_v(l)%t_surf_window_av(m) = & |
---|
1753 | surf_usm_v(l)%t_surf_window_av(m) + & |
---|
1754 | t_surf_window_v(l)%t(m) |
---|
1755 | ENDDO |
---|
1756 | ENDDO |
---|
1757 | |
---|
1758 | CASE ( 'usm_t_surf_green' ) |
---|
1759 | !-- surface temperature for green surfaces |
---|
1760 | DO m = 1, surf_usm_h%ns |
---|
1761 | surf_usm_h%t_surf_green_av(m) = & |
---|
1762 | surf_usm_h%t_surf_green_av(m) + & |
---|
1763 | t_surf_green_h(m) |
---|
1764 | ENDDO |
---|
1765 | DO l = 0, 3 |
---|
1766 | DO m = 1, surf_usm_v(l)%ns |
---|
1767 | surf_usm_v(l)%t_surf_green_av(m) = & |
---|
1768 | surf_usm_v(l)%t_surf_green_av(m) + & |
---|
1769 | t_surf_green_v(l)%t(m) |
---|
1770 | ENDDO |
---|
1771 | ENDDO |
---|
1772 | |
---|
1773 | CASE ( 'usm_t_surf_whole' ) |
---|
1774 | !-- surface temperature for whole surfaces |
---|
1775 | DO m = 1, surf_usm_h%ns |
---|
1776 | surf_usm_h%t_surf_whole_av(m) = & |
---|
1777 | surf_usm_h%t_surf_whole_av(m) + & |
---|
1778 | t_surf_whole_h(m) |
---|
1779 | ENDDO |
---|
1780 | DO l = 0, 3 |
---|
1781 | DO m = 1, surf_usm_v(l)%ns |
---|
1782 | surf_usm_v(l)%t_surf_whole_av(m) = & |
---|
1783 | surf_usm_v(l)%t_surf_whole_av(m) + & |
---|
1784 | t_surf_whole_v(l)%t(m) |
---|
1785 | ENDDO |
---|
1786 | ENDDO |
---|
1787 | |
---|
1788 | CASE ( 'usm_t_surf_10cm' ) |
---|
1789 | !-- near surface temperature for whole surfaces |
---|
1790 | DO m = 1, surf_usm_h%ns |
---|
1791 | surf_usm_h%t_surf_10cm_av(m) = & |
---|
1792 | surf_usm_h%t_surf_10cm_av(m) + & |
---|
1793 | t_surf_10cm_h(m) |
---|
1794 | ENDDO |
---|
1795 | DO l = 0, 3 |
---|
1796 | DO m = 1, surf_usm_v(l)%ns |
---|
1797 | surf_usm_v(l)%t_surf_10cm_av(m) = & |
---|
1798 | surf_usm_v(l)%t_surf_10cm_av(m) + & |
---|
1799 | t_surf_10cm_v(l)%t(m) |
---|
1800 | ENDDO |
---|
1801 | ENDDO |
---|
1802 | |
---|
1803 | |
---|
1804 | CASE ( 'usm_t_wall' ) |
---|
1805 | !-- wall temperature for iwl layer of walls and land |
---|
1806 | DO m = 1, surf_usm_h%ns |
---|
1807 | surf_usm_h%t_wall_av(iwl,m) = & |
---|
1808 | surf_usm_h%t_wall_av(iwl,m) + & |
---|
1809 | t_wall_h(iwl,m) |
---|
1810 | ENDDO |
---|
1811 | DO l = 0, 3 |
---|
1812 | DO m = 1, surf_usm_v(l)%ns |
---|
1813 | surf_usm_v(l)%t_wall_av(iwl,m) = & |
---|
1814 | surf_usm_v(l)%t_wall_av(iwl,m) + & |
---|
1815 | t_wall_v(l)%t(iwl,m) |
---|
1816 | ENDDO |
---|
1817 | ENDDO |
---|
1818 | |
---|
1819 | CASE ( 'usm_t_window' ) |
---|
1820 | !-- window temperature for iwl layer of walls and land |
---|
1821 | DO m = 1, surf_usm_h%ns |
---|
1822 | surf_usm_h%t_window_av(iwl,m) = & |
---|
1823 | surf_usm_h%t_window_av(iwl,m) + & |
---|
1824 | t_window_h(iwl,m) |
---|
1825 | ENDDO |
---|
1826 | DO l = 0, 3 |
---|
1827 | DO m = 1, surf_usm_v(l)%ns |
---|
1828 | surf_usm_v(l)%t_window_av(iwl,m) = & |
---|
1829 | surf_usm_v(l)%t_window_av(iwl,m) + & |
---|
1830 | t_window_v(l)%t(iwl,m) |
---|
1831 | ENDDO |
---|
1832 | ENDDO |
---|
1833 | |
---|
1834 | CASE ( 'usm_t_green' ) |
---|
1835 | !-- green temperature for iwl layer of walls and land |
---|
1836 | DO m = 1, surf_usm_h%ns |
---|
1837 | surf_usm_h%t_green_av(iwl,m) = & |
---|
1838 | surf_usm_h%t_green_av(iwl,m) + & |
---|
1839 | t_green_h(iwl,m) |
---|
1840 | ENDDO |
---|
1841 | DO l = 0, 3 |
---|
1842 | DO m = 1, surf_usm_v(l)%ns |
---|
1843 | surf_usm_v(l)%t_green_av(iwl,m) = & |
---|
1844 | surf_usm_v(l)%t_green_av(iwl,m) + & |
---|
1845 | t_green_v(l)%t(iwl,m) |
---|
1846 | ENDDO |
---|
1847 | ENDDO |
---|
1848 | |
---|
1849 | CASE DEFAULT |
---|
1850 | CONTINUE |
---|
1851 | |
---|
1852 | END SELECT |
---|
1853 | |
---|
1854 | ELSEIF ( mode == 'average' ) THEN |
---|
1855 | |
---|
1856 | SELECT CASE ( TRIM( var ) ) |
---|
1857 | |
---|
1858 | CASE ( 'usm_rad_net' ) |
---|
1859 | !-- array of complete radiation balance |
---|
1860 | DO m = 1, surf_usm_h%ns |
---|
1861 | surf_usm_h%rad_net_av(m) = & |
---|
1862 | surf_usm_h%rad_net_av(m) / & |
---|
1863 | REAL( average_count_3d, kind=wp ) |
---|
1864 | ENDDO |
---|
1865 | DO l = 0, 3 |
---|
1866 | DO m = 1, surf_usm_v(l)%ns |
---|
1867 | surf_usm_v(l)%rad_net_av(m) = & |
---|
1868 | surf_usm_v(l)%rad_net_av(m) / & |
---|
1869 | REAL( average_count_3d, kind=wp ) |
---|
1870 | ENDDO |
---|
1871 | ENDDO |
---|
1872 | |
---|
1873 | CASE ( 'usm_rad_insw' ) |
---|
1874 | !-- array of sw radiation falling to surface after i-th reflection |
---|
1875 | DO l = startenergy, endenergy |
---|
1876 | IF ( surfl(id,l) == ids ) THEN |
---|
1877 | surfinsw_av(l) = surfinsw_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1878 | ENDIF |
---|
1879 | ENDDO |
---|
1880 | |
---|
1881 | CASE ( 'usm_rad_inlw' ) |
---|
1882 | !-- array of lw radiation falling to surface after i-th reflection |
---|
1883 | DO l = startenergy, endenergy |
---|
1884 | IF ( surfl(id,l) == ids ) THEN |
---|
1885 | surfinlw_av(l) = surfinlw_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1886 | ENDIF |
---|
1887 | ENDDO |
---|
1888 | |
---|
1889 | CASE ( 'usm_rad_inswdir' ) |
---|
1890 | !-- array of direct sw radiation falling to surface from sun |
---|
1891 | DO l = startenergy, endenergy |
---|
1892 | IF ( surfl(id,l) == ids ) THEN |
---|
1893 | surfinswdir_av(l) = surfinswdir_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1894 | ENDIF |
---|
1895 | ENDDO |
---|
1896 | |
---|
1897 | CASE ( 'usm_rad_inswdif' ) |
---|
1898 | !-- array of difusion sw radiation falling to surface from sky and borders of the domain |
---|
1899 | DO l = startenergy, endenergy |
---|
1900 | IF ( surfl(id,l) == ids ) THEN |
---|
1901 | surfinswdif_av(l) = surfinswdif_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1902 | ENDIF |
---|
1903 | ENDDO |
---|
1904 | |
---|
1905 | CASE ( 'usm_rad_inswref' ) |
---|
1906 | !-- array of sw radiation falling to surface from reflections |
---|
1907 | DO l = startenergy, endenergy |
---|
1908 | IF ( surfl(id,l) == ids ) THEN |
---|
1909 | surfinswref_av(l) = surfinswref_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1910 | ENDIF |
---|
1911 | ENDDO |
---|
1912 | |
---|
1913 | CASE ( 'usm_rad_inlwdif' ) |
---|
1914 | !-- array of sw radiation falling to surface after i-th reflection |
---|
1915 | DO l = startenergy, endenergy |
---|
1916 | IF ( surfl(id,l) == ids ) THEN |
---|
1917 | surfinlwdif_av(l) = surfinlwdif_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1918 | ENDIF |
---|
1919 | ENDDO |
---|
1920 | |
---|
1921 | CASE ( 'usm_rad_inlwref' ) |
---|
1922 | !-- array of lw radiation falling to surface from reflections |
---|
1923 | DO l = startenergy, endenergy |
---|
1924 | IF ( surfl(id,l) == ids ) THEN |
---|
1925 | surfinlwref_av(l) = surfinlwref_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1926 | ENDIF |
---|
1927 | ENDDO |
---|
1928 | |
---|
1929 | CASE ( 'usm_rad_outsw' ) |
---|
1930 | !-- array of sw radiation emitted from surface after i-th reflection |
---|
1931 | DO l = startenergy, endenergy |
---|
1932 | IF ( surfl(id,l) == ids ) THEN |
---|
1933 | surfoutsw_av(l) = surfoutsw_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1934 | ENDIF |
---|
1935 | ENDDO |
---|
1936 | |
---|
1937 | CASE ( 'usm_rad_outlw' ) |
---|
1938 | !-- array of lw radiation emitted from surface after i-th reflection |
---|
1939 | DO l = startenergy, endenergy |
---|
1940 | IF ( surfl(id,l) == ids ) THEN |
---|
1941 | surfoutlw_av(l) = surfoutlw_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1942 | ENDIF |
---|
1943 | ENDDO |
---|
1944 | |
---|
1945 | CASE ( 'usm_rad_ressw' ) |
---|
1946 | !-- array of residua of sw radiation absorbed in surface after last reflection |
---|
1947 | DO l = startenergy, endenergy |
---|
1948 | IF ( surfl(id,l) == ids ) THEN |
---|
1949 | surfins_av(l) = surfins_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1950 | ENDIF |
---|
1951 | ENDDO |
---|
1952 | |
---|
1953 | CASE ( 'usm_rad_reslw' ) |
---|
1954 | !-- array of residua of lw radiation absorbed in surface after last reflection |
---|
1955 | DO l = startenergy, endenergy |
---|
1956 | IF ( surfl(id,l) == ids ) THEN |
---|
1957 | surfinl_av(l) = surfinl_av(l) / REAL( average_count_3d, kind=wp ) |
---|
1958 | ENDIF |
---|
1959 | ENDDO |
---|
1960 | |
---|
1961 | CASE ( 'usm_rad_hf' ) |
---|
1962 | !-- array of heat flux from radiation for surfaces after i-th reflection |
---|
1963 | DO m = 1, surf_usm_h%ns |
---|
1964 | surf_usm_h%surfhf_av(m) = & |
---|
1965 | surf_usm_h%surfhf_av(m) / & |
---|
1966 | REAL( average_count_3d, kind=wp ) |
---|
1967 | ENDDO |
---|
1968 | DO l = 0, 3 |
---|
1969 | DO m = 1, surf_usm_v(l)%ns |
---|
1970 | surf_usm_v(l)%surfhf_av(m) = & |
---|
1971 | surf_usm_v(l)%surfhf_av(m) / & |
---|
1972 | REAL( average_count_3d, kind=wp ) |
---|
1973 | ENDDO |
---|
1974 | ENDDO |
---|
1975 | |
---|
1976 | CASE ( 'usm_wshf' ) |
---|
1977 | !-- array of sensible heat flux from surfaces (land, roof, wall) |
---|
1978 | DO m = 1, surf_usm_h%ns |
---|
1979 | surf_usm_h%wshf_eb_av(m) = & |
---|
1980 | surf_usm_h%wshf_eb_av(m) / & |
---|
1981 | REAL( average_count_3d, kind=wp ) |
---|
1982 | ENDDO |
---|
1983 | DO l = 0, 3 |
---|
1984 | DO m = 1, surf_usm_v(l)%ns |
---|
1985 | surf_usm_v(l)%wshf_eb_av(m) = & |
---|
1986 | surf_usm_v(l)%wshf_eb_av(m) / & |
---|
1987 | REAL( average_count_3d, kind=wp ) |
---|
1988 | ENDDO |
---|
1989 | ENDDO |
---|
1990 | |
---|
1991 | CASE ( 'usm_wghf' ) |
---|
1992 | !-- array of heat flux from ground (wall, roof, land) |
---|
1993 | DO m = 1, surf_usm_h%ns |
---|
1994 | surf_usm_h%wghf_eb_av(m) = & |
---|
1995 | surf_usm_h%wghf_eb_av(m) / & |
---|
1996 | REAL( average_count_3d, kind=wp ) |
---|
1997 | ENDDO |
---|
1998 | DO l = 0, 3 |
---|
1999 | DO m = 1, surf_usm_v(l)%ns |
---|
2000 | surf_usm_v(l)%wghf_eb_av(m) = & |
---|
2001 | surf_usm_v(l)%wghf_eb_av(m) / & |
---|
2002 | REAL( average_count_3d, kind=wp ) |
---|
2003 | ENDDO |
---|
2004 | ENDDO |
---|
2005 | |
---|
2006 | CASE ( 'usm_wghf_window' ) |
---|
2007 | !-- array of heat flux from window ground (wall, roof, land) |
---|
2008 | DO m = 1, surf_usm_h%ns |
---|
2009 | surf_usm_h%wghf_eb_window_av(m) = & |
---|
2010 | surf_usm_h%wghf_eb_window_av(m) / & |
---|
2011 | REAL( average_count_3d, kind=wp ) |
---|
2012 | ENDDO |
---|
2013 | DO l = 0, 3 |
---|
2014 | DO m = 1, surf_usm_v(l)%ns |
---|
2015 | surf_usm_v(l)%wghf_eb_window_av(m) = & |
---|
2016 | surf_usm_v(l)%wghf_eb_window_av(m) / & |
---|
2017 | REAL( average_count_3d, kind=wp ) |
---|
2018 | ENDDO |
---|
2019 | ENDDO |
---|
2020 | |
---|
2021 | CASE ( 'usm_wghf_green' ) |
---|
2022 | !-- array of heat flux from green ground (wall, roof, land) |
---|
2023 | DO m = 1, surf_usm_h%ns |
---|
2024 | surf_usm_h%wghf_eb_green_av(m) = & |
---|
2025 | surf_usm_h%wghf_eb_green_av(m) / & |
---|
2026 | REAL( average_count_3d, kind=wp ) |
---|
2027 | ENDDO |
---|
2028 | DO l = 0, 3 |
---|
2029 | DO m = 1, surf_usm_v(l)%ns |
---|
2030 | surf_usm_v(l)%wghf_eb_green_av(m) = & |
---|
2031 | surf_usm_v(l)%wghf_eb_green_av(m) / & |
---|
2032 | REAL( average_count_3d, kind=wp ) |
---|
2033 | ENDDO |
---|
2034 | ENDDO |
---|
2035 | |
---|
2036 | CASE ( 'usm_iwghf' ) |
---|
2037 | !-- array of heat flux from indoor ground (wall, roof, land) |
---|
2038 | DO m = 1, surf_usm_h%ns |
---|
2039 | surf_usm_h%iwghf_eb_av(m) = & |
---|
2040 | surf_usm_h%iwghf_eb_av(m) / & |
---|
2041 | REAL( average_count_3d, kind=wp ) |
---|
2042 | ENDDO |
---|
2043 | DO l = 0, 3 |
---|
2044 | DO m = 1, surf_usm_v(l)%ns |
---|
2045 | surf_usm_v(l)%iwghf_eb_av(m) = & |
---|
2046 | surf_usm_v(l)%iwghf_eb_av(m) / & |
---|
2047 | REAL( average_count_3d, kind=wp ) |
---|
2048 | ENDDO |
---|
2049 | ENDDO |
---|
2050 | |
---|
2051 | CASE ( 'usm_iwghf_window' ) |
---|
2052 | !-- array of heat flux from indoor window ground (wall, roof, land) |
---|
2053 | DO m = 1, surf_usm_h%ns |
---|
2054 | surf_usm_h%iwghf_eb_window_av(m) = & |
---|
2055 | surf_usm_h%iwghf_eb_window_av(m) / & |
---|
2056 | REAL( average_count_3d, kind=wp ) |
---|
2057 | ENDDO |
---|
2058 | DO l = 0, 3 |
---|
2059 | DO m = 1, surf_usm_v(l)%ns |
---|
2060 | surf_usm_v(l)%iwghf_eb_window_av(m) = & |
---|
2061 | surf_usm_v(l)%iwghf_eb_window_av(m) / & |
---|
2062 | REAL( average_count_3d, kind=wp ) |
---|
2063 | ENDDO |
---|
2064 | ENDDO |
---|
2065 | |
---|
2066 | CASE ( 'usm_t_surf' ) |
---|
2067 | !-- surface temperature for surfaces |
---|
2068 | DO m = 1, surf_usm_h%ns |
---|
2069 | surf_usm_h%t_surf_av(m) = & |
---|
2070 | surf_usm_h%t_surf_av(m) / & |
---|
2071 | REAL( average_count_3d, kind=wp ) |
---|
2072 | ENDDO |
---|
2073 | DO l = 0, 3 |
---|
2074 | DO m = 1, surf_usm_v(l)%ns |
---|
2075 | surf_usm_v(l)%t_surf_av(m) = & |
---|
2076 | surf_usm_v(l)%t_surf_av(m) / & |
---|
2077 | REAL( average_count_3d, kind=wp ) |
---|
2078 | ENDDO |
---|
2079 | ENDDO |
---|
2080 | |
---|
2081 | CASE ( 'usm_t_surf_window' ) |
---|
2082 | !-- surface temperature for window surfaces |
---|
2083 | DO m = 1, surf_usm_h%ns |
---|
2084 | surf_usm_h%t_surf_window_av(m) = & |
---|
2085 | surf_usm_h%t_surf_window_av(m) / & |
---|
2086 | REAL( average_count_3d, kind=wp ) |
---|
2087 | ENDDO |
---|
2088 | DO l = 0, 3 |
---|
2089 | DO m = 1, surf_usm_v(l)%ns |
---|
2090 | surf_usm_v(l)%t_surf_window_av(m) = & |
---|
2091 | surf_usm_v(l)%t_surf_window_av(m) / & |
---|
2092 | REAL( average_count_3d, kind=wp ) |
---|
2093 | ENDDO |
---|
2094 | ENDDO |
---|
2095 | |
---|
2096 | CASE ( 'usm_t_surf_green' ) |
---|
2097 | !-- surface temperature for green surfaces |
---|
2098 | DO m = 1, surf_usm_h%ns |
---|
2099 | surf_usm_h%t_surf_green_av(m) = & |
---|
2100 | surf_usm_h%t_surf_green_av(m) / & |
---|
2101 | REAL( average_count_3d, kind=wp ) |
---|
2102 | ENDDO |
---|
2103 | DO l = 0, 3 |
---|
2104 | DO m = 1, surf_usm_v(l)%ns |
---|
2105 | surf_usm_v(l)%t_surf_green_av(m) = & |
---|
2106 | surf_usm_v(l)%t_surf_green_av(m) / & |
---|
2107 | REAL( average_count_3d, kind=wp ) |
---|
2108 | ENDDO |
---|
2109 | ENDDO |
---|
2110 | |
---|
2111 | CASE ( 'usm_t_surf_whole' ) |
---|
2112 | !-- surface temperature for whole surfaces |
---|
2113 | DO m = 1, surf_usm_h%ns |
---|
2114 | surf_usm_h%t_surf_whole_av(m) = & |
---|
2115 | surf_usm_h%t_surf_whole_av(m) / & |
---|
2116 | REAL( average_count_3d, kind=wp ) |
---|
2117 | ENDDO |
---|
2118 | DO l = 0, 3 |
---|
2119 | DO m = 1, surf_usm_v(l)%ns |
---|
2120 | surf_usm_v(l)%t_surf_whole_av(m) = & |
---|
2121 | surf_usm_v(l)%t_surf_whole_av(m) / & |
---|
2122 | REAL( average_count_3d, kind=wp ) |
---|
2123 | ENDDO |
---|
2124 | ENDDO |
---|
2125 | |
---|
2126 | CASE ( 'usm_t_surf_10cm' ) |
---|
2127 | !-- near surface temperature for whole surfaces |
---|
2128 | DO m = 1, surf_usm_h%ns |
---|
2129 | surf_usm_h%t_surf_10cm_av(m) = & |
---|
2130 | surf_usm_h%t_surf_10cm_av(m) / & |
---|
2131 | REAL( average_count_3d, kind=wp ) |
---|
2132 | ENDDO |
---|
2133 | DO l = 0, 3 |
---|
2134 | DO m = 1, surf_usm_v(l)%ns |
---|
2135 | surf_usm_v(l)%t_surf_10cm_av(m) = & |
---|
2136 | surf_usm_v(l)%t_surf_10cm_av(m) / & |
---|
2137 | REAL( average_count_3d, kind=wp ) |
---|
2138 | ENDDO |
---|
2139 | ENDDO |
---|
2140 | |
---|
2141 | CASE ( 'usm_t_wall' ) |
---|
2142 | !-- wall temperature for iwl layer of walls and land |
---|
2143 | DO m = 1, surf_usm_h%ns |
---|
2144 | surf_usm_h%t_wall_av(iwl,m) = & |
---|
2145 | surf_usm_h%t_wall_av(iwl,m) / & |
---|
2146 | REAL( average_count_3d, kind=wp ) |
---|
2147 | ENDDO |
---|
2148 | DO l = 0, 3 |
---|
2149 | DO m = 1, surf_usm_v(l)%ns |
---|
2150 | surf_usm_v(l)%t_wall_av(iwl,m) = & |
---|
2151 | surf_usm_v(l)%t_wall_av(iwl,m) / & |
---|
2152 | REAL( average_count_3d, kind=wp ) |
---|
2153 | ENDDO |
---|
2154 | ENDDO |
---|
2155 | |
---|
2156 | CASE ( 'usm_t_window' ) |
---|
2157 | !-- window temperature for iwl layer of walls and land |
---|
2158 | DO m = 1, surf_usm_h%ns |
---|
2159 | surf_usm_h%t_window_av(iwl,m) = & |
---|
2160 | surf_usm_h%t_window_av(iwl,m) / & |
---|
2161 | REAL( average_count_3d, kind=wp ) |
---|
2162 | ENDDO |
---|
2163 | DO l = 0, 3 |
---|
2164 | DO m = 1, surf_usm_v(l)%ns |
---|
2165 | surf_usm_v(l)%t_window_av(iwl,m) = & |
---|
2166 | surf_usm_v(l)%t_window_av(iwl,m) / & |
---|
2167 | REAL( average_count_3d, kind=wp ) |
---|
2168 | ENDDO |
---|
2169 | ENDDO |
---|
2170 | |
---|
2171 | CASE ( 'usm_t_green' ) |
---|
2172 | !-- green temperature for iwl layer of walls and land |
---|
2173 | DO m = 1, surf_usm_h%ns |
---|
2174 | surf_usm_h%t_green_av(iwl,m) = & |
---|
2175 | surf_usm_h%t_green_av(iwl,m) / & |
---|
2176 | REAL( average_count_3d, kind=wp ) |
---|
2177 | ENDDO |
---|
2178 | DO l = 0, 3 |
---|
2179 | DO m = 1, surf_usm_v(l)%ns |
---|
2180 | surf_usm_v(l)%t_green_av(iwl,m) = & |
---|
2181 | surf_usm_v(l)%t_green_av(iwl,m) / & |
---|
2182 | REAL( average_count_3d, kind=wp ) |
---|
2183 | ENDDO |
---|
2184 | ENDDO |
---|
2185 | |
---|
2186 | |
---|
2187 | END SELECT |
---|
2188 | |
---|
2189 | ENDIF |
---|
2190 | |
---|
2191 | END SUBROUTINE usm_average_3d_data |
---|
2192 | |
---|
2193 | |
---|
2194 | |
---|
2195 | !------------------------------------------------------------------------------! |
---|
2196 | ! Description: |
---|
2197 | ! ------------ |
---|
2198 | !> Set internal Neumann boundary condition at outer soil grid points |
---|
2199 | !> for temperature and humidity. |
---|
2200 | !------------------------------------------------------------------------------! |
---|
2201 | SUBROUTINE usm_boundary_condition |
---|
2202 | |
---|
2203 | IMPLICIT NONE |
---|
2204 | |
---|
2205 | INTEGER(iwp) :: i !< grid index x-direction |
---|
2206 | INTEGER(iwp) :: ioff !< offset index x-direction indicating location of soil grid point |
---|
2207 | INTEGER(iwp) :: j !< grid index y-direction |
---|
2208 | INTEGER(iwp) :: joff !< offset index x-direction indicating location of soil grid point |
---|
2209 | INTEGER(iwp) :: k !< grid index z-direction |
---|
2210 | INTEGER(iwp) :: koff !< offset index x-direction indicating location of soil grid point |
---|
2211 | INTEGER(iwp) :: l !< running index surface-orientation |
---|
2212 | INTEGER(iwp) :: m !< running index surface elements |
---|
2213 | |
---|
2214 | koff = surf_usm_h%koff |
---|
2215 | DO m = 1, surf_usm_h%ns |
---|
2216 | i = surf_usm_h%i(m) |
---|
2217 | j = surf_usm_h%j(m) |
---|
2218 | k = surf_usm_h%k(m) |
---|
2219 | pt(k+koff,j,i) = pt(k,j,i) |
---|
2220 | ENDDO |
---|
2221 | |
---|
2222 | DO l = 0, 3 |
---|
2223 | ioff = surf_usm_v(l)%ioff |
---|
2224 | joff = surf_usm_v(l)%joff |
---|
2225 | DO m = 1, surf_usm_v(l)%ns |
---|
2226 | i = surf_usm_v(l)%i(m) |
---|
2227 | j = surf_usm_v(l)%j(m) |
---|
2228 | k = surf_usm_v(l)%k(m) |
---|
2229 | pt(k,j+joff,i+ioff) = pt(k,j,i) |
---|
2230 | ENDDO |
---|
2231 | ENDDO |
---|
2232 | |
---|
2233 | END SUBROUTINE usm_boundary_condition |
---|
2234 | |
---|
2235 | |
---|
2236 | !------------------------------------------------------------------------------! |
---|
2237 | ! |
---|
2238 | ! Description: |
---|
2239 | ! ------------ |
---|
2240 | !> Subroutine checks variables and assigns units. |
---|
2241 | !> It is called out from subroutine check_parameters. |
---|
2242 | !------------------------------------------------------------------------------! |
---|
2243 | SUBROUTINE usm_check_data_output( variable, unit ) |
---|
2244 | |
---|
2245 | IMPLICIT NONE |
---|
2246 | |
---|
2247 | CHARACTER (len=*),INTENT(IN) :: variable !: |
---|
2248 | CHARACTER (len=*),INTENT(OUT) :: unit !: |
---|
2249 | |
---|
2250 | CHARACTER (len=varnamelength) :: var |
---|
2251 | |
---|
2252 | var = TRIM(variable) |
---|
2253 | IF ( var(1:12) == 'usm_rad_net_' .OR. var(1:13) == 'usm_rad_insw_' .OR. & |
---|
2254 | var(1:13) == 'usm_rad_inlw_' .OR. var(1:16) == 'usm_rad_inswdir_' .OR. & |
---|
2255 | var(1:16) == 'usm_rad_inswdif_' .OR. var(1:16) == 'usm_rad_inswref_' .OR. & |
---|
2256 | var(1:16) == 'usm_rad_inlwdif_' .OR. var(1:16) == 'usm_rad_inlwref_' .OR. & |
---|
2257 | var(1:14) == 'usm_rad_outsw_' .OR. var(1:14) == 'usm_rad_outlw_' .OR. & |
---|
2258 | var(1:14) == 'usm_rad_ressw_' .OR. var(1:14) == 'usm_rad_reslw_' .OR. & |
---|
2259 | var(1:11) == 'usm_rad_hf_' .OR. & |
---|
2260 | var(1:9) == 'usm_wshf_' .OR. var(1:9) == 'usm_wghf_' .OR. & |
---|
2261 | var(1:16) == 'usm_wghf_window_' .OR. var(1:15) == 'usm_wghf_green_' .OR. & |
---|
2262 | var(1:10) == 'usm_iwghf_' .OR. var(1:17) == 'usm_iwghf_window_' ) THEN |
---|
2263 | unit = 'W/m2' |
---|
2264 | ELSE IF ( var(1:10) == 'usm_t_surf' .OR. var(1:10) == 'usm_t_wall' .OR. & |
---|
2265 | var(1:12) == 'usm_t_window' .OR. var(1:17) == 'usm_t_surf_window' .OR. & |
---|
2266 | var(1:16) == 'usm_t_surf_green' .OR. & |
---|
2267 | var(1:16) == 'usm_t_surf_whole' .OR. var(1:11) == 'usm_t_green' .OR. & |
---|
2268 | var(1:15) == 'usm_t_surf_10cm') THEN |
---|
2269 | unit = 'K' |
---|
2270 | ELSE IF ( var(1:9) == 'usm_surfz' .OR. var(1:7) == 'usm_svf' .OR. & |
---|
2271 | var(1:7) == 'usm_dif' .OR. var(1:11) == 'usm_surfcat' .OR. & |
---|
2272 | var(1:11) == 'usm_surfalb' .OR. var(1:12) == 'usm_surfemis') THEN |
---|
2273 | unit = '1' |
---|
2274 | ELSE |
---|
2275 | unit = 'illegal' |
---|
2276 | ENDIF |
---|
2277 | |
---|
2278 | END SUBROUTINE usm_check_data_output |
---|
2279 | |
---|
2280 | |
---|
2281 | !------------------------------------------------------------------------------! |
---|
2282 | ! Description: |
---|
2283 | ! ------------ |
---|
2284 | !> Check parameters routine for urban surface model |
---|
2285 | !------------------------------------------------------------------------------! |
---|
2286 | SUBROUTINE usm_check_parameters |
---|
2287 | |
---|
2288 | USE control_parameters, & |
---|
2289 | ONLY: bc_pt_b, bc_q_b, constant_flux_layer, large_scale_forcing, & |
---|
2290 | lsf_surf, topography |
---|
2291 | |
---|
2292 | ! |
---|
2293 | !-- Dirichlet boundary conditions are required as the surface fluxes are |
---|
2294 | !-- calculated from the temperature/humidity gradients in the urban surface |
---|
2295 | !-- model |
---|
2296 | IF ( bc_pt_b == 'neumann' .OR. bc_q_b == 'neumann' ) THEN |
---|
2297 | message_string = 'urban surface model requires setting of '// & |
---|
2298 | 'bc_pt_b = "dirichlet" and '// & |
---|
2299 | 'bc_q_b = "dirichlet"' |
---|
2300 | CALL message( 'check_parameters', 'PA0590', 1, 2, 0, 6, 0 ) |
---|
2301 | ENDIF |
---|
2302 | |
---|
2303 | IF ( .NOT. constant_flux_layer ) THEN |
---|
2304 | message_string = 'urban surface model requires '// & |
---|
2305 | 'constant_flux_layer = .T.' |
---|
2306 | CALL message( 'check_parameters', 'PA0591', 1, 2, 0, 6, 0 ) |
---|
2307 | ENDIF |
---|
2308 | ! |
---|
2309 | !-- Surface forcing has to be disabled for LSF in case of enabled |
---|
2310 | !-- urban surface module |
---|
2311 | IF ( large_scale_forcing ) THEN |
---|
2312 | lsf_surf = .FALSE. |
---|
2313 | ENDIF |
---|
2314 | ! |
---|
2315 | !-- Topography |
---|
2316 | IF ( topography == 'flat' ) THEN |
---|
2317 | message_string = 'topography /= "flat" is required '// & |
---|
2318 | 'when using the urban surface model' |
---|
2319 | CALL message( 'check_parameters', 'PA0592', 1, 2, 0, 6, 0 ) |
---|
2320 | ENDIF |
---|
2321 | |
---|
2322 | END SUBROUTINE usm_check_parameters |
---|
2323 | |
---|
2324 | |
---|
2325 | !------------------------------------------------------------------------------! |
---|
2326 | ! |
---|
2327 | ! Description: |
---|
2328 | ! ------------ |
---|
2329 | !> Output of the 3D-arrays in netCDF and/or AVS format |
---|
2330 | !> for variables of urban_surface model. |
---|
2331 | !> It resorts the urban surface module output quantities from surf style |
---|
2332 | !> indexing into temporary 3D array with indices (i,j,k). |
---|
2333 | !> It is called from subroutine data_output_3d. |
---|
2334 | !------------------------------------------------------------------------------! |
---|
2335 | SUBROUTINE usm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
2336 | |
---|
2337 | IMPLICIT NONE |
---|
2338 | |
---|
2339 | INTEGER(iwp), INTENT(IN) :: av !< |
---|
2340 | CHARACTER (len=*), INTENT(IN) :: variable !< |
---|
2341 | INTEGER(iwp), INTENT(IN) :: nzb_do !< lower limit of the data output (usually 0) |
---|
2342 | INTEGER(iwp), INTENT(IN) :: nzt_do !< vertical upper limit of the data output (usually nz_do3d) |
---|
2343 | LOGICAL, INTENT(OUT) :: found !< |
---|
2344 | REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< sp - it has to correspond to module data_output_3d |
---|
2345 | REAL(wp), DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) :: temp_pf !< temp array for urban surface output procedure |
---|
2346 | |
---|
2347 | CHARACTER (len=varnamelength) :: var, surfid |
---|
2348 | INTEGER(iwp), PARAMETER :: nd = 5 |
---|
2349 | CHARACTER(len=6), DIMENSION(0:nd-1), PARAMETER :: dirname = (/ '_roof ', '_south', '_north', '_west ', '_east ' /) |
---|
2350 | INTEGER(iwp), DIMENSION(0:nd-1), PARAMETER :: dirint = (/ iup_u, isouth_u, inorth_u, iwest_u, ieast_u /) |
---|
2351 | INTEGER(iwp), DIMENSION(0:nd-1) :: dirstart |
---|
2352 | INTEGER(iwp), DIMENSION(0:nd-1) :: dirend |
---|
2353 | INTEGER(iwp) :: ids,isurf,isvf,isurfs,isurflt |
---|
2354 | INTEGER(iwp) :: is,js,ks,i,j,k,iwl,istat, l, m |
---|
2355 | INTEGER(iwp) :: k_topo !< topography top index |
---|
2356 | |
---|
2357 | dirstart = (/ startland, startwall, startwall, startwall, startwall /) |
---|
2358 | dirend = (/ endland, endwall, endwall, endwall, endwall /) |
---|
2359 | |
---|
2360 | found = .TRUE. |
---|
2361 | temp_pf = -1._wp |
---|
2362 | |
---|
2363 | ids = -1 |
---|
2364 | var = TRIM(variable) |
---|
2365 | DO i = 0, nd-1 |
---|
2366 | k = len(TRIM(var)) |
---|
2367 | j = len(TRIM(dirname(i))) |
---|
2368 | IF ( var(k-j+1:k) == dirname(i) ) THEN |
---|
2369 | ids = i |
---|
2370 | var = var(:k-j) |
---|
2371 | EXIT |
---|
2372 | ENDIF |
---|
2373 | ENDDO |
---|
2374 | IF ( ids == -1 ) THEN |
---|
2375 | var = TRIM(variable) |
---|
2376 | ENDIF |
---|
2377 | IF ( var(1:11) == 'usm_t_wall_' .AND. len(TRIM(var)) >= 12 ) THEN |
---|
2378 | !-- wall layers |
---|
2379 | READ(var(12:12), '(I1)', iostat=istat ) iwl |
---|
2380 | IF ( istat == 0 .AND. iwl >= nzb_wall .AND. iwl <= nzt_wall ) THEN |
---|
2381 | var = var(1:10) |
---|
2382 | ENDIF |
---|
2383 | ENDIF |
---|
2384 | IF ( var(1:13) == 'usm_t_window_' .AND. len(TRIM(var)) >= 14 ) THEN |
---|
2385 | !-- window layers |
---|
2386 | READ(var(14:14), '(I1)', iostat=istat ) iwl |
---|
2387 | IF ( istat == 0 .AND. iwl >= nzb_wall .AND. iwl <= nzt_wall ) THEN |
---|
2388 | var = var(1:12) |
---|
2389 | ENDIF |
---|
2390 | ENDIF |
---|
2391 | IF ( var(1:12) == 'usm_t_green_' .AND. len(TRIM(var)) >= 13 ) THEN |
---|
2392 | !-- green layers |
---|
2393 | READ(var(13:13), '(I1)', iostat=istat ) iwl |
---|
2394 | IF ( istat == 0 .AND. iwl >= nzb_wall .AND. iwl <= nzt_wall ) THEN |
---|
2395 | var = var(1:11) |
---|
2396 | ENDIF |
---|
2397 | ENDIF |
---|
2398 | IF ( (var(1:8) == 'usm_svf_' .OR. var(1:8) == 'usm_dif_') .AND. len(TRIM(var)) >= 13 ) THEN |
---|
2399 | !-- svf values to particular surface |
---|
2400 | surfid = var(9:) |
---|
2401 | i = index(surfid,'_') |
---|
2402 | j = index(surfid(i+1:),'_') |
---|
2403 | READ(surfid(1:i-1),*, iostat=istat ) is |
---|
2404 | IF ( istat == 0 ) THEN |
---|
2405 | READ(surfid(i+1:i+j-1),*, iostat=istat ) js |
---|
2406 | ENDIF |
---|
2407 | IF ( istat == 0 ) THEN |
---|
2408 | READ(surfid(i+j+1:),*, iostat=istat ) ks |
---|
2409 | ENDIF |
---|
2410 | IF ( istat == 0 ) THEN |
---|
2411 | var = var(1:7) |
---|
2412 | ENDIF |
---|
2413 | ENDIF |
---|
2414 | |
---|
2415 | SELECT CASE ( TRIM(var) ) |
---|
2416 | |
---|
2417 | CASE ( 'usm_surfz' ) |
---|
2418 | !-- array of lw radiation falling to local surface after i-th reflection |
---|
2419 | DO m = 1, surf_usm_h%ns |
---|
2420 | i = surf_usm_h%i(m) |
---|
2421 | j = surf_usm_h%j(m) |
---|
2422 | k = surf_usm_h%k(m) |
---|
2423 | temp_pf(0,j,i) = MAX( temp_pf(0,j,i), REAL( k, kind=wp) ) |
---|
2424 | ENDDO |
---|
2425 | DO l = 0, 3 |
---|
2426 | DO m = 1, surf_usm_v(l)%ns |
---|
2427 | i = surf_usm_v(l)%i(m) |
---|
2428 | j = surf_usm_v(l)%j(m) |
---|
2429 | k = surf_usm_v(l)%k(m) |
---|
2430 | temp_pf(0,j,i) = MAX( temp_pf(0,j,i), REAL( k, kind=wp) + 1.0_wp ) |
---|
2431 | ENDDO |
---|
2432 | ENDDO |
---|
2433 | |
---|
2434 | CASE ( 'usm_surfcat' ) |
---|
2435 | !-- surface category |
---|
2436 | DO m = 1, surf_usm_h%ns |
---|
2437 | i = surf_usm_h%i(m) |
---|
2438 | j = surf_usm_h%j(m) |
---|
2439 | k = surf_usm_h%k(m) |
---|
2440 | temp_pf(k,j,i) = surf_usm_h%surface_types(m) |
---|
2441 | ENDDO |
---|
2442 | DO l = 0, 3 |
---|
2443 | DO m = 1, surf_usm_v(l)%ns |
---|
2444 | i = surf_usm_v(l)%i(m) |
---|
2445 | j = surf_usm_v(l)%j(m) |
---|
2446 | k = surf_usm_v(l)%k(m) |
---|
2447 | temp_pf(k,j,i) = surf_usm_v(l)%surface_types(m) |
---|
2448 | ENDDO |
---|
2449 | ENDDO |
---|
2450 | |
---|
2451 | CASE ( 'usm_surfalb' ) |
---|
2452 | !-- surface albedo, weighted average |
---|
2453 | DO m = 1, surf_usm_h%ns |
---|
2454 | i = surf_usm_h%i(m) |
---|
2455 | j = surf_usm_h%j(m) |
---|
2456 | k = surf_usm_h%k(m) |
---|
2457 | temp_pf(k,j,i) = surf_usm_h%frac(0,m) * & |
---|
2458 | surf_usm_h%albedo(0,m) + & |
---|
2459 | surf_usm_h%frac(1,m) * & |
---|
2460 | surf_usm_h%albedo(1,m) + & |
---|
2461 | surf_usm_h%frac(2,m) * & |
---|
2462 | surf_usm_h%albedo(2,m) |
---|
2463 | ENDDO |
---|
2464 | DO l = 0, 3 |
---|
2465 | DO m = 1, surf_usm_v(l)%ns |
---|
2466 | i = surf_usm_v(l)%i(m) |
---|
2467 | j = surf_usm_v(l)%j(m) |
---|
2468 | k = surf_usm_v(l)%k(m) |
---|
2469 | temp_pf(k,j,i) = surf_usm_v(l)%frac(0,m) * & |
---|
2470 | surf_usm_v(l)%albedo(0,m) + & |
---|
2471 | surf_usm_v(l)%frac(1,m) * & |
---|
2472 | surf_usm_v(l)%albedo(1,m) + & |
---|
2473 | surf_usm_v(l)%frac(2,m) * & |
---|
2474 | surf_usm_v(l)%albedo(2,m) |
---|
2475 | ENDDO |
---|
2476 | ENDDO |
---|
2477 | |
---|
2478 | CASE ( 'usm_surfemis' ) |
---|
2479 | !-- surface emissivity, weighted average |
---|
2480 | DO m = 1, surf_usm_h%ns |
---|
2481 | i = surf_usm_h%i(m) |
---|
2482 | j = surf_usm_h%j(m) |
---|
2483 | k = surf_usm_h%k(m) |
---|
2484 | temp_pf(k,j,i) = surf_usm_h%frac(0,m) * & |
---|
2485 | surf_usm_h%emissivity(0,m) + & |
---|
2486 | surf_usm_h%frac(1,m) * & |
---|
2487 | surf_usm_h%emissivity(1,m) + & |
---|
2488 | surf_usm_h%frac(2,m) * & |
---|
2489 | surf_usm_h%emissivity(2,m) |
---|
2490 | ENDDO |
---|
2491 | DO l = 0, 3 |
---|
2492 | DO m = 1, surf_usm_v(l)%ns |
---|
2493 | i = surf_usm_v(l)%i(m) |
---|
2494 | j = surf_usm_v(l)%j(m) |
---|
2495 | k = surf_usm_v(l)%k(m) |
---|
2496 | temp_pf(k,j,i) = surf_usm_v(l)%frac(0,m) * & |
---|
2497 | surf_usm_v(l)%emissivity(0,m) + & |
---|
2498 | surf_usm_v(l)%frac(1,m) * & |
---|
2499 | surf_usm_v(l)%emissivity(1,m) + & |
---|
2500 | surf_usm_v(l)%frac(2,m) * & |
---|
2501 | surf_usm_v(l)%emissivity(2,m) |
---|
2502 | ENDDO |
---|
2503 | ENDDO |
---|
2504 | |
---|
2505 | CASE ( 'usm_surfwintrans' ) |
---|
2506 | !-- transmissivity window tiles |
---|
2507 | DO m = 1, surf_usm_h%ns |
---|
2508 | i = surf_usm_h%i(m) |
---|
2509 | j = surf_usm_h%j(m) |
---|
2510 | k = surf_usm_h%k(m) |
---|
2511 | temp_pf(k,j,i) = surf_usm_h%transmissivity(m) |
---|
2512 | ENDDO |
---|
2513 | DO l = 0, 3 |
---|
2514 | DO m = 1, surf_usm_v(l)%ns |
---|
2515 | i = surf_usm_v(l)%i(m) |
---|
2516 | j = surf_usm_v(l)%j(m) |
---|
2517 | k = surf_usm_v(l)%k(m) |
---|
2518 | temp_pf(k,j,i) = surf_usm_v(l)%transmissivity(m) |
---|
2519 | ENDDO |
---|
2520 | |
---|
2521 | ENDDO |
---|
2522 | |
---|
2523 | ! |
---|
2524 | !-- Not adjusted so far |
---|
2525 | CASE ( 'usm_svf', 'usm_dif' ) |
---|
2526 | !-- shape view factors or iradiance factors to selected surface |
---|
2527 | IF ( TRIM(var)=='usm_svf' ) THEN |
---|
2528 | k = 1 |
---|
2529 | ELSE |
---|
2530 | k = 2 |
---|
2531 | ENDIF |
---|
2532 | DO isvf = 1, nsvfl |
---|
2533 | isurflt = svfsurf(1, isvf) |
---|
2534 | isurfs = svfsurf(2, isvf) |
---|
2535 | |
---|
2536 | IF ( surf(ix,isurfs) == is .AND. surf(iy,isurfs) == js .AND. & |
---|
2537 | surf(iz,isurfs) == ks .AND. surf(id,isurfs) == ids ) THEN |
---|
2538 | !-- correct source surface |
---|
2539 | temp_pf(surfl(iz,isurflt),surfl(iy,isurflt),surfl(ix,isurflt)) = svf(k,isvf) |
---|
2540 | ENDIF |
---|
2541 | ENDDO |
---|
2542 | |
---|
2543 | CASE ( 'usm_rad_net' ) |
---|
2544 | !-- array of complete radiation balance |
---|
2545 | IF ( av == 0 ) THEN |
---|
2546 | DO m = 1, surf_usm_h%ns |
---|
2547 | i = surf_usm_h%i(m) |
---|
2548 | j = surf_usm_h%j(m) |
---|
2549 | k = surf_usm_h%k(m) |
---|
2550 | temp_pf(k,j,i) = surf_usm_h%rad_net_l(m) |
---|
2551 | ENDDO |
---|
2552 | DO l = 0, 3 |
---|
2553 | DO m = 1, surf_usm_v(l)%ns |
---|
2554 | i = surf_usm_v(l)%i(m) |
---|
2555 | j = surf_usm_v(l)%j(m) |
---|
2556 | k = surf_usm_v(l)%k(m) |
---|
2557 | temp_pf(k,j,i) = surf_usm_v(l)%rad_net_l(m) |
---|
2558 | ENDDO |
---|
2559 | ENDDO |
---|
2560 | ELSE |
---|
2561 | DO m = 1, surf_usm_h%ns |
---|
2562 | i = surf_usm_h%i(m) |
---|
2563 | j = surf_usm_h%j(m) |
---|
2564 | k = surf_usm_h%k(m) |
---|
2565 | temp_pf(k,j,i) = surf_usm_h%rad_net_av(m) |
---|
2566 | ENDDO |
---|
2567 | DO l = 0, 3 |
---|
2568 | DO m = 1, surf_usm_v(l)%ns |
---|
2569 | i = surf_usm_v(l)%i(m) |
---|
2570 | j = surf_usm_v(l)%j(m) |
---|
2571 | k = surf_usm_v(l)%k(m) |
---|
2572 | temp_pf(k,j,i) = surf_usm_v(l)%rad_net_av(m) |
---|
2573 | ENDDO |
---|
2574 | ENDDO |
---|
2575 | ENDIF |
---|
2576 | |
---|
2577 | CASE ( 'usm_rad_insw' ) |
---|
2578 | !-- array of sw radiation falling to surface after i-th reflection |
---|
2579 | DO isurf = dirstart(ids), dirend(ids) |
---|
2580 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2581 | IF ( av == 0 ) THEN |
---|
2582 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinsw(isurf) |
---|
2583 | ELSE |
---|
2584 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinsw_av(isurf) |
---|
2585 | ENDIF |
---|
2586 | ENDIF |
---|
2587 | ENDDO |
---|
2588 | |
---|
2589 | CASE ( 'usm_rad_inlw' ) |
---|
2590 | !-- array of lw radiation falling to surface after i-th reflection |
---|
2591 | DO isurf = dirstart(ids), dirend(ids) |
---|
2592 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2593 | IF ( av == 0 ) THEN |
---|
2594 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinlw(isurf) |
---|
2595 | ELSE |
---|
2596 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinlw_av(isurf) |
---|
2597 | ENDIF |
---|
2598 | ENDIF |
---|
2599 | ENDDO |
---|
2600 | |
---|
2601 | CASE ( 'usm_rad_inswdir' ) |
---|
2602 | !-- array of direct sw radiation falling to surface from sun |
---|
2603 | DO isurf = dirstart(ids), dirend(ids) |
---|
2604 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2605 | IF ( av == 0 ) THEN |
---|
2606 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinswdir(isurf) |
---|
2607 | ELSE |
---|
2608 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinswdir_av(isurf) |
---|
2609 | ENDIF |
---|
2610 | ENDIF |
---|
2611 | ENDDO |
---|
2612 | |
---|
2613 | CASE ( 'usm_rad_inswdif' ) |
---|
2614 | !-- array of difusion sw radiation falling to surface from sky and borders of the domain |
---|
2615 | DO isurf = dirstart(ids), dirend(ids) |
---|
2616 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2617 | IF ( av == 0 ) THEN |
---|
2618 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinswdif(isurf) |
---|
2619 | ELSE |
---|
2620 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinswdif_av(isurf) |
---|
2621 | ENDIF |
---|
2622 | ENDIF |
---|
2623 | ENDDO |
---|
2624 | |
---|
2625 | CASE ( 'usm_rad_inswref' ) |
---|
2626 | !-- array of sw radiation falling to surface from reflections |
---|
2627 | DO isurf = dirstart(ids), dirend(ids) |
---|
2628 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2629 | IF ( av == 0 ) THEN |
---|
2630 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = & |
---|
2631 | surfinsw(isurf) - surfinswdir(isurf) - surfinswdif(isurf) |
---|
2632 | ELSE |
---|
2633 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinswref_av(isurf) |
---|
2634 | ENDIF |
---|
2635 | ENDIF |
---|
2636 | ENDDO |
---|
2637 | |
---|
2638 | CASE ( 'usm_rad_inlwref' ) |
---|
2639 | !-- array of lw radiation falling to surface from reflections |
---|
2640 | DO isurf = dirstart(ids), dirend(ids) |
---|
2641 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2642 | IF ( av == 0 ) THEN |
---|
2643 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinlw(isurf) - surfinlwdif(isurf) |
---|
2644 | ELSE |
---|
2645 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinlwref_av(isurf) |
---|
2646 | ENDIF |
---|
2647 | ENDIF |
---|
2648 | ENDDO |
---|
2649 | |
---|
2650 | CASE ( 'usm_rad_outsw' ) |
---|
2651 | !-- array of sw radiation emitted from surface after i-th reflection |
---|
2652 | DO isurf = dirstart(ids), dirend(ids) |
---|
2653 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2654 | IF ( av == 0 ) THEN |
---|
2655 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfoutsw(isurf) |
---|
2656 | ELSE |
---|
2657 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfoutsw_av(isurf) |
---|
2658 | ENDIF |
---|
2659 | ENDIF |
---|
2660 | ENDDO |
---|
2661 | |
---|
2662 | CASE ( 'usm_rad_outlw' ) |
---|
2663 | !-- array of lw radiation emitted from surface after i-th reflection |
---|
2664 | DO isurf = dirstart(ids), dirend(ids) |
---|
2665 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2666 | IF ( av == 0 ) THEN |
---|
2667 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfoutlw(isurf) |
---|
2668 | ELSE |
---|
2669 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfoutlw_av(isurf) |
---|
2670 | ENDIF |
---|
2671 | ENDIF |
---|
2672 | ENDDO |
---|
2673 | |
---|
2674 | CASE ( 'usm_rad_ressw' ) |
---|
2675 | !-- average of array of residua of sw radiation absorbed in surface after last reflection |
---|
2676 | DO isurf = dirstart(ids), dirend(ids) |
---|
2677 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2678 | IF ( av == 0 ) THEN |
---|
2679 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfins(isurf) |
---|
2680 | ELSE |
---|
2681 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfins_av(isurf) |
---|
2682 | ENDIF |
---|
2683 | ENDIF |
---|
2684 | ENDDO |
---|
2685 | |
---|
2686 | CASE ( 'usm_rad_reslw' ) |
---|
2687 | !-- average of array of residua of lw radiation absorbed in surface after last reflection |
---|
2688 | DO isurf = dirstart(ids), dirend(ids) |
---|
2689 | IF ( surfl(id,isurf) == ids ) THEN |
---|
2690 | IF ( av == 0 ) THEN |
---|
2691 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinl(isurf) |
---|
2692 | ELSE |
---|
2693 | temp_pf(surfl(iz,isurf),surfl(iy,isurf),surfl(ix,isurf)) = surfinl_av(isurf) |
---|
2694 | ENDIF |
---|
2695 | ENDIF |
---|
2696 | ENDDO |
---|
2697 | |
---|
2698 | CASE ( 'usm_rad_hf' ) |
---|
2699 | !-- array of heat flux from radiation for surfaces after all reflections |
---|
2700 | IF ( av == 0 ) THEN |
---|
2701 | DO m = 1, surf_usm_h%ns |
---|
2702 | i = surf_usm_h%i(m) |
---|
2703 | j = surf_usm_h%j(m) |
---|
2704 | k = surf_usm_h%k(m) |
---|
2705 | temp_pf(k,j,i) = surf_usm_h%surfhf(m) |
---|
2706 | ENDDO |
---|
2707 | DO l = 0, 3 |
---|
2708 | DO m = 1, surf_usm_v(l)%ns |
---|
2709 | i = surf_usm_v(l)%i(m) |
---|
2710 | j = surf_usm_v(l)%j(m) |
---|
2711 | k = surf_usm_v(l)%k(m) |
---|
2712 | temp_pf(k,j,i) = surf_usm_v(l)%surfhf(m) |
---|
2713 | ENDDO |
---|
2714 | ENDDO |
---|
2715 | ELSE |
---|
2716 | DO m = 1, surf_usm_h%ns |
---|
2717 | i = surf_usm_h%i(m) |
---|
2718 | j = surf_usm_h%j(m) |
---|
2719 | k = surf_usm_h%k(m) |
---|
2720 | temp_pf(k,j,i) = surf_usm_h%surfhf_av(m) |
---|
2721 | ENDDO |
---|
2722 | DO l = 0, 3 |
---|
2723 | DO m = 1, surf_usm_v(l)%ns |
---|
2724 | i = surf_usm_v(l)%i(m) |
---|
2725 | j = surf_usm_v(l)%j(m) |
---|
2726 | k = surf_usm_v(l)%k(m) |
---|
2727 | temp_pf(k,j,i) = surf_usm_v(l)%surfhf_av(m) |
---|
2728 | ENDDO |
---|
2729 | ENDDO |
---|
2730 | ENDIF |
---|
2731 | |
---|
2732 | CASE ( 'usm_wshf' ) |
---|
2733 | !-- array of sensible heat flux from surfaces |
---|
2734 | IF ( av == 0 ) THEN |
---|
2735 | DO m = 1, surf_usm_h%ns |
---|
2736 | i = surf_usm_h%i(m) |
---|
2737 | j = surf_usm_h%j(m) |
---|
2738 | k = surf_usm_h%k(m) |
---|
2739 | temp_pf(k,j,i) = surf_usm_h%wshf_eb(m) |
---|
2740 | ENDDO |
---|
2741 | DO l = 0, 3 |
---|
2742 | DO m = 1, surf_usm_v(l)%ns |
---|
2743 | i = surf_usm_v(l)%i(m) |
---|
2744 | j = surf_usm_v(l)%j(m) |
---|
2745 | k = surf_usm_v(l)%k(m) |
---|
2746 | temp_pf(k,j,i) = surf_usm_v(l)%wshf_eb(m) |
---|
2747 | ENDDO |
---|
2748 | ENDDO |
---|
2749 | ELSE |
---|
2750 | DO m = 1, surf_usm_h%ns |
---|
2751 | i = surf_usm_h%i(m) |
---|
2752 | j = surf_usm_h%j(m) |
---|
2753 | k = surf_usm_h%k(m) |
---|
2754 | temp_pf(k,j,i) = surf_usm_h%wshf_eb_av(m) |
---|
2755 | ENDDO |
---|
2756 | DO l = 0, 3 |
---|
2757 | DO m = 1, surf_usm_v(l)%ns |
---|
2758 | i = surf_usm_v(l)%i(m) |
---|
2759 | j = surf_usm_v(l)%j(m) |
---|
2760 | k = surf_usm_v(l)%k(m) |
---|
2761 | temp_pf(k,j,i) = surf_usm_v(l)%wshf_eb_av(m) |
---|
2762 | ENDDO |
---|
2763 | ENDDO |
---|
2764 | ENDIF |
---|
2765 | |
---|
2766 | |
---|
2767 | CASE ( 'usm_wghf' ) |
---|
2768 | !-- array of heat flux from ground (land, wall, roof) |
---|
2769 | IF ( av == 0 ) THEN |
---|
2770 | DO m = 1, surf_usm_h%ns |
---|
2771 | i = surf_usm_h%i(m) |
---|
2772 | j = surf_usm_h%j(m) |
---|
2773 | k = surf_usm_h%k(m) |
---|
2774 | temp_pf(k,j,i) = surf_usm_h%wghf_eb(m) |
---|
2775 | ENDDO |
---|
2776 | DO l = 0, 3 |
---|
2777 | DO m = 1, surf_usm_v(l)%ns |
---|
2778 | i = surf_usm_v(l)%i(m) |
---|
2779 | j = surf_usm_v(l)%j(m) |
---|
2780 | k = surf_usm_v(l)%k(m) |
---|
2781 | temp_pf(k,j,i) = surf_usm_v(l)%wghf_eb(m) |
---|
2782 | ENDDO |
---|
2783 | ENDDO |
---|
2784 | ELSE |
---|
2785 | DO m = 1, surf_usm_h%ns |
---|
2786 | i = surf_usm_h%i(m) |
---|
2787 | j = surf_usm_h%j(m) |
---|
2788 | k = surf_usm_h%k(m) |
---|
2789 | temp_pf(k,j,i) = surf_usm_h%wghf_eb_av(m) |
---|
2790 | ENDDO |
---|
2791 | DO l = 0, 3 |
---|
2792 | DO m = 1, surf_usm_v(l)%ns |
---|
2793 | i = surf_usm_v(l)%i(m) |
---|
2794 | j = surf_usm_v(l)%j(m) |
---|
2795 | k = surf_usm_v(l)%k(m) |
---|
2796 | temp_pf(k,j,i) = surf_usm_v(l)%wghf_eb_av(m) |
---|
2797 | ENDDO |
---|
2798 | ENDDO |
---|
2799 | ENDIF |
---|
2800 | |
---|
2801 | CASE ( 'usm_wghf_window' ) |
---|
2802 | !-- array of heat flux from window ground (land, wall, roof) |
---|
2803 | |
---|
2804 | IF ( av == 0 ) THEN |
---|
2805 | DO m = 1, surf_usm_h%ns |
---|
2806 | i = surf_usm_h%i(m) |
---|
2807 | j = surf_usm_h%j(m) |
---|
2808 | k = surf_usm_h%k(m) |
---|
2809 | temp_pf(k,j,i) = surf_usm_h%wghf_eb_window(m) |
---|
2810 | ENDDO |
---|
2811 | DO l = 0, 3 |
---|
2812 | DO m = 1, surf_usm_v(l)%ns |
---|
2813 | i = surf_usm_v(l)%i(m) |
---|
2814 | j = surf_usm_v(l)%j(m) |
---|
2815 | k = surf_usm_v(l)%k(m) |
---|
2816 | temp_pf(k,j,i) = surf_usm_v(l)%wghf_eb_window(m) |
---|
2817 | ENDDO |
---|
2818 | ENDDO |
---|
2819 | ELSE |
---|
2820 | DO m = 1, surf_usm_h%ns |
---|
2821 | i = surf_usm_h%i(m) |
---|
2822 | j = surf_usm_h%j(m) |
---|
2823 | k = surf_usm_h%k(m) |
---|
2824 | temp_pf(k,j,i) = surf_usm_h%wghf_eb_window_av(m) |
---|
2825 | ENDDO |
---|
2826 | DO l = 0, 3 |
---|
2827 | DO m = 1, surf_usm_v(l)%ns |
---|
2828 | i = surf_usm_v(l)%i(m) |
---|
2829 | j = surf_usm_v(l)%j(m) |
---|
2830 | k = surf_usm_v(l)%k(m) |
---|
2831 | temp_pf(k,j,i) = surf_usm_v(l)%wghf_eb_window_av(m) |
---|
2832 | ENDDO |
---|
2833 | ENDDO |
---|
2834 | ENDIF |
---|
2835 | |
---|
2836 | CASE ( 'usm_wghf_green' ) |
---|
2837 | !-- array of heat flux from green ground (land, wall, roof) |
---|
2838 | |
---|
2839 | IF ( av == 0 ) THEN |
---|
2840 | DO m = 1, surf_usm_h%ns |
---|
2841 | i = surf_usm_h%i(m) |
---|
2842 | j = surf_usm_h%j(m) |
---|
2843 | k = surf_usm_h%k(m) |
---|
2844 | temp_pf(k,j,i) = surf_usm_h%wghf_eb_green(m) |
---|
2845 | ENDDO |
---|
2846 | DO l = 0, 3 |
---|
2847 | DO m = 1, surf_usm_v(l)%ns |
---|
2848 | i = surf_usm_v(l)%i(m) |
---|
2849 | j = surf_usm_v(l)%j(m) |
---|
2850 | k = surf_usm_v(l)%k(m) |
---|
2851 | temp_pf(k,j,i) = surf_usm_v(l)%wghf_eb_green(m) |
---|
2852 | ENDDO |
---|
2853 | ENDDO |
---|
2854 | ELSE |
---|
2855 | DO m = 1, surf_usm_h%ns |
---|
2856 | i = surf_usm_h%i(m) |
---|
2857 | j = surf_usm_h%j(m) |
---|
2858 | k = surf_usm_h%k(m) |
---|
2859 | temp_pf(k,j,i) = surf_usm_h%wghf_eb_green_av(m) |
---|
2860 | ENDDO |
---|
2861 | DO l = 0, 3 |
---|
2862 | DO m = 1, surf_usm_v(l)%ns |
---|
2863 | i = surf_usm_v(l)%i(m) |
---|
2864 | j = surf_usm_v(l)%j(m) |
---|
2865 | k = surf_usm_v(l)%k(m) |
---|
2866 | temp_pf(k,j,i) = surf_usm_v(l)%wghf_eb_green_av(m) |
---|
2867 | ENDDO |
---|
2868 | ENDDO |
---|
2869 | ENDIF |
---|
2870 | |
---|
2871 | CASE ( 'usm_iwghf' ) |
---|
2872 | !-- array of heat flux from indoor ground (land, wall, roof) |
---|
2873 | IF ( av == 0 ) THEN |
---|
2874 | DO m = 1, surf_usm_h%ns |
---|
2875 | i = surf_usm_h%i(m) |
---|
2876 | j = surf_usm_h%j(m) |
---|
2877 | k = surf_usm_h%k(m) |
---|
2878 | temp_pf(k,j,i) = surf_usm_h%iwghf_eb(m) |
---|
2879 | ENDDO |
---|
2880 | DO l = 0, 3 |
---|
2881 | DO m = 1, surf_usm_v(l)%ns |
---|
2882 | i = surf_usm_v(l)%i(m) |
---|
2883 | j = surf_usm_v(l)%j(m) |
---|
2884 | k = surf_usm_v(l)%k(m) |
---|
2885 | temp_pf(k,j,i) = surf_usm_v(l)%iwghf_eb(m) |
---|
2886 | ENDDO |
---|
2887 | ENDDO |
---|
2888 | ELSE |
---|
2889 | DO m = 1, surf_usm_h%ns |
---|
2890 | i = surf_usm_h%i(m) |
---|
2891 | j = surf_usm_h%j(m) |
---|
2892 | k = surf_usm_h%k(m) |
---|
2893 | temp_pf(k,j,i) = surf_usm_h%iwghf_eb_av(m) |
---|
2894 | ENDDO |
---|
2895 | DO l = 0, 3 |
---|
2896 | DO m = 1, surf_usm_v(l)%ns |
---|
2897 | i = surf_usm_v(l)%i(m) |
---|
2898 | j = surf_usm_v(l)%j(m) |
---|
2899 | k = surf_usm_v(l)%k(m) |
---|
2900 | temp_pf(k,j,i) = surf_usm_v(l)%iwghf_eb_av(m) |
---|
2901 | ENDDO |
---|
2902 | ENDDO |
---|
2903 | ENDIF |
---|
2904 | |
---|
2905 | CASE ( 'usm_iwghf_window' ) |
---|
2906 | !-- array of heat flux from indoor window ground (land, wall, roof) |
---|
2907 | |
---|
2908 | IF ( av == 0 ) THEN |
---|
2909 | DO m = 1, surf_usm_h%ns |
---|
2910 | i = surf_usm_h%i(m) |
---|
2911 | j = surf_usm_h%j(m) |
---|
2912 | k = surf_usm_h%k(m) |
---|
2913 | temp_pf(k,j,i) = surf_usm_h%iwghf_eb_window(m) |
---|
2914 | ENDDO |
---|
2915 | DO l = 0, 3 |
---|
2916 | DO m = 1, surf_usm_v(l)%ns |
---|
2917 | i = surf_usm_v(l)%i(m) |
---|
2918 | j = surf_usm_v(l)%j(m) |
---|
2919 | k = surf_usm_v(l)%k(m) |
---|
2920 | temp_pf(k,j,i) = surf_usm_v(l)%iwghf_eb_window(m) |
---|
2921 | ENDDO |
---|
2922 | ENDDO |
---|
2923 | ELSE |
---|
2924 | DO m = 1, surf_usm_h%ns |
---|
2925 | i = surf_usm_h%i(m) |
---|
2926 | j = surf_usm_h%j(m) |
---|
2927 | k = surf_usm_h%k(m) |
---|
2928 | temp_pf(k,j,i) = surf_usm_h%iwghf_eb_window_av(m) |
---|
2929 | ENDDO |
---|
2930 | DO l = 0, 3 |
---|
2931 | DO m = 1, surf_usm_v(l)%ns |
---|
2932 | i = surf_usm_v(l)%i(m) |
---|
2933 | j = surf_usm_v(l)%j(m) |
---|
2934 | k = surf_usm_v(l)%k(m) |
---|
2935 | temp_pf(k,j,i) = surf_usm_v(l)%iwghf_eb_window_av(m) |
---|
2936 | ENDDO |
---|
2937 | ENDDO |
---|
2938 | ENDIF |
---|
2939 | |
---|
2940 | CASE ( 'usm_t_surf' ) |
---|
2941 | !-- surface temperature for surfaces |
---|
2942 | IF ( av == 0 ) THEN |
---|
2943 | DO m = 1, surf_usm_h%ns |
---|
2944 | i = surf_usm_h%i(m) |
---|
2945 | j = surf_usm_h%j(m) |
---|
2946 | k = surf_usm_h%k(m) |
---|
2947 | temp_pf(k,j,i) = t_surf_h(m) |
---|
2948 | ENDDO |
---|
2949 | DO l = 0, 3 |
---|
2950 | DO m = 1, surf_usm_v(l)%ns |
---|
2951 | i = surf_usm_v(l)%i(m) |
---|
2952 | j = surf_usm_v(l)%j(m) |
---|
2953 | k = surf_usm_v(l)%k(m) |
---|
2954 | temp_pf(k,j,i) = t_surf_v(l)%t(m) |
---|
2955 | ENDDO |
---|
2956 | ENDDO |
---|
2957 | ELSE |
---|
2958 | DO m = 1, surf_usm_h%ns |
---|
2959 | i = surf_usm_h%i(m) |
---|
2960 | j = surf_usm_h%j(m) |
---|
2961 | k = surf_usm_h%k(m) |
---|
2962 | temp_pf(k,j,i) = surf_usm_h%t_surf_av(m) |
---|
2963 | ENDDO |
---|
2964 | DO l = 0, 3 |
---|
2965 | DO m = 1, surf_usm_v(l)%ns |
---|
2966 | i = surf_usm_v(l)%i(m) |
---|
2967 | j = surf_usm_v(l)%j(m) |
---|
2968 | k = surf_usm_v(l)%k(m) |
---|
2969 | temp_pf(k,j,i) = surf_usm_v(l)%t_surf_av(m) |
---|
2970 | ENDDO |
---|
2971 | ENDDO |
---|
2972 | ENDIF |
---|
2973 | |
---|
2974 | CASE ( 'usm_t_surf_window' ) |
---|
2975 | !-- surface temperature for window surfaces |
---|
2976 | |
---|
2977 | IF ( av == 0 ) THEN |
---|
2978 | DO m = 1, surf_usm_h%ns |
---|
2979 | i = surf_usm_h%i(m) |
---|
2980 | j = surf_usm_h%j(m) |
---|
2981 | k = surf_usm_h%k(m) |
---|
2982 | temp_pf(k,j,i) = t_surf_window_h(m) |
---|
2983 | ENDDO |
---|
2984 | DO l = 0, 3 |
---|
2985 | DO m = 1, surf_usm_v(l)%ns |
---|
2986 | i = surf_usm_v(l)%i(m) |
---|
2987 | j = surf_usm_v(l)%j(m) |
---|
2988 | k = surf_usm_v(l)%k(m) |
---|
2989 | temp_pf(k,j,i) = t_surf_window_v(l)%t(m) |
---|
2990 | ENDDO |
---|
2991 | ENDDO |
---|
2992 | |
---|
2993 | ELSE |
---|
2994 | DO m = 1, surf_usm_h%ns |
---|
2995 | i = surf_usm_h%i(m) |
---|
2996 | j = surf_usm_h%j(m) |
---|
2997 | k = surf_usm_h%k(m) |
---|
2998 | temp_pf(k,j,i) = surf_usm_h%t_surf_window_av(m) |
---|
2999 | ENDDO |
---|
3000 | DO l = 0, 3 |
---|
3001 | DO m = 1, surf_usm_v(l)%ns |
---|
3002 | i = surf_usm_v(l)%i(m) |
---|
3003 | j = surf_usm_v(l)%j(m) |
---|
3004 | k = surf_usm_v(l)%k(m) |
---|
3005 | temp_pf(k,j,i) = surf_usm_v(l)%t_surf_window_av(m) |
---|
3006 | ENDDO |
---|
3007 | |
---|
3008 | ENDDO |
---|
3009 | |
---|
3010 | ENDIF |
---|
3011 | |
---|
3012 | CASE ( 'usm_t_surf_green' ) |
---|
3013 | !-- surface temperature for green surfaces |
---|
3014 | |
---|
3015 | IF ( av == 0 ) THEN |
---|
3016 | DO m = 1, surf_usm_h%ns |
---|
3017 | i = surf_usm_h%i(m) |
---|
3018 | j = surf_usm_h%j(m) |
---|
3019 | k = surf_usm_h%k(m) |
---|
3020 | temp_pf(k,j,i) = t_surf_green_h(m) |
---|
3021 | ENDDO |
---|
3022 | DO l = 0, 3 |
---|
3023 | DO m = 1, surf_usm_v(l)%ns |
---|
3024 | i = surf_usm_v(l)%i(m) |
---|
3025 | j = surf_usm_v(l)%j(m) |
---|
3026 | k = surf_usm_v(l)%k(m) |
---|
3027 | temp_pf(k,j,i) = t_surf_green_v(l)%t(m) |
---|
3028 | ENDDO |
---|
3029 | ENDDO |
---|
3030 | |
---|
3031 | ELSE |
---|
3032 | DO m = 1, surf_usm_h%ns |
---|
3033 | i = surf_usm_h%i(m) |
---|
3034 | j = surf_usm_h%j(m) |
---|
3035 | k = surf_usm_h%k(m) |
---|
3036 | temp_pf(k,j,i) = surf_usm_h%t_surf_green_av(m) |
---|
3037 | ENDDO |
---|
3038 | DO l = 0, 3 |
---|
3039 | DO m = 1, surf_usm_v(l)%ns |
---|
3040 | i = surf_usm_v(l)%i(m) |
---|
3041 | j = surf_usm_v(l)%j(m) |
---|
3042 | k = surf_usm_v(l)%k(m) |
---|
3043 | temp_pf(k,j,i) = surf_usm_v(l)%t_surf_green_av(m) |
---|
3044 | ENDDO |
---|
3045 | |
---|
3046 | ENDDO |
---|
3047 | |
---|
3048 | ENDIF |
---|
3049 | |
---|
3050 | CASE ( 'usm_t_surf_whole' ) |
---|
3051 | !-- surface temperature for whole surfaces |
---|
3052 | |
---|
3053 | IF ( av == 0 ) THEN |
---|
3054 | DO m = 1, surf_usm_h%ns |
---|
3055 | i = surf_usm_h%i(m) |
---|
3056 | j = surf_usm_h%j(m) |
---|
3057 | k = surf_usm_h%k(m) |
---|
3058 | temp_pf(k,j,i) = t_surf_whole_h(m) |
---|
3059 | ENDDO |
---|
3060 | DO l = 0, 3 |
---|
3061 | DO m = 1, surf_usm_v(l)%ns |
---|
3062 | i = surf_usm_v(l)%i(m) |
---|
3063 | j = surf_usm_v(l)%j(m) |
---|
3064 | k = surf_usm_v(l)%k(m) |
---|
3065 | temp_pf(k,j,i) = t_surf_whole_v(l)%t(m) |
---|
3066 | ENDDO |
---|
3067 | ENDDO |
---|
3068 | |
---|
3069 | ELSE |
---|
3070 | DO m = 1, surf_usm_h%ns |
---|
3071 | i = surf_usm_h%i(m) |
---|
3072 | j = surf_usm_h%j(m) |
---|
3073 | k = surf_usm_h%k(m) |
---|
3074 | temp_pf(k,j,i) = surf_usm_h%t_surf_whole_av(m) |
---|
3075 | ENDDO |
---|
3076 | DO l = 0, 3 |
---|
3077 | DO m = 1, surf_usm_v(l)%ns |
---|
3078 | i = surf_usm_v(l)%i(m) |
---|
3079 | j = surf_usm_v(l)%j(m) |
---|
3080 | k = surf_usm_v(l)%k(m) |
---|
3081 | temp_pf(k,j,i) = surf_usm_v(l)%t_surf_whole_av(m) |
---|
3082 | ENDDO |
---|
3083 | |
---|
3084 | ENDDO |
---|
3085 | |
---|
3086 | ENDIF |
---|
3087 | |
---|
3088 | CASE ( 'usm_t_surf_10cm' ) |
---|
3089 | !-- near surface temperature for whole surfaces |
---|
3090 | |
---|
3091 | IF ( av == 0 ) THEN |
---|
3092 | DO m = 1, surf_usm_h%ns |
---|
3093 | i = surf_usm_h%i(m) |
---|
3094 | j = surf_usm_h%j(m) |
---|
3095 | k = surf_usm_h%k(m) |
---|
3096 | temp_pf(k,j,i) = t_surf_10cm_h(m) |
---|
3097 | ENDDO |
---|
3098 | DO l = 0, 3 |
---|
3099 | DO m = 1, surf_usm_v(l)%ns |
---|
3100 | i = surf_usm_v(l)%i(m) |
---|
3101 | j = surf_usm_v(l)%j(m) |
---|
3102 | k = surf_usm_v(l)%k(m) |
---|
3103 | temp_pf(k,j,i) = t_surf_10cm_v(l)%t(m) |
---|
3104 | ENDDO |
---|
3105 | ENDDO |
---|
3106 | |
---|
3107 | ELSE |
---|
3108 | DO m = 1, surf_usm_h%ns |
---|
3109 | i = surf_usm_h%i(m) |
---|
3110 | j = surf_usm_h%j(m) |
---|
3111 | k = surf_usm_h%k(m) |
---|
3112 | temp_pf(k,j,i) = surf_usm_h%t_surf_10cm_av(m) |
---|
3113 | ENDDO |
---|
3114 | DO l = 0, 3 |
---|
3115 | DO m = 1, surf_usm_v(l)%ns |
---|
3116 | i = surf_usm_v(l)%i(m) |
---|
3117 | j = surf_usm_v(l)%j(m) |
---|
3118 | k = surf_usm_v(l)%k(m) |
---|
3119 | temp_pf(k,j,i) = surf_usm_v(l)%t_surf_10cm_av(m) |
---|
3120 | ENDDO |
---|
3121 | |
---|
3122 | ENDDO |
---|
3123 | |
---|
3124 | ENDIF |
---|
3125 | |
---|
3126 | |
---|
3127 | CASE ( 'usm_t_wall' ) |
---|
3128 | !-- wall temperature for iwl layer of walls and land |
---|
3129 | IF ( av == 0 ) THEN |
---|
3130 | DO m = 1, surf_usm_h%ns |
---|
3131 | i = surf_usm_h%i(m) |
---|
3132 | j = surf_usm_h%j(m) |
---|
3133 | k = surf_usm_h%k(m) |
---|
3134 | temp_pf(k,j,i) = t_wall_h(iwl,m) |
---|
3135 | ENDDO |
---|
3136 | DO l = 0, 3 |
---|
3137 | DO m = 1, surf_usm_v(l)%ns |
---|
3138 | i = surf_usm_v(l)%i(m) |
---|
3139 | j = surf_usm_v(l)%j(m) |
---|
3140 | k = surf_usm_v(l)%k(m) |
---|
3141 | temp_pf(k,j,i) = t_wall_v(l)%t(iwl,m) |
---|
3142 | ENDDO |
---|
3143 | ENDDO |
---|
3144 | ELSE |
---|
3145 | DO m = 1, surf_usm_h%ns |
---|
3146 | i = surf_usm_h%i(m) |
---|
3147 | j = surf_usm_h%j(m) |
---|
3148 | k = surf_usm_h%k(m) |
---|
3149 | temp_pf(k,j,i) = surf_usm_h%t_wall_av(iwl,m) |
---|
3150 | ENDDO |
---|
3151 | DO l = 0, 3 |
---|
3152 | DO m = 1, surf_usm_v(l)%ns |
---|
3153 | i = surf_usm_v(l)%i(m) |
---|
3154 | j = surf_usm_v(l)%j(m) |
---|
3155 | k = surf_usm_v(l)%k(m) |
---|
3156 | temp_pf(k,j,i) = surf_usm_v(l)%t_wall_av(iwl,m) |
---|
3157 | ENDDO |
---|
3158 | ENDDO |
---|
3159 | ENDIF |
---|
3160 | |
---|
3161 | CASE ( 'usm_t_window' ) |
---|
3162 | !-- window temperature for iwl layer of walls and land |
---|
3163 | IF ( av == 0 ) THEN |
---|
3164 | DO m = 1, surf_usm_h%ns |
---|
3165 | i = surf_usm_h%i(m) |
---|
3166 | j = surf_usm_h%j(m) |
---|
3167 | k = surf_usm_h%k(m) |
---|
3168 | temp_pf(k,j,i) = t_window_h(iwl,m) |
---|
3169 | ENDDO |
---|
3170 | DO l = 0, 3 |
---|
3171 | DO m = 1, surf_usm_v(l)%ns |
---|
3172 | i = surf_usm_v(l)%i(m) |
---|
3173 | j = surf_usm_v(l)%j(m) |
---|
3174 | k = surf_usm_v(l)%k(m) |
---|
3175 | temp_pf(k,j,i) = t_window_v(l)%t(iwl,m) |
---|
3176 | ENDDO |
---|
3177 | ENDDO |
---|
3178 | ELSE |
---|
3179 | DO m = 1, surf_usm_h%ns |
---|
3180 | i = surf_usm_h%i(m) |
---|
3181 | j = surf_usm_h%j(m) |
---|
3182 | k = surf_usm_h%k(m) |
---|
3183 | temp_pf(k,j,i) = surf_usm_h%t_window_av(iwl,m) |
---|
3184 | ENDDO |
---|
3185 | DO l = 0, 3 |
---|
3186 | DO m = 1, surf_usm_v(l)%ns |
---|
3187 | i = surf_usm_v(l)%i(m) |
---|
3188 | j = surf_usm_v(l)%j(m) |
---|
3189 | k = surf_usm_v(l)%k(m) |
---|
3190 | temp_pf(k,j,i) = surf_usm_v(l)%t_window_av(iwl,m) |
---|
3191 | ENDDO |
---|
3192 | ENDDO |
---|
3193 | ENDIF |
---|
3194 | |
---|
3195 | CASE ( 'usm_t_green' ) |
---|
3196 | !-- green temperature for iwl layer of walls and land |
---|
3197 | IF ( av == 0 ) THEN |
---|
3198 | DO m = 1, surf_usm_h%ns |
---|
3199 | i = surf_usm_h%i(m) |
---|
3200 | j = surf_usm_h%j(m) |
---|
3201 | k = surf_usm_h%k(m) |
---|
3202 | temp_pf(k,j,i) = t_green_h(iwl,m) |
---|
3203 | ENDDO |
---|
3204 | DO l = 0, 3 |
---|
3205 | DO m = 1, surf_usm_v(l)%ns |
---|
3206 | i = surf_usm_v(l)%i(m) |
---|
3207 | j = surf_usm_v(l)%j(m) |
---|
3208 | k = surf_usm_v(l)%k(m) |
---|
3209 | temp_pf(k,j,i) = t_green_v(l)%t(iwl,m) |
---|
3210 | ENDDO |
---|
3211 | ENDDO |
---|
3212 | ELSE |
---|
3213 | DO m = 1, surf_usm_h%ns |
---|
3214 | i = surf_usm_h%i(m) |
---|
3215 | j = surf_usm_h%j(m) |
---|
3216 | k = surf_usm_h%k(m) |
---|
3217 | temp_pf(k,j,i) = surf_usm_h%t_green_av(iwl,m) |
---|
3218 | ENDDO |
---|
3219 | DO l = 0, 3 |
---|
3220 | DO m = 1, surf_usm_v(l)%ns |
---|
3221 | i = surf_usm_v(l)%i(m) |
---|
3222 | j = surf_usm_v(l)%j(m) |
---|
3223 | k = surf_usm_v(l)%k(m) |
---|
3224 | temp_pf(k,j,i) = surf_usm_v(l)%t_green_av(iwl,m) |
---|
3225 | ENDDO |
---|
3226 | ENDDO |
---|
3227 | ENDIF |
---|
3228 | |
---|
3229 | |
---|
3230 | CASE DEFAULT |
---|
3231 | found = .FALSE. |
---|
3232 | |
---|
3233 | END SELECT |
---|
3234 | |
---|
3235 | ! |
---|
3236 | !-- Rearrange dimensions for NetCDF output |
---|
3237 | DO j = nys, nyn |
---|
3238 | DO i = nxl, nxr |
---|
3239 | DO k = nzb_do, nzt_do |
---|
3240 | local_pf(i,j,k) = temp_pf(k,j,i) |
---|
3241 | ENDDO |
---|
3242 | ENDDO |
---|
3243 | ENDDO |
---|
3244 | |
---|
3245 | END SUBROUTINE usm_data_output_3d |
---|
3246 | |
---|
3247 | |
---|
3248 | !------------------------------------------------------------------------------! |
---|
3249 | ! |
---|
3250 | ! Description: |
---|
3251 | ! ------------ |
---|
3252 | !> Soubroutine defines appropriate grid for netcdf variables. |
---|
3253 | !> It is called out from subroutine netcdf. |
---|
3254 | !------------------------------------------------------------------------------! |
---|
3255 | SUBROUTINE usm_define_netcdf_grid( variable, found, grid_x, grid_y, grid_z ) |
---|
3256 | |
---|
3257 | IMPLICIT NONE |
---|
3258 | |
---|
3259 | CHARACTER (len=*), INTENT(IN) :: variable !< |
---|
3260 | LOGICAL, INTENT(OUT) :: found !< |
---|
3261 | CHARACTER (len=*), INTENT(OUT) :: grid_x !< |
---|
3262 | CHARACTER (len=*), INTENT(OUT) :: grid_y !< |
---|
3263 | CHARACTER (len=*), INTENT(OUT) :: grid_z !< |
---|
3264 | |
---|
3265 | CHARACTER (len=varnamelength) :: var |
---|
3266 | |
---|
3267 | var = TRIM(variable) |
---|
3268 | IF ( var(1:12) == 'usm_rad_net_' .OR. var(1:13) == 'usm_rad_insw_' .OR. & |
---|
3269 | var(1:13) == 'usm_rad_inlw_' .OR. var(1:16) == 'usm_rad_inswdir_' .OR. & |
---|
3270 | var(1:16) == 'usm_rad_inswdif_' .OR. var(1:16) == 'usm_rad_inswref_' .OR. & |
---|
3271 | var(1:16) == 'usm_rad_inlwdif_' .OR. var(1:16) == 'usm_rad_inlwref_' .OR. & |
---|
3272 | var(1:14) == 'usm_rad_outsw_' .OR. var(1:14) == 'usm_rad_outlw_' .OR. & |
---|
3273 | var(1:14) == 'usm_rad_ressw_' .OR. var(1:14) == 'usm_rad_reslw_' .OR. & |
---|
3274 | var(1:11) == 'usm_rad_hf_' .OR. & |
---|
3275 | var(1:9) == 'usm_wshf_' .OR. var(1:9) == 'usm_wghf_' .OR. & |
---|
3276 | var(1:16) == 'usm_wghf_window_' .OR. var(1:15) == 'usm_wghf_green_' .OR. & |
---|
3277 | var(1:10) == 'usm_iwghf_' .OR. var(1:17) == 'usm_iwghf_window_' .OR. & |
---|
3278 | var(1:10) == 'usm_t_surf' .OR. var(1:10) == 'usm_t_wall' .OR. & |
---|
3279 | var(1:17) == 'usm_t_surf_window' .OR. var(1:12) == 'usm_t_window' .OR. & |
---|
3280 | var(1:16) == 'usm_t_surf_green' .OR. var(1:16) == 'usm_t_surf_whole' .OR. & |
---|
3281 | var(1:15) == 'usm_t_surf_10cm' .OR. & |
---|
3282 | var(1:9) == 'usm_surfz' .OR. var(1:7) == 'usm_svf' .OR. & |
---|
3283 | var(1:7) == 'usm_dif' .OR. var(1:11) == 'usm_surfcat' .OR. & |
---|
3284 | var(1:11) == 'usm_surfalb' .OR. var(1:12) == 'usm_surfemis' .OR. & |
---|
3285 | var(1:16) == 'usm_surfwintrans' ) THEN |
---|
3286 | |
---|
3287 | found = .TRUE. |
---|
3288 | grid_x = 'x' |
---|
3289 | grid_y = 'y' |
---|
3290 | grid_z = 'zu' |
---|
3291 | ELSE |
---|
3292 | found = .FALSE. |
---|
3293 | grid_x = 'none' |
---|
3294 | grid_y = 'none' |
---|
3295 | grid_z = 'none' |
---|
3296 | ENDIF |
---|
3297 | |
---|
3298 | END SUBROUTINE usm_define_netcdf_grid |
---|
3299 | |
---|
3300 | |
---|
3301 | !------------------------------------------------------------------------------! |
---|
3302 | ! Description: |
---|
3303 | ! ------------ |
---|
3304 | !> Initialization of the wall surface model |
---|
3305 | !------------------------------------------------------------------------------! |
---|
3306 | SUBROUTINE usm_init_material_model |
---|
3307 | |
---|
3308 | IMPLICIT NONE |
---|
3309 | |
---|
3310 | INTEGER(iwp) :: k, l, m !< running indices |
---|
3311 | |
---|
3312 | CALL location_message( ' initialization of wall surface model', .TRUE. ) |
---|
3313 | |
---|
3314 | !-- Calculate wall grid spacings. |
---|
3315 | !-- Temperature is defined at the center of the wall layers, |
---|
3316 | !-- whereas gradients/fluxes are defined at the edges (_stag) |
---|
3317 | !-- apply for all particular surface grids. First for horizontal surfaces |
---|
3318 | DO m = 1, surf_usm_h%ns |
---|
3319 | |
---|
3320 | surf_usm_h%dz_wall(nzb_wall,m) = surf_usm_h%zw(nzb_wall,m) |
---|
3321 | DO k = nzb_wall+1, nzt_wall |
---|
3322 | surf_usm_h%dz_wall(k,m) = surf_usm_h%zw(k,m) - & |
---|
3323 | surf_usm_h%zw(k-1,m) |
---|
3324 | ENDDO |
---|
3325 | surf_usm_h%dz_window(nzb_wall,m) = surf_usm_h%zw_window(nzb_wall,m) |
---|
3326 | DO k = nzb_wall+1, nzt_wall |
---|
3327 | surf_usm_h%dz_window(k,m) = surf_usm_h%zw_window(k,m) - & |
---|
3328 | surf_usm_h%zw_window(k-1,m) |
---|
3329 | ENDDO |
---|
3330 | surf_usm_h%dz_green(nzb_wall,m) = surf_usm_h%zw_green(nzb_wall,m) |
---|
3331 | DO k = nzb_wall+1, nzt_wall |
---|
3332 | surf_usm_h%dz_green(k,m) = surf_usm_h%zw_green(k,m) - & |
---|
3333 | surf_usm_h%zw_green(k-1,m) |
---|
3334 | ENDDO |
---|
3335 | |
---|
3336 | surf_usm_h%dz_wall(nzt_wall+1,m) = surf_usm_h%dz_wall(nzt_wall,m) |
---|
3337 | |
---|
3338 | DO k = nzb_wall, nzt_wall-1 |
---|
3339 | surf_usm_h%dz_wall_stag(k,m) = 0.5 * ( & |
---|
3340 | surf_usm_h%dz_wall(k+1,m) + surf_usm_h%dz_wall(k,m) ) |
---|
3341 | ENDDO |
---|
3342 | surf_usm_h%dz_wall_stag(nzt_wall,m) = surf_usm_h%dz_wall(nzt_wall,m) |
---|
3343 | |
---|
3344 | surf_usm_h%dz_window(nzt_wall+1,m) = surf_usm_h%dz_window(nzt_wall,m) |
---|
3345 | |
---|
3346 | DO k = nzb_wall, nzt_wall-1 |
---|
3347 | surf_usm_h%dz_window_stag(k,m) = 0.5 * ( & |
---|
3348 | surf_usm_h%dz_window(k+1,m) + surf_usm_h%dz_window(k,m) ) |
---|
3349 | ENDDO |
---|
3350 | surf_usm_h%dz_window_stag(nzt_wall,m) = surf_usm_h%dz_window(nzt_wall,m) |
---|
3351 | |
---|
3352 | surf_usm_h%dz_green(nzt_wall+1,m) = surf_usm_h%dz_green(nzt_wall,m) |
---|
3353 | |
---|
3354 | DO k = nzb_wall, nzt_wall-1 |
---|
3355 | surf_usm_h%dz_green_stag(k,m) = 0.5 * ( & |
---|
3356 | surf_usm_h%dz_green(k+1,m) + surf_usm_h%dz_green(k,m) ) |
---|
3357 | ENDDO |
---|
3358 | surf_usm_h%dz_green_stag(nzt_wall,m) = surf_usm_h%dz_green(nzt_wall,m) |
---|
3359 | ENDDO |
---|
3360 | surf_usm_h%ddz_wall = 1.0_wp / surf_usm_h%dz_wall |
---|
3361 | surf_usm_h%ddz_wall_stag = 1.0_wp / surf_usm_h%dz_wall_stag |
---|
3362 | surf_usm_h%ddz_window = 1.0_wp / surf_usm_h%dz_window |
---|
3363 | surf_usm_h%ddz_window_stag = 1.0_wp / surf_usm_h%dz_window_stag |
---|
3364 | surf_usm_h%ddz_green = 1.0_wp / surf_usm_h%dz_green |
---|
3365 | surf_usm_h%ddz_green_stag = 1.0_wp / surf_usm_h%dz_green_stag |
---|
3366 | ! |
---|
3367 | !-- For vertical surfaces |
---|
3368 | DO l = 0, 3 |
---|
3369 | DO m = 1, surf_usm_v(l)%ns |
---|
3370 | surf_usm_v(l)%dz_wall(nzb_wall,m) = surf_usm_v(l)%zw(nzb_wall,m) |
---|
3371 | DO k = nzb_wall+1, nzt_wall |
---|
3372 | surf_usm_v(l)%dz_wall(k,m) = surf_usm_v(l)%zw(k,m) - & |
---|
3373 | surf_usm_v(l)%zw(k-1,m) |
---|
3374 | ENDDO |
---|
3375 | surf_usm_v(l)%dz_window(nzb_wall,m) = surf_usm_v(l)%zw_window(nzb_wall,m) |
---|
3376 | DO k = nzb_wall+1, nzt_wall |
---|
3377 | surf_usm_v(l)%dz_window(k,m) = surf_usm_v(l)%zw_window(k,m) - & |
---|
3378 | surf_usm_v(l)%zw_window(k-1,m) |
---|
3379 | ENDDO |
---|
3380 | surf_usm_v(l)%dz_green(nzb_wall,m) = surf_usm_v(l)%zw_green(nzb_wall,m) |
---|
3381 | DO k = nzb_wall+1, nzt_wall |
---|
3382 | surf_usm_v(l)%dz_green(k,m) = surf_usm_v(l)%zw_green(k,m) - & |
---|
3383 | surf_usm_v(l)%zw_green(k-1,m) |
---|
3384 | ENDDO |
---|
3385 | |
---|
3386 | surf_usm_v(l)%dz_wall(nzt_wall+1,m) = & |
---|
3387 | surf_usm_v(l)%dz_wall(nzt_wall,m) |
---|
3388 | |
---|
3389 | DO k = nzb_wall, nzt_wall-1 |
---|
3390 | surf_usm_v(l)%dz_wall_stag(k,m) = 0.5 * ( & |
---|
3391 | surf_usm_v(l)%dz_wall(k+1,m) + & |
---|
3392 | surf_usm_v(l)%dz_wall(k,m) ) |
---|
3393 | ENDDO |
---|
3394 | surf_usm_v(l)%dz_wall_stag(nzt_wall,m) = & |
---|
3395 | surf_usm_v(l)%dz_wall(nzt_wall,m) |
---|
3396 | surf_usm_v(l)%dz_window(nzt_wall+1,m) = & |
---|
3397 | surf_usm_v(l)%dz_window(nzt_wall,m) |
---|
3398 | |
---|
3399 | DO k = nzb_wall, nzt_wall-1 |
---|
3400 | surf_usm_v(l)%dz_window_stag(k,m) = 0.5 * ( & |
---|
3401 | surf_usm_v(l)%dz_window(k+1,m) + & |
---|
3402 | surf_usm_v(l)%dz_window(k,m) ) |
---|
3403 | ENDDO |
---|
3404 | surf_usm_v(l)%dz_window_stag(nzt_wall,m) = & |
---|
3405 | surf_usm_v(l)%dz_window(nzt_wall,m) |
---|
3406 | surf_usm_v(l)%dz_green(nzt_wall+1,m) = & |
---|
3407 | surf_usm_v(l)%dz_green(nzt_wall,m) |
---|
3408 | |
---|
3409 | DO k = nzb_wall, nzt_wall-1 |
---|
3410 | surf_usm_v(l)%dz_green_stag(k,m) = 0.5 * ( & |
---|
3411 | surf_usm_v(l)%dz_green(k+1,m) + & |
---|
3412 | surf_usm_v(l)%dz_green(k,m) ) |
---|
3413 | ENDDO |
---|
3414 | surf_usm_v(l)%dz_green_stag(nzt_wall,m) = & |
---|
3415 | surf_usm_v(l)%dz_green(nzt_wall,m) |
---|
3416 | ENDDO |
---|
3417 | surf_usm_v(l)%ddz_wall = 1.0_wp / surf_usm_v(l)%dz_wall |
---|
3418 | surf_usm_v(l)%ddz_wall_stag = 1.0_wp / surf_usm_v(l)%dz_wall_stag |
---|
3419 | surf_usm_v(l)%ddz_window = 1.0_wp / surf_usm_v(l)%dz_window |
---|
3420 | surf_usm_v(l)%ddz_window_stag = 1.0_wp / surf_usm_v(l)%dz_window_stag |
---|
3421 | surf_usm_v(l)%ddz_green = 1.0_wp / surf_usm_v(l)%dz_green |
---|
3422 | surf_usm_v(l)%ddz_green_stag = 1.0_wp / surf_usm_v(l)%dz_green_stag |
---|
3423 | ENDDO |
---|
3424 | |
---|
3425 | |
---|
3426 | CALL location_message( ' wall structures filed out', .TRUE. ) |
---|
3427 | |
---|
3428 | CALL location_message( ' initialization of wall surface model finished', .TRUE. ) |
---|
3429 | |
---|
3430 | END SUBROUTINE usm_init_material_model |
---|
3431 | |
---|
3432 | |
---|
3433 | !------------------------------------------------------------------------------! |
---|
3434 | ! Description: |
---|
3435 | ! ------------ |
---|
3436 | !> Initialization of the urban surface model |
---|
3437 | !------------------------------------------------------------------------------! |
---|
3438 | SUBROUTINE usm_init_urban_surface |
---|
3439 | |
---|
3440 | USE arrays_3d, & |
---|
3441 | ONLY: zw |
---|
3442 | |
---|
3443 | USE netcdf_data_input_mod, & |
---|
3444 | ONLY: building_pars_f, building_type_f, terrain_height_f |
---|
3445 | |
---|
3446 | IMPLICIT NONE |
---|
3447 | |
---|
3448 | INTEGER(iwp) :: i !< loop index x-dirction |
---|
3449 | INTEGER(iwp) :: ind_emis_wall !< index in input list for wall emissivity |
---|
3450 | INTEGER(iwp) :: ind_emis_green !< index in input list for green emissivity |
---|
3451 | INTEGER(iwp) :: ind_emis_win !< index in input list for window emissivity |
---|
3452 | INTEGER(iwp) :: ind_green_frac_w !< index in input list for green fraction on wall |
---|
3453 | INTEGER(iwp) :: ind_green_frac_r !< index in input list for green fraction on roof |
---|
3454 | INTEGER(iwp) :: ind_hc1 !< index in input list for heat capacity at first wall layer |
---|
3455 | INTEGER(iwp) :: ind_hc2 !< index in input list for heat capacity at second wall layer |
---|
3456 | INTEGER(iwp) :: ind_hc3 !< index in input list for heat capacity at third wall layer |
---|
3457 | INTEGER(iwp) :: ind_lai_r !< index in input list for LAI on roof |
---|
3458 | INTEGER(iwp) :: ind_lai_w !< index in input list for LAI on wall |
---|
3459 | INTEGER(iwp) :: ind_tc1 !< index in input list for thermal conductivity at first wall layer |
---|
3460 | INTEGER(iwp) :: ind_tc2 !< index in input list for thermal conductivity at second wall layer |
---|
3461 | INTEGER(iwp) :: ind_tc3 !< index in input list for thermal conductivity at third wall layer |
---|
3462 | INTEGER(iwp) :: ind_trans !< index in input list for window transmissivity |
---|
3463 | INTEGER(iwp) :: ind_wall_frac !< index in input list for wall fraction |
---|
3464 | INTEGER(iwp) :: ind_win_frac !< index in input list for window fraction |
---|
3465 | INTEGER(iwp) :: ind_z0 !< index in input list for z0 |
---|
3466 | INTEGER(iwp) :: ind_z0qh !< index in input list for z0h / z0q |
---|
3467 | INTEGER(iwp) :: j !< loop index y-dirction |
---|
3468 | INTEGER(iwp) :: k !< loop index z-dirction |
---|
3469 | INTEGER(iwp) :: l !< loop index surface orientation |
---|
3470 | INTEGER(iwp) :: m !< loop index surface element |
---|
3471 | INTEGER(iwp) :: st !< dummy |
---|
3472 | |
---|
3473 | REAL(wp) :: c, d, tin, twin, exn |
---|
3474 | REAL(wp) :: ground_floor_level_l !< local height of ground floor level |
---|
3475 | REAL(wp) :: z_agl !< height above ground |
---|
3476 | |
---|
3477 | ! |
---|
3478 | !-- NOPOINTER version not implemented yet |
---|
3479 | #if defined( __nopointer ) |
---|
3480 | message_string = 'The urban surface module only runs with POINTER version' |
---|
3481 | CALL message( 'urban_surface_mod', 'PA0452', 1, 2, 0, 6, 0 ) |
---|
3482 | #endif |
---|
3483 | |
---|
3484 | CALL cpu_log( log_point_s(78), 'usm_init', 'start' ) |
---|
3485 | !-- surface forcing have to be disabled for LSF |
---|
3486 | !-- in case of enabled urban surface module |
---|
3487 | IF ( large_scale_forcing ) THEN |
---|
3488 | lsf_surf = .FALSE. |
---|
3489 | ENDIF |
---|
3490 | |
---|
3491 | ! |
---|
3492 | !-- Flag surface elements belonging to the ground floor level. Therefore, |
---|
3493 | !-- use terrain height array from file, if available. This flag is later used |
---|
3494 | !-- to control initialization of surface attributes. |
---|
3495 | surf_usm_h%ground_level = .FALSE. |
---|
3496 | DO m = 1, surf_usm_h%ns |
---|
3497 | i = surf_usm_h%i(m) |
---|
3498 | j = surf_usm_h%j(m) |
---|
3499 | k = surf_usm_h%k(m) |
---|
3500 | ! |
---|
3501 | !-- Get local ground level. If no ground level is given in input file, |
---|
3502 | !-- use default value. |
---|
3503 | ground_floor_level_l = ground_floor_level |
---|
3504 | IF ( building_pars_f%from_file ) THEN |
---|
3505 | IF ( building_pars_f%pars_xy(ind_gflh,j,i) /= & |
---|
3506 | building_pars_f%fill ) & |
---|
3507 | ground_floor_level_l = building_pars_f%pars_xy(ind_gflh,j,i) |
---|
3508 | ENDIF |
---|
3509 | ! |
---|
3510 | !-- Determine height of surface element above ground level |
---|
3511 | IF ( terrain_height_f%from_file ) THEN |
---|
3512 | z_agl = zw(k) - terrain_height_f%var(j,i) |
---|
3513 | ELSE |
---|
3514 | z_agl = zw(k) |
---|
3515 | ENDIF |
---|
3516 | ! |
---|
3517 | !-- Set flag for ground level |
---|
3518 | IF ( z_agl <= ground_floor_level_l ) & |
---|
3519 | surf_usm_h%ground_level(m) = .TRUE. |
---|
3520 | ENDDO |
---|
3521 | |
---|
3522 | DO l = 0, 3 |
---|
3523 | surf_usm_v(l)%ground_level = .FALSE. |
---|
3524 | DO m = 1, surf_usm_v(l)%ns |
---|
3525 | i = surf_usm_v(l)%i(m) + surf_usm_v(l)%ioff |
---|
3526 | j = surf_usm_v(l)%j(m) + surf_usm_v(l)%joff |
---|
3527 | k = surf_usm_v(l)%k(m) |
---|
3528 | ! |
---|
3529 | !-- Get local ground level. If no ground level is given in input file, |
---|
3530 | !-- use default value. |
---|
3531 | ground_floor_level_l = ground_floor_level |
---|
3532 | IF ( building_pars_f%from_file ) THEN |
---|
3533 | IF ( building_pars_f%pars_xy(ind_gflh,j,i) /= & |
---|
3534 | building_pars_f%fill ) & |
---|
3535 | ground_floor_level_l = building_pars_f%pars_xy(ind_gflh,j,i) |
---|
3536 | ENDIF |
---|
3537 | ! |
---|
3538 | !-- Determine height of surface element above ground level. Please |
---|
3539 | !-- note, height of surface element is determined with respect to |
---|
3540 | !-- its height of the adjoing atmospheric grid point. |
---|
3541 | IF ( terrain_height_f%from_file ) THEN |
---|
3542 | z_agl = zw(k) - terrain_height_f%var(j-surf_usm_v(l)%joff, & |
---|
3543 | i-surf_usm_v(l)%ioff) |
---|
3544 | ELSE |
---|
3545 | z_agl = zw(k) |
---|
3546 | ENDIF |
---|
3547 | ! |
---|
3548 | !-- Set flag for ground level |
---|
3549 | IF ( z_agl <= ground_floor_level_l ) & |
---|
3550 | surf_usm_v(l)%ground_level(m) = .TRUE. |
---|
3551 | |
---|
3552 | ENDDO |
---|
3553 | ENDDO |
---|
3554 | ! |
---|
3555 | !-- Initialize urban-type surface attribute. According to initialization in |
---|
3556 | !-- land-surface model, follow a 3-level approach. |
---|
3557 | !-- Level 1 - initialization via default attributes |
---|
3558 | DO m = 1, surf_usm_h%ns |
---|
3559 | ! |
---|
3560 | !-- Now, all horizontal surfaces are roof surfaces (?) |
---|
3561 | surf_usm_h%isroof_surf(m) = .TRUE. |
---|
3562 | surf_usm_h%surface_types(m) = roof_category !< default category for root surface |
---|
3563 | ! |
---|
3564 | !-- In order to distinguish between ground floor level and |
---|
3565 | !-- above-ground-floor level surfaces, set input indices. |
---|
3566 | ind_wall_frac = MERGE( ind_wall_frac_gfl, ind_wall_frac_agfl, & |
---|
3567 | surf_usm_h%ground_level(m) ) |
---|
3568 | ind_win_frac = MERGE( ind_win_frac_gfl, ind_win_frac_agfl, & |
---|
3569 | surf_usm_h%ground_level(m) ) |
---|
3570 | ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, & |
---|
3571 | surf_usm_h%ground_level(m) ) |
---|
3572 | ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, & |
---|
3573 | surf_usm_h%ground_level(m) ) |
---|
3574 | ind_lai_r = MERGE( ind_lai_r_gfl, ind_lai_r_agfl, & |
---|
3575 | surf_usm_h%ground_level(m) ) |
---|
3576 | ind_lai_w = MERGE( ind_lai_w_gfl, ind_lai_w_agfl, & |
---|
3577 | surf_usm_h%ground_level(m) ) |
---|
3578 | ind_hc1 = MERGE( ind_hc1_gfl, ind_hc1_agfl, & |
---|
3579 | surf_usm_h%ground_level(m) ) |
---|
3580 | ind_hc2 = MERGE( ind_hc2_gfl, ind_hc2_agfl, & |
---|
3581 | surf_usm_h%ground_level(m) ) |
---|
3582 | ind_hc3 = MERGE( ind_hc3_gfl, ind_hc3_agfl, & |
---|
3583 | surf_usm_h%ground_level(m) ) |
---|
3584 | ind_tc1 = MERGE( ind_tc1_gfl, ind_tc1_agfl, & |
---|
3585 | surf_usm_h%ground_level(m) ) |
---|
3586 | ind_tc2 = MERGE( ind_tc2_gfl, ind_tc2_agfl, & |
---|
3587 | surf_usm_h%ground_level(m) ) |
---|
3588 | ind_tc3 = MERGE( ind_tc3_gfl, ind_tc3_agfl, & |
---|
3589 | surf_usm_h%ground_level(m) ) |
---|
3590 | ind_emis_wall = MERGE( ind_emis_wall_gfl, ind_emis_wall_agfl, & |
---|
3591 | surf_usm_h%ground_level(m) ) |
---|
3592 | ind_emis_green = MERGE( ind_emis_green_gfl, ind_emis_green_agfl, & |
---|
3593 | surf_usm_h%ground_level(m) ) |
---|
3594 | ind_emis_win = MERGE( ind_emis_win_gfl, ind_emis_win_agfl, & |
---|
3595 | surf_usm_h%ground_level(m) ) |
---|
3596 | ind_trans = MERGE( ind_trans_gfl, ind_trans_agfl, & |
---|
3597 | surf_usm_h%ground_level(m) ) |
---|
3598 | ind_z0 = MERGE( ind_z0_gfl, ind_z0_agfl, & |
---|
3599 | surf_usm_h%ground_level(m) ) |
---|
3600 | ind_z0qh = MERGE( ind_z0qh_gfl, ind_z0qh_agfl, & |
---|
3601 | surf_usm_h%ground_level(m) ) |
---|
3602 | ! |
---|
3603 | !-- Initialize relatvie wall- (0), green- (1) and window (2) fractions |
---|
3604 | surf_usm_h%frac(0,m) = building_pars(ind_wall_frac,building_type) |
---|
3605 | surf_usm_h%frac(1,m) = building_pars(ind_green_frac_r,building_type) |
---|
3606 | surf_usm_h%frac(2,m) = building_pars(ind_win_frac,building_type) |
---|
3607 | surf_usm_h%lai(m) = building_pars(ind_green_frac_r,building_type) |
---|
3608 | |
---|
3609 | surf_usm_h%rho_c_wall(nzb_wall,m) = building_pars(ind_hc1,building_type) |
---|
3610 | surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1,building_type) |
---|
3611 | surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2,building_type) |
---|
3612 | surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,building_type) |
---|
3613 | surf_usm_h%lambda_h(nzb_wall,m) = building_pars(ind_tc1,building_type) |
---|
3614 | surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1,building_type) |
---|
3615 | surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2,building_type) |
---|
3616 | surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,building_type) |
---|
3617 | surf_usm_h%rho_c_green(nzb_wall,m) = building_pars(ind_hc1,building_type) |
---|
3618 | surf_usm_h%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,building_type) |
---|
3619 | surf_usm_h%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,building_type) |
---|
3620 | surf_usm_h%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,building_type) |
---|
3621 | surf_usm_h%lambda_h_green(nzb_wall,m) = building_pars(ind_tc1,building_type) |
---|
3622 | surf_usm_h%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,building_type) |
---|
3623 | surf_usm_h%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,building_type) |
---|
3624 | surf_usm_h%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,building_type) |
---|
3625 | surf_usm_h%rho_c_window(nzb_wall,m) = building_pars(ind_hc1,building_type) |
---|
3626 | surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,building_type) |
---|
3627 | surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,building_type) |
---|
3628 | surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,building_type) |
---|
3629 | surf_usm_h%lambda_h_window(nzb_wall,m) = building_pars(ind_tc1,building_type) |
---|
3630 | surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,building_type) |
---|
3631 | surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,building_type) |
---|
3632 | surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,building_type) |
---|
3633 | |
---|
3634 | surf_usm_h%target_temp_summer(m) = building_pars(12,building_type) |
---|
3635 | surf_usm_h%target_temp_winter(m) = building_pars(13,building_type) |
---|
3636 | ! |
---|
3637 | !-- emissivity of wall-, green- and window fraction |
---|
3638 | surf_usm_h%emissivity(0,m) = building_pars(ind_emis_wall,building_type) |
---|
3639 | surf_usm_h%emissivity(1,m) = building_pars(ind_emis_green,building_type) |
---|
3640 | surf_usm_h%emissivity(2,m) = building_pars(ind_emis_win,building_type) |
---|
3641 | |
---|
3642 | surf_usm_h%transmissivity(m) = building_pars(ind_trans,building_type) |
---|
3643 | |
---|
3644 | surf_usm_h%z0(m) = building_pars(ind_z0,building_type) |
---|
3645 | surf_usm_h%z0h(m) = building_pars(ind_z0qh,building_type) |
---|
3646 | surf_usm_h%z0q(m) = building_pars(ind_z0qh,building_type) |
---|
3647 | ! |
---|
3648 | !-- albedo type for wall fraction, green fraction, window fraction |
---|
3649 | surf_usm_h%albedo_type(0,m) = INT( building_pars(ind_alb_wall,building_type) ) |
---|
3650 | surf_usm_h%albedo_type(1,m) = INT( building_pars(ind_alb_green,building_type) ) |
---|
3651 | surf_usm_h%albedo_type(2,m) = INT( building_pars(ind_alb_win,building_type) ) |
---|
3652 | |
---|
3653 | surf_usm_h%zw(nzb_wall,m) = building_pars(ind_thick_1,building_type) |
---|
3654 | surf_usm_h%zw(nzb_wall+1,m) = building_pars(ind_thick_2,building_type) |
---|
3655 | surf_usm_h%zw(nzb_wall+2,m) = building_pars(ind_thick_3,building_type) |
---|
3656 | surf_usm_h%zw(nzb_wall+3,m) = building_pars(ind_thick_4,building_type) |
---|
3657 | |
---|
3658 | surf_usm_h%zw_green(nzb_wall,m) = building_pars(ind_thick_1,building_type) |
---|
3659 | surf_usm_h%zw_green(nzb_wall+1,m) = building_pars(ind_thick_2,building_type) |
---|
3660 | surf_usm_h%zw_green(nzb_wall+2,m) = building_pars(ind_thick_3,building_type) |
---|
3661 | surf_usm_h%zw_green(nzb_wall+3,m) = building_pars(ind_thick_4,building_type) |
---|
3662 | |
---|
3663 | surf_usm_h%zw_window(nzb_wall,m) = building_pars(ind_thick_1,building_type) |
---|
3664 | surf_usm_h%zw_window(nzb_wall+1,m) = building_pars(ind_thick_2,building_type) |
---|
3665 | surf_usm_h%zw_window(nzb_wall+2,m) = building_pars(ind_thick_3,building_type) |
---|
3666 | surf_usm_h%zw_window(nzb_wall+3,m) = building_pars(ind_thick_4,building_type) |
---|
3667 | |
---|
3668 | surf_usm_h%c_surface(m) = building_pars(45,building_type) |
---|
3669 | surf_usm_h%lambda_surf(m) = building_pars(46,building_type) |
---|
3670 | surf_usm_h%c_surface_green(m) = building_pars(45,building_type) |
---|
3671 | surf_usm_h%lambda_surf_green(m) = building_pars(46,building_type) |
---|
3672 | surf_usm_h%c_surface_window(m) = building_pars(45,building_type) |
---|
3673 | surf_usm_h%lambda_surf_window(m) = building_pars(46,building_type) |
---|
3674 | |
---|
3675 | ENDDO |
---|
3676 | |
---|
3677 | DO l = 0, 3 |
---|
3678 | DO m = 1, surf_usm_v(l)%ns |
---|
3679 | |
---|
3680 | surf_usm_v(l)%surface_types(m) = wall_category !< default category for root surface |
---|
3681 | ! |
---|
3682 | !-- In order to distinguish between ground floor level and |
---|
3683 | !-- above-ground-floor level surfaces, set input indices. |
---|
3684 | ind_wall_frac = MERGE( ind_wall_frac_gfl, ind_wall_frac_agfl, & |
---|
3685 | surf_usm_v(l)%ground_level(m) ) |
---|
3686 | ind_win_frac = MERGE( ind_win_frac_gfl, ind_win_frac_agfl, & |
---|
3687 | surf_usm_v(l)%ground_level(m) ) |
---|
3688 | ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, & |
---|
3689 | surf_usm_v(l)%ground_level(m) ) |
---|
3690 | ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, & |
---|
3691 | surf_usm_v(l)%ground_level(m) ) |
---|
3692 | ind_lai_r = MERGE( ind_lai_r_gfl, ind_lai_r_agfl, & |
---|
3693 | surf_usm_v(l)%ground_level(m) ) |
---|
3694 | ind_lai_w = MERGE( ind_lai_w_gfl, ind_lai_w_agfl, & |
---|
3695 | surf_usm_v(l)%ground_level(m) ) |
---|
3696 | ind_hc1 = MERGE( ind_hc1_gfl, ind_hc1_agfl, & |
---|
3697 | surf_usm_v(l)%ground_level(m) ) |
---|
3698 | ind_hc2 = MERGE( ind_hc2_gfl, ind_hc2_agfl, & |
---|
3699 | surf_usm_v(l)%ground_level(m) ) |
---|
3700 | ind_hc3 = MERGE( ind_hc3_gfl, ind_hc3_agfl, & |
---|
3701 | surf_usm_v(l)%ground_level(m) ) |
---|
3702 | ind_tc1 = MERGE( ind_tc1_gfl, ind_tc1_agfl, & |
---|
3703 | surf_usm_v(l)%ground_level(m) ) |
---|
3704 | ind_tc2 = MERGE( ind_tc2_gfl, ind_tc2_agfl, & |
---|
3705 | surf_usm_v(l)%ground_level(m) ) |
---|
3706 | ind_tc3 = MERGE( ind_tc3_gfl, ind_tc3_agfl, & |
---|
3707 | surf_usm_v(l)%ground_level(m) ) |
---|
3708 | ind_emis_wall = MERGE( ind_emis_wall_gfl, ind_emis_wall_agfl, & |
---|
3709 | surf_usm_v(l)%ground_level(m) ) |
---|
3710 | ind_emis_green = MERGE( ind_emis_green_gfl, ind_emis_green_agfl, & |
---|
3711 | surf_usm_v(l)%ground_level(m) ) |
---|
3712 | ind_emis_win = MERGE( ind_emis_win_gfl, ind_emis_win_agfl, & |
---|
3713 | surf_usm_v(l)%ground_level(m) ) |
---|
3714 | ind_trans = MERGE( ind_trans_gfl, ind_trans_agfl, & |
---|
3715 | surf_usm_v(l)%ground_level(m) ) |
---|
3716 | ind_z0 = MERGE( ind_z0_gfl, ind_z0_agfl, & |
---|
3717 | surf_usm_v(l)%ground_level(m) ) |
---|
3718 | ind_z0qh = MERGE( ind_z0qh_gfl, ind_z0qh_agfl, & |
---|
3719 | surf_usm_v(l)%ground_level(m) ) |
---|
3720 | |
---|
3721 | ! |
---|
3722 | !-- Initialize relatvie wall- (0), green- (1) and window (2) fractions |
---|
3723 | surf_usm_v(l)%frac(0,m) = building_pars(ind_wall_frac,building_type) |
---|
3724 | surf_usm_v(l)%frac(1,m) = building_pars(ind_green_frac_w,building_type) |
---|
3725 | surf_usm_v(l)%frac(2,m) = building_pars(ind_win_frac,building_type) |
---|
3726 | surf_usm_v(l)%lai(m) = building_pars(ind_lai_w,building_type) |
---|
3727 | |
---|
3728 | surf_usm_v(l)%rho_c_wall(nzb_wall,m) = building_pars(ind_hc1,building_type) |
---|
3729 | surf_usm_v(l)%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1,building_type) |
---|
3730 | surf_usm_v(l)%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2,building_type) |
---|
3731 | surf_usm_v(l)%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,building_type) |
---|
3732 | |
---|
3733 | surf_usm_v(l)%rho_c_green(nzb_wall,m) = building_pars(ind_hc1,building_type) |
---|
3734 | surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,building_type) |
---|
3735 | surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,building_type) |
---|
3736 | surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,building_type) |
---|
3737 | |
---|
3738 | surf_usm_v(l)%rho_c_window(nzb_wall,m) = building_pars(ind_hc1,building_type) |
---|
3739 | surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,building_type) |
---|
3740 | surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,building_type) |
---|
3741 | surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,building_type) |
---|
3742 | |
---|
3743 | surf_usm_v(l)%lambda_h(nzb_wall,m) = building_pars(ind_tc1,building_type) |
---|
3744 | surf_usm_v(l)%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1,building_type) |
---|
3745 | surf_usm_v(l)%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2,building_type) |
---|
3746 | surf_usm_v(l)%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,building_type) |
---|
3747 | |
---|
3748 | surf_usm_v(l)%lambda_h_green(nzb_wall,m) = building_pars(ind_tc1,building_type) |
---|
3749 | surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,building_type) |
---|
3750 | surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,building_type) |
---|
3751 | surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,building_type) |
---|
3752 | |
---|
3753 | surf_usm_v(l)%lambda_h_window(nzb_wall,m) = building_pars(ind_tc1,building_type) |
---|
3754 | surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,building_type) |
---|
3755 | surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,building_type) |
---|
3756 | surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,building_type) |
---|
3757 | |
---|
3758 | surf_usm_v(l)%target_temp_summer(m) = building_pars(12,building_type) |
---|
3759 | surf_usm_v(l)%target_temp_winter(m) = building_pars(13,building_type) |
---|
3760 | ! |
---|
3761 | !-- emissivity of wall-, green- and window fraction |
---|
3762 | surf_usm_v(l)%emissivity(0,m) = building_pars(ind_emis_wall,building_type) |
---|
3763 | surf_usm_v(l)%emissivity(1,m) = building_pars(ind_emis_green,building_type) |
---|
3764 | surf_usm_v(l)%emissivity(2,m) = building_pars(ind_emis_win,building_type) |
---|
3765 | |
---|
3766 | surf_usm_v(l)%transmissivity(m) = building_pars(ind_trans,building_type) |
---|
3767 | |
---|
3768 | surf_usm_v(l)%z0(m) = building_pars(ind_z0,building_type) |
---|
3769 | surf_usm_v(l)%z0h(m) = building_pars(ind_z0qh,building_type) |
---|
3770 | surf_usm_v(l)%z0q(m) = building_pars(ind_z0qh,building_type) |
---|
3771 | |
---|
3772 | surf_usm_v(l)%albedo_type(0,m) = INT( building_pars(ind_alb_wall,building_type) ) |
---|
3773 | surf_usm_v(l)%albedo_type(1,m) = INT( building_pars(ind_alb_green,building_type) ) |
---|
3774 | surf_usm_v(l)%albedo_type(2,m) = INT( building_pars(ind_alb_win,building_type) ) |
---|
3775 | |
---|
3776 | surf_usm_v(l)%zw(nzb_wall,m) = building_pars(ind_thick_1,building_type) |
---|
3777 | surf_usm_v(l)%zw(nzb_wall+1,m) = building_pars(ind_thick_2,building_type) |
---|
3778 | surf_usm_v(l)%zw(nzb_wall+2,m) = building_pars(ind_thick_3,building_type) |
---|
3779 | surf_usm_v(l)%zw(nzb_wall+3,m) = building_pars(ind_thick_4,building_type) |
---|
3780 | |
---|
3781 | surf_usm_v(l)%zw_green(nzb_wall,m) = building_pars(ind_thick_1,building_type) |
---|
3782 | surf_usm_v(l)%zw_green(nzb_wall+1,m) = building_pars(ind_thick_2,building_type) |
---|
3783 | surf_usm_v(l)%zw_green(nzb_wall+2,m) = building_pars(ind_thick_3,building_type) |
---|
3784 | surf_usm_v(l)%zw_green(nzb_wall+3,m) = building_pars(ind_thick_4,building_type) |
---|
3785 | |
---|
3786 | surf_usm_v(l)%zw_window(nzb_wall,m) = building_pars(ind_thick_1,building_type) |
---|
3787 | surf_usm_v(l)%zw_window(nzb_wall+1,m) = building_pars(ind_thick_2,building_type) |
---|
3788 | surf_usm_v(l)%zw_window(nzb_wall+2,m) = building_pars(ind_thick_3,building_type) |
---|
3789 | surf_usm_v(l)%zw_window(nzb_wall+3,m) = building_pars(ind_thick_4,building_type) |
---|
3790 | |
---|
3791 | surf_usm_v(l)%c_surface(m) = building_pars(45,building_type) |
---|
3792 | surf_usm_v(l)%lambda_surf(m) = building_pars(46,building_type) |
---|
3793 | surf_usm_v(l)%c_surface_green(m) = building_pars(45,building_type) |
---|
3794 | surf_usm_v(l)%lambda_surf_green(m) = building_pars(46,building_type) |
---|
3795 | surf_usm_v(l)%c_surface_window(m) = building_pars(45,building_type) |
---|
3796 | surf_usm_v(l)%lambda_surf_window(m) = building_pars(46,building_type) |
---|
3797 | |
---|
3798 | ENDDO |
---|
3799 | ENDDO |
---|
3800 | ! |
---|
3801 | !-- Level 2 - initialization via building type read from file |
---|
3802 | IF ( building_type_f%from_file ) THEN |
---|
3803 | DO m = 1, surf_usm_h%ns |
---|
3804 | i = surf_usm_h%i(m) |
---|
3805 | j = surf_usm_h%j(m) |
---|
3806 | ! |
---|
3807 | !-- For the moment, limit building type to 6 (to overcome errors in input file). |
---|
3808 | st = building_type_f%var(j,i) |
---|
3809 | IF ( st /= building_type_f%fill ) THEN |
---|
3810 | |
---|
3811 | ! |
---|
3812 | !-- In order to distinguish between ground floor level and |
---|
3813 | !-- above-ground-floor level surfaces, set input indices. |
---|
3814 | ind_wall_frac = MERGE( ind_wall_frac_gfl, ind_wall_frac_agfl, & |
---|
3815 | surf_usm_h%ground_level(m) ) |
---|
3816 | ind_win_frac = MERGE( ind_win_frac_gfl, ind_win_frac_agfl, & |
---|
3817 | surf_usm_h%ground_level(m) ) |
---|
3818 | ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, & |
---|
3819 | surf_usm_h%ground_level(m) ) |
---|
3820 | ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, & |
---|
3821 | surf_usm_h%ground_level(m) ) |
---|
3822 | ind_lai_r = MERGE( ind_lai_r_gfl, ind_lai_r_agfl, & |
---|
3823 | surf_usm_h%ground_level(m) ) |
---|
3824 | ind_lai_w = MERGE( ind_lai_w_gfl, ind_lai_w_agfl, & |
---|
3825 | surf_usm_h%ground_level(m) ) |
---|
3826 | ind_hc1 = MERGE( ind_hc1_gfl, ind_hc1_agfl, & |
---|
3827 | surf_usm_h%ground_level(m) ) |
---|
3828 | ind_hc2 = MERGE( ind_hc2_gfl, ind_hc2_agfl, & |
---|
3829 | surf_usm_h%ground_level(m) ) |
---|
3830 | ind_hc3 = MERGE( ind_hc3_gfl, ind_hc3_agfl, & |
---|
3831 | surf_usm_h%ground_level(m) ) |
---|
3832 | ind_tc1 = MERGE( ind_tc1_gfl, ind_tc1_agfl, & |
---|
3833 | surf_usm_h%ground_level(m) ) |
---|
3834 | ind_tc2 = MERGE( ind_tc2_gfl, ind_tc2_agfl, & |
---|
3835 | surf_usm_h%ground_level(m) ) |
---|
3836 | ind_tc3 = MERGE( ind_tc3_gfl, ind_tc3_agfl, & |
---|
3837 | surf_usm_h%ground_level(m) ) |
---|
3838 | ind_emis_wall = MERGE( ind_emis_wall_gfl, ind_emis_wall_agfl, & |
---|
3839 | surf_usm_h%ground_level(m) ) |
---|
3840 | ind_emis_green = MERGE( ind_emis_green_gfl, ind_emis_green_agfl, & |
---|
3841 | surf_usm_h%ground_level(m) ) |
---|
3842 | ind_emis_win = MERGE( ind_emis_win_gfl, ind_emis_win_agfl, & |
---|
3843 | surf_usm_h%ground_level(m) ) |
---|
3844 | ind_trans = MERGE( ind_trans_gfl, ind_trans_agfl, & |
---|
3845 | surf_usm_h%ground_level(m) ) |
---|
3846 | ind_z0 = MERGE( ind_z0_gfl, ind_z0_agfl, & |
---|
3847 | surf_usm_h%ground_level(m) ) |
---|
3848 | ind_z0qh = MERGE( ind_z0qh_gfl, ind_z0qh_agfl, & |
---|
3849 | surf_usm_h%ground_level(m) ) |
---|
3850 | |
---|
3851 | ! |
---|
3852 | !-- Initialize relatvie wall- (0), green- (1) and window (2) fractions |
---|
3853 | surf_usm_h%frac(0,m) = building_pars(ind_wall_frac,st) |
---|
3854 | surf_usm_h%frac(1,m) = building_pars(ind_green_frac_r,st) |
---|
3855 | surf_usm_h%frac(2,m) = building_pars(ind_win_frac,st) |
---|
3856 | surf_usm_h%lai(m) = building_pars(ind_green_frac_r,st) |
---|
3857 | |
---|
3858 | surf_usm_h%rho_c_wall(nzb_wall,m) = building_pars(ind_hc1,st) |
---|
3859 | surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1,st) |
---|
3860 | surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2,st) |
---|
3861 | surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,st) |
---|
3862 | surf_usm_h%lambda_h(nzb_wall,m) = building_pars(ind_tc1,st) |
---|
3863 | surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1,st) |
---|
3864 | surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2,st) |
---|
3865 | surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,st) |
---|
3866 | |
---|
3867 | surf_usm_h%rho_c_green(nzb_wall,m) = building_pars(ind_hc1,st) |
---|
3868 | surf_usm_h%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,st) |
---|
3869 | surf_usm_h%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,st) |
---|
3870 | surf_usm_h%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,st) |
---|
3871 | surf_usm_h%lambda_h_green(nzb_wall,m) = building_pars(ind_tc1,st) |
---|
3872 | surf_usm_h%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,st) |
---|
3873 | surf_usm_h%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,st) |
---|
3874 | surf_usm_h%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,st) |
---|
3875 | |
---|
3876 | surf_usm_h%rho_c_window(nzb_wall,m) = building_pars(ind_hc1,st) |
---|
3877 | surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,st) |
---|
3878 | surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,st) |
---|
3879 | surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,st) |
---|
3880 | surf_usm_h%lambda_h_window(nzb_wall,m) = building_pars(ind_tc1,st) |
---|
3881 | surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,st) |
---|
3882 | surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,st) |
---|
3883 | surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,st) |
---|
3884 | |
---|
3885 | surf_usm_h%target_temp_summer(m) = building_pars(12,st) |
---|
3886 | surf_usm_h%target_temp_winter(m) = building_pars(13,st) |
---|
3887 | ! |
---|
3888 | !-- emissivity of wall-, green- and window fraction |
---|
3889 | surf_usm_h%emissivity(0,m) = building_pars(ind_emis_wall,st) |
---|
3890 | surf_usm_h%emissivity(1,m) = building_pars(ind_emis_green,st) |
---|
3891 | surf_usm_h%emissivity(2,m) = building_pars(ind_emis_win,st) |
---|
3892 | |
---|
3893 | surf_usm_h%transmissivity(m) = building_pars(ind_trans,st) |
---|
3894 | |
---|
3895 | surf_usm_h%z0(m) = building_pars(ind_z0,st) |
---|
3896 | surf_usm_h%z0h(m) = building_pars(ind_z0qh,st) |
---|
3897 | surf_usm_h%z0q(m) = building_pars(ind_z0qh,st) |
---|
3898 | ! |
---|
3899 | !-- albedo type for wall fraction, green fraction, window fraction |
---|
3900 | surf_usm_h%albedo_type(0,m) = INT( building_pars(ind_alb_wall,st) ) |
---|
3901 | surf_usm_h%albedo_type(1,m) = INT( building_pars(ind_alb_green,st) ) |
---|
3902 | surf_usm_h%albedo_type(2,m) = INT( building_pars(ind_alb_win,st) ) |
---|
3903 | |
---|
3904 | surf_usm_h%zw(nzb_wall,m) = building_pars(ind_thick_1,st) |
---|
3905 | surf_usm_h%zw(nzb_wall+1,m) = building_pars(ind_thick_2,st) |
---|
3906 | surf_usm_h%zw(nzb_wall+2,m) = building_pars(ind_thick_3,st) |
---|
3907 | surf_usm_h%zw(nzb_wall+3,m) = building_pars(ind_thick_4,st) |
---|
3908 | |
---|
3909 | surf_usm_h%zw_green(nzb_wall,m) = building_pars(ind_thick_1,st) |
---|
3910 | surf_usm_h%zw_green(nzb_wall+1,m) = building_pars(ind_thick_2,st) |
---|
3911 | surf_usm_h%zw_green(nzb_wall+2,m) = building_pars(ind_thick_3,st) |
---|
3912 | surf_usm_h%zw_green(nzb_wall+3,m) = building_pars(ind_thick_4,st) |
---|
3913 | |
---|
3914 | surf_usm_h%zw_window(nzb_wall,m) = building_pars(ind_thick_1,st) |
---|
3915 | surf_usm_h%zw_window(nzb_wall+1,m) = building_pars(ind_thick_2,st) |
---|
3916 | surf_usm_h%zw_window(nzb_wall+2,m) = building_pars(ind_thick_3,st) |
---|
3917 | surf_usm_h%zw_window(nzb_wall+3,m) = building_pars(ind_thick_4,st) |
---|
3918 | |
---|
3919 | surf_usm_h%c_surface(m) = building_pars(45,st) |
---|
3920 | surf_usm_h%lambda_surf(m) = building_pars(46,st) |
---|
3921 | surf_usm_h%c_surface_green(m) = building_pars(45,st) |
---|
3922 | surf_usm_h%lambda_surf_green(m) = building_pars(46,st) |
---|
3923 | surf_usm_h%c_surface_window(m) = building_pars(45,st) |
---|
3924 | surf_usm_h%lambda_surf_window(m) = building_pars(46,st) |
---|
3925 | |
---|
3926 | ENDIF |
---|
3927 | ENDDO |
---|
3928 | |
---|
3929 | DO l = 0, 3 |
---|
3930 | DO m = 1, surf_usm_v(l)%ns |
---|
3931 | i = surf_usm_v(l)%i(m) + surf_usm_v(l)%ioff |
---|
3932 | j = surf_usm_v(l)%j(m) + surf_usm_v(l)%joff |
---|
3933 | ! |
---|
3934 | !-- For the moment, limit building type to 6 (to overcome errors in input file). |
---|
3935 | |
---|
3936 | st = building_type_f%var(j,i) |
---|
3937 | IF ( st /= building_type_f%fill ) THEN |
---|
3938 | |
---|
3939 | ! |
---|
3940 | !-- In order to distinguish between ground floor level and |
---|
3941 | !-- above-ground-floor level surfaces, set input indices. |
---|
3942 | ind_wall_frac = MERGE( ind_wall_frac_gfl, ind_wall_frac_agfl, & |
---|
3943 | surf_usm_v(l)%ground_level(m) ) |
---|
3944 | ind_win_frac = MERGE( ind_win_frac_gfl, ind_win_frac_agfl, & |
---|
3945 | surf_usm_v(l)%ground_level(m) ) |
---|
3946 | ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, & |
---|
3947 | surf_usm_v(l)%ground_level(m) ) |
---|
3948 | ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, & |
---|
3949 | surf_usm_v(l)%ground_level(m) ) |
---|
3950 | ind_lai_r = MERGE( ind_lai_r_gfl, ind_lai_r_agfl, & |
---|
3951 | surf_usm_v(l)%ground_level(m) ) |
---|
3952 | ind_lai_w = MERGE( ind_lai_w_gfl, ind_lai_w_agfl, & |
---|
3953 | surf_usm_v(l)%ground_level(m) ) |
---|
3954 | ind_hc1 = MERGE( ind_hc1_gfl, ind_hc1_agfl, & |
---|
3955 | surf_usm_v(l)%ground_level(m) ) |
---|
3956 | ind_hc2 = MERGE( ind_hc2_gfl, ind_hc2_agfl, & |
---|
3957 | surf_usm_v(l)%ground_level(m) ) |
---|
3958 | ind_hc3 = MERGE( ind_hc3_gfl, ind_hc3_agfl, & |
---|
3959 | surf_usm_v(l)%ground_level(m) ) |
---|
3960 | ind_tc1 = MERGE( ind_tc1_gfl, ind_tc1_agfl, & |
---|
3961 | surf_usm_v(l)%ground_level(m) ) |
---|
3962 | ind_tc2 = MERGE( ind_tc2_gfl, ind_tc2_agfl, & |
---|
3963 | surf_usm_v(l)%ground_level(m) ) |
---|
3964 | ind_tc3 = MERGE( ind_tc3_gfl, ind_tc3_agfl, & |
---|
3965 | surf_usm_v(l)%ground_level(m) ) |
---|
3966 | ind_emis_wall = MERGE( ind_emis_wall_gfl, ind_emis_wall_agfl, & |
---|
3967 | surf_usm_v(l)%ground_level(m) ) |
---|
3968 | ind_emis_green = MERGE( ind_emis_green_gfl, ind_emis_green_agfl, & |
---|
3969 | surf_usm_v(l)%ground_level(m) ) |
---|
3970 | ind_emis_win = MERGE( ind_emis_win_gfl, ind_emis_win_agfl, & |
---|
3971 | surf_usm_v(l)%ground_level(m) ) |
---|
3972 | ind_trans = MERGE( ind_trans_gfl, ind_trans_agfl, & |
---|
3973 | surf_usm_v(l)%ground_level(m) ) |
---|
3974 | ind_z0 = MERGE( ind_z0_gfl, ind_z0_agfl, & |
---|
3975 | surf_usm_v(l)%ground_level(m) ) |
---|
3976 | ind_z0qh = MERGE( ind_z0qh_gfl, ind_z0qh_agfl, & |
---|
3977 | surf_usm_v(l)%ground_level(m) ) |
---|
3978 | |
---|
3979 | ! |
---|
3980 | !-- Initialize relatvie wall- (0), green- (1) and window (2) fractions |
---|
3981 | surf_usm_v(l)%frac(0,m) = building_pars(ind_wall_frac,st) |
---|
3982 | surf_usm_v(l)%frac(1,m) = building_pars(ind_green_frac_w,st) |
---|
3983 | surf_usm_v(l)%frac(2,m) = building_pars(ind_win_frac,st) |
---|
3984 | surf_usm_v(l)%lai(m) = building_pars(ind_lai_w,st) |
---|
3985 | |
---|
3986 | surf_usm_v(l)%rho_c_wall(nzb_wall,m) = building_pars(ind_hc1,st) |
---|
3987 | surf_usm_v(l)%rho_c_wall(nzb_wall+1,m) = building_pars(ind_hc1,st) |
---|
3988 | surf_usm_v(l)%rho_c_wall(nzb_wall+2,m) = building_pars(ind_hc2,st) |
---|
3989 | surf_usm_v(l)%rho_c_wall(nzb_wall+3,m) = building_pars(ind_hc3,st) |
---|
3990 | |
---|
3991 | surf_usm_v(l)%rho_c_green(nzb_wall,m) = building_pars(ind_hc1,st) |
---|
3992 | surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = building_pars(ind_hc1,st) |
---|
3993 | surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = building_pars(ind_hc2,st) |
---|
3994 | surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = building_pars(ind_hc3,st) |
---|
3995 | |
---|
3996 | surf_usm_v(l)%rho_c_window(nzb_wall,m) = building_pars(ind_hc1,st) |
---|
3997 | surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars(ind_hc1,st) |
---|
3998 | surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars(ind_hc2,st) |
---|
3999 | surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars(ind_hc3,st) |
---|
4000 | |
---|
4001 | surf_usm_v(l)%lambda_h(nzb_wall,m) = building_pars(ind_tc1,st) |
---|
4002 | surf_usm_v(l)%lambda_h(nzb_wall+1,m) = building_pars(ind_tc1,st) |
---|
4003 | surf_usm_v(l)%lambda_h(nzb_wall+2,m) = building_pars(ind_tc2,st) |
---|
4004 | surf_usm_v(l)%lambda_h(nzb_wall+3,m) = building_pars(ind_tc3,st) |
---|
4005 | |
---|
4006 | surf_usm_v(l)%lambda_h_green(nzb_wall,m) = building_pars(ind_tc1,st) |
---|
4007 | surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = building_pars(ind_tc1,st) |
---|
4008 | surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = building_pars(ind_tc2,st) |
---|
4009 | surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = building_pars(ind_tc3,st) |
---|
4010 | |
---|
4011 | surf_usm_v(l)%lambda_h_window(nzb_wall,m) = building_pars(ind_tc1,st) |
---|
4012 | surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars(ind_tc1,st) |
---|
4013 | surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars(ind_tc2,st) |
---|
4014 | surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars(ind_tc3,st) |
---|
4015 | |
---|
4016 | surf_usm_v(l)%target_temp_summer(m) = building_pars(12,st) |
---|
4017 | surf_usm_v(l)%target_temp_winter(m) = building_pars(13,st) |
---|
4018 | ! |
---|
4019 | !-- emissivity of wall-, green- and window fraction |
---|
4020 | surf_usm_v(l)%emissivity(0,m) = building_pars(ind_emis_wall,st) |
---|
4021 | surf_usm_v(l)%emissivity(1,m) = building_pars(ind_emis_green,st) |
---|
4022 | surf_usm_v(l)%emissivity(2,m) = building_pars(ind_emis_win,st) |
---|
4023 | |
---|
4024 | surf_usm_v(l)%transmissivity(m) = building_pars(ind_trans,st) |
---|
4025 | |
---|
4026 | surf_usm_v(l)%z0(m) = building_pars(ind_z0,st) |
---|
4027 | surf_usm_v(l)%z0h(m) = building_pars(ind_z0qh,st) |
---|
4028 | surf_usm_v(l)%z0q(m) = building_pars(ind_z0qh,st) |
---|
4029 | |
---|
4030 | surf_usm_v(l)%albedo_type(0,m) = INT( building_pars(ind_alb_wall,st) ) |
---|
4031 | surf_usm_v(l)%albedo_type(1,m) = INT( building_pars(ind_alb_green,st) ) |
---|
4032 | surf_usm_v(l)%albedo_type(2,m) = INT( building_pars(ind_alb_win,st) ) |
---|
4033 | |
---|
4034 | surf_usm_v(l)%zw(nzb_wall,m) = building_pars(ind_thick_1,st) |
---|
4035 | surf_usm_v(l)%zw(nzb_wall+1,m) = building_pars(ind_thick_2,st) |
---|
4036 | surf_usm_v(l)%zw(nzb_wall+2,m) = building_pars(ind_thick_3,st) |
---|
4037 | surf_usm_v(l)%zw(nzb_wall+3,m) = building_pars(ind_thick_4,st) |
---|
4038 | |
---|
4039 | surf_usm_v(l)%zw_green(nzb_wall,m) = building_pars(ind_thick_1,st) |
---|
4040 | surf_usm_v(l)%zw_green(nzb_wall+1,m) = building_pars(ind_thick_2,st) |
---|
4041 | surf_usm_v(l)%zw_green(nzb_wall+2,m) = building_pars(ind_thick_3,st) |
---|
4042 | surf_usm_v(l)%zw_green(nzb_wall+3,m) = building_pars(ind_thick_4,st) |
---|
4043 | |
---|
4044 | surf_usm_v(l)%zw_window(nzb_wall,m) = building_pars(ind_thick_1,st) |
---|
4045 | surf_usm_v(l)%zw_window(nzb_wall+1,m) = building_pars(ind_thick_2,st) |
---|
4046 | surf_usm_v(l)%zw_window(nzb_wall+2,m) = building_pars(ind_thick_3,st) |
---|
4047 | surf_usm_v(l)%zw_window(nzb_wall+3,m) = building_pars(ind_thick_4,st) |
---|
4048 | |
---|
4049 | surf_usm_v(l)%c_surface(m) = building_pars(45,st) |
---|
4050 | surf_usm_v(l)%lambda_surf(m) = building_pars(46,st) |
---|
4051 | surf_usm_v(l)%c_surface_green(m) = building_pars(45,st) |
---|
4052 | surf_usm_v(l)%lambda_surf_green(m) = building_pars(46,st) |
---|
4053 | surf_usm_v(l)%c_surface_window(m) = building_pars(45,st) |
---|
4054 | surf_usm_v(l)%lambda_surf_window(m) = building_pars(46,st) |
---|
4055 | |
---|
4056 | |
---|
4057 | ENDIF |
---|
4058 | ENDDO |
---|
4059 | ENDDO |
---|
4060 | ENDIF |
---|
4061 | |
---|
4062 | ! |
---|
4063 | !-- Level 3 - initialization via building_pars read from file |
---|
4064 | IF ( building_pars_f%from_file ) THEN |
---|
4065 | DO m = 1, surf_usm_h%ns |
---|
4066 | i = surf_usm_h%i(m) |
---|
4067 | j = surf_usm_h%j(m) |
---|
4068 | |
---|
4069 | ! |
---|
4070 | !-- In order to distinguish between ground floor level and |
---|
4071 | !-- above-ground-floor level surfaces, set input indices. |
---|
4072 | ind_wall_frac = MERGE( ind_wall_frac_gfl, ind_wall_frac_agfl, & |
---|
4073 | surf_usm_h%ground_level(m) ) |
---|
4074 | ind_win_frac = MERGE( ind_win_frac_gfl, ind_win_frac_agfl, & |
---|
4075 | surf_usm_h%ground_level(m) ) |
---|
4076 | ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, & |
---|
4077 | surf_usm_h%ground_level(m) ) |
---|
4078 | ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, & |
---|
4079 | surf_usm_h%ground_level(m) ) |
---|
4080 | ind_lai_r = MERGE( ind_lai_r_gfl, ind_lai_r_agfl, & |
---|
4081 | surf_usm_h%ground_level(m) ) |
---|
4082 | ind_lai_w = MERGE( ind_lai_w_gfl, ind_lai_w_agfl, & |
---|
4083 | surf_usm_h%ground_level(m) ) |
---|
4084 | ind_hc1 = MERGE( ind_hc1_gfl, ind_hc1_agfl, & |
---|
4085 | surf_usm_h%ground_level(m) ) |
---|
4086 | ind_hc2 = MERGE( ind_hc2_gfl, ind_hc2_agfl, & |
---|
4087 | surf_usm_h%ground_level(m) ) |
---|
4088 | ind_hc3 = MERGE( ind_hc3_gfl, ind_hc3_agfl, & |
---|
4089 | surf_usm_h%ground_level(m) ) |
---|
4090 | ind_tc1 = MERGE( ind_tc1_gfl, ind_tc1_agfl, & |
---|
4091 | surf_usm_h%ground_level(m) ) |
---|
4092 | ind_tc2 = MERGE( ind_tc2_gfl, ind_tc2_agfl, & |
---|
4093 | surf_usm_h%ground_level(m) ) |
---|
4094 | ind_tc3 = MERGE( ind_tc3_gfl, ind_tc3_agfl, & |
---|
4095 | surf_usm_h%ground_level(m) ) |
---|
4096 | ind_emis_wall = MERGE( ind_emis_wall_gfl, ind_emis_wall_agfl, & |
---|
4097 | surf_usm_h%ground_level(m) ) |
---|
4098 | ind_emis_green = MERGE( ind_emis_green_gfl, ind_emis_green_agfl, & |
---|
4099 | surf_usm_h%ground_level(m) ) |
---|
4100 | ind_emis_win = MERGE( ind_emis_win_gfl, ind_emis_win_agfl, & |
---|
4101 | surf_usm_h%ground_level(m) ) |
---|
4102 | ind_trans = MERGE( ind_trans_gfl, ind_trans_agfl, & |
---|
4103 | surf_usm_h%ground_level(m) ) |
---|
4104 | ind_z0 = MERGE( ind_z0_gfl, ind_z0_agfl, & |
---|
4105 | surf_usm_h%ground_level(m) ) |
---|
4106 | ind_z0qh = MERGE( ind_z0qh_gfl, ind_z0qh_agfl, & |
---|
4107 | surf_usm_h%ground_level(m) ) |
---|
4108 | |
---|
4109 | ! |
---|
4110 | !-- Initialize relatvie wall- (0), green- (1) and window (2) fractions |
---|
4111 | IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /= building_pars_f%fill ) & |
---|
4112 | surf_usm_h%frac(0,m) = building_pars_f%pars_xy(ind_wall_frac,j,i) |
---|
4113 | IF ( building_pars_f%pars_xy(ind_green_frac_r,j,i) /= building_pars_f%fill ) & |
---|
4114 | surf_usm_h%frac(1,m) = building_pars_f%pars_xy(ind_green_frac_r,j,i) |
---|
4115 | IF ( building_pars_f%pars_xy(ind_win_frac,j,i) /= building_pars_f%fill ) & |
---|
4116 | surf_usm_h%frac(2,m) = building_pars_f%pars_xy(ind_win_frac,j,i) |
---|
4117 | |
---|
4118 | |
---|
4119 | IF ( building_pars_f%pars_xy(ind_lai_r,j,i) /= building_pars_f%fill ) & |
---|
4120 | surf_usm_h%lai(m) = building_pars_f%pars_xy(ind_lai_r,j,i) |
---|
4121 | |
---|
4122 | IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill ) THEN |
---|
4123 | surf_usm_h%rho_c_wall(nzb_wall,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4124 | surf_usm_h%rho_c_wall(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4125 | ENDIF |
---|
4126 | IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill ) & |
---|
4127 | surf_usm_h%rho_c_wall(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i) |
---|
4128 | IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill ) & |
---|
4129 | surf_usm_h%rho_c_wall(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i) |
---|
4130 | IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill ) THEN |
---|
4131 | surf_usm_h%rho_c_green(nzb_wall,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4132 | surf_usm_h%rho_c_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4133 | ENDIF |
---|
4134 | IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill ) & |
---|
4135 | surf_usm_h%rho_c_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i) |
---|
4136 | IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill ) & |
---|
4137 | surf_usm_h%rho_c_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i) |
---|
4138 | IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill ) THEN |
---|
4139 | surf_usm_h%rho_c_window(nzb_wall,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4140 | surf_usm_h%rho_c_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4141 | ENDIF |
---|
4142 | IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill ) & |
---|
4143 | surf_usm_h%rho_c_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i) |
---|
4144 | IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill ) & |
---|
4145 | surf_usm_h%rho_c_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i) |
---|
4146 | |
---|
4147 | IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill ) THEN |
---|
4148 | surf_usm_h%lambda_h(nzb_wall,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4149 | surf_usm_h%lambda_h(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4150 | ENDIF |
---|
4151 | IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill ) & |
---|
4152 | surf_usm_h%lambda_h(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i) |
---|
4153 | IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill ) & |
---|
4154 | surf_usm_h%lambda_h(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i) |
---|
4155 | IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill ) THEN |
---|
4156 | surf_usm_h%lambda_h_green(nzb_wall,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4157 | surf_usm_h%lambda_h_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4158 | ENDIF |
---|
4159 | IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill ) & |
---|
4160 | surf_usm_h%lambda_h_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i) |
---|
4161 | IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill ) & |
---|
4162 | surf_usm_h%lambda_h_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i) |
---|
4163 | IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill ) THEN |
---|
4164 | surf_usm_h%lambda_h_window(nzb_wall,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4165 | surf_usm_h%lambda_h_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4166 | ENDIF |
---|
4167 | IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill ) & |
---|
4168 | surf_usm_h%lambda_h_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i) |
---|
4169 | IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill ) & |
---|
4170 | surf_usm_h%lambda_h_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i) |
---|
4171 | |
---|
4172 | IF ( building_pars_f%pars_xy(12,j,i) /= building_pars_f%fill ) & |
---|
4173 | surf_usm_h%target_temp_summer(m) = building_pars_f%pars_xy(12,j,i) |
---|
4174 | IF ( building_pars_f%pars_xy(13,j,i) /= building_pars_f%fill ) & |
---|
4175 | surf_usm_h%target_temp_winter(m) = building_pars_f%pars_xy(13,j,i) |
---|
4176 | |
---|
4177 | IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /= building_pars_f%fill ) & |
---|
4178 | surf_usm_h%emissivity(0,m) = building_pars_f%pars_xy(ind_emis_wall,j,i) |
---|
4179 | IF ( building_pars_f%pars_xy(ind_emis_green,j,i) /= building_pars_f%fill )& |
---|
4180 | surf_usm_h%emissivity(1,m) = building_pars_f%pars_xy(ind_emis_green,j,i) |
---|
4181 | IF ( building_pars_f%pars_xy(ind_emis_win,j,i) /= building_pars_f%fill ) & |
---|
4182 | surf_usm_h%emissivity(2,m) = building_pars_f%pars_xy(ind_emis_win,j,i) |
---|
4183 | |
---|
4184 | IF ( building_pars_f%pars_xy(ind_trans,j,i) /= building_pars_f%fill ) & |
---|
4185 | surf_usm_h%transmissivity(m) = building_pars_f%pars_xy(ind_trans,j,i) |
---|
4186 | |
---|
4187 | IF ( building_pars_f%pars_xy(ind_z0,j,i) /= building_pars_f%fill ) & |
---|
4188 | surf_usm_h%z0(m) = building_pars_f%pars_xy(ind_z0,j,i) |
---|
4189 | IF ( building_pars_f%pars_xy(ind_z0qh,j,i) /= building_pars_f%fill ) & |
---|
4190 | surf_usm_h%z0h(m) = building_pars_f%pars_xy(ind_z0qh,j,i) |
---|
4191 | IF ( building_pars_f%pars_xy(ind_z0qh,j,i) /= building_pars_f%fill ) & |
---|
4192 | surf_usm_h%z0q(m) = building_pars_f%pars_xy(ind_z0qh,j,i) |
---|
4193 | |
---|
4194 | IF ( building_pars_f%pars_xy(ind_alb_wall,j,i) /= building_pars_f%fill ) & |
---|
4195 | surf_usm_h%albedo_type(0,m) = building_pars_f%pars_xy(ind_alb_wall,j,i) |
---|
4196 | IF ( building_pars_f%pars_xy(ind_alb_green,j,i) /= building_pars_f%fill ) & |
---|
4197 | surf_usm_h%albedo_type(1,m) = building_pars_f%pars_xy(ind_alb_green,j,i) |
---|
4198 | IF ( building_pars_f%pars_xy(ind_alb_win,j,i) /= building_pars_f%fill ) & |
---|
4199 | surf_usm_h%albedo_type(2,m) = building_pars_f%pars_xy(ind_alb_win,j,i) |
---|
4200 | |
---|
4201 | IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill ) & |
---|
4202 | surf_usm_h%zw(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i) |
---|
4203 | IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill ) & |
---|
4204 | surf_usm_h%zw(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i) |
---|
4205 | IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill ) & |
---|
4206 | surf_usm_h%zw(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i) |
---|
4207 | IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill ) & |
---|
4208 | surf_usm_h%zw(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i) |
---|
4209 | IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill ) & |
---|
4210 | surf_usm_h%zw_green(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i) |
---|
4211 | IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill ) & |
---|
4212 | surf_usm_h%zw_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i) |
---|
4213 | IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill ) & |
---|
4214 | surf_usm_h%zw_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i) |
---|
4215 | IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill ) & |
---|
4216 | surf_usm_h%zw_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i) |
---|
4217 | IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill ) & |
---|
4218 | surf_usm_h%zw_window(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i) |
---|
4219 | IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill ) & |
---|
4220 | surf_usm_h%zw_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i) |
---|
4221 | IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill ) & |
---|
4222 | surf_usm_h%zw_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i) |
---|
4223 | IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill ) & |
---|
4224 | surf_usm_h%zw_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i) |
---|
4225 | |
---|
4226 | IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill ) & |
---|
4227 | surf_usm_h%c_surface(m) = building_pars_f%pars_xy(45,j,i) |
---|
4228 | IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill ) & |
---|
4229 | surf_usm_h%lambda_surf(m) = building_pars_f%pars_xy(46,j,i) |
---|
4230 | IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill ) & |
---|
4231 | surf_usm_h%c_surface_green(m) = building_pars_f%pars_xy(45,j,i) |
---|
4232 | IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill ) & |
---|
4233 | surf_usm_h%lambda_surf_green(m) = building_pars_f%pars_xy(46,j,i) |
---|
4234 | IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill ) & |
---|
4235 | surf_usm_h%c_surface_window(m) = building_pars_f%pars_xy(45,j,i) |
---|
4236 | IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill ) & |
---|
4237 | surf_usm_h%lambda_surf_window(m) = building_pars_f%pars_xy(46,j,i) |
---|
4238 | ENDDO |
---|
4239 | |
---|
4240 | |
---|
4241 | |
---|
4242 | DO l = 0, 3 |
---|
4243 | DO m = 1, surf_usm_v(l)%ns |
---|
4244 | i = surf_usm_v(l)%i(m) + surf_usm_v(l)%ioff |
---|
4245 | j = surf_usm_v(l)%j(m) + surf_usm_v(l)%joff |
---|
4246 | |
---|
4247 | ! |
---|
4248 | !-- In order to distinguish between ground floor level and |
---|
4249 | !-- above-ground-floor level surfaces, set input indices. |
---|
4250 | ind_wall_frac = MERGE( ind_wall_frac_gfl, ind_wall_frac_agfl, & |
---|
4251 | surf_usm_v(l)%ground_level(m) ) |
---|
4252 | ind_win_frac = MERGE( ind_win_frac_gfl, ind_win_frac_agfl, & |
---|
4253 | surf_usm_v(l)%ground_level(m) ) |
---|
4254 | ind_green_frac_w = MERGE( ind_green_frac_w_gfl, ind_green_frac_w_agfl, & |
---|
4255 | surf_usm_v(l)%ground_level(m) ) |
---|
4256 | ind_green_frac_r = MERGE( ind_green_frac_r_gfl, ind_green_frac_r_agfl, & |
---|
4257 | surf_usm_v(l)%ground_level(m) ) |
---|
4258 | ind_lai_r = MERGE( ind_lai_r_gfl, ind_lai_r_agfl, & |
---|
4259 | surf_usm_v(l)%ground_level(m) ) |
---|
4260 | ind_lai_w = MERGE( ind_lai_w_gfl, ind_lai_w_agfl, & |
---|
4261 | surf_usm_v(l)%ground_level(m) ) |
---|
4262 | ind_hc1 = MERGE( ind_hc1_gfl, ind_hc1_agfl, & |
---|
4263 | surf_usm_v(l)%ground_level(m) ) |
---|
4264 | ind_hc2 = MERGE( ind_hc2_gfl, ind_hc2_agfl, & |
---|
4265 | surf_usm_v(l)%ground_level(m) ) |
---|
4266 | ind_hc3 = MERGE( ind_hc3_gfl, ind_hc3_agfl, & |
---|
4267 | surf_usm_v(l)%ground_level(m) ) |
---|
4268 | ind_tc1 = MERGE( ind_tc1_gfl, ind_tc1_agfl, & |
---|
4269 | surf_usm_v(l)%ground_level(m) ) |
---|
4270 | ind_tc2 = MERGE( ind_tc2_gfl, ind_tc2_agfl, & |
---|
4271 | surf_usm_v(l)%ground_level(m) ) |
---|
4272 | ind_tc3 = MERGE( ind_tc3_gfl, ind_tc3_agfl, & |
---|
4273 | surf_usm_v(l)%ground_level(m) ) |
---|
4274 | ind_emis_wall = MERGE( ind_emis_wall_gfl, ind_emis_wall_agfl, & |
---|
4275 | surf_usm_v(l)%ground_level(m) ) |
---|
4276 | ind_emis_green = MERGE( ind_emis_green_gfl, ind_emis_green_agfl, & |
---|
4277 | surf_usm_v(l)%ground_level(m) ) |
---|
4278 | ind_emis_win = MERGE( ind_emis_win_gfl, ind_emis_win_agfl, & |
---|
4279 | surf_usm_v(l)%ground_level(m) ) |
---|
4280 | ind_trans = MERGE( ind_trans_gfl, ind_trans_agfl, & |
---|
4281 | surf_usm_v(l)%ground_level(m) ) |
---|
4282 | ind_z0 = MERGE( ind_z0_gfl, ind_z0_agfl, & |
---|
4283 | surf_usm_v(l)%ground_level(m) ) |
---|
4284 | ind_z0qh = MERGE( ind_z0qh_gfl, ind_z0qh_agfl, & |
---|
4285 | surf_usm_v(l)%ground_level(m) ) |
---|
4286 | |
---|
4287 | ! |
---|
4288 | !-- Initialize relatvie wall- (0), green- (1) and window (2) fractions |
---|
4289 | IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /= & |
---|
4290 | building_pars_f%fill ) & |
---|
4291 | surf_usm_v(l)%frac(0,m) = building_pars_f%pars_xy(ind_wall_frac,j,i) |
---|
4292 | IF ( building_pars_f%pars_xy(ind_green_frac_w,j,i) /= & |
---|
4293 | building_pars_f%fill ) & |
---|
4294 | surf_usm_v(l)%frac(1,m) = building_pars_f%pars_xy(ind_green_frac_w,j,i) |
---|
4295 | IF ( building_pars_f%pars_xy(ind_win_frac,j,i) /= & |
---|
4296 | building_pars_f%fill ) & |
---|
4297 | surf_usm_v(l)%frac(2,m) = building_pars_f%pars_xy(ind_win_frac,j,i) |
---|
4298 | |
---|
4299 | IF ( building_pars_f%pars_xy(ind_lai_w,j,i) /= building_pars_f%fill ) & |
---|
4300 | surf_usm_v(l)%lai(m) = building_pars_f%pars_xy(ind_lai_w,j,i) |
---|
4301 | |
---|
4302 | IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill ) & |
---|
4303 | THEN |
---|
4304 | surf_usm_v(l)%rho_c_wall(nzb_wall,m) = & |
---|
4305 | building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4306 | surf_usm_v(l)%rho_c_wall(nzb_wall+1,m) = & |
---|
4307 | building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4308 | ENDIF |
---|
4309 | IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill ) & |
---|
4310 | surf_usm_v(l)%rho_c_wall(nzb_wall+2,m) = & |
---|
4311 | building_pars_f%pars_xy(ind_hc2,j,i) |
---|
4312 | IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill ) & |
---|
4313 | surf_usm_v(l)%rho_c_wall(nzb_wall+3,m) = & |
---|
4314 | building_pars_f%pars_xy(ind_hc3,j,i) |
---|
4315 | IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill ) THEN |
---|
4316 | surf_usm_v(l)%rho_c_green(nzb_wall,m) = & |
---|
4317 | building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4318 | surf_usm_v(l)%rho_c_green(nzb_wall+1,m) = & |
---|
4319 | building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4320 | ENDIF |
---|
4321 | IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill ) & |
---|
4322 | surf_usm_v(l)%rho_c_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i) |
---|
4323 | IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill ) & |
---|
4324 | surf_usm_v(l)%rho_c_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i) |
---|
4325 | IF ( building_pars_f%pars_xy(ind_hc1,j,i) /= building_pars_f%fill ) THEN |
---|
4326 | surf_usm_v(l)%rho_c_window(nzb_wall,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4327 | surf_usm_v(l)%rho_c_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_hc1,j,i) |
---|
4328 | ENDIF |
---|
4329 | IF ( building_pars_f%pars_xy(ind_hc2,j,i) /= building_pars_f%fill ) & |
---|
4330 | surf_usm_v(l)%rho_c_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_hc2,j,i) |
---|
4331 | IF ( building_pars_f%pars_xy(ind_hc3,j,i) /= building_pars_f%fill ) & |
---|
4332 | surf_usm_v(l)%rho_c_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_hc3,j,i) |
---|
4333 | |
---|
4334 | IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill ) THEN |
---|
4335 | surf_usm_v(l)%lambda_h(nzb_wall,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4336 | surf_usm_v(l)%lambda_h(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4337 | ENDIF |
---|
4338 | IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill ) & |
---|
4339 | surf_usm_v(l)%lambda_h(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i) |
---|
4340 | IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill ) & |
---|
4341 | surf_usm_v(l)%lambda_h(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i) |
---|
4342 | IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill ) THEN |
---|
4343 | surf_usm_v(l)%lambda_h_green(nzb_wall,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4344 | surf_usm_v(l)%lambda_h_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4345 | ENDIF |
---|
4346 | IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill ) & |
---|
4347 | surf_usm_v(l)%lambda_h_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i) |
---|
4348 | IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill ) & |
---|
4349 | surf_usm_v(l)%lambda_h_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i) |
---|
4350 | IF ( building_pars_f%pars_xy(ind_tc1,j,i) /= building_pars_f%fill ) THEN |
---|
4351 | surf_usm_v(l)%lambda_h_window(nzb_wall,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4352 | surf_usm_v(l)%lambda_h_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_tc1,j,i) |
---|
4353 | ENDIF |
---|
4354 | IF ( building_pars_f%pars_xy(ind_tc2,j,i) /= building_pars_f%fill ) & |
---|
4355 | surf_usm_v(l)%lambda_h_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_tc2,j,i) |
---|
4356 | IF ( building_pars_f%pars_xy(ind_tc3,j,i) /= building_pars_f%fill ) & |
---|
4357 | surf_usm_v(l)%lambda_h_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_tc3,j,i) |
---|
4358 | |
---|
4359 | IF ( building_pars_f%pars_xy(12,j,i) /= building_pars_f%fill ) & |
---|
4360 | surf_usm_v(l)%target_temp_summer(m) = building_pars_f%pars_xy(12,j,i) |
---|
4361 | IF ( building_pars_f%pars_xy(13,j,i) /= building_pars_f%fill ) & |
---|
4362 | surf_usm_v(l)%target_temp_winter(m) = building_pars_f%pars_xy(13,j,i) |
---|
4363 | |
---|
4364 | IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /= building_pars_f%fill ) & |
---|
4365 | surf_usm_v(l)%emissivity(0,m) = building_pars_f%pars_xy(ind_emis_wall,j,i) |
---|
4366 | IF ( building_pars_f%pars_xy(ind_emis_green,j,i) /= building_pars_f%fill )& |
---|
4367 | surf_usm_v(l)%emissivity(1,m) = building_pars_f%pars_xy(ind_emis_green,j,i) |
---|
4368 | IF ( building_pars_f%pars_xy(ind_emis_win,j,i) /= building_pars_f%fill ) & |
---|
4369 | surf_usm_v(l)%emissivity(2,m) = building_pars_f%pars_xy(ind_emis_win,j,i) |
---|
4370 | |
---|
4371 | IF ( building_pars_f%pars_xy(ind_trans,j,i) /= building_pars_f%fill ) & |
---|
4372 | surf_usm_v(l)%transmissivity(m) = building_pars_f%pars_xy(ind_trans,j,i) |
---|
4373 | |
---|
4374 | IF ( building_pars_f%pars_xy(ind_z0,j,i) /= building_pars_f%fill ) & |
---|
4375 | surf_usm_v(l)%z0(m) = building_pars_f%pars_xy(ind_z0,j,i) |
---|
4376 | IF ( building_pars_f%pars_xy(ind_z0qh,j,i) /= building_pars_f%fill ) & |
---|
4377 | surf_usm_v(l)%z0h(m) = building_pars_f%pars_xy(ind_z0qh,j,i) |
---|
4378 | IF ( building_pars_f%pars_xy(ind_z0qh,j,i) /= building_pars_f%fill ) & |
---|
4379 | surf_usm_v(l)%z0q(m) = building_pars_f%pars_xy(ind_z0qh,j,i) |
---|
4380 | |
---|
4381 | IF ( building_pars_f%pars_xy(ind_alb_wall,j,i) /= building_pars_f%fill ) & |
---|
4382 | surf_usm_v(l)%albedo_type(0,m) = building_pars_f%pars_xy(ind_alb_wall,j,i) |
---|
4383 | IF ( building_pars_f%pars_xy(ind_alb_green,j,i) /= building_pars_f%fill ) & |
---|
4384 | surf_usm_v(l)%albedo_type(1,m) = building_pars_f%pars_xy(ind_alb_green,j,i) |
---|
4385 | IF ( building_pars_f%pars_xy(ind_alb_win,j,i) /= building_pars_f%fill ) & |
---|
4386 | surf_usm_v(l)%albedo_type(2,m) = building_pars_f%pars_xy(ind_alb_win,j,i) |
---|
4387 | |
---|
4388 | IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill ) & |
---|
4389 | surf_usm_v(l)%zw(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i) |
---|
4390 | IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill ) & |
---|
4391 | surf_usm_v(l)%zw(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i) |
---|
4392 | IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill ) & |
---|
4393 | surf_usm_v(l)%zw(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i) |
---|
4394 | IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill ) & |
---|
4395 | surf_usm_v(l)%zw(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i) |
---|
4396 | IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill ) & |
---|
4397 | surf_usm_v(l)%zw_green(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i) |
---|
4398 | IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill ) & |
---|
4399 | surf_usm_v(l)%zw_green(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i) |
---|
4400 | IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill ) & |
---|
4401 | surf_usm_v(l)%zw_green(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i) |
---|
4402 | IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill ) & |
---|
4403 | surf_usm_v(l)%zw_green(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i) |
---|
4404 | IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill ) & |
---|
4405 | surf_usm_v(l)%zw_window(nzb_wall,m) = building_pars_f%pars_xy(ind_thick_1,j,i) |
---|
4406 | IF ( building_pars_f%pars_xy(ind_thick_2,j,i) /= building_pars_f%fill ) & |
---|
4407 | surf_usm_v(l)%zw_window(nzb_wall+1,m) = building_pars_f%pars_xy(ind_thick_2,j,i) |
---|
4408 | IF ( building_pars_f%pars_xy(ind_thick_3,j,i) /= building_pars_f%fill ) & |
---|
4409 | surf_usm_v(l)%zw_window(nzb_wall+2,m) = building_pars_f%pars_xy(ind_thick_3,j,i) |
---|
4410 | IF ( building_pars_f%pars_xy(ind_thick_4,j,i) /= building_pars_f%fill ) & |
---|
4411 | surf_usm_v(l)%zw_window(nzb_wall+3,m) = building_pars_f%pars_xy(ind_thick_4,j,i) |
---|
4412 | |
---|
4413 | IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill ) & |
---|
4414 | surf_usm_v(l)%c_surface(m) = building_pars_f%pars_xy(45,j,i) |
---|
4415 | IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill ) & |
---|
4416 | surf_usm_v(l)%lambda_surf(m) = building_pars_f%pars_xy(46,j,i) |
---|
4417 | IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill ) & |
---|
4418 | surf_usm_v(l)%c_surface_green(m) = building_pars_f%pars_xy(45,j,i) |
---|
4419 | IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill ) & |
---|
4420 | surf_usm_v(l)%lambda_surf_green(m) = building_pars_f%pars_xy(46,j,i) |
---|
4421 | IF ( building_pars_f%pars_xy(45,j,i) /= building_pars_f%fill ) & |
---|
4422 | surf_usm_v(l)%c_surface_window(m) = building_pars_f%pars_xy(45,j,i) |
---|
4423 | IF ( building_pars_f%pars_xy(46,j,i) /= building_pars_f%fill ) & |
---|
4424 | surf_usm_v(l)%lambda_surf_window(m) = building_pars_f%pars_xy(46,j,i) |
---|
4425 | |
---|
4426 | ENDDO |
---|
4427 | ENDDO |
---|
4428 | ENDIF |
---|
4429 | ! |
---|
4430 | !-- Read the surface_types array. |
---|
4431 | !-- Please note, here also initialization of surface attributes is done as |
---|
4432 | !-- long as _urbsurf and _surfpar files are available. Values from above |
---|
4433 | !-- will be overwritten. This might be removed later, but is still in the |
---|
4434 | !-- code to enable compatibility with older model version. |
---|
4435 | CALL usm_read_urban_surface_types() |
---|
4436 | |
---|
4437 | !-- init material heat model |
---|
4438 | CALL usm_init_material_model() |
---|
4439 | |
---|
4440 | !-- init anthropogenic sources of heat |
---|
4441 | IF ( usm_anthropogenic_heat ) THEN |
---|
4442 | !-- init anthropogenic sources of heat (from transportation for now) |
---|
4443 | CALL usm_read_anthropogenic_heat() |
---|
4444 | ENDIF |
---|
4445 | |
---|
4446 | IF ( plant_canopy ) THEN |
---|
4447 | |
---|
4448 | IF ( .NOT. ALLOCATED( pc_heating_rate) ) THEN |
---|
4449 | !-- then pc_heating_rate is allocated in init_plant_canopy |
---|
4450 | !-- in case of cthf /= 0 => we need to allocate it for our use here |
---|
4451 | ALLOCATE( pc_heating_rate(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) |
---|
4452 | ENDIF |
---|
4453 | ENDIF |
---|
4454 | |
---|
4455 | !-- Intitialization of the surface and wall/ground/roof temperature |
---|
4456 | |
---|
4457 | !-- Initialization for restart runs |
---|
4458 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & |
---|
4459 | TRIM( initializing_actions ) /= 'cyclic_fill' ) THEN |
---|
4460 | |
---|
4461 | !-- Calculate initial surface temperature from pt of adjacent gridbox |
---|
4462 | exn = ( surface_pressure / 1000.0_wp )**0.286_wp |
---|
4463 | |
---|
4464 | ! |
---|
4465 | !-- At horizontal surfaces. Please note, t_surf_h is defined on a |
---|
4466 | !-- different data type, but with the same dimension. |
---|
4467 | #if ! defined( __nopointer ) |
---|
4468 | DO m = 1, surf_usm_h%ns |
---|
4469 | i = surf_usm_h%i(m) |
---|
4470 | j = surf_usm_h%j(m) |
---|
4471 | k = surf_usm_h%k(m) |
---|
4472 | |
---|
4473 | t_surf_h(m) = pt(k,j,i) * exn |
---|
4474 | t_surf_window_h(m) = pt(k,j,i) * exn |
---|
4475 | t_surf_green_h(m) = pt(k,j,i) * exn |
---|
4476 | t_surf_whole_h(m) = pt(k,j,i) * exn |
---|
4477 | ENDDO |
---|
4478 | ! |
---|
4479 | !-- At vertical surfaces. |
---|
4480 | DO l = 0, 3 |
---|
4481 | DO m = 1, surf_usm_v(l)%ns |
---|
4482 | i = surf_usm_v(l)%i(m) |
---|
4483 | j = surf_usm_v(l)%j(m) |
---|
4484 | k = surf_usm_v(l)%k(m) |
---|
4485 | |
---|
4486 | t_surf_v(l)%t(m) = pt(k,j,i) * exn |
---|
4487 | t_surf_window_v(l)%t(m) = pt(k,j,i) * exn |
---|
4488 | t_surf_green_v(l)%t(m) = pt(k,j,i) * exn |
---|
4489 | t_surf_whole_v(l)%t(m) = pt(k,j,i) * exn |
---|
4490 | ENDDO |
---|
4491 | ENDDO |
---|
4492 | #endif |
---|
4493 | |
---|
4494 | !-- initial values for t_wall |
---|
4495 | !-- outer value is set to surface temperature |
---|
4496 | !-- inner value is set to wall_inner_temperature |
---|
4497 | !-- and profile is logaritmic (linear in nz). |
---|
4498 | !-- Horizontal surfaces |
---|
4499 | DO m = 1, surf_usm_h%ns |
---|
4500 | ! |
---|
4501 | !-- Roof |
---|
4502 | IF ( surf_usm_h%isroof_surf(m) ) THEN |
---|
4503 | tin = roof_inner_temperature |
---|
4504 | twin = window_inner_temperature |
---|
4505 | ! |
---|
4506 | !-- Normal land surface |
---|
4507 | ELSE |
---|
4508 | tin = soil_inner_temperature |
---|
4509 | twin = window_inner_temperature |
---|
4510 | ENDIF |
---|
4511 | |
---|
4512 | DO k = nzb_wall, nzt_wall+1 |
---|
4513 | c = REAL( k - nzb_wall, wp ) / & |
---|
4514 | REAL( nzt_wall + 1 - nzb_wall , wp ) |
---|
4515 | |
---|
4516 | t_wall_h(k,m) = ( 1.0_wp - c ) * t_surf_h(m) + c * tin |
---|
4517 | t_window_h(k,m) = ( 1.0_wp - c ) * t_surf_window_h(m) + c * twin |
---|
4518 | t_green_h(k,m) = t_surf_h(m) |
---|
4519 | ENDDO |
---|
4520 | ENDDO |
---|
4521 | ! |
---|
4522 | !-- Vertical surfaces |
---|
4523 | DO l = 0, 3 |
---|
4524 | DO m = 1, surf_usm_v(l)%ns |
---|
4525 | ! |
---|
4526 | !-- Inner wall |
---|
4527 | tin = wall_inner_temperature |
---|
4528 | twin = window_inner_temperature |
---|
4529 | |
---|
4530 | DO k = nzb_wall, nzt_wall+1 |
---|
4531 | c = REAL( k - nzb_wall, wp ) / & |
---|
4532 | REAL( nzt_wall + 1 - nzb_wall , wp ) |
---|
4533 | t_wall_v(l)%t(k,m) = ( 1.0_wp - c ) * t_surf_v(l)%t(m) + c * tin |
---|
4534 | t_window_v(l)%t(k,m) = ( 1.0_wp - c ) * t_surf_window_v(l)%t(m) + c * twin |
---|
4535 | t_green_v(l)%t(k,m) = t_surf_v(l)%t(m) |
---|
4536 | ENDDO |
---|
4537 | ENDDO |
---|
4538 | ENDDO |
---|
4539 | |
---|
4540 | ENDIF |
---|
4541 | |
---|
4542 | !-- |
---|
4543 | !-- Possibly DO user-defined actions (e.g. define heterogeneous wall surface) |
---|
4544 | CALL user_init_urban_surface |
---|
4545 | |
---|
4546 | !-- initialize prognostic values for the first timestep |
---|
4547 | t_surf_h_p = t_surf_h |
---|
4548 | t_surf_v_p = t_surf_v |
---|
4549 | t_surf_window_h_p = t_surf_window_h |
---|
4550 | t_surf_window_v_p = t_surf_window_v |
---|
4551 | t_surf_whole_h_p = t_surf_whole_h |
---|
4552 | t_surf_whole_v_p = t_surf_whole_v |
---|
4553 | t_surf_green_h_p = t_surf_green_h |
---|
4554 | t_surf_green_v_p = t_surf_green_v |
---|
4555 | t_surf_10cm_h_p = t_surf_10cm_h |
---|
4556 | t_surf_10cm_v_p = t_surf_10cm_v |
---|
4557 | |
---|
4558 | t_wall_h_p = t_wall_h |
---|
4559 | t_wall_v_p = t_wall_v |
---|
4560 | t_window_h_p = t_window_h |
---|
4561 | t_window_v_p = t_window_v |
---|
4562 | t_green_h_p = t_green_h |
---|
4563 | t_green_v_p = t_green_v |
---|
4564 | |
---|
4565 | CALL cpu_log( log_point_s(78), 'usm_init', 'stop' ) |
---|
4566 | |
---|
4567 | END SUBROUTINE usm_init_urban_surface |
---|
4568 | |
---|
4569 | |
---|
4570 | !------------------------------------------------------------------------------! |
---|
4571 | ! Description: |
---|
4572 | ! ------------ |
---|
4573 | ! |
---|
4574 | !> Wall model as part of the urban surface model. The model predicts wall |
---|
4575 | !> temperature. |
---|
4576 | !------------------------------------------------------------------------------! |
---|
4577 | SUBROUTINE usm_material_heat_model |
---|
4578 | |
---|
4579 | |
---|
4580 | IMPLICIT NONE |
---|
4581 | |
---|
4582 | INTEGER(iwp) :: i,j,k,l,kw, m !< running indices |
---|
4583 | |
---|
4584 | REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: wtend, wintend !< tendency |
---|
4585 | |
---|
4586 | ! |
---|
4587 | !-- For horizontal surfaces |
---|
4588 | DO m = 1, surf_usm_h%ns |
---|
4589 | ! |
---|
4590 | !-- Obtain indices |
---|
4591 | i = surf_usm_h%i(m) |
---|
4592 | j = surf_usm_h%j(m) |
---|
4593 | k = surf_usm_h%k(m) |
---|
4594 | ! |
---|
4595 | !-- prognostic equation for ground/roof temperature t_wall_h |
---|
4596 | wtend(:) = 0.0_wp |
---|
4597 | wtend(nzb_wall) = (1.0_wp / surf_usm_h%rho_c_wall(nzb_wall,m)) * & |
---|
4598 | ( surf_usm_h%lambda_h(nzb_wall,m) * & |
---|
4599 | ( t_wall_h(nzb_wall+1,m) & |
---|
4600 | - t_wall_h(nzb_wall,m) ) * & |
---|
4601 | surf_usm_h%ddz_wall(nzb_wall+1,m) & |
---|
4602 | + surf_usm_h%frac(0,m) & |
---|
4603 | / (surf_usm_h%frac(0,m) & |
---|
4604 | + surf_usm_h%frac(1,m) ) & |
---|
4605 | * surf_usm_h%wghf_eb(m) & |
---|
4606 | - surf_usm_h%frac(1,m) & |
---|
4607 | / (surf_usm_h%frac(0,m) & |
---|
4608 | + surf_usm_h%frac(1,m) ) & |
---|
4609 | * ( surf_usm_h%lambda_h_green(nzt_wall,m) & |
---|
4610 | * surf_usm_h%ddz_green(nzt_wall,m) & |
---|
4611 | + surf_usm_h%lambda_h(nzb_wall,m) & |
---|
4612 | * surf_usm_h%ddz_wall(nzb_wall,m) ) & |
---|
4613 | / ( surf_usm_h%ddz_green(nzt_wall,m) & |
---|
4614 | + surf_usm_h%ddz_wall(nzb_wall,m) ) & |
---|
4615 | * ( t_wall_h(nzb_wall,m) & |
---|
4616 | - t_green_h(nzt_wall,m) ) ) * & |
---|
4617 | surf_usm_h%ddz_wall_stag(nzb_wall,m) |
---|
4618 | |
---|
4619 | !dummy value for testing |
---|
4620 | surf_usm_h%iwghf_eb(m) = 0. |
---|
4621 | |
---|
4622 | IF ( indoor_model ) then |
---|
4623 | DO kw = nzb_wall+1, nzt_wall-1 |
---|
4624 | wtend(kw) = (1.0_wp / surf_usm_h%rho_c_wall(kw,m)) & |
---|
4625 | * ( surf_usm_h%lambda_h(kw,m) & |
---|
4626 | * ( t_wall_h(kw+1,m) - t_wall_h(kw,m) ) & |
---|
4627 | * surf_usm_h%ddz_wall(kw+1,m) & |
---|
4628 | - surf_usm_h%lambda_h(kw-1,m) & |
---|
4629 | * ( t_wall_h(kw,m) - t_wall_h(kw-1,m) ) & |
---|
4630 | * surf_usm_h%ddz_wall(kw,m) & |
---|
4631 | ) * surf_usm_h%ddz_wall_stag(kw,m) |
---|
4632 | ENDDO |
---|
4633 | wtend(nzt_wall) = (1.0_wp / surf_usm_h%rho_c_wall(nzt_wall,m)) * & |
---|
4634 | ( surf_usm_h%lambda_h(nzt_wall-1,m) * & |
---|
4635 | ( t_wall_h(nzt_wall,m) & |
---|
4636 | - t_wall_h(nzt_wall-1,m) ) * & |
---|
4637 | surf_usm_h%ddz_wall(nzt_wall,m) & |
---|
4638 | + surf_usm_h%iwghf_eb(m) ) * & |
---|
4639 | surf_usm_h%ddz_wall_stag(nzt_wall,m) |
---|
4640 | ELSE |
---|
4641 | DO kw = nzb_wall+1, nzt_wall |
---|
4642 | wtend(kw) = (1.0_wp / surf_usm_h%rho_c_wall(kw,m)) & |
---|
4643 | * ( surf_usm_h%lambda_h(kw,m) & |
---|
4644 | * ( t_wall_h(kw+1,m) - t_wall_h(kw,m) ) & |
---|
4645 | * surf_usm_h%ddz_wall(kw+1,m) & |
---|
4646 | - surf_usm_h%lambda_h(kw-1,m) & |
---|
4647 | * ( t_wall_h(kw,m) - t_wall_h(kw-1,m) ) & |
---|
4648 | * surf_usm_h%ddz_wall(kw,m) & |
---|
4649 | ) * surf_usm_h%ddz_wall_stag(kw,m) |
---|
4650 | ENDDO |
---|
4651 | ENDIF |
---|
4652 | |
---|
4653 | t_wall_h_p(nzb_wall:nzt_wall,m) = t_wall_h(nzb_wall:nzt_wall,m) & |
---|
4654 | + dt_3d * ( tsc(2) & |
---|
4655 | * wtend(nzb_wall:nzt_wall) + tsc(3) & |
---|
4656 | * surf_usm_h%tt_wall_m(nzb_wall:nzt_wall,m) ) |
---|
4657 | |
---|
4658 | !-- prognostic equation for ground/roof window temperature t_window_h |
---|
4659 | wintend(:) = 0.0_wp |
---|
4660 | wintend(nzb_wall) = (1.0_wp / surf_usm_h%rho_c_window(nzb_wall,m)) * & |
---|
4661 | ( surf_usm_h%lambda_h_window(nzb_wall,m) * & |
---|
4662 | ( t_window_h(nzb_wall+1,m) & |
---|
4663 | - t_window_h(nzb_wall,m) ) * & |
---|
4664 | surf_usm_h%ddz_window(nzb_wall+1,m) & |
---|
4665 | + surf_usm_h%wghf_eb_window(m) & |
---|
4666 | + surf_usm_h%rad_sw_in(m) & |
---|
4667 | * (1.0_wp - exp(-surf_usm_h%transmissivity(m) & |
---|
4668 | * surf_usm_h%zw_window(nzb_wall,m) ) ) & |
---|
4669 | ) * surf_usm_h%ddz_window_stag(nzb_wall,m) |
---|
4670 | |
---|
4671 | IF ( indoor_model ) then |
---|
4672 | DO kw = nzb_wall+1, nzt_wall-1 |
---|
4673 | wintend(kw) = (1.0_wp / surf_usm_h%rho_c_window(kw,m)) & |
---|
4674 | * ( surf_usm_h%lambda_h_window(kw,m) & |
---|
4675 | * ( t_window_h(kw+1,m) - t_window_h(kw,m) ) & |
---|
4676 | * surf_usm_h%ddz_window(kw+1,m) & |
---|
4677 | - surf_usm_h%lambda_h_window(kw-1,m) & |
---|
4678 | * ( t_window_h(kw,m) - t_window_h(kw-1,m) ) & |
---|
4679 | * surf_usm_h%ddz_window(kw,m) & |
---|
4680 | + surf_usm_h%rad_sw_in(m) & |
---|
4681 | * (exp(-surf_usm_h%transmissivity(m) & |
---|
4682 | * surf_usm_h%zw_window(kw-1,m) ) & |
---|
4683 | - exp(-surf_usm_h%transmissivity(m) & |
---|
4684 | * surf_usm_h%zw_window(kw,m) ) ) & |
---|
4685 | ) * surf_usm_h%ddz_window_stag(kw,m) |
---|
4686 | |
---|
4687 | ENDDO |
---|
4688 | wintend(nzt_wall) = (1.0_wp / surf_usm_h%rho_c_window(nzt_wall,m)) * & |
---|
4689 | ( surf_usm_h%lambda_h_window(nzt_wall-1,m) * & |
---|
4690 | ( t_window_h(nzt_wall,m) & |
---|
4691 | - t_window_h(nzt_wall-1,m) ) * & |
---|
4692 | surf_usm_h%ddz_window(nzt_wall,m) & |
---|
4693 | + surf_usm_h%iwghf_eb_window(m) & |
---|
4694 | + surf_usm_h%rad_sw_in(m) & |
---|
4695 | * (1.0_wp - exp(-surf_usm_h%transmissivity(m) & |
---|
4696 | * surf_usm_h%zw_window(nzt_wall,m) ) ) & |
---|
4697 | ) * surf_usm_h%ddz_window_stag(nzt_wall,m) |
---|
4698 | ELSE |
---|
4699 | DO kw = nzb_wall+1, nzt_wall |
---|
4700 | wintend(kw) = (1.0_wp / surf_usm_h%rho_c_window(kw,m)) & |
---|
4701 | * ( surf_usm_h%lambda_h_window(kw,m) & |
---|
4702 | * ( t_window_h(kw+1,m) - t_window_h(kw,m) ) & |
---|
4703 | * surf_usm_h%ddz_window(kw+1,m) & |
---|
4704 | - surf_usm_h%lambda_h_window(kw-1,m) & |
---|
4705 | * ( t_window_h(kw,m) - t_window_h(kw-1,m) ) & |
---|
4706 | * surf_usm_h%ddz_window(kw,m) & |
---|
4707 | + surf_usm_h%rad_sw_in(m) & |
---|
4708 | * (exp(-surf_usm_h%transmissivity(m) & |
---|
4709 | * surf_usm_h%zw_window(kw-1,m) ) & |
---|
4710 | - exp(-surf_usm_h%transmissivity(m) & |
---|
4711 | * surf_usm_h%zw_window(kw,m) ) ) & |
---|
4712 | ) * surf_usm_h%ddz_window_stag(kw,m) |
---|
4713 | |
---|
4714 | ENDDO |
---|
4715 | ENDIF |
---|
4716 | |
---|
4717 | t_window_h_p(nzb_wall:nzt_wall,m) = t_window_h(nzb_wall:nzt_wall,m) & |
---|
4718 | + dt_3d * ( tsc(2) & |
---|
4719 | * wintend(nzb_wall:nzt_wall) + tsc(3) & |
---|
4720 | * surf_usm_h%tt_window_m(nzb_wall:nzt_wall,m) ) |
---|
4721 | |
---|
4722 | ! |
---|
4723 | !-- calculate t_wall tendencies for the next Runge-Kutta step |
---|
4724 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
4725 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
4726 | DO kw = nzb_wall, nzt_wall |
---|
4727 | surf_usm_h%tt_wall_m(kw,m) = wtend(kw) |
---|
4728 | ENDDO |
---|
4729 | ELSEIF ( intermediate_timestep_count < & |
---|
4730 | intermediate_timestep_count_max ) THEN |
---|
4731 | DO kw = nzb_wall, nzt_wall |
---|
4732 | surf_usm_h%tt_wall_m(kw,m) = -9.5625_wp * wtend(kw) + & |
---|
4733 | 5.3125_wp * surf_usm_h%tt_wall_m(kw,m) |
---|
4734 | ENDDO |
---|
4735 | ENDIF |
---|
4736 | ENDIF |
---|
4737 | |
---|
4738 | !-- calculate t_window tendencies for the next Runge-Kutta step |
---|
4739 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
4740 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
4741 | DO kw = nzb_wall, nzt_wall |
---|
4742 | surf_usm_h%tt_window_m(kw,m) = wintend(kw) |
---|
4743 | ENDDO |
---|
4744 | ELSEIF ( intermediate_timestep_count < & |
---|
4745 | intermediate_timestep_count_max ) THEN |
---|
4746 | DO kw = nzb_wall, nzt_wall |
---|
4747 | surf_usm_h%tt_window_m(kw,m) = -9.5625_wp * wintend(kw) + & |
---|
4748 | 5.3125_wp * surf_usm_h%tt_window_m(kw,m) |
---|
4749 | ENDDO |
---|
4750 | ENDIF |
---|
4751 | ENDIF |
---|
4752 | ENDDO |
---|
4753 | |
---|
4754 | ! |
---|
4755 | !-- For vertical surfaces |
---|
4756 | DO l = 0, 3 |
---|
4757 | DO m = 1, surf_usm_v(l)%ns |
---|
4758 | ! |
---|
4759 | !-- Obtain indices |
---|
4760 | i = surf_usm_v(l)%i(m) |
---|
4761 | j = surf_usm_v(l)%j(m) |
---|
4762 | k = surf_usm_v(l)%k(m) |
---|
4763 | ! |
---|
4764 | !-- prognostic equation for wall temperature t_wall_v |
---|
4765 | wtend(:) = 0.0_wp |
---|
4766 | |
---|
4767 | wtend(nzb_wall) = (1.0_wp / surf_usm_v(l)%rho_c_wall(nzb_wall,m)) * & |
---|
4768 | ( surf_usm_v(l)%lambda_h(nzb_wall,m) * & |
---|
4769 | ( t_wall_v(l)%t(nzb_wall+1,m) & |
---|
4770 | - t_wall_v(l)%t(nzb_wall,m) ) * & |
---|
4771 | surf_usm_v(l)%ddz_wall(nzb_wall+1,m) & |
---|
4772 | + surf_usm_v(l)%frac(0,m) & |
---|
4773 | / (surf_usm_v(l)%frac(0,m) & |
---|
4774 | + surf_usm_v(l)%frac(1,m) ) & |
---|
4775 | * surf_usm_v(l)%wghf_eb(m) & |
---|
4776 | - surf_usm_v(l)%frac(1,m) & |
---|
4777 | / (surf_usm_v(l)%frac(0,m) & |
---|
4778 | + surf_usm_v(l)%frac(1,m) ) & |
---|
4779 | * ( surf_usm_v(l)%lambda_h_green(nzt_wall,m) & |
---|
4780 | * surf_usm_v(l)%ddz_green(nzt_wall,m) & |
---|
4781 | + surf_usm_v(l)%lambda_h(nzb_wall,m) & |
---|
4782 | * surf_usm_v(l)%ddz_wall(nzb_wall,m) ) & |
---|
4783 | / ( surf_usm_v(l)%ddz_green(nzt_wall,m) & |
---|
4784 | + surf_usm_v(l)%ddz_wall(nzb_wall,m) ) & |
---|
4785 | * ( t_wall_v(l)%t(nzb_wall,m) & |
---|
4786 | - t_green_v(l)%t(nzt_wall,m) ) ) * & |
---|
4787 | surf_usm_v(l)%ddz_wall_stag(nzb_wall,m) |
---|
4788 | |
---|
4789 | !dummy value for testing |
---|
4790 | surf_usm_v(l)%iwghf_eb(m) = 0. |
---|
4791 | |
---|
4792 | IF ( indoor_model ) then |
---|
4793 | DO kw = nzb_wall+1, nzt_wall-1 |
---|
4794 | wtend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_wall(kw,m)) & |
---|
4795 | * ( surf_usm_v(l)%lambda_h(kw,m) & |
---|
4796 | * ( t_wall_v(l)%t(kw+1,m) - t_wall_v(l)%t(kw,m) )& |
---|
4797 | * surf_usm_v(l)%ddz_wall(kw+1,m) & |
---|
4798 | - surf_usm_v(l)%lambda_h(kw-1,m) & |
---|
4799 | * ( t_wall_v(l)%t(kw,m) - t_wall_v(l)%t(kw-1,m) )& |
---|
4800 | * surf_usm_v(l)%ddz_wall(kw,m) & |
---|
4801 | ) * surf_usm_v(l)%ddz_wall_stag(kw,m) |
---|
4802 | ENDDO |
---|
4803 | wtend(nzt_wall) = (1.0_wp / surf_usm_v(l)%rho_c_wall(nzt_wall,m)) * & |
---|
4804 | ( surf_usm_v(l)%lambda_h(nzt_wall-1,m) * & |
---|
4805 | ( t_wall_v(l)%t(nzt_wall,m) & |
---|
4806 | - t_wall_v(l)%t(nzt_wall-1,m) ) * & |
---|
4807 | surf_usm_v(l)%ddz_wall(nzt_wall,m) & |
---|
4808 | + surf_usm_v(l)%iwghf_eb(m) ) * & |
---|
4809 | surf_usm_v(l)%ddz_wall_stag(nzt_wall,m) |
---|
4810 | ELSE |
---|
4811 | DO kw = nzb_wall+1, nzt_wall |
---|
4812 | wtend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_wall(kw,m)) & |
---|
4813 | * ( surf_usm_v(l)%lambda_h(kw,m) & |
---|
4814 | * ( t_wall_v(l)%t(kw+1,m) - t_wall_v(l)%t(kw,m) )& |
---|
4815 | * surf_usm_v(l)%ddz_wall(kw+1,m) & |
---|
4816 | - surf_usm_v(l)%lambda_h(kw-1,m) & |
---|
4817 | * ( t_wall_v(l)%t(kw,m) - t_wall_v(l)%t(kw-1,m) )& |
---|
4818 | * surf_usm_v(l)%ddz_wall(kw,m) & |
---|
4819 | ) * surf_usm_v(l)%ddz_wall_stag(kw,m) |
---|
4820 | ENDDO |
---|
4821 | ENDIF |
---|
4822 | |
---|
4823 | t_wall_v_p(l)%t(nzb_wall:nzt_wall,m) = & |
---|
4824 | t_wall_v(l)%t(nzb_wall:nzt_wall,m) & |
---|
4825 | + dt_3d * ( tsc(2) & |
---|
4826 | * wtend(nzb_wall:nzt_wall) + tsc(3) & |
---|
4827 | * surf_usm_v(l)%tt_wall_m(nzb_wall:nzt_wall,m) ) |
---|
4828 | |
---|
4829 | !-- prognostic equation for window temperature t_window_v |
---|
4830 | wintend(:) = 0.0_wp |
---|
4831 | wintend(nzb_wall) = (1.0_wp / surf_usm_v(l)%rho_c_window(nzb_wall,m)) * & |
---|
4832 | ( surf_usm_v(l)%lambda_h_window(nzb_wall,m) * & |
---|
4833 | ( t_window_v(l)%t(nzb_wall+1,m) & |
---|
4834 | - t_window_v(l)%t(nzb_wall,m) ) * & |
---|
4835 | surf_usm_v(l)%ddz_window(nzb_wall+1,m) & |
---|
4836 | + surf_usm_v(l)%wghf_eb_window(m) & |
---|
4837 | + surf_usm_v(l)%rad_sw_in(m) & |
---|
4838 | * (1.0_wp - exp(-surf_usm_v(l)%transmissivity(m) & |
---|
4839 | * surf_usm_v(l)%zw_window(nzb_wall,m) ) ) & |
---|
4840 | ) * surf_usm_v(l)%ddz_window_stag(nzb_wall,m) |
---|
4841 | |
---|
4842 | IF ( indoor_model ) then |
---|
4843 | DO kw = nzb_wall+1, nzt_wall -1 |
---|
4844 | wintend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_window(kw,m)) & |
---|
4845 | * ( surf_usm_v(l)%lambda_h_window(kw,m) & |
---|
4846 | * ( t_window_v(l)%t(kw+1,m) - t_window_v(l)%t(kw,m) ) & |
---|
4847 | * surf_usm_v(l)%ddz_window(kw+1,m) & |
---|
4848 | - surf_usm_v(l)%lambda_h_window(kw-1,m) & |
---|
4849 | * ( t_window_v(l)%t(kw,m) - t_window_v(l)%t(kw-1,m) ) & |
---|
4850 | * surf_usm_v(l)%ddz_window(kw,m) & |
---|
4851 | + surf_usm_v(l)%rad_sw_in(m) & |
---|
4852 | * (exp(-surf_usm_v(l)%transmissivity(m) & |
---|
4853 | * surf_usm_v(l)%zw_window(kw-1,m) ) & |
---|
4854 | - exp(-surf_usm_v(l)%transmissivity(m) & |
---|
4855 | * surf_usm_v(l)%zw_window(kw,m) ) ) & |
---|
4856 | ) * surf_usm_v(l)%ddz_window_stag(kw,m) |
---|
4857 | ENDDO |
---|
4858 | wintend(nzt_wall) = (1.0_wp / surf_usm_v(l)%rho_c_window(nzt_wall,m)) * & |
---|
4859 | ( surf_usm_v(l)%lambda_h_window(nzt_wall-1,m) * & |
---|
4860 | ( t_window_v(l)%t(nzt_wall,m) & |
---|
4861 | - t_window_v(l)%t(nzt_wall-1,m) ) * & |
---|
4862 | surf_usm_v(l)%ddz_window(nzt_wall,m) & |
---|
4863 | + surf_usm_v(l)%iwghf_eb_window(m) & |
---|
4864 | + surf_usm_v(l)%rad_sw_in(m) & |
---|
4865 | * (1.0_wp - exp(-surf_usm_v(l)%transmissivity(m) & |
---|
4866 | * surf_usm_v(l)%zw_window(nzt_wall,m) ) ) & |
---|
4867 | ) * surf_usm_v(l)%ddz_window_stag(nzt_wall,m) |
---|
4868 | ELSE |
---|
4869 | DO kw = nzb_wall+1, nzt_wall |
---|
4870 | wintend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_window(kw,m)) & |
---|
4871 | * ( surf_usm_v(l)%lambda_h_window(kw,m) & |
---|
4872 | * ( t_window_v(l)%t(kw+1,m) - t_window_v(l)%t(kw,m) ) & |
---|
4873 | * surf_usm_v(l)%ddz_window(kw+1,m) & |
---|
4874 | - surf_usm_v(l)%lambda_h_window(kw-1,m) & |
---|
4875 | * ( t_window_v(l)%t(kw,m) - t_window_v(l)%t(kw-1,m) ) & |
---|
4876 | * surf_usm_v(l)%ddz_window(kw,m) & |
---|
4877 | + surf_usm_v(l)%rad_sw_in(m) & |
---|
4878 | * (exp(-surf_usm_v(l)%transmissivity(m) & |
---|
4879 | * surf_usm_v(l)%zw_window(kw-1,m) ) & |
---|
4880 | - exp(-surf_usm_v(l)%transmissivity(m) & |
---|
4881 | * surf_usm_v(l)%zw_window(kw,m) ) ) & |
---|
4882 | ) * surf_usm_v(l)%ddz_window_stag(kw,m) |
---|
4883 | ENDDO |
---|
4884 | ENDIF |
---|
4885 | |
---|
4886 | t_window_v_p(l)%t(nzb_wall:nzt_wall,m) = & |
---|
4887 | t_window_v(l)%t(nzb_wall:nzt_wall,m) & |
---|
4888 | + dt_3d * ( tsc(2) & |
---|
4889 | * wintend(nzb_wall:nzt_wall) + tsc(3) & |
---|
4890 | * surf_usm_v(l)%tt_window_m(nzb_wall:nzt_wall,m) ) |
---|
4891 | |
---|
4892 | ! |
---|
4893 | !-- calculate t_wall tendencies for the next Runge-Kutta step |
---|
4894 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
4895 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
4896 | DO kw = nzb_wall, nzt_wall |
---|
4897 | surf_usm_v(l)%tt_wall_m(kw,m) = wtend(kw) |
---|
4898 | ENDDO |
---|
4899 | ELSEIF ( intermediate_timestep_count < & |
---|
4900 | intermediate_timestep_count_max ) THEN |
---|
4901 | DO kw = nzb_wall, nzt_wall |
---|
4902 | surf_usm_v(l)%tt_wall_m(kw,m) = & |
---|
4903 | - 9.5625_wp * wtend(kw) + & |
---|
4904 | 5.3125_wp * surf_usm_v(l)%tt_wall_m(kw,m) |
---|
4905 | ENDDO |
---|
4906 | ENDIF |
---|
4907 | ENDIF |
---|
4908 | !-- calculate t_window tendencies for the next Runge-Kutta step |
---|
4909 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
4910 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
4911 | DO kw = nzb_wall, nzt_wall |
---|
4912 | surf_usm_v(l)%tt_window_m(kw,m) = wintend(kw) |
---|
4913 | ENDDO |
---|
4914 | ELSEIF ( intermediate_timestep_count < & |
---|
4915 | intermediate_timestep_count_max ) THEN |
---|
4916 | DO kw = nzb_wall, nzt_wall |
---|
4917 | surf_usm_v(l)%tt_window_m(kw,m) = & |
---|
4918 | - 9.5625_wp * wintend(kw) + & |
---|
4919 | 5.3125_wp * surf_usm_v(l)%tt_window_m(kw,m) |
---|
4920 | ENDDO |
---|
4921 | ENDIF |
---|
4922 | ENDIF |
---|
4923 | ENDDO |
---|
4924 | ENDDO |
---|
4925 | |
---|
4926 | END SUBROUTINE usm_material_heat_model |
---|
4927 | |
---|
4928 | !------------------------------------------------------------------------------! |
---|
4929 | ! Description: |
---|
4930 | ! ------------ |
---|
4931 | ! |
---|
4932 | !> Green and substrate model as part of the urban surface model. The model predicts ground |
---|
4933 | !> temperatures. |
---|
4934 | !------------------------------------------------------------------------------! |
---|
4935 | SUBROUTINE usm_green_heat_model |
---|
4936 | |
---|
4937 | |
---|
4938 | IMPLICIT NONE |
---|
4939 | |
---|
4940 | INTEGER(iwp) :: i,j,k,l,kw, m !< running indices |
---|
4941 | |
---|
4942 | REAL(wp), DIMENSION(nzb_wall:nzt_wall) :: gtend !< tendency |
---|
4943 | |
---|
4944 | ! |
---|
4945 | !-- For horizontal surfaces |
---|
4946 | DO m = 1, surf_usm_h%ns |
---|
4947 | ! |
---|
4948 | !-- Obtain indices |
---|
4949 | i = surf_usm_h%i(m) |
---|
4950 | j = surf_usm_h%j(m) |
---|
4951 | k = surf_usm_h%k(m) |
---|
4952 | |
---|
4953 | t_green_h(nzt_wall+1,m) = t_wall_h(nzb_wall,m) |
---|
4954 | ! |
---|
4955 | !-- prognostic equation for ground/roof temperature t_green_h |
---|
4956 | gtend(:) = 0.0_wp |
---|
4957 | gtend(nzb_wall) = (1.0_wp / surf_usm_h%rho_c_green(nzb_wall,m)) * & |
---|
4958 | ( surf_usm_h%lambda_h_green(nzb_wall,m) * & |
---|
4959 | ( t_green_h(nzb_wall+1,m) & |
---|
4960 | - t_green_h(nzb_wall,m) ) * & |
---|
4961 | surf_usm_h%ddz_green(nzb_wall+1,m) & |
---|
4962 | + surf_usm_h%wghf_eb_green(m) ) * & |
---|
4963 | surf_usm_h%ddz_green_stag(nzb_wall,m) |
---|
4964 | |
---|
4965 | DO kw = nzb_wall+1, nzt_wall |
---|
4966 | gtend(kw) = (1.0_wp / surf_usm_h%rho_c_green(kw,m)) & |
---|
4967 | * ( surf_usm_h%lambda_h_green(kw,m) & |
---|
4968 | * ( t_green_h(kw+1,m) - t_green_h(kw,m) ) & |
---|
4969 | * surf_usm_h%ddz_green(kw+1,m) & |
---|
4970 | - surf_usm_h%lambda_h_green(kw-1,m) & |
---|
4971 | * ( t_green_h(kw,m) - t_green_h(kw-1,m) ) & |
---|
4972 | * surf_usm_h%ddz_green(kw,m) & |
---|
4973 | ) * surf_usm_h%ddz_green_stag(kw,m) |
---|
4974 | ENDDO |
---|
4975 | |
---|
4976 | t_green_h_p(nzb_wall:nzt_wall,m) = t_green_h(nzb_wall:nzt_wall,m) & |
---|
4977 | + dt_3d * ( tsc(2) & |
---|
4978 | * gtend(nzb_wall:nzt_wall) + tsc(3) & |
---|
4979 | * surf_usm_h%tt_green_m(nzb_wall:nzt_wall,m) ) |
---|
4980 | |
---|
4981 | |
---|
4982 | ! |
---|
4983 | !-- calculate t_green tendencies for the next Runge-Kutta step |
---|
4984 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
4985 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
4986 | DO kw = nzb_wall, nzt_wall |
---|
4987 | surf_usm_h%tt_green_m(kw,m) = gtend(kw) |
---|
4988 | ENDDO |
---|
4989 | ELSEIF ( intermediate_timestep_count < & |
---|
4990 | intermediate_timestep_count_max ) THEN |
---|
4991 | DO kw = nzb_wall, nzt_wall |
---|
4992 | surf_usm_h%tt_green_m(kw,m) = -9.5625_wp * gtend(kw) + & |
---|
4993 | 5.3125_wp * surf_usm_h%tt_green_m(kw,m) |
---|
4994 | ENDDO |
---|
4995 | ENDIF |
---|
4996 | ENDIF |
---|
4997 | ENDDO |
---|
4998 | |
---|
4999 | ! |
---|
5000 | !-- For vertical surfaces |
---|
5001 | DO l = 0, 3 |
---|
5002 | DO m = 1, surf_usm_v(l)%ns |
---|
5003 | ! |
---|
5004 | !-- Obtain indices |
---|
5005 | i = surf_usm_v(l)%i(m) |
---|
5006 | j = surf_usm_v(l)%j(m) |
---|
5007 | k = surf_usm_v(l)%k(m) |
---|
5008 | |
---|
5009 | t_green_v(l)%t(nzt_wall+1,m) = t_wall_v(l)%t(nzb_wall,m) |
---|
5010 | ! |
---|
5011 | !-- prognostic equation for green temperature t_green_v |
---|
5012 | gtend(:) = 0.0_wp |
---|
5013 | gtend(nzb_wall) = (1.0_wp / surf_usm_v(l)%rho_c_green(nzb_wall,m)) * & |
---|
5014 | ( surf_usm_v(l)%lambda_h_green(nzb_wall,m) * & |
---|
5015 | ( t_green_v(l)%t(nzb_wall+1,m) & |
---|
5016 | - t_green_v(l)%t(nzb_wall,m) ) * & |
---|
5017 | surf_usm_v(l)%ddz_green(nzb_wall+1,m) & |
---|
5018 | + surf_usm_v(l)%wghf_eb(m) ) * & |
---|
5019 | surf_usm_v(l)%ddz_green_stag(nzb_wall,m) |
---|
5020 | |
---|
5021 | DO kw = nzb_wall+1, nzt_wall |
---|
5022 | gtend(kw) = (1.0_wp / surf_usm_v(l)%rho_c_green(kw,m)) & |
---|
5023 | * ( surf_usm_v(l)%lambda_h_green(kw,m) & |
---|
5024 | * ( t_green_v(l)%t(kw+1,m) - t_green_v(l)%t(kw,m) ) & |
---|
5025 | * surf_usm_v(l)%ddz_green(kw+1,m) & |
---|
5026 | - surf_usm_v(l)%lambda_h(kw-1,m) & |
---|
5027 | * ( t_green_v(l)%t(kw,m) - t_green_v(l)%t(kw-1,m) ) & |
---|
5028 | * surf_usm_v(l)%ddz_green(kw,m) ) & |
---|
5029 | * surf_usm_v(l)%ddz_green_stag(kw,m) |
---|
5030 | ENDDO |
---|
5031 | |
---|
5032 | t_green_v_p(l)%t(nzb_wall:nzt_wall,m) = & |
---|
5033 | t_green_v(l)%t(nzb_wall:nzt_wall,m) & |
---|
5034 | + dt_3d * ( tsc(2) & |
---|
5035 | * gtend(nzb_wall:nzt_wall) + tsc(3) & |
---|
5036 | * surf_usm_v(l)%tt_green_m(nzb_wall:nzt_wall,m) ) |
---|
5037 | |
---|
5038 | ! |
---|
5039 | !-- calculate t_green tendencies for the next Runge-Kutta step |
---|
5040 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
5041 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
5042 | DO kw = nzb_wall, nzt_wall |
---|
5043 | surf_usm_v(l)%tt_green_m(kw,m) = gtend(kw) |
---|
5044 | ENDDO |
---|
5045 | ELSEIF ( intermediate_timestep_count < & |
---|
5046 | intermediate_timestep_count_max ) THEN |
---|
5047 | DO kw = nzb_wall, nzt_wall |
---|
5048 | surf_usm_v(l)%tt_green_m(kw,m) = & |
---|
5049 | - 9.5625_wp * gtend(kw) + & |
---|
5050 | 5.3125_wp * surf_usm_v(l)%tt_green_m(kw,m) |
---|
5051 | ENDDO |
---|
5052 | ENDIF |
---|
5053 | ENDIF |
---|
5054 | |
---|
5055 | ENDDO |
---|
5056 | ENDDO |
---|
5057 | |
---|
5058 | END SUBROUTINE usm_green_heat_model |
---|
5059 | |
---|
5060 | !------------------------------------------------------------------------------! |
---|
5061 | ! Description: |
---|
5062 | ! ------------ |
---|
5063 | !> Parin for &usm_par for urban surface model |
---|
5064 | !------------------------------------------------------------------------------! |
---|
5065 | SUBROUTINE usm_parin |
---|
5066 | |
---|
5067 | IMPLICIT NONE |
---|
5068 | |
---|
5069 | CHARACTER (LEN=80) :: line !< string containing current line of file PARIN |
---|
5070 | |
---|
5071 | NAMELIST /urban_surface_par/ & |
---|
5072 | building_type, & |
---|
5073 | land_category, & |
---|
5074 | pedestrant_category, & |
---|
5075 | ra_horiz_coef, & |
---|
5076 | roof_category, & |
---|
5077 | urban_surface, & |
---|
5078 | usm_anthropogenic_heat, & |
---|
5079 | usm_material_model, & |
---|
5080 | usm_lad_rma, & |
---|
5081 | wall_category, & |
---|
5082 | indoor_model |
---|
5083 | |
---|
5084 | line = ' ' |
---|
5085 | |
---|
5086 | ! |
---|
5087 | !-- Try to find urban surface model package |
---|
5088 | REWIND ( 11 ) |
---|
5089 | line = ' ' |
---|
5090 | DO WHILE ( INDEX( line, '&urban_surface_par' ) == 0 ) |
---|
5091 | READ ( 11, '(A)', END=10 ) line |
---|
5092 | ENDDO |
---|
5093 | BACKSPACE ( 11 ) |
---|
5094 | |
---|
5095 | ! |
---|
5096 | !-- Read user-defined namelist |
---|
5097 | READ ( 11, urban_surface_par ) |
---|
5098 | ! |
---|
5099 | !-- Set flag that indicates that the land surface model is switched on |
---|
5100 | urban_surface = .TRUE. |
---|
5101 | |
---|
5102 | ! |
---|
5103 | !-- Activate spinup |
---|
5104 | IF ( spinup_time > 0.0_wp ) THEN |
---|
5105 | coupling_start_time = spinup_time |
---|
5106 | end_time = end_time + spinup_time |
---|
5107 | IF ( spinup_pt_mean == 9999999.9_wp ) THEN |
---|
5108 | spinup_pt_mean = pt_surface |
---|
5109 | ENDIF |
---|
5110 | spinup = .TRUE. |
---|
5111 | ENDIF |
---|
5112 | |
---|
5113 | 10 CONTINUE |
---|
5114 | |
---|
5115 | END SUBROUTINE usm_parin |
---|
5116 | |
---|
5117 | !------------------------------------------------------------------------------! |
---|
5118 | ! Description: |
---|
5119 | ! ------------ |
---|
5120 | !> Calculates temperature near surface (10 cm) for indoor model |
---|
5121 | !------------------------------------------------------------------------------! |
---|
5122 | SUBROUTINE usm_temperature_near_surface |
---|
5123 | |
---|
5124 | IMPLICIT NONE |
---|
5125 | |
---|
5126 | INTEGER(iwp) :: i, j, k, l, m !< running indices |
---|
5127 | |
---|
5128 | ! |
---|
5129 | !-- First, treat horizontal surface elements |
---|
5130 | DO m = 1, surf_usm_h%ns |
---|
5131 | |
---|
5132 | !-- Get indices of respective grid point |
---|
5133 | i = surf_usm_h%i(m) |
---|
5134 | j = surf_usm_h%j(m) |
---|
5135 | k = surf_usm_h%k(m) |
---|
5136 | |
---|
5137 | t_surf_10cm_h(m) = t_surf_whole_h(m) + surf_usm_h%ts(m) / kappa & |
---|
5138 | * ( log( 0.1_wp / surf_usm_h%z0h(m) ) & |
---|
5139 | - psi_h( 0.1_wp / surf_usm_h%ol(m) ) & |
---|
5140 | + psi_h( surf_usm_h%z0h(m) / surf_usm_h%ol(m) ) ) |
---|
5141 | |
---|
5142 | ENDDO |
---|
5143 | ! |
---|
5144 | !-- Now, treat vertical surface elements |
---|
5145 | DO l = 0, 3 |
---|
5146 | DO m = 1, surf_usm_v(l)%ns |
---|
5147 | |
---|
5148 | !-- Get indices of respective grid point |
---|
5149 | i = surf_usm_v(l)%i(m) |
---|
5150 | j = surf_usm_v(l)%j(m) |
---|
5151 | k = surf_usm_v(l)%k(m) |
---|
5152 | |
---|
5153 | t_surf_10cm_v(l)%t(m) = t_surf_whole_v(l)%t(m) + surf_usm_v(l)%ts(m) / kappa & |
---|
5154 | * ( log( 0.1_wp / surf_usm_v(l)%z0h(m) ) & |
---|
5155 | - psi_h( 0.1_wp / surf_usm_v(l)%ol(m) ) & |
---|
5156 | + psi_h( surf_usm_v(l)%z0h(m) / surf_usm_v(l)%ol(m) ) ) |
---|
5157 | |
---|
5158 | ENDDO |
---|
5159 | |
---|
5160 | ENDDO |
---|
5161 | |
---|
5162 | |
---|
5163 | END SUBROUTINE usm_temperature_near_surface |
---|
5164 | |
---|
5165 | |
---|
5166 | |
---|
5167 | !------------------------------------------------------------------------------! |
---|
5168 | ! Description: |
---|
5169 | ! ------------ |
---|
5170 | ! |
---|
5171 | !> This subroutine is part of the urban surface model. |
---|
5172 | !> It reads daily heat produced by anthropogenic sources |
---|
5173 | !> and the diurnal cycle of the heat. |
---|
5174 | !------------------------------------------------------------------------------! |
---|
5175 | SUBROUTINE usm_read_anthropogenic_heat |
---|
5176 | |
---|
5177 | INTEGER(iwp) :: i,j,ii |
---|
5178 | REAL(wp) :: heat |
---|
5179 | |
---|
5180 | !-- allocation of array of sources of anthropogenic heat and their diural profile |
---|
5181 | ALLOCATE( aheat(nys:nyn,nxl:nxr) ) |
---|
5182 | ALLOCATE( aheatprof(0:24) ) |
---|
5183 | |
---|
5184 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
5185 | !-- read daily amount of heat and its daily cycle |
---|
5186 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
5187 | aheat = 0.0_wp |
---|
5188 | DO ii = 0, io_blocks-1 |
---|
5189 | IF ( ii == io_group ) THEN |
---|
5190 | |
---|
5191 | !-- open anthropogenic heat file |
---|
5192 | OPEN( 151, file='ANTHROPOGENIC_HEAT'//TRIM(coupling_char), action='read', & |
---|
5193 | status='old', form='formatted', err=11 ) |
---|
5194 | i = 0 |
---|
5195 | j = 0 |
---|
5196 | DO |
---|
5197 | READ( 151, *, err=12, end=13 ) i, j, heat |
---|
5198 | IF ( i >= nxl .AND. i <= nxr .AND. j >= nys .AND. j <= nyn ) THEN |
---|
5199 | !-- write heat into the array |
---|
5200 | aheat(j,i) = heat |
---|
5201 | ENDIF |
---|
5202 | CYCLE |
---|
5203 | 12 WRITE(message_string,'(a,2i4)') 'error in file ANTHROPOGENIC_HEAT'//TRIM(coupling_char)//' after line ',i,j |
---|
5204 | CALL message( 'usm_read_anthropogenic_heat', 'PA0515', 0, 1, 0, 6, 0 ) |
---|
5205 | ENDDO |
---|
5206 | 13 CLOSE(151) |
---|
5207 | CYCLE |
---|
5208 | 11 message_string = 'file ANTHROPOGENIC_HEAT'//TRIM(coupling_char)//' does not exist' |
---|
5209 | CALL message( 'usm_read_anthropogenic_heat', 'PA0516', 1, 2, 0, 6, 0 ) |
---|
5210 | ENDIF |
---|
5211 | |
---|
5212 | #if defined( __parallel ) && ! defined ( __check ) |
---|
5213 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
5214 | #endif |
---|
5215 | ENDDO |
---|
5216 | |
---|
5217 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
5218 | !-- read diurnal profiles of heat sources |
---|
5219 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
5220 | aheatprof = 0.0_wp |
---|
5221 | DO ii = 0, io_blocks-1 |
---|
5222 | IF ( ii == io_group ) THEN |
---|
5223 | |
---|
5224 | !-- open anthropogenic heat profile file |
---|
5225 | OPEN( 151, file='ANTHROPOGENIC_HEAT_PROFILE'//TRIM(coupling_char), action='read', & |
---|
5226 | status='old', form='formatted', err=21 ) |
---|
5227 | i = 0 |
---|
5228 | DO |
---|
5229 | READ( 151, *, err=22, end=23 ) i, heat |
---|
5230 | IF ( i >= 0 .AND. i <= 24 ) THEN |
---|
5231 | !-- write heat into the array |
---|
5232 | aheatprof(i) = heat |
---|
5233 | ENDIF |
---|
5234 | CYCLE |
---|
5235 | 22 WRITE(message_string,'(a,i4)') 'error in file ANTHROPOGENIC_HEAT_PROFILE'// & |
---|
5236 | TRIM(coupling_char)//' after line ',i |
---|
5237 | CALL message( 'usm_read_anthropogenic_heat', 'PA0517', 0, 1, 0, 6, 0 ) |
---|
5238 | ENDDO |
---|
5239 | aheatprof(24) = aheatprof(0) |
---|
5240 | 23 CLOSE(151) |
---|
5241 | CYCLE |
---|
5242 | 21 message_string = 'file ANTHROPOGENIC_HEAT_PROFILE'//TRIM(coupling_char)//' does not exist' |
---|
5243 | CALL message( 'usm_read_anthropogenic_heat', 'PA0518', 1, 2, 0, 6, 0 ) |
---|
5244 | ENDIF |
---|
5245 | |
---|
5246 | #if defined( __parallel ) && ! defined ( __check ) |
---|
5247 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
5248 | #endif |
---|
5249 | ENDDO |
---|
5250 | |
---|
5251 | END SUBROUTINE usm_read_anthropogenic_heat |
---|
5252 | |
---|
5253 | |
---|
5254 | !------------------------------------------------------------------------------! |
---|
5255 | ! |
---|
5256 | ! Description: |
---|
5257 | ! ------------ |
---|
5258 | !> Soubroutine reads t_surf and t_wall data from restart files |
---|
5259 | !kanani: Renamed this routine according to corresponging routines in PALM |
---|
5260 | !kanani: Modified the routine to match read_var_list, from where usm_read_restart_data |
---|
5261 | ! shall be called in the future. This part has not been tested yet. (see virtual_flight_mod) |
---|
5262 | ! Also, I had some trouble with the allocation of t_surf, since this is a pointer. |
---|
5263 | ! So, I added some directives here. |
---|
5264 | !------------------------------------------------------------------------------! |
---|
5265 | SUBROUTINE usm_read_restart_data( ii, & |
---|
5266 | nxlfa, nxl_on_file, nxrfa, nxr_on_file, & |
---|
5267 | nynfa, nyn_on_file, nysfa, nys_on_file, & |
---|
5268 | offset_xa, offset_ya, overlap_count ) |
---|
5269 | |
---|
5270 | |
---|
5271 | USE pegrid, & |
---|
5272 | ONLY: numprocs_previous_run |
---|
5273 | |
---|
5274 | IMPLICIT NONE |
---|
5275 | |
---|
5276 | CHARACTER (LEN=1) :: dum !< dummy to create correct string for reading input variable |
---|
5277 | CHARACTER (LEN=30) :: field_chr !< input variable |
---|
5278 | |
---|
5279 | INTEGER(iwp) :: l !< index variable for surface type |
---|
5280 | INTEGER(iwp) :: ii !< running index over input files |
---|
5281 | INTEGER(iwp) :: kk !< running index over previous input files covering current local domain |
---|
5282 | INTEGER(iwp) :: ns_h_on_file_usm !< number of horizontal surface elements (urban type) on file |
---|
5283 | INTEGER(iwp) :: nxlc !< index of left boundary on current subdomain |
---|
5284 | INTEGER(iwp) :: nxlf !< index of left boundary on former subdomain |
---|
5285 | INTEGER(iwp) :: nxl_on_file !< index of left boundary on former local domain |
---|
5286 | INTEGER(iwp) :: nxrc !< index of right boundary on current subdomain |
---|
5287 | INTEGER(iwp) :: nxrf !< index of right boundary on former subdomain |
---|
5288 | INTEGER(iwp) :: nxr_on_file !< index of right boundary on former local domain |
---|
5289 | INTEGER(iwp) :: nync !< index of north boundary on current subdomain |
---|
5290 | INTEGER(iwp) :: nynf !< index of north boundary on former subdomain |
---|
5291 | INTEGER(iwp) :: nyn_on_file !< index of norht boundary on former local domain |
---|
5292 | INTEGER(iwp) :: nysc !< index of south boundary on current subdomain |
---|
5293 | INTEGER(iwp) :: nysf !< index of south boundary on former subdomain |
---|
5294 | INTEGER(iwp) :: nys_on_file !< index of south boundary on former local domain |
---|
5295 | INTEGER(iwp) :: overlap_count !< number of overlaps |
---|
5296 | |
---|
5297 | INTEGER(iwp) :: ns_v_on_file_usm(0:3) !< number of vertical surface elements (urban type) on file |
---|
5298 | |
---|
5299 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxlfa !< |
---|
5300 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nxrfa !< |
---|
5301 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nynfa !< |
---|
5302 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: nysfa !< |
---|
5303 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_xa !< |
---|
5304 | INTEGER(iwp), DIMENSION(numprocs_previous_run,1000) :: offset_ya !< |
---|
5305 | |
---|
5306 | INTEGER(iwp), DIMENSION(nys_on_file:nyn_on_file,nxl_on_file:nxr_on_file) :: start_index_on_file |
---|
5307 | INTEGER(iwp), DIMENSION(nys_on_file:nyn_on_file,nxl_on_file:nxr_on_file) :: end_index_on_file |
---|
5308 | |
---|
5309 | REAL(wp), DIMENSION(:), ALLOCATABLE :: tmp_surf_h, tmp_surf_window_h, tmp_surf_green_h |
---|
5310 | REAL(wp), DIMENSION(:,:), ALLOCATABLE :: tmp_wall_h, tmp_window_h, tmp_green_h |
---|
5311 | |
---|
5312 | TYPE( t_surf_vertical ), DIMENSION(0:3) :: tmp_surf_v, tmp_surf_window_v, tmp_surf_green_v |
---|
5313 | TYPE( t_wall_vertical ), DIMENSION(0:3) :: tmp_wall_v, tmp_window_v, tmp_green_v |
---|
5314 | |
---|
5315 | |
---|
5316 | IF ( initializing_actions == 'read_restart_data' .OR. & |
---|
5317 | initializing_actions == 'cyclic_fill' ) THEN |
---|
5318 | |
---|
5319 | ! |
---|
5320 | !-- Read number of respective surface elements on file |
---|
5321 | READ ( 13 ) field_chr |
---|
5322 | IF ( TRIM( field_chr ) /= 'ns_h_on_file_usm' ) THEN |
---|
5323 | ! |
---|
5324 | !-- Add a proper error message |
---|
5325 | ENDIF |
---|
5326 | READ ( 13 ) ns_h_on_file_usm |
---|
5327 | |
---|
5328 | READ ( 13 ) field_chr |
---|
5329 | IF ( TRIM( field_chr ) /= 'ns_v_on_file_usm' ) THEN |
---|
5330 | ! |
---|
5331 | !-- Add a proper error message |
---|
5332 | ENDIF |
---|
5333 | READ ( 13 ) ns_v_on_file_usm |
---|
5334 | ! |
---|
5335 | !-- Allocate temporary arrays for reading data on file. Note, the |
---|
5336 | !-- size of allocated surface elements do not necessarily need to match |
---|
5337 | !-- the size of present surface elements on current processor, as the |
---|
5338 | !-- number of processors between restarts can change. |
---|
5339 | ALLOCATE( tmp_surf_h(1:ns_h_on_file_usm) ) |
---|
5340 | ALLOCATE( tmp_wall_h(nzb_wall:nzt_wall+1,1:ns_h_on_file_usm) ) |
---|
5341 | ALLOCATE( tmp_surf_window_h(1:ns_h_on_file_usm) ) |
---|
5342 | ALLOCATE( tmp_window_h(nzb_wall:nzt_wall+1,1:ns_h_on_file_usm) ) |
---|
5343 | ALLOCATE( tmp_surf_green_h(1:ns_h_on_file_usm) ) |
---|
5344 | ALLOCATE( tmp_green_h(nzb_wall:nzt_wall+1,1:ns_h_on_file_usm) ) |
---|
5345 | |
---|
5346 | DO l = 0, 3 |
---|
5347 | ALLOCATE( tmp_surf_v(l)%t(1:ns_v_on_file_usm(l)) ) |
---|
5348 | ALLOCATE( tmp_wall_v(l)%t(nzb_wall:nzt_wall+1,1:ns_v_on_file_usm(l) ) ) |
---|
5349 | ALLOCATE( tmp_surf_window_v(l)%t(1:ns_v_on_file_usm(l)) ) |
---|
5350 | ALLOCATE( tmp_window_v(l)%t(nzb_wall:nzt_wall+1,1:ns_v_on_file_usm(l) ) ) |
---|
5351 | ALLOCATE( tmp_surf_green_v(l)%t(1:ns_v_on_file_usm(l)) ) |
---|
5352 | ALLOCATE( tmp_green_v(l)%t(nzb_wall:nzt_wall+1,1:ns_v_on_file_usm(l) ) ) |
---|
5353 | ENDDO |
---|
5354 | |
---|
5355 | |
---|
5356 | READ ( 13 ) field_chr |
---|
5357 | |
---|
5358 | DO WHILE ( TRIM( field_chr ) /= '*** end usm ***' ) |
---|
5359 | ! |
---|
5360 | !-- Map data on file as often as needed (data are read only for k=1) |
---|
5361 | DO kk = 1, overlap_count |
---|
5362 | ! |
---|
5363 | !-- Get the index range of the subdomain on file which overlap with the |
---|
5364 | !-- current subdomain |
---|
5365 | nxlf = nxlfa(ii,kk) |
---|
5366 | nxlc = nxlfa(ii,kk) + offset_xa(ii,kk) |
---|
5367 | nxrf = nxrfa(ii,kk) |
---|
5368 | nxrc = nxrfa(ii,kk) + offset_xa(ii,kk) |
---|
5369 | nysf = nysfa(ii,kk) |
---|
5370 | nysc = nysfa(ii,kk) + offset_ya(ii,kk) |
---|
5371 | nynf = nynfa(ii,kk) |
---|
5372 | nync = nynfa(ii,kk) + offset_ya(ii,kk) |
---|
5373 | |
---|
5374 | SELECT CASE ( TRIM( field_chr ) ) |
---|
5375 | |
---|
5376 | CASE ( 'usm_start_index_h', 'usm_start_index_v' ) |
---|
5377 | IF ( kk == 1 ) & |
---|
5378 | READ ( 13 ) start_index_on_file |
---|
5379 | |
---|
5380 | CASE ( 'usm_end_index_h', 'usm_end_index_v' ) |
---|
5381 | IF ( kk == 1 ) & |
---|
5382 | READ ( 13 ) end_index_on_file |
---|
5383 | |
---|
5384 | CASE ( 't_surf_h' ) |
---|
5385 | #if defined( __nopointer ) |
---|
5386 | IF ( kk == 1 ) THEN |
---|
5387 | IF ( .NOT. ALLOCATED( t_surf_h ) ) & |
---|
5388 | ALLOCATE( t_surf_h(1:surf_usm_h%ns) ) |
---|
5389 | READ ( 13 ) tmp_surf_h |
---|
5390 | ENDIF |
---|
5391 | CALL surface_restore_elements( & |
---|
5392 | t_surf_h, tmp_surf_h, & |
---|
5393 | surf_usm_h%start_index, & |
---|
5394 | start_index_on_file, & |
---|
5395 | end_index_on_file, & |
---|
5396 | nxlc, nysc, & |
---|
5397 | nxlf, nxrf, nysf, nynf, & |
---|
5398 | nys_on_file, nyn_on_file, & |
---|
5399 | nxl_on_file,nxr_on_file ) |
---|
5400 | #else |
---|
5401 | IF ( kk == 1 ) THEN |
---|
5402 | IF ( .NOT. ALLOCATED( t_surf_h_1 ) ) & |
---|
5403 | ALLOCATE( t_surf_h_1(1:surf_usm_h%ns) ) |
---|
5404 | READ ( 13 ) tmp_surf_h |
---|
5405 | ENDIF |
---|
5406 | CALL surface_restore_elements( & |
---|
5407 | t_surf_h_1, tmp_surf_h, & |
---|
5408 | surf_usm_h%start_index, & |
---|
5409 | start_index_on_file, & |
---|
5410 | end_index_on_file, & |
---|
5411 | nxlc, nysc, & |
---|
5412 | nxlf, nxrf, nysf, nynf, & |
---|
5413 | nys_on_file, nyn_on_file, & |
---|
5414 | nxl_on_file,nxr_on_file ) |
---|
5415 | #endif |
---|
5416 | |
---|
5417 | CASE ( 't_surf_v(0)' ) |
---|
5418 | #if defined( __nopointer ) |
---|
5419 | IF ( kk == 1 ) THEN |
---|
5420 | IF ( .NOT. ALLOCATED( t_surf_v(0)%t ) ) & |
---|
5421 | ALLOCATE( t_surf_v(0)%t(1:surf_usm_v(0)%ns) ) |
---|
5422 | READ ( 13 ) tmp_surf_v(0)%t |
---|
5423 | ENDIF |
---|
5424 | CALL surface_restore_elements( & |
---|
5425 | t_surf_v(0)%t, tmp_surf_v(0)%t, & |
---|
5426 | surf_usm_v(0)%start_index, & |
---|
5427 | start_index_on_file, & |
---|
5428 | end_index_on_file, & |
---|
5429 | nxlc, nysc, & |
---|
5430 | nxlf, nxrf, nysf, nynf, & |
---|
5431 | nys_on_file, nyn_on_file, & |
---|
5432 | nxl_on_file,nxr_on_file ) |
---|
5433 | #else |
---|
5434 | IF ( kk == 1 ) THEN |
---|
5435 | IF ( .NOT. ALLOCATED( t_surf_v_1(0)%t ) ) & |
---|
5436 | ALLOCATE( t_surf_v_1(0)%t(1:surf_usm_v(0)%ns) ) |
---|
5437 | READ ( 13 ) tmp_surf_v(0)%t |
---|
5438 | ENDIF |
---|
5439 | CALL surface_restore_elements( & |
---|
5440 | t_surf_v_1(0)%t, tmp_surf_v(0)%t,& |
---|
5441 | surf_usm_v(0)%start_index, & |
---|
5442 | start_index_on_file, & |
---|
5443 | end_index_on_file, & |
---|
5444 | nxlc, nysc, & |
---|
5445 | nxlf, nxrf, nysf, nynf, & |
---|
5446 | nys_on_file, nyn_on_file, & |
---|
5447 | nxl_on_file,nxr_on_file ) |
---|
5448 | #endif |
---|
5449 | |
---|
5450 | CASE ( 't_surf_v(1)' ) |
---|
5451 | #if defined( __nopointer ) |
---|
5452 | IF ( kk == 1 ) THEN |
---|
5453 | IF ( .NOT. ALLOCATED( t_surf_v(1)%t ) ) & |
---|
5454 | ALLOCATE( t_surf_v(1)%t(1:surf_usm_v(1)%ns) ) |
---|
5455 | READ ( 13 ) tmp_surf_v(1)%t |
---|
5456 | ENDIF |
---|
5457 | CALL surface_restore_elements( & |
---|
5458 | t_surf_v(1)%t, tmp_surf_v(1)%t, & |
---|
5459 | surf_usm_v(1)%start_index, & |
---|
5460 | start_index_on_file, & |
---|
5461 | end_index_on_file, & |
---|
5462 | nxlc, nysc, & |
---|
5463 | nxlf, nxrf, nysf, nynf, & |
---|
5464 | nys_on_file, nyn_on_file, & |
---|
5465 | nxl_on_file,nxr_on_file ) |
---|
5466 | #else |
---|
5467 | IF ( kk == 1 ) THEN |
---|
5468 | IF ( .NOT. ALLOCATED( t_surf_v_1(1)%t ) ) & |
---|
5469 | ALLOCATE( t_surf_v_1(1)%t(1:surf_usm_v(1)%ns) ) |
---|
5470 | READ ( 13 ) tmp_surf_v(1)%t |
---|
5471 | ENDIF |
---|
5472 | CALL surface_restore_elements( & |
---|
5473 | t_surf_v_1(1)%t, tmp_surf_v(1)%t,& |
---|
5474 | surf_usm_v(1)%start_index, & |
---|
5475 | start_index_on_file, & |
---|
5476 | end_index_on_file, & |
---|
5477 | nxlc, nysc, & |
---|
5478 | nxlf, nxrf, nysf, nynf, & |
---|
5479 | nys_on_file, nyn_on_file, & |
---|
5480 | nxl_on_file,nxr_on_file ) |
---|
5481 | #endif |
---|
5482 | |
---|
5483 | CASE ( 't_surf_v(2)' ) |
---|
5484 | #if defined( __nopointer ) |
---|
5485 | IF ( kk == 1 ) THEN |
---|
5486 | IF ( .NOT. ALLOCATED( t_surf_v(2)%t ) ) & |
---|
5487 | ALLOCATE( t_surf_v(2)%t(1:surf_usm_v(2)%ns) ) |
---|
5488 | READ ( 13 ) tmp_surf_v(2)%t |
---|
5489 | ENDIF |
---|
5490 | CALL surface_restore_elements( & |
---|
5491 | t_surf_v(2)%t, tmp_surf_v(2)%t, & |
---|
5492 | surf_usm_v(2)%start_index, & |
---|
5493 | start_index_on_file, & |
---|
5494 | end_index_on_file, & |
---|
5495 | nxlc, nysc, & |
---|
5496 | nxlf, nxrf, nysf, nynf, & |
---|
5497 | nys_on_file, nyn_on_file, & |
---|
5498 | nxl_on_file,nxr_on_file ) |
---|
5499 | #else |
---|
5500 | IF ( kk == 1 ) THEN |
---|
5501 | IF ( .NOT. ALLOCATED( t_surf_v_1(2)%t ) ) & |
---|
5502 | ALLOCATE( t_surf_v_1(2)%t(1:surf_usm_v(2)%ns) ) |
---|
5503 | READ ( 13 ) tmp_surf_v(2)%t |
---|
5504 | ENDIF |
---|
5505 | CALL surface_restore_elements( & |
---|
5506 | t_surf_v_1(2)%t, tmp_surf_v(2)%t,& |
---|
5507 | surf_usm_v(2)%start_index, & |
---|
5508 | start_index_on_file, & |
---|
5509 | end_index_on_file, & |
---|
5510 | nxlc, nysc, & |
---|
5511 | nxlf, nxrf, nysf, nynf, & |
---|
5512 | nys_on_file, nyn_on_file, & |
---|
5513 | nxl_on_file,nxr_on_file ) |
---|
5514 | #endif |
---|
5515 | |
---|
5516 | CASE ( 't_surf_v(3)' ) |
---|
5517 | #if defined( __nopointer ) |
---|
5518 | IF ( kk == 1 ) THEN |
---|
5519 | IF ( .NOT. ALLOCATED( t_surf_v(3)%t ) ) & |
---|
5520 | ALLOCATE( t_surf_v(3)%t(1:surf_usm_v(3)%ns) ) |
---|
5521 | READ ( 13 ) tmp_surf_v(3)%t |
---|
5522 | ENDIF |
---|
5523 | CALL surface_restore_elements( & |
---|
5524 | t_surf_v(3)%t, tmp_surf_v(3)%t, & |
---|
5525 | surf_usm_v(3)%start_index, & |
---|
5526 | start_index_on_file, & |
---|
5527 | end_index_on_file, & |
---|
5528 | nxlc, nysc, & |
---|
5529 | nxlf, nxrf, nysf, nynf, & |
---|
5530 | nys_on_file, nyn_on_file, & |
---|
5531 | nxl_on_file,nxr_on_file ) |
---|
5532 | #else |
---|
5533 | IF ( kk == 1 ) THEN |
---|
5534 | IF ( .NOT. ALLOCATED( t_surf_v_1(3)%t ) ) & |
---|
5535 | ALLOCATE( t_surf_v_1(3)%t(1:surf_usm_v(3)%ns) ) |
---|
5536 | READ ( 13 ) tmp_surf_v(3)%t |
---|
5537 | ENDIF |
---|
5538 | CALL surface_restore_elements( & |
---|
5539 | t_surf_v_1(3)%t, tmp_surf_v(3)%t,& |
---|
5540 | surf_usm_v(3)%start_index, & |
---|
5541 | start_index_on_file, & |
---|
5542 | end_index_on_file, & |
---|
5543 | nxlc, nysc, & |
---|
5544 | nxlf, nxrf, nysf, nynf, & |
---|
5545 | nys_on_file, nyn_on_file, & |
---|
5546 | nxl_on_file,nxr_on_file ) |
---|
5547 | #endif |
---|
5548 | CASE ( 't_surf_green_h' ) |
---|
5549 | #if defined( __nopointer ) |
---|
5550 | IF ( kk == 1 ) THEN |
---|
5551 | IF ( .NOT. ALLOCATED( t_surf_green_h ) ) & |
---|
5552 | ALLOCATE( t_surf_green_h(1:surf_usm_h%ns) ) |
---|
5553 | READ ( 13 ) tmp_surf_green_h |
---|
5554 | ENDIF |
---|
5555 | CALL surface_restore_elements( & |
---|
5556 | t_surf_green_h, tmp_surf_green_h, & |
---|
5557 | surf_usm_h%start_index, & |
---|
5558 | start_index_on_file, & |
---|
5559 | end_index_on_file, & |
---|
5560 | nxlc, nysc, & |
---|
5561 | nxlf, nxrf, nysf, nynf, & |
---|
5562 | nys_on_file, nyn_on_file, & |
---|
5563 | nxl_on_file,nxr_on_file ) |
---|
5564 | #else |
---|
5565 | IF ( kk == 1 ) THEN |
---|
5566 | IF ( .NOT. ALLOCATED( t_surf_green_h_1 ) ) & |
---|
5567 | ALLOCATE( t_surf_green_h_1(1:surf_usm_h%ns) ) |
---|
5568 | READ ( 13 ) tmp_surf_green_h |
---|
5569 | ENDIF |
---|
5570 | CALL surface_restore_elements( & |
---|
5571 | t_surf_green_h_1, tmp_surf_green_h, & |
---|
5572 | surf_usm_h%start_index, & |
---|
5573 | start_index_on_file, & |
---|
5574 | end_index_on_file, & |
---|
5575 | nxlc, nysc, & |
---|
5576 | nxlf, nxrf, nysf, nynf, & |
---|
5577 | nys_on_file, nyn_on_file, & |
---|
5578 | nxl_on_file,nxr_on_file ) |
---|
5579 | #endif |
---|
5580 | |
---|
5581 | CASE ( 't_surf_green_v(0)' ) |
---|
5582 | #if defined( __nopointer ) |
---|
5583 | IF ( kk == 1 ) THEN |
---|
5584 | IF ( .NOT. ALLOCATED( t_surf_green_v(0)%t ) ) & |
---|
5585 | ALLOCATE( t_surf_green_v(0)%t(1:surf_usm_v(0)%ns) ) |
---|
5586 | READ ( 13 ) tmp_surf_green_v(0)%t |
---|
5587 | ENDIF |
---|
5588 | CALL surface_restore_elements( & |
---|
5589 | t_surf_green_v(0)%t, tmp_surf_green_v(0)%t, & |
---|
5590 | surf_usm_v(0)%start_index, & |
---|
5591 | start_index_on_file, & |
---|
5592 | end_index_on_file, & |
---|
5593 | nxlc, nysc, & |
---|
5594 | nxlf, nxrf, nysf, nynf, & |
---|
5595 | nys_on_file, nyn_on_file, & |
---|
5596 | nxl_on_file,nxr_on_file ) |
---|
5597 | #else |
---|
5598 | IF ( kk == 1 ) THEN |
---|
5599 | IF ( .NOT. ALLOCATED( t_surf_green_v_1(0)%t ) ) & |
---|
5600 | ALLOCATE( t_surf_green_v_1(0)%t(1:surf_usm_v(0)%ns) ) |
---|
5601 | READ ( 13 ) tmp_surf_green_v(0)%t |
---|
5602 | ENDIF |
---|
5603 | CALL surface_restore_elements( & |
---|
5604 | t_surf_green_v_1(0)%t, tmp_surf_green_v(0)%t,& |
---|
5605 | surf_usm_v(0)%start_index, & |
---|
5606 | start_index_on_file, & |
---|
5607 | end_index_on_file, & |
---|
5608 | nxlc, nysc, & |
---|
5609 | nxlf, nxrf, nysf, nynf, & |
---|
5610 | nys_on_file, nyn_on_file, & |
---|
5611 | nxl_on_file,nxr_on_file ) |
---|
5612 | #endif |
---|
5613 | |
---|
5614 | CASE ( 't_surf_green_v(1)' ) |
---|
5615 | #if defined( __nopointer ) |
---|
5616 | IF ( kk == 1 ) THEN |
---|
5617 | IF ( .NOT. ALLOCATED( t_surf_green_v(1)%t ) ) & |
---|
5618 | ALLOCATE( t_surf_green_v(1)%t(1:surf_usm_v(1)%ns) ) |
---|
5619 | READ ( 13 ) tmp_surf_green_v(1)%t |
---|
5620 | ENDIF |
---|
5621 | CALL surface_restore_elements( & |
---|
5622 | t_surf_green_v(1)%t, tmp_surf_green_v(1)%t, & |
---|
5623 | surf_usm_v(1)%start_index, & |
---|
5624 | start_index_on_file, & |
---|
5625 | end_index_on_file, & |
---|
5626 | nxlc, nysc, & |
---|
5627 | nxlf, nxrf, nysf, nynf, & |
---|
5628 | nys_on_file, nyn_on_file, & |
---|
5629 | nxl_on_file,nxr_on_file ) |
---|
5630 | #else |
---|
5631 | IF ( kk == 1 ) THEN |
---|
5632 | IF ( .NOT. ALLOCATED( t_surf_green_v_1(1)%t ) ) & |
---|
5633 | ALLOCATE( t_surf_green_v_1(1)%t(1:surf_usm_v(1)%ns) ) |
---|
5634 | READ ( 13 ) tmp_surf_green_v(1)%t |
---|
5635 | ENDIF |
---|
5636 | CALL surface_restore_elements( & |
---|
5637 | t_surf_green_v_1(1)%t, tmp_surf_green_v(1)%t,& |
---|
5638 | surf_usm_v(1)%start_index, & |
---|
5639 | start_index_on_file, & |
---|
5640 | end_index_on_file, & |
---|
5641 | nxlc, nysc, & |
---|
5642 | nxlf, nxrf, nysf, nynf, & |
---|
5643 | nys_on_file, nyn_on_file, & |
---|
5644 | nxl_on_file,nxr_on_file ) |
---|
5645 | #endif |
---|
5646 | |
---|
5647 | CASE ( 't_surf_green_v(2)' ) |
---|
5648 | #if defined( __nopointer ) |
---|
5649 | IF ( kk == 1 ) THEN |
---|
5650 | IF ( .NOT. ALLOCATED( t_surf_green_v(2)%t ) ) & |
---|
5651 | ALLOCATE( t_surf_green_v(2)%t(1:surf_usm_v(2)%ns) ) |
---|
5652 | READ ( 13 ) tmp_surf_green_v(2)%t |
---|
5653 | ENDIF |
---|
5654 | CALL surface_restore_elements( & |
---|
5655 | t_surf_green_v(2)%t, tmp_surf_green_v(2)%t, & |
---|
5656 | surf_usm_v(2)%start_index, & |
---|
5657 | start_index_on_file, & |
---|
5658 | end_index_on_file, & |
---|
5659 | nxlc, nysc, & |
---|
5660 | nxlf, nxrf, nysf, nynf, & |
---|
5661 | nys_on_file, nyn_on_file, & |
---|
5662 | nxl_on_file,nxr_on_file ) |
---|
5663 | #else |
---|
5664 | IF ( kk == 1 ) THEN |
---|
5665 | IF ( .NOT. ALLOCATED( t_surf_green_v_1(2)%t ) ) & |
---|
5666 | ALLOCATE( t_surf_green_v_1(2)%t(1:surf_usm_v(2)%ns) ) |
---|
5667 | READ ( 13 ) tmp_surf_green_v(2)%t |
---|
5668 | ENDIF |
---|
5669 | CALL surface_restore_elements( & |
---|
5670 | t_surf_green_v_1(2)%t, tmp_surf_green_v(2)%t,& |
---|
5671 | surf_usm_v(2)%start_index, & |
---|
5672 | start_index_on_file, & |
---|
5673 | end_index_on_file, & |
---|
5674 | nxlc, nysc, & |
---|
5675 | nxlf, nxrf, nysf, nynf, & |
---|
5676 | nys_on_file, nyn_on_file, & |
---|
5677 | nxl_on_file,nxr_on_file ) |
---|
5678 | #endif |
---|
5679 | |
---|
5680 | CASE ( 't_surf_green_v(3)' ) |
---|
5681 | #if defined( __nopointer ) |
---|
5682 | IF ( kk == 1 ) THEN |
---|
5683 | IF ( .NOT. ALLOCATED( t_surf_green_v(3)%t ) ) & |
---|
5684 | ALLOCATE( t_surf_green_v(3)%t(1:surf_usm_v(3)%ns) ) |
---|
5685 | READ ( 13 ) tmp_surf_green_v(3)%t |
---|
5686 | ENDIF |
---|
5687 | CALL surface_restore_elements( & |
---|
5688 | t_surf_green_v(3)%t, tmp_surf_green_v(3)%t, & |
---|
5689 | surf_usm_v(3)%start_index, & |
---|
5690 | start_index_on_file, & |
---|
5691 | end_index_on_file, & |
---|
5692 | nxlc, nysc, & |
---|
5693 | nxlf, nxrf, nysf, nynf, & |
---|
5694 | nys_on_file, nyn_on_file, & |
---|
5695 | nxl_on_file,nxr_on_file ) |
---|
5696 | #else |
---|
5697 | IF ( kk == 1 ) THEN |
---|
5698 | IF ( .NOT. ALLOCATED( t_surf_green_v_1(3)%t ) ) & |
---|
5699 | ALLOCATE( t_surf_green_v_1(3)%t(1:surf_usm_v(3)%ns) ) |
---|
5700 | READ ( 13 ) tmp_surf_green_v(3)%t |
---|
5701 | ENDIF |
---|
5702 | CALL surface_restore_elements( & |
---|
5703 | t_surf_green_v_1(3)%t, tmp_surf_green_v(3)%t,& |
---|
5704 | surf_usm_v(3)%start_index, & |
---|
5705 | start_index_on_file, & |
---|
5706 | end_index_on_file, & |
---|
5707 | nxlc, nysc, & |
---|
5708 | nxlf, nxrf, nysf, nynf, & |
---|
5709 | nys_on_file, nyn_on_file, & |
---|
5710 | nxl_on_file,nxr_on_file ) |
---|
5711 | #endif |
---|
5712 | CASE ( 't_surf_window_h' ) |
---|
5713 | #if defined( __nopointer ) |
---|
5714 | IF ( kk == 1 ) THEN |
---|
5715 | IF ( .NOT. ALLOCATED( t_surf_window_h ) ) & |
---|
5716 | ALLOCATE( t_surf_window_h(1:surf_usm_h%ns) ) |
---|
5717 | READ ( 13 ) tmp_surf_window_h |
---|
5718 | ENDIF |
---|
5719 | CALL surface_restore_elements( & |
---|
5720 | t_surf_window_h, tmp_surf_window_h, & |
---|
5721 | surf_usm_h%start_index, & |
---|
5722 | start_index_on_file, & |
---|
5723 | end_index_on_file, & |
---|
5724 | nxlc, nysc, & |
---|
5725 | nxlf, nxrf, nysf, nynf, & |
---|
5726 | nys_on_file, nyn_on_file, & |
---|
5727 | nxl_on_file,nxr_on_file ) |
---|
5728 | #else |
---|
5729 | IF ( kk == 1 ) THEN |
---|
5730 | IF ( .NOT. ALLOCATED( t_surf_window_h_1 ) ) & |
---|
5731 | ALLOCATE( t_surf_window_h_1(1:surf_usm_h%ns) ) |
---|
5732 | READ ( 13 ) tmp_surf_window_h |
---|
5733 | ENDIF |
---|
5734 | CALL surface_restore_elements( & |
---|
5735 | t_surf_window_h_1, tmp_surf_window_h, & |
---|
5736 | surf_usm_h%start_index, & |
---|
5737 | start_index_on_file, & |
---|
5738 | end_index_on_file, & |
---|
5739 | nxlc, nysc, & |
---|
5740 | nxlf, nxrf, nysf, nynf, & |
---|
5741 | nys_on_file, nyn_on_file, & |
---|
5742 | nxl_on_file,nxr_on_file ) |
---|
5743 | #endif |
---|
5744 | |
---|
5745 | CASE ( 't_surf_window_v(0)' ) |
---|
5746 | #if defined( __nopointer ) |
---|
5747 | IF ( kk == 1 ) THEN |
---|
5748 | IF ( .NOT. ALLOCATED( t_surf_window_v(0)%t ) ) & |
---|
5749 | ALLOCATE( t_surf_window_v(0)%t(1:surf_usm_v(0)%ns) ) |
---|
5750 | READ ( 13 ) tmp_surf_window_v(0)%t |
---|
5751 | ENDIF |
---|
5752 | CALL surface_restore_elements( & |
---|
5753 | t_surf_window_v(0)%t, tmp_surf_window_v(0)%t, & |
---|
5754 | surf_usm_v(0)%start_index, & |
---|
5755 | start_index_on_file, & |
---|
5756 | end_index_on_file, & |
---|
5757 | nxlc, nysc, & |
---|
5758 | nxlf, nxrf, nysf, nynf, & |
---|
5759 | nys_on_file, nyn_on_file, & |
---|
5760 | nxl_on_file,nxr_on_file ) |
---|
5761 | #else |
---|
5762 | IF ( kk == 1 ) THEN |
---|
5763 | IF ( .NOT. ALLOCATED( t_surf_window_v_1(0)%t ) ) & |
---|
5764 | ALLOCATE( t_surf_window_v_1(0)%t(1:surf_usm_v(0)%ns) ) |
---|
5765 | READ ( 13 ) tmp_surf_window_v(0)%t |
---|
5766 | ENDIF |
---|
5767 | CALL surface_restore_elements( & |
---|
5768 | t_surf_window_v_1(0)%t, tmp_surf_window_v(0)%t,& |
---|
5769 | surf_usm_v(0)%start_index, & |
---|
5770 | start_index_on_file, & |
---|
5771 | end_index_on_file, & |
---|
5772 | nxlc, nysc, & |
---|
5773 | nxlf, nxrf, nysf, nynf, & |
---|
5774 | nys_on_file, nyn_on_file, & |
---|
5775 | nxl_on_file,nxr_on_file ) |
---|
5776 | #endif |
---|
5777 | |
---|
5778 | CASE ( 't_surf_window_v(1)' ) |
---|
5779 | #if defined( __nopointer ) |
---|
5780 | IF ( kk == 1 ) THEN |
---|
5781 | IF ( .NOT. ALLOCATED( t_surf_window_v(1)%t ) ) & |
---|
5782 | ALLOCATE( t_surf_window_v(1)%t(1:surf_usm_v(1)%ns) ) |
---|
5783 | READ ( 13 ) tmp_surf_window_v(1)%t |
---|
5784 | ENDIF |
---|
5785 | CALL surface_restore_elements( & |
---|
5786 | t_surf_window_v(1)%t, tmp_surf_window_v(1)%t, & |
---|
5787 | surf_usm_v(1)%start_index, & |
---|
5788 | start_index_on_file, & |
---|
5789 | end_index_on_file, & |
---|
5790 | nxlc, nysc, & |
---|
5791 | nxlf, nxrf, nysf, nynf, & |
---|
5792 | nys_on_file, nyn_on_file, & |
---|
5793 | nxl_on_file,nxr_on_file ) |
---|
5794 | #else |
---|
5795 | IF ( kk == 1 ) THEN |
---|
5796 | IF ( .NOT. ALLOCATED( t_surf_window_v_1(1)%t ) ) & |
---|
5797 | ALLOCATE( t_surf_window_v_1(1)%t(1:surf_usm_v(1)%ns) ) |
---|
5798 | READ ( 13 ) tmp_surf_window_v(1)%t |
---|
5799 | ENDIF |
---|
5800 | CALL surface_restore_elements( & |
---|
5801 | t_surf_window_v_1(1)%t, tmp_surf_window_v(1)%t,& |
---|
5802 | surf_usm_v(1)%start_index, & |
---|
5803 | start_index_on_file, & |
---|
5804 | end_index_on_file, & |
---|
5805 | nxlc, nysc, & |
---|
5806 | nxlf, nxrf, nysf, nynf, & |
---|
5807 | nys_on_file, nyn_on_file, & |
---|
5808 | nxl_on_file,nxr_on_file ) |
---|
5809 | #endif |
---|
5810 | |
---|
5811 | CASE ( 't_surf_window_v(2)' ) |
---|
5812 | #if defined( __nopointer ) |
---|
5813 | IF ( kk == 1 ) THEN |
---|
5814 | IF ( .NOT. ALLOCATED( t_surf_window_v(2)%t ) ) & |
---|
5815 | ALLOCATE( t_surf_window_v(2)%t(1:surf_usm_v(2)%ns) ) |
---|
5816 | READ ( 13 ) tmp_surf_window_v(2)%t |
---|
5817 | ENDIF |
---|
5818 | CALL surface_restore_elements( & |
---|
5819 | t_surf_window_v(2)%t, tmp_surf_window_v(2)%t, & |
---|
5820 | surf_usm_v(2)%start_index, & |
---|
5821 | start_index_on_file, & |
---|
5822 | end_index_on_file, & |
---|
5823 | nxlc, nysc, & |
---|
5824 | nxlf, nxrf, nysf, nynf, & |
---|
5825 | nys_on_file, nyn_on_file, & |
---|
5826 | nxl_on_file,nxr_on_file ) |
---|
5827 | #else |
---|
5828 | IF ( kk == 1 ) THEN |
---|
5829 | IF ( .NOT. ALLOCATED( t_surf_window_v_1(2)%t ) ) & |
---|
5830 | ALLOCATE( t_surf_window_v_1(2)%t(1:surf_usm_v(2)%ns) ) |
---|
5831 | READ ( 13 ) tmp_surf_window_v(2)%t |
---|
5832 | ENDIF |
---|
5833 | CALL surface_restore_elements( & |
---|
5834 | t_surf_window_v_1(2)%t, tmp_surf_window_v(2)%t,& |
---|
5835 | surf_usm_v(2)%start_index, & |
---|
5836 | start_index_on_file, & |
---|
5837 | end_index_on_file, & |
---|
5838 | nxlc, nysc, & |
---|
5839 | nxlf, nxrf, nysf, nynf, & |
---|
5840 | nys_on_file, nyn_on_file, & |
---|
5841 | nxl_on_file,nxr_on_file ) |
---|
5842 | #endif |
---|
5843 | |
---|
5844 | CASE ( 't_surf_window_v(3)' ) |
---|
5845 | #if defined( __nopointer ) |
---|
5846 | IF ( kk == 1 ) THEN |
---|
5847 | IF ( .NOT. ALLOCATED( t_surf_window_v(3)%t ) ) & |
---|
5848 | ALLOCATE( t_surf_window_v(3)%t(1:surf_usm_v(3)%ns) ) |
---|
5849 | READ ( 13 ) tmp_surf_window_v(3)%t |
---|
5850 | ENDIF |
---|
5851 | CALL surface_restore_elements( & |
---|
5852 | t_surf_window_v(3)%t, tmp_surf_window_v(3)%t, & |
---|
5853 | surf_usm_v(3)%start_index, & |
---|
5854 | start_index_on_file, & |
---|
5855 | end_index_on_file, & |
---|
5856 | nxlc, nysc, & |
---|
5857 | nxlf, nxrf, nysf, nynf, & |
---|
5858 | nys_on_file, nyn_on_file, & |
---|
5859 | nxl_on_file,nxr_on_file ) |
---|
5860 | #else |
---|
5861 | IF ( kk == 1 ) THEN |
---|
5862 | IF ( .NOT. ALLOCATED( t_surf_window_v_1(3)%t ) ) & |
---|
5863 | ALLOCATE( t_surf_window_v_1(3)%t(1:surf_usm_v(3)%ns) ) |
---|
5864 | READ ( 13 ) tmp_surf_window_v(3)%t |
---|
5865 | ENDIF |
---|
5866 | CALL surface_restore_elements( & |
---|
5867 | t_surf_window_v_1(3)%t, tmp_surf_window_v(3)%t,& |
---|
5868 | surf_usm_v(3)%start_index, & |
---|
5869 | start_index_on_file, & |
---|
5870 | end_index_on_file, & |
---|
5871 | nxlc, nysc, & |
---|
5872 | nxlf, nxrf, nysf, nynf, & |
---|
5873 | nys_on_file, nyn_on_file, & |
---|
5874 | nxl_on_file,nxr_on_file ) |
---|
5875 | #endif |
---|
5876 | CASE ( 't_wall_h' ) |
---|
5877 | #if defined( __nopointer ) |
---|
5878 | IF ( kk == 1 ) THEN |
---|
5879 | IF ( .NOT. ALLOCATED( t_wall_h ) ) & |
---|
5880 | ALLOCATE( t_wall_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
5881 | READ ( 13 ) tmp_wall_h |
---|
5882 | ENDIF |
---|
5883 | CALL surface_restore_elements( & |
---|
5884 | t_wall_h, tmp_wall_h, & |
---|
5885 | surf_usm_h%start_index, & |
---|
5886 | start_index_on_file, & |
---|
5887 | end_index_on_file, & |
---|
5888 | nxlc, nysc, & |
---|
5889 | nxlf, nxrf, nysf, nynf, & |
---|
5890 | nys_on_file, nyn_on_file, & |
---|
5891 | nxl_on_file,nxr_on_file ) |
---|
5892 | #else |
---|
5893 | IF ( kk == 1 ) THEN |
---|
5894 | IF ( .NOT. ALLOCATED( t_wall_h_1 ) ) & |
---|
5895 | ALLOCATE( t_wall_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
5896 | READ ( 13 ) tmp_wall_h |
---|
5897 | ENDIF |
---|
5898 | CALL surface_restore_elements( & |
---|
5899 | t_wall_h_1, tmp_wall_h, & |
---|
5900 | surf_usm_h%start_index, & |
---|
5901 | start_index_on_file, & |
---|
5902 | end_index_on_file, & |
---|
5903 | nxlc, nysc, & |
---|
5904 | nxlf, nxrf, nysf, nynf, & |
---|
5905 | nys_on_file, nyn_on_file, & |
---|
5906 | nxl_on_file,nxr_on_file ) |
---|
5907 | #endif |
---|
5908 | CASE ( 't_wall_v(0)' ) |
---|
5909 | #if defined( __nopointer ) |
---|
5910 | IF ( kk == 1 ) THEN |
---|
5911 | IF ( .NOT. ALLOCATED( t_wall_v(0)%t ) ) & |
---|
5912 | ALLOCATE( t_wall_v(0)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(0)%ns) ) |
---|
5913 | READ ( 13 ) tmp_wall_v(0)%t |
---|
5914 | ENDIF |
---|
5915 | CALL surface_restore_elements( & |
---|
5916 | t_wall_v(0)%t, tmp_wall_v(0)%t, & |
---|
5917 | surf_usm_v(0)%start_index, & |
---|
5918 | start_index_on_file, & |
---|
5919 | end_index_on_file, & |
---|
5920 | nxlc, nysc, & |
---|
5921 | nxlf, nxrf, nysf, nynf, & |
---|
5922 | nys_on_file, nyn_on_file, & |
---|
5923 | nxl_on_file,nxr_on_file ) |
---|
5924 | #else |
---|
5925 | IF ( kk == 1 ) THEN |
---|
5926 | IF ( .NOT. ALLOCATED( t_wall_v_1(0)%t ) ) & |
---|
5927 | ALLOCATE( t_wall_v_1(0)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(0)%ns) ) |
---|
5928 | READ ( 13 ) tmp_wall_v(0)%t |
---|
5929 | ENDIF |
---|
5930 | CALL surface_restore_elements( & |
---|
5931 | t_wall_v_1(0)%t, tmp_wall_v(0)%t,& |
---|
5932 | surf_usm_v(0)%start_index, & |
---|
5933 | start_index_on_file, & |
---|
5934 | end_index_on_file, & |
---|
5935 | nxlc, nysc, & |
---|
5936 | nxlf, nxrf, nysf, nynf, & |
---|
5937 | nys_on_file, nyn_on_file, & |
---|
5938 | nxl_on_file,nxr_on_file ) |
---|
5939 | #endif |
---|
5940 | CASE ( 't_wall_v(1)' ) |
---|
5941 | #if defined( __nopointer ) |
---|
5942 | IF ( kk == 1 ) THEN |
---|
5943 | IF ( .NOT. ALLOCATED( t_wall_v(1)%t ) ) & |
---|
5944 | ALLOCATE( t_wall_v(1)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(1)%ns) ) |
---|
5945 | READ ( 13 ) tmp_wall_v(1)%t |
---|
5946 | ENDIF |
---|
5947 | CALL surface_restore_elements( & |
---|
5948 | t_wall_v(1)%t, tmp_wall_v(1)%t, & |
---|
5949 | surf_usm_v(1)%start_index, & |
---|
5950 | start_index_on_file, & |
---|
5951 | end_index_on_file , & |
---|
5952 | nxlc, nysc, , & |
---|
5953 | nys_on_file, nyn_on_file, & |
---|
5954 | nxl_on_file,nxr_on_file ) |
---|
5955 | #else |
---|
5956 | IF ( kk == 1 ) THEN |
---|
5957 | IF ( .NOT. ALLOCATED( t_wall_v_1(1)%t ) ) & |
---|
5958 | ALLOCATE( t_wall_v_1(1)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(1)%ns) ) |
---|
5959 | READ ( 13 ) tmp_wall_v(1)%t |
---|
5960 | ENDIF |
---|
5961 | CALL surface_restore_elements( & |
---|
5962 | t_wall_v_1(1)%t, tmp_wall_v(1)%t,& |
---|
5963 | surf_usm_v(1)%start_index, & |
---|
5964 | start_index_on_file, & |
---|
5965 | end_index_on_file, & |
---|
5966 | nxlc, nysc, & |
---|
5967 | nxlf, nxrf, nysf, nynf, & |
---|
5968 | nys_on_file, nyn_on_file, & |
---|
5969 | nxl_on_file,nxr_on_file ) |
---|
5970 | #endif |
---|
5971 | CASE ( 't_wall_v(2)' ) |
---|
5972 | #if defined( __nopointer ) |
---|
5973 | IF ( kk == 1 ) THEN |
---|
5974 | IF ( .NOT. ALLOCATED( t_wall_v(2)%t ) ) & |
---|
5975 | ALLOCATE( t_wall_v(2)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(2)%ns) ) |
---|
5976 | READ ( 13 ) tmp_wall_v(2)%t |
---|
5977 | ENDIF |
---|
5978 | CALL surface_restore_elements( & |
---|
5979 | t_wall_v(2)%t, tmp_wall_v(2)%t, & |
---|
5980 | surf_usm_v(2)%start_index, & |
---|
5981 | start_index_on_file, & |
---|
5982 | end_index_on_file, & |
---|
5983 | nxlc, nysc, & |
---|
5984 | nxlf, nxrf, nysf, nynf, & |
---|
5985 | nys_on_file, nyn_on_file, & |
---|
5986 | nxl_on_file,nxr_on_file ) |
---|
5987 | #else |
---|
5988 | IF ( kk == 1 ) THEN |
---|
5989 | IF ( .NOT. ALLOCATED( t_wall_v_1(2)%t ) ) & |
---|
5990 | ALLOCATE( t_wall_v_1(2)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(2)%ns) ) |
---|
5991 | READ ( 13 ) tmp_wall_v(2)%t |
---|
5992 | ENDIF |
---|
5993 | CALL surface_restore_elements( & |
---|
5994 | t_wall_v_1(2)%t, tmp_wall_v(2)%t,& |
---|
5995 | surf_usm_v(2)%start_index, & |
---|
5996 | start_index_on_file, & |
---|
5997 | end_index_on_file , & |
---|
5998 | nxlc, nysc, & |
---|
5999 | nxlf, nxrf, nysf, nynf, & |
---|
6000 | nys_on_file, nyn_on_file, & |
---|
6001 | nxl_on_file,nxr_on_file ) |
---|
6002 | #endif |
---|
6003 | CASE ( 't_wall_v(3)' ) |
---|
6004 | #if defined( __nopointer ) |
---|
6005 | IF ( kk == 1 ) THEN |
---|
6006 | IF ( .NOT. ALLOCATED( t_wall_v(3)%t ) ) & |
---|
6007 | ALLOCATE( t_wall_v(3)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(3)%ns) ) |
---|
6008 | READ ( 13 ) tmp_wall_v(3)%t |
---|
6009 | ENDIF |
---|
6010 | CALL surface_restore_elements( & |
---|
6011 | t_wall_v(3)%t, tmp_wall_v(3)%t, & |
---|
6012 | surf_usm_v(3)%start_index, & |
---|
6013 | start_index_on_file, & |
---|
6014 | end_index_on_file, & |
---|
6015 | nxlc, nysc, & |
---|
6016 | nxlf, nxrf, nysf, nynf, & |
---|
6017 | nys_on_file, nyn_on_file, & |
---|
6018 | nxl_on_file,nxr_on_file ) |
---|
6019 | #else |
---|
6020 | IF ( kk == 1 ) THEN |
---|
6021 | IF ( .NOT. ALLOCATED( t_wall_v_1(3)%t ) ) & |
---|
6022 | ALLOCATE( t_wall_v_1(3)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(3)%ns) ) |
---|
6023 | READ ( 13 ) tmp_wall_v(3)%t |
---|
6024 | ENDIF |
---|
6025 | CALL surface_restore_elements( & |
---|
6026 | t_wall_v_1(3)%t, tmp_wall_v(3)%t,& |
---|
6027 | surf_usm_v(3)%start_index, & |
---|
6028 | start_index_on_file, & |
---|
6029 | end_index_on_file, & |
---|
6030 | nxlc, nysc, & |
---|
6031 | nxlf, nxrf, nysf, nynf, & |
---|
6032 | nys_on_file, nyn_on_file, & |
---|
6033 | nxl_on_file,nxr_on_file ) |
---|
6034 | #endif |
---|
6035 | CASE ( 't_green_h' ) |
---|
6036 | #if defined( __nopointer ) |
---|
6037 | IF ( kk == 1 ) THEN |
---|
6038 | IF ( .NOT. ALLOCATED( t_green_h ) ) & |
---|
6039 | ALLOCATE( t_green_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
6040 | READ ( 13 ) tmp_green_h |
---|
6041 | ENDIF |
---|
6042 | CALL surface_restore_elements( & |
---|
6043 | t_green_h, tmp_green_h, & |
---|
6044 | surf_usm_h%start_index, & |
---|
6045 | start_index_on_file, & |
---|
6046 | end_index_on_file, & |
---|
6047 | nxlc, nysc, & |
---|
6048 | nxlf, nxrf, nysf, nynf, & |
---|
6049 | nys_on_file, nyn_on_file, & |
---|
6050 | nxl_on_file,nxr_on_file ) |
---|
6051 | #else |
---|
6052 | IF ( kk == 1 ) THEN |
---|
6053 | IF ( .NOT. ALLOCATED( t_green_h_1 ) ) & |
---|
6054 | ALLOCATE( t_green_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
6055 | READ ( 13 ) tmp_green_h |
---|
6056 | ENDIF |
---|
6057 | CALL surface_restore_elements( & |
---|
6058 | t_green_h_1, tmp_green_h, & |
---|
6059 | surf_usm_h%start_index, & |
---|
6060 | start_index_on_file, & |
---|
6061 | end_index_on_file, & |
---|
6062 | nxlc, nysc, & |
---|
6063 | nxlf, nxrf, nysf, nynf, & |
---|
6064 | nys_on_file, nyn_on_file, & |
---|
6065 | nxl_on_file,nxr_on_file ) |
---|
6066 | #endif |
---|
6067 | CASE ( 't_green_v(0)' ) |
---|
6068 | #if defined( __nopointer ) |
---|
6069 | IF ( kk == 1 ) THEN |
---|
6070 | IF ( .NOT. ALLOCATED( t_green_v(0)%t ) ) & |
---|
6071 | ALLOCATE( t_green_v(0)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(0)%ns) ) |
---|
6072 | READ ( 13 ) tmp_green_v(0)%t |
---|
6073 | ENDIF |
---|
6074 | CALL surface_restore_elements( & |
---|
6075 | t_green_v(0)%t, tmp_green_v(0)%t, & |
---|
6076 | surf_usm_v(0)%start_index, & |
---|
6077 | start_index_on_file, & |
---|
6078 | end_index_on_file, & |
---|
6079 | nxlc, nysc, & |
---|
6080 | nxlf, nxrf, nysf, nynf, & |
---|
6081 | nys_on_file, nyn_on_file, & |
---|
6082 | nxl_on_file,nxr_on_file ) |
---|
6083 | #else |
---|
6084 | IF ( kk == 1 ) THEN |
---|
6085 | IF ( .NOT. ALLOCATED( t_green_v_1(0)%t ) ) & |
---|
6086 | ALLOCATE( t_green_v_1(0)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(0)%ns) ) |
---|
6087 | READ ( 13 ) tmp_green_v(0)%t |
---|
6088 | ENDIF |
---|
6089 | CALL surface_restore_elements( & |
---|
6090 | t_green_v_1(0)%t, tmp_green_v(0)%t,& |
---|
6091 | surf_usm_v(0)%start_index, & |
---|
6092 | start_index_on_file, & |
---|
6093 | end_index_on_file, & |
---|
6094 | nxlc, nysc, & |
---|
6095 | nxlf, nxrf, nysf, nynf, & |
---|
6096 | nys_on_file, nyn_on_file, & |
---|
6097 | nxl_on_file,nxr_on_file ) |
---|
6098 | #endif |
---|
6099 | CASE ( 't_green_v(1)' ) |
---|
6100 | #if defined( __nopointer ) |
---|
6101 | IF ( kk == 1 ) THEN |
---|
6102 | IF ( .NOT. ALLOCATED( t_green_v(1)%t ) ) & |
---|
6103 | ALLOCATE( t_green_v(1)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(1)%ns) ) |
---|
6104 | READ ( 13 ) tmp_green_v(1)%t |
---|
6105 | ENDIF |
---|
6106 | CALL surface_restore_elements( & |
---|
6107 | t_green_v(1)%t, tmp_green_v(1)%t, & |
---|
6108 | surf_usm_v(1)%start_index, & |
---|
6109 | start_index_on_file, & |
---|
6110 | end_index_on_file , & |
---|
6111 | nxlc, nysc, , & |
---|
6112 | nys_on_file, nyn_on_file, & |
---|
6113 | nxl_on_file,nxr_on_file ) |
---|
6114 | #else |
---|
6115 | IF ( kk == 1 ) THEN |
---|
6116 | IF ( .NOT. ALLOCATED( t_green_v_1(1)%t ) ) & |
---|
6117 | ALLOCATE( t_green_v_1(1)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(1)%ns) ) |
---|
6118 | READ ( 13 ) tmp_green_v(1)%t |
---|
6119 | ENDIF |
---|
6120 | CALL surface_restore_elements( & |
---|
6121 | t_green_v_1(1)%t, tmp_green_v(1)%t,& |
---|
6122 | surf_usm_v(1)%start_index, & |
---|
6123 | start_index_on_file, & |
---|
6124 | end_index_on_file, & |
---|
6125 | nxlc, nysc, & |
---|
6126 | nxlf, nxrf, nysf, nynf, & |
---|
6127 | nys_on_file, nyn_on_file, & |
---|
6128 | nxl_on_file,nxr_on_file ) |
---|
6129 | #endif |
---|
6130 | CASE ( 't_green_v(2)' ) |
---|
6131 | #if defined( __nopointer ) |
---|
6132 | IF ( kk == 1 ) THEN |
---|
6133 | IF ( .NOT. ALLOCATED( t_green_v(2)%t ) ) & |
---|
6134 | ALLOCATE( t_green_v(2)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(2)%ns) ) |
---|
6135 | READ ( 13 ) tmp_green_v(2)%t |
---|
6136 | ENDIF |
---|
6137 | CALL surface_restore_elements( & |
---|
6138 | t_green_v(2)%t, tmp_green_v(2)%t, & |
---|
6139 | surf_usm_v(2)%start_index, & |
---|
6140 | start_index_on_file, & |
---|
6141 | end_index_on_file, & |
---|
6142 | nxlc, nysc, & |
---|
6143 | nxlf, nxrf, nysf, nynf, & |
---|
6144 | nys_on_file, nyn_on_file, & |
---|
6145 | nxl_on_file,nxr_on_file ) |
---|
6146 | #else |
---|
6147 | IF ( kk == 1 ) THEN |
---|
6148 | IF ( .NOT. ALLOCATED( t_green_v_1(2)%t ) ) & |
---|
6149 | ALLOCATE( t_green_v_1(2)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(2)%ns) ) |
---|
6150 | READ ( 13 ) tmp_green_v(2)%t |
---|
6151 | ENDIF |
---|
6152 | CALL surface_restore_elements( & |
---|
6153 | t_green_v_1(2)%t, tmp_green_v(2)%t,& |
---|
6154 | surf_usm_v(2)%start_index, & |
---|
6155 | start_index_on_file, & |
---|
6156 | end_index_on_file , & |
---|
6157 | nxlc, nysc, & |
---|
6158 | nxlf, nxrf, nysf, nynf, & |
---|
6159 | nys_on_file, nyn_on_file, & |
---|
6160 | nxl_on_file,nxr_on_file ) |
---|
6161 | #endif |
---|
6162 | CASE ( 't_green_v(3)' ) |
---|
6163 | #if defined( __nopointer ) |
---|
6164 | IF ( kk == 1 ) THEN |
---|
6165 | IF ( .NOT. ALLOCATED( t_green_v(3)%t ) ) & |
---|
6166 | ALLOCATE( t_green_v(3)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(3)%ns) ) |
---|
6167 | READ ( 13 ) tmp_green_v(3)%t |
---|
6168 | ENDIF |
---|
6169 | CALL surface_restore_elements( & |
---|
6170 | t_green_v(3)%t, tmp_green_v(3)%t, & |
---|
6171 | surf_usm_v(3)%start_index, & |
---|
6172 | start_index_on_file, & |
---|
6173 | end_index_on_file, & |
---|
6174 | nxlc, nysc, & |
---|
6175 | nxlf, nxrf, nysf, nynf, & |
---|
6176 | nys_on_file, nyn_on_file, & |
---|
6177 | nxl_on_file,nxr_on_file ) |
---|
6178 | #else |
---|
6179 | IF ( kk == 1 ) THEN |
---|
6180 | IF ( .NOT. ALLOCATED( t_green_v_1(3)%t ) ) & |
---|
6181 | ALLOCATE( t_green_v_1(3)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(3)%ns) ) |
---|
6182 | READ ( 13 ) tmp_green_v(3)%t |
---|
6183 | ENDIF |
---|
6184 | CALL surface_restore_elements( & |
---|
6185 | t_green_v_1(3)%t, tmp_green_v(3)%t,& |
---|
6186 | surf_usm_v(3)%start_index, & |
---|
6187 | start_index_on_file, & |
---|
6188 | end_index_on_file, & |
---|
6189 | nxlc, nysc, & |
---|
6190 | nxlf, nxrf, nysf, nynf, & |
---|
6191 | nys_on_file, nyn_on_file, & |
---|
6192 | nxl_on_file,nxr_on_file ) |
---|
6193 | #endif |
---|
6194 | CASE ( 't_window_h' ) |
---|
6195 | #if defined( __nopointer ) |
---|
6196 | IF ( kk == 1 ) THEN |
---|
6197 | IF ( .NOT. ALLOCATED( t_window_h ) ) & |
---|
6198 | ALLOCATE( t_window_h(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
6199 | READ ( 13 ) tmp_window_h |
---|
6200 | ENDIF |
---|
6201 | CALL surface_restore_elements( & |
---|
6202 | t_window_h, tmp_window_h, & |
---|
6203 | surf_usm_h%start_index, & |
---|
6204 | start_index_on_file, & |
---|
6205 | end_index_on_file, & |
---|
6206 | nxlc, nysc, & |
---|
6207 | nxlf, nxrf, nysf, nynf, & |
---|
6208 | nys_on_file, nyn_on_file, & |
---|
6209 | nxl_on_file,nxr_on_file ) |
---|
6210 | #else |
---|
6211 | IF ( kk == 1 ) THEN |
---|
6212 | IF ( .NOT. ALLOCATED( t_window_h_1 ) ) & |
---|
6213 | ALLOCATE( t_window_h_1(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) ) |
---|
6214 | READ ( 13 ) tmp_window_h |
---|
6215 | ENDIF |
---|
6216 | CALL surface_restore_elements( & |
---|
6217 | t_window_h_1, tmp_window_h, & |
---|
6218 | surf_usm_h%start_index, & |
---|
6219 | start_index_on_file, & |
---|
6220 | end_index_on_file, & |
---|
6221 | nxlc, nysc, & |
---|
6222 | nxlf, nxrf, nysf, nynf, & |
---|
6223 | nys_on_file, nyn_on_file, & |
---|
6224 | nxl_on_file,nxr_on_file ) |
---|
6225 | #endif |
---|
6226 | CASE ( 't_window_v(0)' ) |
---|
6227 | #if defined( __nopointer ) |
---|
6228 | IF ( kk == 1 ) THEN |
---|
6229 | IF ( .NOT. ALLOCATED( t_window_v(0)%t ) ) & |
---|
6230 | ALLOCATE( t_window_v(0)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(0)%ns) ) |
---|
6231 | READ ( 13 ) tmp_window_v(0)%t |
---|
6232 | ENDIF |
---|
6233 | CALL surface_restore_elements( & |
---|
6234 | t_window_v(0)%t, tmp_window_v(0)%t, & |
---|
6235 | surf_usm_v(0)%start_index, & |
---|
6236 | start_index_on_file, & |
---|
6237 | end_index_on_file, & |
---|
6238 | nxlc, nysc, & |
---|
6239 | nxlf, nxrf, nysf, nynf, & |
---|
6240 | nys_on_file, nyn_on_file, & |
---|
6241 | nxl_on_file,nxr_on_file ) |
---|
6242 | #else |
---|
6243 | IF ( kk == 1 ) THEN |
---|
6244 | IF ( .NOT. ALLOCATED( t_window_v_1(0)%t ) ) & |
---|
6245 | ALLOCATE( t_window_v_1(0)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(0)%ns) ) |
---|
6246 | READ ( 13 ) tmp_window_v(0)%t |
---|
6247 | ENDIF |
---|
6248 | CALL surface_restore_elements( & |
---|
6249 | t_window_v_1(0)%t, tmp_window_v(0)%t,& |
---|
6250 | surf_usm_v(0)%start_index, & |
---|
6251 | start_index_on_file, & |
---|
6252 | end_index_on_file, & |
---|
6253 | nxlc, nysc, & |
---|
6254 | nxlf, nxrf, nysf, nynf, & |
---|
6255 | nys_on_file, nyn_on_file, & |
---|
6256 | nxl_on_file,nxr_on_file ) |
---|
6257 | #endif |
---|
6258 | CASE ( 't_window_v(1)' ) |
---|
6259 | #if defined( __nopointer ) |
---|
6260 | IF ( kk == 1 ) THEN |
---|
6261 | IF ( .NOT. ALLOCATED( t_window_v(1)%t ) ) & |
---|
6262 | ALLOCATE( t_window_v(1)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(1)%ns) ) |
---|
6263 | READ ( 13 ) tmp_window_v(1)%t |
---|
6264 | ENDIF |
---|
6265 | CALL surface_restore_elements( & |
---|
6266 | t_window_v(1)%t, tmp_window_v(1)%t, & |
---|
6267 | surf_usm_v(1)%start_index, & |
---|
6268 | start_index_on_file, & |
---|
6269 | end_index_on_file , & |
---|
6270 | nxlc, nysc, , & |
---|
6271 | nys_on_file, nyn_on_file, & |
---|
6272 | nxl_on_file,nxr_on_file ) |
---|
6273 | #else |
---|
6274 | IF ( kk == 1 ) THEN |
---|
6275 | IF ( .NOT. ALLOCATED( t_window_v_1(1)%t ) ) & |
---|
6276 | ALLOCATE( t_window_v_1(1)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(1)%ns) ) |
---|
6277 | READ ( 13 ) tmp_window_v(1)%t |
---|
6278 | ENDIF |
---|
6279 | CALL surface_restore_elements( & |
---|
6280 | t_window_v_1(1)%t, tmp_window_v(1)%t,& |
---|
6281 | surf_usm_v(1)%start_index, & |
---|
6282 | start_index_on_file, & |
---|
6283 | end_index_on_file, & |
---|
6284 | nxlc, nysc, & |
---|
6285 | nxlf, nxrf, nysf, nynf, & |
---|
6286 | nys_on_file, nyn_on_file, & |
---|
6287 | nxl_on_file,nxr_on_file ) |
---|
6288 | #endif |
---|
6289 | CASE ( 't_window_v(2)' ) |
---|
6290 | #if defined( __nopointer ) |
---|
6291 | IF ( kk == 1 ) THEN |
---|
6292 | IF ( .NOT. ALLOCATED( t_window_v(2)%t ) ) & |
---|
6293 | ALLOCATE( t_window_v(2)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(2)%ns) ) |
---|
6294 | READ ( 13 ) tmp_window_v(2)%t |
---|
6295 | ENDIF |
---|
6296 | CALL surface_restore_elements( & |
---|
6297 | t_window_v(2)%t, tmp_window_v(2)%t, & |
---|
6298 | surf_usm_v(2)%start_index, & |
---|
6299 | start_index_on_file, & |
---|
6300 | end_index_on_file, & |
---|
6301 | nxlc, nysc, & |
---|
6302 | nxlf, nxrf, nysf, nynf, & |
---|
6303 | nys_on_file, nyn_on_file, & |
---|
6304 | nxl_on_file,nxr_on_file ) |
---|
6305 | #else |
---|
6306 | IF ( kk == 1 ) THEN |
---|
6307 | IF ( .NOT. ALLOCATED( t_window_v_1(2)%t ) ) & |
---|
6308 | ALLOCATE( t_window_v_1(2)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(2)%ns) ) |
---|
6309 | READ ( 13 ) tmp_window_v(2)%t |
---|
6310 | ENDIF |
---|
6311 | CALL surface_restore_elements( & |
---|
6312 | t_window_v_1(2)%t, tmp_window_v(2)%t,& |
---|
6313 | surf_usm_v(2)%start_index, & |
---|
6314 | start_index_on_file, & |
---|
6315 | end_index_on_file , & |
---|
6316 | nxlc, nysc, & |
---|
6317 | nxlf, nxrf, nysf, nynf, & |
---|
6318 | nys_on_file, nyn_on_file, & |
---|
6319 | nxl_on_file,nxr_on_file ) |
---|
6320 | #endif |
---|
6321 | CASE ( 't_window_v(3)' ) |
---|
6322 | #if defined( __nopointer ) |
---|
6323 | IF ( kk == 1 ) THEN |
---|
6324 | IF ( .NOT. ALLOCATED( t_window_v(3)%t ) ) & |
---|
6325 | ALLOCATE( t_window_v(3)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(3)%ns) ) |
---|
6326 | READ ( 13 ) tmp_window_v(3)%t |
---|
6327 | ENDIF |
---|
6328 | CALL surface_restore_elements( & |
---|
6329 | t_window_v(3)%t, tmp_window_v(3)%t, & |
---|
6330 | surf_usm_v(3)%start_index, & |
---|
6331 | start_index_on_file, & |
---|
6332 | end_index_on_file, & |
---|
6333 | nxlc, nysc, & |
---|
6334 | nxlf, nxrf, nysf, nynf, & |
---|
6335 | nys_on_file, nyn_on_file, & |
---|
6336 | nxl_on_file,nxr_on_file ) |
---|
6337 | #else |
---|
6338 | IF ( kk == 1 ) THEN |
---|
6339 | IF ( .NOT. ALLOCATED( t_window_v_1(3)%t ) ) & |
---|
6340 | ALLOCATE( t_window_v_1(3)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(3)%ns) ) |
---|
6341 | READ ( 13 ) tmp_window_v(3)%t |
---|
6342 | ENDIF |
---|
6343 | CALL surface_restore_elements( & |
---|
6344 | t_window_v_1(3)%t, tmp_window_v(3)%t,& |
---|
6345 | surf_usm_v(3)%start_index, & |
---|
6346 | start_index_on_file, & |
---|
6347 | end_index_on_file, & |
---|
6348 | nxlc, nysc, & |
---|
6349 | nxlf, nxrf, nysf, nynf, & |
---|
6350 | nys_on_file, nyn_on_file, & |
---|
6351 | nxl_on_file,nxr_on_file ) |
---|
6352 | #endif |
---|
6353 | CASE DEFAULT |
---|
6354 | WRITE ( message_string, * ) 'unknown variable named "', & |
---|
6355 | TRIM( field_chr ), '" found in', & |
---|
6356 | '&data from prior run on PE ', myid |
---|
6357 | CALL message( 'user_read_restart_data', 'UI0012', 1, 2, 0, 6, 0 ) |
---|
6358 | |
---|
6359 | END SELECT |
---|
6360 | |
---|
6361 | ENDDO |
---|
6362 | |
---|
6363 | READ ( 13 ) field_chr |
---|
6364 | |
---|
6365 | ENDDO |
---|
6366 | |
---|
6367 | ENDIF |
---|
6368 | |
---|
6369 | END SUBROUTINE usm_read_restart_data |
---|
6370 | |
---|
6371 | |
---|
6372 | |
---|
6373 | !------------------------------------------------------------------------------! |
---|
6374 | ! Description: |
---|
6375 | ! ------------ |
---|
6376 | ! |
---|
6377 | !> This subroutine reads walls, roofs and land categories and it parameters |
---|
6378 | !> from input files. |
---|
6379 | !------------------------------------------------------------------------------! |
---|
6380 | SUBROUTINE usm_read_urban_surface_types |
---|
6381 | |
---|
6382 | USE netcdf_data_input_mod, & |
---|
6383 | ONLY: building_pars_f, building_type_f |
---|
6384 | |
---|
6385 | IMPLICIT NONE |
---|
6386 | |
---|
6387 | CHARACTER(12) :: wtn |
---|
6388 | INTEGER(iwp) :: wtc |
---|
6389 | REAL(wp), DIMENSION(n_surface_params) :: wtp |
---|
6390 | |
---|
6391 | INTEGER(iwp), DIMENSION(0:17, nysg:nyng, nxlg:nxrg) :: usm_par |
---|
6392 | REAL(wp), DIMENSION(1:14, nysg:nyng, nxlg:nxrg) :: usm_val |
---|
6393 | INTEGER(iwp) :: k, l, d, iw, jw, kw, it, ip, ii, ij, m |
---|
6394 | INTEGER(iwp) :: i, j |
---|
6395 | INTEGER(iwp) :: nz, roof, dirwe, dirsn |
---|
6396 | INTEGER(iwp) :: category |
---|
6397 | INTEGER(iwp) :: weheight1, wecat1, snheight1, sncat1 |
---|
6398 | INTEGER(iwp) :: weheight2, wecat2, snheight2, sncat2 |
---|
6399 | INTEGER(iwp) :: weheight3, wecat3, snheight3, sncat3 |
---|
6400 | REAL(wp) :: height, albedo, thick |
---|
6401 | REAL(wp) :: wealbedo1, wethick1, snalbedo1, snthick1 |
---|
6402 | REAL(wp) :: wealbedo2, wethick2, snalbedo2, snthick2 |
---|
6403 | REAL(wp) :: wealbedo3, wethick3, snalbedo3, snthick3 |
---|
6404 | |
---|
6405 | LOGICAL :: surfpar |
---|
6406 | LOGICAL :: urbsurf |
---|
6407 | |
---|
6408 | ! |
---|
6409 | !-- If building_pars or building_type are already read from static input |
---|
6410 | !-- file, skip reading ASCII file. |
---|
6411 | IF ( building_type_f%from_file .OR. building_pars_f%from_file ) & |
---|
6412 | RETURN |
---|
6413 | |
---|
6414 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
6415 | !-- read categories of walls and their parameters |
---|
6416 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
6417 | DO ii = 0, io_blocks-1 |
---|
6418 | IF ( ii == io_group ) THEN |
---|
6419 | |
---|
6420 | !-- open urban surface file |
---|
6421 | OPEN( 151, file='SURFACE_PARAMETERS'//coupling_char, action='read', & |
---|
6422 | status='old', form='formatted', err=15 ) |
---|
6423 | !-- first test and get n_surface_types |
---|
6424 | k = 0 |
---|
6425 | l = 0 |
---|
6426 | DO |
---|
6427 | l = l+1 |
---|
6428 | READ( 151, *, err=11, end=12 ) wtc, wtp, wtn |
---|
6429 | k = k+1 |
---|
6430 | CYCLE |
---|
6431 | 11 CONTINUE |
---|
6432 | ENDDO |
---|
6433 | 12 n_surface_types = k |
---|
6434 | ALLOCATE( surface_type_names(n_surface_types) ) |
---|
6435 | ALLOCATE( surface_type_codes(n_surface_types) ) |
---|
6436 | ALLOCATE( surface_params(n_surface_params, n_surface_types) ) |
---|
6437 | !-- real reading |
---|
6438 | rewind( 151 ) |
---|
6439 | k = 0 |
---|
6440 | DO |
---|
6441 | READ( 151, *, err=13, end=14 ) wtc, wtp, wtn |
---|
6442 | k = k+1 |
---|
6443 | surface_type_codes(k) = wtc |
---|
6444 | surface_params(:,k) = wtp |
---|
6445 | surface_type_names(k) = wtn |
---|
6446 | CYCLE |
---|
6447 | 13 WRITE(6,'(i3,a,2i5)') myid, 'readparams2 error k=', k |
---|
6448 | FLUSH(6) |
---|
6449 | CONTINUE |
---|
6450 | ENDDO |
---|
6451 | 14 CLOSE(151) |
---|
6452 | CYCLE |
---|
6453 | 15 message_string = 'file SURFACE_PARAMETERS'//TRIM(coupling_char)//' does not exist' |
---|
6454 | CALL message( 'usm_read_urban_surface_types', 'PA0513', 1, 2, 0, 6, 0 ) |
---|
6455 | ENDIF |
---|
6456 | ENDDO |
---|
6457 | |
---|
6458 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
6459 | !-- read types of surfaces |
---|
6460 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
6461 | usm_par = 0 |
---|
6462 | DO ii = 0, io_blocks-1 |
---|
6463 | IF ( ii == io_group ) THEN |
---|
6464 | |
---|
6465 | ! |
---|
6466 | !-- open csv urban surface file |
---|
6467 | OPEN( 151, file='URBAN_SURFACE'//TRIM(coupling_char), action='read', & |
---|
6468 | status='old', form='formatted', err=23 ) |
---|
6469 | |
---|
6470 | l = 0 |
---|
6471 | DO |
---|
6472 | l = l+1 |
---|
6473 | !-- i, j, height, nz, roof, dirwe, dirsn, category, soilcat, |
---|
6474 | !-- weheight1, wecat1, snheight1, sncat1, weheight2, wecat2, snheight2, sncat2, |
---|
6475 | !-- weheight3, wecat3, snheight3, sncat3 |
---|
6476 | READ( 151, *, err=21, end=25 ) i, j, height, nz, roof, dirwe, dirsn, & |
---|
6477 | category, albedo, thick, & |
---|
6478 | weheight1, wecat1, wealbedo1, wethick1, & |
---|
6479 | weheight2, wecat2, wealbedo2, wethick2, & |
---|
6480 | weheight3, wecat3, wealbedo3, wethick3, & |
---|
6481 | snheight1, sncat1, snalbedo1, snthick1, & |
---|
6482 | snheight2, sncat2, snalbedo2, snthick2, & |
---|
6483 | snheight3, sncat3, snalbedo3, snthick3 |
---|
6484 | |
---|
6485 | IF ( i >= nxlg .AND. i <= nxrg .AND. j >= nysg .AND. j <= nyng ) THEN |
---|
6486 | !-- write integer variables into array |
---|
6487 | usm_par(:,j,i) = (/1, nz, roof, dirwe, dirsn, category, & |
---|
6488 | weheight1, wecat1, weheight2, wecat2, weheight3, wecat3, & |
---|
6489 | snheight1, sncat1, snheight2, sncat2, snheight3, sncat3 /) |
---|
6490 | !-- write real values into array |
---|
6491 | usm_val(:,j,i) = (/ albedo, thick, & |
---|
6492 | wealbedo1, wethick1, wealbedo2, wethick2, & |
---|
6493 | wealbedo3, wethick3, snalbedo1, snthick1, & |
---|
6494 | snalbedo2, snthick2, snalbedo3, snthick3 /) |
---|
6495 | ENDIF |
---|
6496 | CYCLE |
---|
6497 | 21 WRITE (message_string, "(A,I5)") 'errors in file URBAN_SURFACE'//TRIM(coupling_char)//' on line ', l |
---|
6498 | CALL message( 'usm_read_urban_surface_types', 'PA0512', 0, 1, 0, 6, 0 ) |
---|
6499 | ENDDO |
---|
6500 | |
---|
6501 | 23 message_string = 'file URBAN_SURFACE'//TRIM(coupling_char)//' does not exist' |
---|
6502 | CALL message( 'usm_read_urban_surface_types', 'PA0514', 1, 2, 0, 6, 0 ) |
---|
6503 | |
---|
6504 | 25 CLOSE( 90 ) |
---|
6505 | |
---|
6506 | ENDIF |
---|
6507 | #if defined( __parallel ) && ! defined ( __check ) |
---|
6508 | CALL MPI_BARRIER( comm2d, ierr ) |
---|
6509 | #endif |
---|
6510 | ENDDO |
---|
6511 | |
---|
6512 | ! |
---|
6513 | !-- check completeness and formal correctness of the data |
---|
6514 | DO i = nxlg, nxrg |
---|
6515 | DO j = nysg, nyng |
---|
6516 | IF ( usm_par(0,j,i) /= 0 .AND. ( & !< incomplete data,supply default values later |
---|
6517 | usm_par(1,j,i) < nzb .OR. & |
---|
6518 | usm_par(1,j,i) > nzt .OR. & !< incorrect height (nz < nzb .OR. nz > nzt) |
---|
6519 | usm_par(2,j,i) < 0 .OR. & |
---|
6520 | usm_par(2,j,i) > 1 .OR. & !< incorrect roof sign |
---|
6521 | usm_par(3,j,i) < nzb-nzt .OR. & |
---|
6522 | usm_par(3,j,i) > nzt-nzb .OR. & !< incorrect west-east wall direction sign |
---|
6523 | usm_par(4,j,i) < nzb-nzt .OR. & |
---|
6524 | usm_par(4,j,i) > nzt-nzb .OR. & !< incorrect south-north wall direction sign |
---|
6525 | usm_par(6,j,i) < nzb .OR. & |
---|
6526 | usm_par(6,j,i) > nzt .OR. & !< incorrect pedestrian level height for west-east wall |
---|
6527 | usm_par(8,j,i) > nzt .OR. & |
---|
6528 | usm_par(10,j,i) > nzt .OR. & !< incorrect wall or roof level height for west-east wall |
---|
6529 | usm_par(12,j,i) < nzb .OR. & |
---|
6530 | usm_par(12,j,i) > nzt .OR. & !< incorrect pedestrian level height for south-north wall |
---|
6531 | usm_par(14,j,i) > nzt .OR. & |
---|
6532 | usm_par(16,j,i) > nzt & !< incorrect wall or roof level height for south-north wall |
---|
6533 | ) ) THEN |
---|
6534 | !-- incorrect input data |
---|
6535 | WRITE (message_string, "(A,2I5)") 'missing or incorrect data in file URBAN_SURFACE'// & |
---|
6536 | TRIM(coupling_char)//' for i,j=', i,j |
---|
6537 | CALL message( 'usm_read_urban_surface', 'PA0504', 1, 2, 0, 6, 0 ) |
---|
6538 | ENDIF |
---|
6539 | |
---|
6540 | ENDDO |
---|
6541 | ENDDO |
---|
6542 | ! |
---|
6543 | !-- Assign the surface types to the respective data type. |
---|
6544 | !-- First, for horizontal upward-facing surfaces. |
---|
6545 | DO m = 1, surf_usm_h%ns |
---|
6546 | iw = surf_usm_h%i(m) |
---|
6547 | jw = surf_usm_h%j(m) |
---|
6548 | kw = surf_usm_h%k(m) |
---|
6549 | |
---|
6550 | IF ( usm_par(5,jw,iw) == 0 ) THEN |
---|
6551 | #if ! defined( __nopointer ) |
---|
6552 | IF ( zu(kw) >= roof_height_limit ) THEN |
---|
6553 | surf_usm_h%isroof_surf(m) = .TRUE. |
---|
6554 | surf_usm_h%surface_types(m) = roof_category !< default category for root surface |
---|
6555 | ELSE |
---|
6556 | surf_usm_h%isroof_surf(m) = .FALSE. |
---|
6557 | surf_usm_h%surface_types(m) = land_category !< default category for land surface |
---|
6558 | ENDIF |
---|
6559 | #endif |
---|
6560 | surf_usm_h%albedo(:,m) = -1.0_wp |
---|
6561 | surf_usm_h%thickness_wall(m) = -1.0_wp |
---|
6562 | surf_usm_h%thickness_green(m) = -1.0_wp |
---|
6563 | surf_usm_h%thickness_window(m) = -1.0_wp |
---|
6564 | ELSE |
---|
6565 | IF ( usm_par(2,jw,iw)==0 ) THEN |
---|
6566 | surf_usm_h%isroof_surf(m) = .FALSE. |
---|
6567 | surf_usm_h%thickness_wall(m) = -1.0_wp |
---|
6568 | surf_usm_h%thickness_window(m) = -1.0_wp |
---|
6569 | surf_usm_h%thickness_green(m) = -1.0_wp |
---|
6570 | ELSE |
---|
6571 | surf_usm_h%isroof_surf(m) = .TRUE. |
---|
6572 | surf_usm_h%thickness_wall(m) = usm_val(2,jw,iw) |
---|
6573 | surf_usm_h%thickness_window(m) = usm_val(2,jw,iw) |
---|
6574 | surf_usm_h%thickness_green(m) = usm_val(2,jw,iw) |
---|
6575 | ENDIF |
---|
6576 | surf_usm_h%surface_types(m) = usm_par(5,jw,iw) |
---|
6577 | surf_usm_h%albedo(:,m) = usm_val(1,jw,iw) |
---|
6578 | surf_usm_h%transmissivity(m) = 0.0_wp |
---|
6579 | ENDIF |
---|
6580 | ! |
---|
6581 | !-- Find the type position |
---|
6582 | it = surf_usm_h%surface_types(m) |
---|
6583 | ip = -99999 |
---|
6584 | DO k = 1, n_surface_types |
---|
6585 | IF ( surface_type_codes(k) == it ) THEN |
---|
6586 | ip = k |
---|
6587 | EXIT |
---|
6588 | ENDIF |
---|
6589 | ENDDO |
---|
6590 | IF ( ip == -99999 ) THEN |
---|
6591 | !-- wall category not found |
---|
6592 | WRITE (message_string, "(A,I5,A,3I5)") 'wall category ', it, & |
---|
6593 | ' not found for i,j,k=', iw,jw,kw |
---|
6594 | CALL message( 'usm_read_urban_surface', 'PA0506', 1, 2, 0, 6, 0 ) |
---|
6595 | ENDIF |
---|
6596 | ! |
---|
6597 | !-- Albedo |
---|
6598 | IF ( surf_usm_h%albedo(0,m) < 0.0_wp ) THEN |
---|
6599 | surf_usm_h%albedo(:,m) = surface_params(ialbedo,ip) |
---|
6600 | ENDIF |
---|
6601 | !-- Transmissivity |
---|
6602 | IF ( surf_usm_h%transmissivity(m) < 0.0_wp ) THEN |
---|
6603 | surf_usm_h%transmissivity(m) = 0.0_wp |
---|
6604 | ENDIF |
---|
6605 | ! |
---|
6606 | !-- emissivity of the wall |
---|
6607 | surf_usm_h%emissivity(:,m) = surface_params(iemiss,ip) |
---|
6608 | ! |
---|
6609 | !-- heat conductivity λS between air and wall ( W mâ2 Kâ1 ) |
---|
6610 | surf_usm_h%lambda_surf(m) = surface_params(ilambdas,ip) |
---|
6611 | surf_usm_h%lambda_surf_window(m) = surface_params(ilambdas,ip) |
---|
6612 | surf_usm_h%lambda_surf_green(m) = surface_params(ilambdas,ip) |
---|
6613 | ! |
---|
6614 | !-- roughness relative to concrete |
---|
6615 | surf_usm_h%z0(m) = surface_params(irough,ip) |
---|
6616 | ! |
---|
6617 | !-- Surface skin layer heat capacity (J mâ2 Kâ1 ) |
---|
6618 | surf_usm_h%c_surface(m) = surface_params(icsurf,ip) |
---|
6619 | surf_usm_h%c_surface_window(m) = surface_params(icsurf,ip) |
---|
6620 | surf_usm_h%c_surface_green(m) = surface_params(icsurf,ip) |
---|
6621 | ! |
---|
6622 | !-- wall material parameters: |
---|
6623 | !-- thickness of the wall (m) |
---|
6624 | !-- missing values are replaced by default value for category |
---|
6625 | IF ( surf_usm_h%thickness_wall(m) <= 0.001_wp ) THEN |
---|
6626 | surf_usm_h%thickness_wall(m) = surface_params(ithick,ip) |
---|
6627 | ENDIF |
---|
6628 | IF ( surf_usm_h%thickness_window(m) <= 0.001_wp ) THEN |
---|
6629 | surf_usm_h%thickness_window(m) = surface_params(ithick,ip) |
---|
6630 | ENDIF |
---|
6631 | IF ( surf_usm_h%thickness_green(m) <= 0.001_wp ) THEN |
---|
6632 | surf_usm_h%thickness_green(m) = surface_params(ithick,ip) |
---|
6633 | ENDIF |
---|
6634 | ! |
---|
6635 | !-- volumetric heat capacity rho*C of the wall ( J mâ3 Kâ1 ) |
---|
6636 | surf_usm_h%rho_c_wall(:,m) = surface_params(irhoC,ip) |
---|
6637 | surf_usm_h%rho_c_window(:,m) = surface_params(irhoC,ip) |
---|
6638 | surf_usm_h%rho_c_green(:,m) = surface_params(irhoC,ip) |
---|
6639 | ! |
---|
6640 | !-- thermal conductivity λH of the wall (W mâ1 Kâ1 ) |
---|
6641 | surf_usm_h%lambda_h(:,m) = surface_params(ilambdah,ip) |
---|
6642 | surf_usm_h%lambda_h_window(:,m) = surface_params(ilambdah,ip) |
---|
6643 | surf_usm_h%lambda_h_green(:,m) = surface_params(ilambdah,ip) |
---|
6644 | |
---|
6645 | ENDDO |
---|
6646 | ! |
---|
6647 | !-- For vertical surface elements ( 0 -- northward-facing, 1 -- southward-facing, |
---|
6648 | !-- 2 -- eastward-facing, 3 -- westward-facing ) |
---|
6649 | DO l = 0, 3 |
---|
6650 | DO m = 1, surf_usm_v(l)%ns |
---|
6651 | i = surf_usm_v(l)%i(m) |
---|
6652 | j = surf_usm_v(l)%j(m) |
---|
6653 | kw = surf_usm_v(l)%k(m) |
---|
6654 | |
---|
6655 | IF ( l == 3 ) THEN ! westward facing |
---|
6656 | iw = i |
---|
6657 | jw = j |
---|
6658 | ii = 6 |
---|
6659 | ij = 3 |
---|
6660 | ELSEIF ( l == 2 ) THEN |
---|
6661 | iw = i-1 |
---|
6662 | jw = j |
---|
6663 | ii = 6 |
---|
6664 | ij = 3 |
---|
6665 | ELSEIF ( l == 1 ) THEN |
---|
6666 | iw = i |
---|
6667 | jw = j |
---|
6668 | ii = 12 |
---|
6669 | ij = 9 |
---|
6670 | ELSEIF ( l == 0 ) THEN |
---|
6671 | iw = i |
---|
6672 | jw = j-1 |
---|
6673 | ii = 12 |
---|
6674 | ij = 9 |
---|
6675 | ENDIF |
---|
6676 | |
---|
6677 | IF ( kw <= usm_par(ii,jw,iw) ) THEN |
---|
6678 | !-- pedestrant zone |
---|
6679 | IF ( usm_par(ii+1,jw,iw) == 0 ) THEN |
---|
6680 | surf_usm_v(l)%surface_types(m) = pedestrant_category !< default category for wall surface in pedestrant zone |
---|
6681 | surf_usm_v(l)%albedo(:,m) = -1.0_wp |
---|
6682 | surf_usm_v(l)%thickness_wall(m) = -1.0_wp |
---|
6683 | surf_usm_v(l)%thickness_window(m) = -1.0_wp |
---|
6684 | surf_usm_v(l)%thickness_green(m) = -1.0_wp |
---|
6685 | surf_usm_v(l)%transmissivity(m) = -1.0_wp |
---|
6686 | ELSE |
---|
6687 | surf_usm_v(l)%surface_types(m) = usm_par(ii+1,jw,iw) |
---|
6688 | surf_usm_v(l)%albedo(:,m) = usm_val(ij,jw,iw) |
---|
6689 | surf_usm_v(l)%thickness_wall(m) = usm_val(ij+1,jw,iw) |
---|
6690 | surf_usm_v(l)%thickness_window(m) = usm_val(ij+1,jw,iw) |
---|
6691 | surf_usm_v(l)%thickness_green(m) = usm_val(ij+1,jw,iw) |
---|
6692 | surf_usm_v(l)%transmissivity(m) = 0.0_wp |
---|
6693 | ENDIF |
---|
6694 | ELSE IF ( kw <= usm_par(ii+2,jw,iw) ) THEN |
---|
6695 | !-- wall zone |
---|
6696 | IF ( usm_par(ii+3,jw,iw) == 0 ) THEN |
---|
6697 | surf_usm_v(l)%surface_types(m) = wall_category !< default category for wall surface |
---|
6698 | surf_usm_v(l)%albedo(:,m) = -1.0_wp |
---|
6699 | surf_usm_v(l)%thickness_wall(m) = -1.0_wp |
---|
6700 | surf_usm_v(l)%thickness_window(m) = -1.0_wp |
---|
6701 | surf_usm_v(l)%thickness_green(m) = -1.0_wp |
---|
6702 | surf_usm_v(l)%transmissivity(m) = -1.0_wp |
---|
6703 | ELSE |
---|
6704 | surf_usm_v(l)%surface_types(m) = usm_par(ii+3,jw,iw) |
---|
6705 | surf_usm_v(l)%albedo(:,m) = usm_val(ij+2,jw,iw) |
---|
6706 | surf_usm_v(l)%thickness_wall(m) = usm_val(ij+3,jw,iw) |
---|
6707 | surf_usm_v(l)%thickness_window(m) = usm_val(ij+3,jw,iw) |
---|
6708 | surf_usm_v(l)%thickness_green(m) = usm_val(ij+3,jw,iw) |
---|
6709 | surf_usm_v(l)%transmissivity(m) = 0.0_wp |
---|
6710 | ENDIF |
---|
6711 | ELSE IF ( kw <= usm_par(ii+4,jw,iw) ) THEN |
---|
6712 | !-- roof zone |
---|
6713 | IF ( usm_par(ii+5,jw,iw) == 0 ) THEN |
---|
6714 | surf_usm_v(l)%surface_types(m) = roof_category !< default category for roof surface |
---|
6715 | surf_usm_v(l)%albedo(:,m) = -1.0_wp |
---|
6716 | surf_usm_v(l)%thickness_wall(m) = -1.0_wp |
---|
6717 | surf_usm_v(l)%thickness_window(m) = -1.0_wp |
---|
6718 | surf_usm_v(l)%thickness_green(m) = -1.0_wp |
---|
6719 | surf_usm_v(l)%transmissivity(m) = -1.0_wp |
---|
6720 | ELSE |
---|
6721 | surf_usm_v(l)%surface_types(m) = usm_par(ii+5,jw,iw) |
---|
6722 | surf_usm_v(l)%albedo(:,m) = usm_val(ij+4,jw,iw) |
---|
6723 | surf_usm_v(l)%thickness_wall(m) = usm_val(ij+5,jw,iw) |
---|
6724 | surf_usm_v(l)%thickness_window(m) = usm_val(ij+5,jw,iw) |
---|
6725 | surf_usm_v(l)%thickness_green(m) = usm_val(ij+5,jw,iw) |
---|
6726 | surf_usm_v(l)%transmissivity(m) = 0.0_wp |
---|
6727 | ENDIF |
---|
6728 | ELSE |
---|
6729 | !-- something wrong |
---|
6730 | CALL message( 'usm_read_urban_surface', 'PA0505', 1, 2, 0, 6, 0 ) |
---|
6731 | ENDIF |
---|
6732 | |
---|
6733 | ! |
---|
6734 | !-- Find the type position |
---|
6735 | it = surf_usm_v(l)%surface_types(m) |
---|
6736 | ip = -99999 |
---|
6737 | DO k = 1, n_surface_types |
---|
6738 | IF ( surface_type_codes(k) == it ) THEN |
---|
6739 | ip = k |
---|
6740 | EXIT |
---|
6741 | ENDIF |
---|
6742 | ENDDO |
---|
6743 | IF ( ip == -99999 ) THEN |
---|
6744 | !-- wall category not found |
---|
6745 | WRITE (message_string, "(A,I5,A,3I5)") 'wall category ', it, & |
---|
6746 | ' not found for i,j,k=', iw,jw,kw |
---|
6747 | CALL message( 'usm_read_urban_surface', 'PA0506', 1, 2, 0, 6, 0 ) |
---|
6748 | ENDIF |
---|
6749 | ! |
---|
6750 | !-- Albedo |
---|
6751 | IF ( surf_usm_v(l)%albedo(0,m) < 0.0_wp ) THEN |
---|
6752 | surf_usm_v(l)%albedo(:,m) = surface_params(ialbedo,ip) |
---|
6753 | ENDIF |
---|
6754 | !-- Transmissivity of the windows |
---|
6755 | IF ( surf_usm_v(l)%transmissivity(m) < 0.0_wp ) THEN |
---|
6756 | surf_usm_v(l)%transmissivity(m) = 0.0_wp |
---|
6757 | ENDIF |
---|
6758 | ! |
---|
6759 | !-- emissivity of the wall |
---|
6760 | surf_usm_v(l)%emissivity(:,m) = surface_params(iemiss,ip) |
---|
6761 | ! |
---|
6762 | !-- heat conductivity λS between air and wall ( W mâ2 Kâ1 ) |
---|
6763 | surf_usm_v(l)%lambda_surf(m) = surface_params(ilambdas,ip) |
---|
6764 | surf_usm_v(l)%lambda_surf_window(m) = surface_params(ilambdas,ip) |
---|
6765 | surf_usm_v(l)%lambda_surf_green(m) = surface_params(ilambdas,ip) |
---|
6766 | ! |
---|
6767 | !-- roughness relative to concrete |
---|
6768 | surf_usm_v(l)%z0(m) = surface_params(irough,ip) |
---|
6769 | ! |
---|
6770 | !-- Surface skin layer heat capacity (J mâ2 Kâ1 ) |
---|
6771 | surf_usm_v(l)%c_surface(m) = surface_params(icsurf,ip) |
---|
6772 | surf_usm_v(l)%c_surface_window(m) = surface_params(icsurf,ip) |
---|
6773 | surf_usm_v(l)%c_surface_green(m) = surface_params(icsurf,ip) |
---|
6774 | ! |
---|
6775 | !-- wall material parameters: |
---|
6776 | !-- thickness of the wall (m) |
---|
6777 | !-- missing values are replaced by default value for category |
---|
6778 | IF ( surf_usm_v(l)%thickness_wall(m) <= 0.001_wp ) THEN |
---|
6779 | surf_usm_v(l)%thickness_wall(m) = surface_params(ithick,ip) |
---|
6780 | ENDIF |
---|
6781 | IF ( surf_usm_v(l)%thickness_window(m) <= 0.001_wp ) THEN |
---|
6782 | surf_usm_v(l)%thickness_window(m) = surface_params(ithick,ip) |
---|
6783 | ENDIF |
---|
6784 | IF ( surf_usm_v(l)%thickness_green(m) <= 0.001_wp ) THEN |
---|
6785 | surf_usm_v(l)%thickness_green(m) = surface_params(ithick,ip) |
---|
6786 | ENDIF |
---|
6787 | ! |
---|
6788 | !-- volumetric heat capacity rho*C of the wall ( J mâ3 Kâ1 ) |
---|
6789 | surf_usm_v(l)%rho_c_wall(:,m) = surface_params(irhoC,ip) |
---|
6790 | surf_usm_v(l)%rho_c_window(:,m) = surface_params(irhoC,ip) |
---|
6791 | surf_usm_v(l)%rho_c_green(:,m) = surface_params(irhoC,ip) |
---|
6792 | ! |
---|
6793 | !-- thermal conductivity λH of the wall (W mâ1 Kâ1 ) |
---|
6794 | surf_usm_v(l)%lambda_h(:,m) = surface_params(ilambdah,ip) |
---|
6795 | surf_usm_v(l)%lambda_h_window(:,m) = surface_params(ilambdah,ip) |
---|
6796 | surf_usm_v(l)%lambda_h_green(:,m) = surface_params(ilambdah,ip) |
---|
6797 | |
---|
6798 | ENDDO |
---|
6799 | ENDDO |
---|
6800 | ! |
---|
6801 | !-- Initialize wall layer thicknesses. Please note, this will be removed |
---|
6802 | !-- after migration to Palm input data standard. |
---|
6803 | DO k = nzb_wall, nzt_wall |
---|
6804 | zwn(k) = zwn_default(k) |
---|
6805 | zwn_green(k) = zwn_default_green(k) |
---|
6806 | zwn_window(k) = zwn_default_window(k) |
---|
6807 | ENDDO |
---|
6808 | ! |
---|
6809 | !-- apply for all particular surface grids. First for horizontal surfaces |
---|
6810 | DO m = 1, surf_usm_h%ns |
---|
6811 | surf_usm_h%zw(:,m) = zwn(:) * surf_usm_h%thickness_wall(m) |
---|
6812 | surf_usm_h%zw_green(:,m) = zwn_green(:) * surf_usm_h%thickness_green(m) |
---|
6813 | surf_usm_h%zw_window(:,m) = zwn_window(:) * surf_usm_h%thickness_window(m) |
---|
6814 | ENDDO |
---|
6815 | DO l = 0, 3 |
---|
6816 | DO m = 1, surf_usm_v(l)%ns |
---|
6817 | surf_usm_v(l)%zw(:,m) = zwn(:) * surf_usm_v(l)%thickness_wall(m) |
---|
6818 | surf_usm_v(l)%zw_green(:,m) = zwn_green(:) * surf_usm_v(l)%thickness_green(m) |
---|
6819 | surf_usm_v(l)%zw_window(:,m) = zwn_window(:) * surf_usm_v(l)%thickness_window(m) |
---|
6820 | ENDDO |
---|
6821 | ENDDO |
---|
6822 | |
---|
6823 | CALL location_message( ' types and parameters of urban surfaces read', .TRUE. ) |
---|
6824 | |
---|
6825 | END SUBROUTINE usm_read_urban_surface_types |
---|
6826 | |
---|
6827 | |
---|
6828 | !------------------------------------------------------------------------------! |
---|
6829 | ! Description: |
---|
6830 | ! ------------ |
---|
6831 | !> Solver for the energy balance at the ground/roof/wall surface. |
---|
6832 | !> It follows basic ideas and structure of lsm_energy_balance |
---|
6833 | !> with many simplifications and adjustments. |
---|
6834 | !> TODO better description |
---|
6835 | !------------------------------------------------------------------------------! |
---|
6836 | SUBROUTINE usm_surface_energy_balance |
---|
6837 | |
---|
6838 | IMPLICIT NONE |
---|
6839 | |
---|
6840 | INTEGER(iwp) :: i, j, k, l, d, m !< running indices |
---|
6841 | |
---|
6842 | REAL(wp) :: u1,v1,w1 !< near wall u,v,w |
---|
6843 | REAL(wp) :: stend !< surface tendency |
---|
6844 | REAL(wp) :: stend_window !< surface tendency |
---|
6845 | REAL(wp) :: stend_green !< surface tendency |
---|
6846 | REAL(wp) :: coef_1 !< first coeficient for prognostic equation |
---|
6847 | REAL(wp) :: coef_window_1 !< first coeficient for prognostic window equation |
---|
6848 | REAL(wp) :: coef_green_1 !< first coeficient for prognostic green wall equation |
---|
6849 | REAL(wp) :: coef_2 !< second coeficient for prognostic equation |
---|
6850 | REAL(wp) :: coef_window_2 !< second coeficient for prognostic window equation |
---|
6851 | REAL(wp) :: coef_green_2 !< second coeficient for prognostic green wall equation |
---|
6852 | REAL(wp) :: rho_cp !< rho_wall_surface * cp |
---|
6853 | REAL(wp) :: r_a !< aerodynamic resistance for horizontal and vertical surfaces |
---|
6854 | REAL(wp) :: r_a_window !< aerodynamic resistance for horizontal and vertical window surfaces |
---|
6855 | REAL(wp) :: r_a_green !< aerodynamic resistance for horizontal and vertical green surfaces |
---|
6856 | REAL(wp) :: f_shf !< factor for shf_eb |
---|
6857 | REAL(wp) :: f_shf_window !< factor for shf_eb window |
---|
6858 | REAL(wp) :: f_shf_green !< factor for shf_eb green wall |
---|
6859 | REAL(wp) :: lambda_surface !< current value of lambda_surface (heat conductivity between air and wall) |
---|
6860 | REAL(wp) :: lambda_surface_window !< current value of lambda_surface (heat conductivity between air and window) |
---|
6861 | REAL(wp) :: lambda_surface_green !< current value of lambda_surface (heat conductivity between air and greeb wall) |
---|
6862 | REAL(wp) :: Ueff !< effective wind speed for calculation of heat transfer coefficients |
---|
6863 | REAL(wp) :: httc !< heat transfer coefficient |
---|
6864 | REAL(wp) :: httc_window !< heat transfer coefficient window |
---|
6865 | REAL(wp) :: httc_green !< heat transfer coefficient green wall |
---|
6866 | REAL(wp), DIMENSION(nzub:nzut) :: exn !< value of the Exner function in layers |
---|
6867 | |
---|
6868 | REAL(wp), DIMENSION(0:4) :: dxdir !< surface normal direction gridbox length |
---|
6869 | REAL(wp) :: dtime !< simulated time of day (in UTC) |
---|
6870 | INTEGER(iwp) :: dhour !< simulated hour of day (in UTC) |
---|
6871 | REAL(wp) :: acoef !< actual coefficient of diurnal profile of anthropogenic heat |
---|
6872 | |
---|
6873 | |
---|
6874 | dxdir = (/dz,dy,dy,dx,dx/) |
---|
6875 | #if ! defined( __nopointer ) |
---|
6876 | exn(:) = (hyp(nzub:nzut) / 100000.0_wp )**0.286_wp !< Exner function |
---|
6877 | #endif |
---|
6878 | ! |
---|
6879 | !-- First, treat horizontal surface elements |
---|
6880 | DO m = 1, surf_usm_h%ns |
---|
6881 | ! |
---|
6882 | !-- Get indices of respective grid point |
---|
6883 | i = surf_usm_h%i(m) |
---|
6884 | j = surf_usm_h%j(m) |
---|
6885 | k = surf_usm_h%k(m) |
---|
6886 | ! |
---|
6887 | !-- TODO - how to calculate lambda_surface for horizontal surfaces |
---|
6888 | !-- (lambda_surface is set according to stratification in land surface model) |
---|
6889 | !-- MS: ??? |
---|
6890 | IF ( surf_usm_h%ol(m) >= 0.0_wp ) THEN |
---|
6891 | lambda_surface = surf_usm_h%lambda_surf(m) |
---|
6892 | lambda_surface_window = surf_usm_h%lambda_surf_window(m) |
---|
6893 | lambda_surface_green = surf_usm_h%lambda_surf_green(m) |
---|
6894 | ELSE |
---|
6895 | lambda_surface = surf_usm_h%lambda_surf(m) |
---|
6896 | lambda_surface_window = surf_usm_h%lambda_surf_window(m) |
---|
6897 | lambda_surface_green = surf_usm_h%lambda_surf_green(m) |
---|
6898 | ENDIF |
---|
6899 | #if ! defined( __nopointer ) |
---|
6900 | ! |
---|
6901 | !-- calculate rho * cp coefficient at surface layer |
---|
6902 | rho_cp = cp * hyp(k) / ( r_d * surf_usm_h%pt1(m) * exn(k) ) |
---|
6903 | #endif |
---|
6904 | ! |
---|
6905 | !-- Calculate aerodyamic resistance. |
---|
6906 | !-- Calculation for horizontal surfaces follows LSM formulation |
---|
6907 | !-- pt, us, ts are not available for the prognostic time step, |
---|
6908 | !-- data from the last time step is used here. |
---|
6909 | |
---|
6910 | !-- Workarounf to keep resistances positive |
---|
6911 | r_a = ( surf_usm_h%pt1(m) - surf_usm_h%pt_surface(m) ) / & |
---|
6912 | ( surf_usm_h%ts(m) * surf_usm_h%us(m) + 1.0E-20_wp ) |
---|
6913 | r_a_window = r_a |
---|
6914 | r_a_green = r_a |
---|
6915 | ! r_a = ( surf_usm_h%pt1(m) - t_surf_h(m) / exn(k) ) / & |
---|
6916 | ! ( surf_usm_h%ts(m) * surf_usm_h%us(m) + 1.0E-20_wp ) |
---|
6917 | ! r_a_window = ( surf_usm_h%pt1(m) - t_surf_window_h(m) / exn(k) ) / & |
---|
6918 | ! ( surf_usm_h%ts(m) * surf_usm_h%us(m) + 1.0E-20_wp ) |
---|
6919 | ! r_a_green = ( surf_usm_h%pt1(m) - t_surf_green_h(m) / exn(k) ) / & |
---|
6920 | ! ( surf_usm_h%ts(m) * surf_usm_h%us(m) + 1.0E-20_wp ) |
---|
6921 | |
---|
6922 | !-- make sure that the resistance does not drop to zero |
---|
6923 | IF ( r_a < 1.0_wp ) r_a = 1.0_wp |
---|
6924 | IF ( r_a_window < 1.0_wp ) r_a_window = 1.0_wp |
---|
6925 | IF ( r_a_green < 1.0_wp ) r_a_green = 1.0_wp |
---|
6926 | |
---|
6927 | |
---|
6928 | !-- the parameterization is developed originally for larger scales |
---|
6929 | !-- (compare with remark in TUF-3D) |
---|
6930 | !-- our first experiences show that the parameterization underestimates |
---|
6931 | !-- r_a in meter resolution. |
---|
6932 | !-- A temporary solution would be multiplication by magic constant :-(. |
---|
6933 | !-- For the moment this is comment out. |
---|
6934 | r_a = r_a !* ra_horiz_coef |
---|
6935 | r_a_window = r_a_window !* ra_horiz_coef |
---|
6936 | r_a_green = r_a_green !* ra_horiz_coef |
---|
6937 | |
---|
6938 | !-- factor for shf_eb |
---|
6939 | f_shf = rho_cp / r_a |
---|
6940 | f_shf_window = rho_cp / r_a_window |
---|
6941 | f_shf_green = rho_cp / r_a_green |
---|
6942 | |
---|
6943 | !-- add LW up so that it can be removed in prognostic equation |
---|
6944 | surf_usm_h%rad_net_l(m) = surf_usm_h%rad_sw_in(m) - & |
---|
6945 | surf_usm_h%rad_sw_out(m) + & |
---|
6946 | surf_usm_h%rad_lw_in(m) - & |
---|
6947 | surf_usm_h%rad_lw_out(m) |
---|
6948 | |
---|
6949 | !-- numerator of the prognostic equation |
---|
6950 | !-- Todo: Adjust to tile approach. So far, emissivity for wall (element 0) |
---|
6951 | !-- is used |
---|
6952 | coef_1 = surf_usm_h%rad_net_l(m) + & |
---|
6953 | ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(0,m) * sigma_sb * & |
---|
6954 | t_surf_h(m) ** 4 + & |
---|
6955 | f_shf * surf_usm_h%pt1(m) + & |
---|
6956 | lambda_surface * t_wall_h(nzb_wall,m) |
---|
6957 | coef_window_1 = surf_usm_h%rad_net_l(m) + & |
---|
6958 | ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(2,m) * sigma_sb * & |
---|
6959 | t_surf_window_h(m) ** 4 + & |
---|
6960 | f_shf_window * surf_usm_h%pt1(m) + & |
---|
6961 | lambda_surface_window * t_window_h(nzb_wall,m) |
---|
6962 | coef_green_1 = surf_usm_h%rad_net_l(m) + & |
---|
6963 | ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(1,m) * sigma_sb * & |
---|
6964 | t_surf_green_h(m) ** 4 + & |
---|
6965 | f_shf_green * surf_usm_h%pt1(m) + & |
---|
6966 | lambda_surface_green * t_wall_h(nzb_wall,m) |
---|
6967 | |
---|
6968 | !-- denominator of the prognostic equation |
---|
6969 | coef_2 = 4.0_wp * surf_usm_h%emissivity(0,m) * sigma_sb * & |
---|
6970 | t_surf_h(m) ** 3 & |
---|
6971 | + lambda_surface + f_shf / exn(k) |
---|
6972 | coef_window_2 = 4.0_wp * surf_usm_h%emissivity(2,m) * sigma_sb * & |
---|
6973 | t_surf_window_h(m) ** 3 & |
---|
6974 | + lambda_surface_window + f_shf_window / exn(k) |
---|
6975 | coef_green_2 = 4.0_wp * surf_usm_h%emissivity(1,m) * sigma_sb * & |
---|
6976 | t_surf_green_h(m) ** 3 & |
---|
6977 | + lambda_surface_green + f_shf_green / exn(k) |
---|
6978 | |
---|
6979 | !-- implicit solution when the surface layer has no heat capacity, |
---|
6980 | !-- otherwise use RK3 scheme. |
---|
6981 | t_surf_h_p(m) = ( coef_1 * dt_3d * tsc(2) + & |
---|
6982 | surf_usm_h%c_surface(m) * t_surf_h(m) ) / & |
---|
6983 | ( surf_usm_h%c_surface(m) + coef_2 * dt_3d * tsc(2) ) |
---|
6984 | t_surf_window_h_p(m) = ( coef_window_1 * dt_3d * tsc(2) + & |
---|
6985 | surf_usm_h%c_surface_window(m) * t_surf_window_h(m) ) / & |
---|
6986 | ( surf_usm_h%c_surface_window(m) + coef_window_2 * dt_3d * tsc(2) ) |
---|
6987 | t_surf_green_h_p(m) = ( coef_green_1 * dt_3d * tsc(2) + & |
---|
6988 | surf_usm_h%c_surface_green(m) * t_surf_green_h(m) ) / & |
---|
6989 | ( surf_usm_h%c_surface_green(m) + coef_green_2 * dt_3d * tsc(2) ) |
---|
6990 | |
---|
6991 | !-- add RK3 term |
---|
6992 | t_surf_h_p(m) = t_surf_h_p(m) + dt_3d * tsc(3) * & |
---|
6993 | surf_usm_h%tt_surface_m(m) |
---|
6994 | t_surf_window_h_p(m) = t_surf_window_h_p(m) + dt_3d * tsc(3) * & |
---|
6995 | surf_usm_h%tt_surface_window_m(m) |
---|
6996 | t_surf_green_h_p(m) = t_surf_green_h_p(m) + dt_3d * tsc(3) * & |
---|
6997 | surf_usm_h%tt_surface_green_m(m) |
---|
6998 | ! |
---|
6999 | !-- Store surface temperature |
---|
7000 | surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(0,m) * t_surf_h_p(m) & |
---|
7001 | + surf_usm_h%frac(2,m) * t_surf_window_h_p(m) & |
---|
7002 | + surf_usm_h%frac(1,m) * t_surf_green_h_p(m) ) & |
---|
7003 | / exn(k) |
---|
7004 | |
---|
7005 | !-- calculate true tendency |
---|
7006 | stend = ( t_surf_h_p(m) - t_surf_h(m) - dt_3d * tsc(3) * & |
---|
7007 | surf_usm_h%tt_surface_m(m)) / ( dt_3d * tsc(2) ) |
---|
7008 | stend_window = ( t_surf_window_h_p(m) - t_surf_window_h(m) - dt_3d * tsc(3) * & |
---|
7009 | surf_usm_h%tt_surface_window_m(m)) / ( dt_3d * tsc(2) ) |
---|
7010 | stend_green = ( t_surf_green_h_p(m) - t_surf_green_h(m) - dt_3d * tsc(3) * & |
---|
7011 | surf_usm_h%tt_surface_green_m(m)) / ( dt_3d * tsc(2) ) |
---|
7012 | |
---|
7013 | !-- calculate t_surf tendencies for the next Runge-Kutta step |
---|
7014 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
7015 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
7016 | surf_usm_h%tt_surface_m(m) = stend |
---|
7017 | surf_usm_h%tt_surface_window_m(m) = stend_window |
---|
7018 | surf_usm_h%tt_surface_green_m(m) = stend_green |
---|
7019 | ELSEIF ( intermediate_timestep_count < & |
---|
7020 | intermediate_timestep_count_max ) THEN |
---|
7021 | surf_usm_h%tt_surface_m(m) = -9.5625_wp * stend + & |
---|
7022 | 5.3125_wp * surf_usm_h%tt_surface_m(m) |
---|
7023 | surf_usm_h%tt_surface_window_m(m) = -9.5625_wp * stend_window + & |
---|
7024 | 5.3125_wp * surf_usm_h%tt_surface_window_m(m) |
---|
7025 | surf_usm_h%tt_surface_green_m(m) = -9.5625_wp * stend_green + & |
---|
7026 | 5.3125_wp * surf_usm_h%tt_surface_green_m(m) |
---|
7027 | ENDIF |
---|
7028 | ENDIF |
---|
7029 | |
---|
7030 | !-- in case of fast changes in the skin temperature, it is required to |
---|
7031 | !-- update the radiative fluxes in order to keep the solution stable |
---|
7032 | IF ( ( ABS( t_surf_h_p(m) - t_surf_h(m) ) > 1.0_wp ) .OR. & |
---|
7033 | ( ABS( t_surf_green_h_p(m) - t_surf_green_h(m) ) > 1.0_wp ) .OR. & |
---|
7034 | ( ABS( t_surf_window_h_p(m) - t_surf_window_h(m) ) > 1.0_wp ) ) THEN |
---|
7035 | force_radiation_call_l = .TRUE. |
---|
7036 | ENDIF |
---|
7037 | ! |
---|
7038 | !-- for horizontal surfaces is pt(nzb_s_inner(j,i),j,i) = pt_surf. |
---|
7039 | !-- there is no equivalent surface gridpoint for vertical surfaces. |
---|
7040 | !-- pt(k,j,i) is calculated for all directions in diffusion_s |
---|
7041 | !-- using surface and wall heat fluxes |
---|
7042 | #if ! defined( __nopointer ) |
---|
7043 | ! pt(k-1,j,i) = ( surf_usm_h%frac(0,m) * t_surf_h_p(m) & |
---|
7044 | ! + surf_usm_h%frac(2,m) * t_surf_window_h_p(m) & |
---|
7045 | ! + surf_usm_h%frac(1,m) * t_surf_green_h_p(m) ) & |
---|
7046 | ! / exn(k) ! not for vertical surfaces |
---|
7047 | #endif |
---|
7048 | |
---|
7049 | !-- calculate fluxes |
---|
7050 | !-- rad_net_l is never used! |
---|
7051 | surf_usm_h%rad_net_l(m) = surf_usm_h%frac(0,m) * & |
---|
7052 | ( surf_usm_h%rad_net_l(m) + & |
---|
7053 | 3.0_wp * sigma_sb * & |
---|
7054 | t_surf_h(m)**4 - 4.0_wp * sigma_sb * & |
---|
7055 | t_surf_h(m)**3 * t_surf_h_p(m) ) & |
---|
7056 | + surf_usm_h%frac(2,m) * & |
---|
7057 | ( surf_usm_h%rad_net_l(m) + & |
---|
7058 | 3.0_wp * sigma_sb * & |
---|
7059 | t_surf_window_h(m)**4 - 4.0_wp * sigma_sb * & |
---|
7060 | t_surf_window_h(m)**3 * t_surf_window_h_p(m) ) & |
---|
7061 | + surf_usm_h%frac(1,m) * & |
---|
7062 | ( surf_usm_h%rad_net_l(m) + & |
---|
7063 | 3.0_wp * sigma_sb * & |
---|
7064 | t_surf_green_h(m)**4 - 4.0_wp * sigma_sb * & |
---|
7065 | t_surf_green_h(m)**3 * t_surf_green_h_p(m) ) |
---|
7066 | surf_usm_h%wghf_eb(m) = lambda_surface * & |
---|
7067 | ( t_surf_h_p(m) - t_wall_h(nzb_wall,m) ) |
---|
7068 | surf_usm_h%wghf_eb_green(m) = lambda_surface_green * & |
---|
7069 | ( t_surf_green_h_p(m) - t_green_h(nzb_wall,m) ) |
---|
7070 | surf_usm_h%wghf_eb_window(m) = lambda_surface_window * & |
---|
7071 | ( t_surf_window_h_p(m) - t_window_h(nzb_wall,m) ) |
---|
7072 | |
---|
7073 | ! |
---|
7074 | !-- ground/wall/roof surface heat flux |
---|
7075 | surf_usm_h%wshf_eb(m) = - f_shf * ( surf_usm_h%pt1(m) - t_surf_h_p(m) / exn(k) ) * & |
---|
7076 | surf_usm_h%frac(0,m) & |
---|
7077 | - f_shf_window * ( surf_usm_h%pt1(m) - t_surf_window_h_p(m) / exn(k) ) * & |
---|
7078 | surf_usm_h%frac(2,m) & |
---|
7079 | - f_shf_green * ( surf_usm_h%pt1(m) - t_surf_green_h_p(m) / exn(k) ) * & |
---|
7080 | surf_usm_h%frac(1,m) |
---|
7081 | ! |
---|
7082 | !-- store kinematic surface heat fluxes for utilization in other processes |
---|
7083 | !-- diffusion_s, surface_layer_fluxes,... |
---|
7084 | surf_usm_h%shf(m) = surf_usm_h%wshf_eb(m) / cp |
---|
7085 | |
---|
7086 | ENDDO |
---|
7087 | ! |
---|
7088 | !-- Now, treat vertical surface elements |
---|
7089 | DO l = 0, 3 |
---|
7090 | DO m = 1, surf_usm_v(l)%ns |
---|
7091 | ! |
---|
7092 | !-- Get indices of respective grid point |
---|
7093 | i = surf_usm_v(l)%i(m) |
---|
7094 | j = surf_usm_v(l)%j(m) |
---|
7095 | k = surf_usm_v(l)%k(m) |
---|
7096 | |
---|
7097 | ! |
---|
7098 | !-- TODO - how to calculate lambda_surface for horizontal (??? do you mean verical ???) surfaces |
---|
7099 | !-- (lambda_surface is set according to stratification in land surface model). |
---|
7100 | !-- Please note, for vertical surfaces no ol is defined, since |
---|
7101 | !-- stratification is not considered in this case. |
---|
7102 | lambda_surface = surf_usm_v(l)%lambda_surf(m) |
---|
7103 | lambda_surface_window = surf_usm_v(l)%lambda_surf_window(m) |
---|
7104 | lambda_surface_green = surf_usm_v(l)%lambda_surf_green(m) |
---|
7105 | |
---|
7106 | #if ! defined( __nopointer ) |
---|
7107 | ! |
---|
7108 | !-- calculate rho * cp coefficient at surface layer |
---|
7109 | rho_cp = cp * hyp(k) / ( r_d * surf_usm_v(l)%pt1(m) * exn(k) ) |
---|
7110 | #endif |
---|
7111 | |
---|
7112 | !-- Calculation of r_a for vertical surfaces |
---|
7113 | !-- |
---|
7114 | !-- heat transfer coefficient for forced convection along vertical walls |
---|
7115 | !-- follows formulation in TUF3d model (Krayenhoff & Voogt, 2006) |
---|
7116 | !-- |
---|
7117 | !-- H = httc (Tsfc - Tair) |
---|
7118 | !-- httc = rw * (11.8 + 4.2 * Ueff) - 4.0 |
---|
7119 | !-- |
---|
7120 | !-- rw: wall patch roughness relative to 1.0 for concrete |
---|
7121 | !-- Ueff: effective wind speed |
---|
7122 | !-- - 4.0 is a reduction of Rowley et al (1930) formulation based on |
---|
7123 | !-- Cole and Sturrock (1977) |
---|
7124 | !-- |
---|
7125 | !-- Ucan: Canyon wind speed |
---|
7126 | !-- wstar: convective velocity |
---|
7127 | !-- Qs: surface heat flux |
---|
7128 | !-- zH: height of the convective layer |
---|
7129 | !-- wstar = (g/Tcan*Qs*zH)**(1./3.) |
---|
7130 | |
---|
7131 | !-- Effective velocity components must always |
---|
7132 | !-- be defined at scalar grid point. The wall normal component is |
---|
7133 | !-- obtained by simple linear interpolation. ( An alternative would |
---|
7134 | !-- be an logarithmic interpolation. ) |
---|
7135 | #if ! defined( __nopointer ) |
---|
7136 | u1 = ( u(k,j,i) + u(k,j,i+1) ) * 0.5_wp |
---|
7137 | v1 = ( v(k,j,i) + v(k,j+1,i) ) * 0.5_wp |
---|
7138 | w1 = ( w(k,j,i) + w(k-1,j,i) ) * 0.5_wp |
---|
7139 | #endif |
---|
7140 | |
---|
7141 | Ueff = SQRT( u1**2 + v1**2 + w1**2 ) |
---|
7142 | httc = surf_usm_v(l)%z0(m) * & |
---|
7143 | ( 11.8_wp + 4.2_wp * Ueff ) - 4.0_wp |
---|
7144 | f_shf = httc |
---|
7145 | f_shf_window = httc |
---|
7146 | f_shf_green = httc |
---|
7147 | |
---|
7148 | !-- add LW up so that it can be removed in prognostic equation |
---|
7149 | surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%rad_sw_in(m) - & |
---|
7150 | surf_usm_v(l)%rad_sw_out(m) + & |
---|
7151 | surf_usm_v(l)%rad_lw_in(m) - & |
---|
7152 | surf_usm_v(l)%rad_lw_out(m) |
---|
7153 | |
---|
7154 | !-- numerator of the prognostic equation |
---|
7155 | coef_1 = surf_usm_v(l)%rad_net_l(m) + & ! coef +1 corresponds to -lwout included in calculation of radnet_l |
---|
7156 | ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(0,m) * sigma_sb * & |
---|
7157 | t_surf_v(l)%t(m) ** 4 + & |
---|
7158 | f_shf * surf_usm_v(l)%pt1(m) + & |
---|
7159 | lambda_surface * t_wall_v(l)%t(nzb_wall,m) |
---|
7160 | coef_window_1 = surf_usm_v(l)%rad_net_l(m) + & ! coef +1 corresponds to -lwout included in calculation of radnet_l |
---|
7161 | ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(2,m) * sigma_sb * & |
---|
7162 | t_surf_window_v(l)%t(m) ** 4 + & |
---|
7163 | f_shf * surf_usm_v(l)%pt1(m) + & |
---|
7164 | lambda_surface_window * t_window_v(l)%t(nzb_wall,m) |
---|
7165 | |
---|
7166 | coef_green_1 = surf_usm_v(l)%rad_net_l(m) + & ! coef +1 corresponds to -lwout included in calculation of radnet_l |
---|
7167 | ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(1,m) * sigma_sb * & |
---|
7168 | t_surf_green_v(l)%t(m) ** 4 + & |
---|
7169 | f_shf * surf_usm_v(l)%pt1(m) + & |
---|
7170 | lambda_surface_green * t_wall_v(l)%t(nzb_wall,m) |
---|
7171 | |
---|
7172 | !-- denominator of the prognostic equation |
---|
7173 | coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(0,m) * sigma_sb * & |
---|
7174 | t_surf_v(l)%t(m) ** 3 & |
---|
7175 | + lambda_surface + f_shf / exn(k) |
---|
7176 | coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(2,m) * sigma_sb * & |
---|
7177 | t_surf_window_v(l)%t(m) ** 3 & |
---|
7178 | + lambda_surface_window + f_shf / exn(k) |
---|
7179 | coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(1,m) * sigma_sb * & |
---|
7180 | t_surf_green_v(l)%t(m) ** 3 & |
---|
7181 | + lambda_surface_green + f_shf / exn(k) |
---|
7182 | |
---|
7183 | !-- implicit solution when the surface layer has no heat capacity, |
---|
7184 | !-- otherwise use RK3 scheme. |
---|
7185 | t_surf_v_p(l)%t(m) = ( coef_1 * dt_3d * tsc(2) + & |
---|
7186 | surf_usm_v(l)%c_surface(m) * t_surf_v(l)%t(m) ) / & |
---|
7187 | ( surf_usm_v(l)%c_surface(m) + coef_2 * dt_3d * tsc(2) ) |
---|
7188 | t_surf_window_v_p(l)%t(m) = ( coef_window_1 * dt_3d * tsc(2) + & |
---|
7189 | surf_usm_v(l)%c_surface_window(m) * t_surf_window_v(l)%t(m) ) / & |
---|
7190 | ( surf_usm_v(l)%c_surface_window(m) + coef_window_2 * dt_3d * tsc(2) ) |
---|
7191 | |
---|
7192 | t_surf_green_v_p(l)%t(m) = ( coef_green_1 * dt_3d * tsc(2) + & |
---|
7193 | surf_usm_v(l)%c_surface_green(m) * t_surf_green_v(l)%t(m) ) / & |
---|
7194 | ( surf_usm_v(l)%c_surface_green(m) + coef_green_2 * dt_3d * tsc(2) ) |
---|
7195 | |
---|
7196 | |
---|
7197 | |
---|
7198 | !-- add RK3 term |
---|
7199 | t_surf_v_p(l)%t(m) = t_surf_v_p(l)%t(m) + dt_3d * tsc(3) * & |
---|
7200 | surf_usm_v(l)%tt_surface_m(m) |
---|
7201 | t_surf_window_v_p(l)%t(m) = t_surf_window_v_p(l)%t(m) + dt_3d * tsc(3) * & |
---|
7202 | surf_usm_v(l)%tt_surface_window_m(m) |
---|
7203 | t_surf_green_v_p(l)%t(m) = t_surf_green_v_p(l)%t(m) + dt_3d * tsc(3) * & |
---|
7204 | surf_usm_v(l)%tt_surface_green_m(m) |
---|
7205 | ! |
---|
7206 | !-- Store surface temperature |
---|
7207 | surf_usm_v(l)%pt_surface(m) = ( surf_usm_v(l)%frac(0,m) * t_surf_v_p(l)%t(m) & |
---|
7208 | + surf_usm_v(l)%frac(2,m) * t_surf_window_v_p(l)%t(m) & |
---|
7209 | + surf_usm_v(l)%frac(1,m) * t_surf_green_v_p(l)%t(m) ) & |
---|
7210 | / exn(k) |
---|
7211 | |
---|
7212 | !-- calculate true tendency |
---|
7213 | stend = ( t_surf_v_p(l)%t(m) - t_surf_v(l)%t(m) - dt_3d * tsc(3) *& |
---|
7214 | surf_usm_v(l)%tt_surface_m(m) ) / ( dt_3d * tsc(2) ) |
---|
7215 | stend_window = ( t_surf_window_v_p(l)%t(m) - t_surf_window_v(l)%t(m) - dt_3d * tsc(3) *& |
---|
7216 | surf_usm_v(l)%tt_surface_window_m(m) ) / ( dt_3d * tsc(2) ) |
---|
7217 | stend_green = ( t_surf_green_v_p(l)%t(m) - t_surf_green_v(l)%t(m) - dt_3d * tsc(3) *& |
---|
7218 | surf_usm_v(l)%tt_surface_green_m(m) ) / ( dt_3d * tsc(2) ) |
---|
7219 | |
---|
7220 | !-- calculate t_surf tendencies for the next Runge-Kutta step |
---|
7221 | IF ( timestep_scheme(1:5) == 'runge' ) THEN |
---|
7222 | IF ( intermediate_timestep_count == 1 ) THEN |
---|
7223 | surf_usm_v(l)%tt_surface_m(m) = stend |
---|
7224 | surf_usm_v(l)%tt_surface_window_m(m) = stend_window |
---|
7225 | surf_usm_v(l)%tt_surface_green_m(m) = stend_green |
---|
7226 | ELSEIF ( intermediate_timestep_count < & |
---|
7227 | intermediate_timestep_count_max ) THEN |
---|
7228 | surf_usm_v(l)%tt_surface_m(m) = -9.5625_wp * stend + & |
---|
7229 | 5.3125_wp * surf_usm_v(l)%tt_surface_m(m) |
---|
7230 | surf_usm_v(l)%tt_surface_green_m(m) = -9.5625_wp * stend_green + & |
---|
7231 | 5.3125_wp * surf_usm_v(l)%tt_surface_green_m(m) |
---|
7232 | surf_usm_v(l)%tt_surface_window_m(m) = -9.5625_wp * stend_window + & |
---|
7233 | 5.3125_wp * surf_usm_v(l)%tt_surface_window_m(m) |
---|
7234 | ENDIF |
---|
7235 | ENDIF |
---|
7236 | |
---|
7237 | !-- in case of fast changes in the skin temperature, it is required to |
---|
7238 | !-- update the radiative fluxes in order to keep the solution stable |
---|
7239 | |
---|
7240 | IF ( ( ABS( t_surf_v_p(l)%t(m) - t_surf_v(l)%t(m) ) > 1.0_wp ) .OR. & |
---|
7241 | ( ABS( t_surf_green_v_p(l)%t(m) - t_surf_green_v(l)%t(m) ) > 1.0_wp ) .OR. & |
---|
7242 | ( ABS( t_surf_window_v_p(l)%t(m) - t_surf_window_v(l)%t(m) ) > 1.0_wp ) ) THEN |
---|
7243 | force_radiation_call_l = .TRUE. |
---|
7244 | ENDIF |
---|
7245 | |
---|
7246 | !-- calculate fluxes |
---|
7247 | !-- rad_net_l is never used! |
---|
7248 | surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%frac(0,m) * & |
---|
7249 | ( surf_usm_v(l)%rad_net_l(m) + & |
---|
7250 | 3.0_wp * sigma_sb * & |
---|
7251 | t_surf_v(l)%t(m)**4 - 4.0_wp * sigma_sb * & |
---|
7252 | t_surf_v(l)%t(m)**3 * t_surf_v_p(l)%t(m) ) & |
---|
7253 | + surf_usm_v(l)%frac(2,m) * & |
---|
7254 | ( surf_usm_v(l)%rad_net_l(m) + & |
---|
7255 | 3.0_wp * sigma_sb * & |
---|
7256 | t_surf_window_v(l)%t(m)**4 - 4.0_wp * sigma_sb * & |
---|
7257 | t_surf_window_v(l)%t(m)**3 * t_surf_window_v_p(l)%t(m) ) & |
---|
7258 | + surf_usm_v(l)%frac(1,m) * & |
---|
7259 | ( surf_usm_v(l)%rad_net_l(m) + & |
---|
7260 | 3.0_wp * sigma_sb * & |
---|
7261 | t_surf_green_v(l)%t(m)**4 - 4.0_wp * sigma_sb * & |
---|
7262 | t_surf_green_v(l)%t(m)**3 * t_surf_green_v_p(l)%t(m) ) |
---|
7263 | |
---|
7264 | surf_usm_v(l)%wghf_eb_window(m) = lambda_surface_window * & |
---|
7265 | ( t_surf_window_v_p(l)%t(m) - t_window_v(l)%t(nzb_wall,m) ) |
---|
7266 | surf_usm_v(l)%wghf_eb(m) = lambda_surface * & |
---|
7267 | ( t_surf_v_p(l)%t(m) - t_wall_v(l)%t(nzb_wall,m) ) |
---|
7268 | surf_usm_v(l)%wghf_eb_green(m) = lambda_surface_green * & |
---|
7269 | ( t_surf_green_v_p(l)%t(m) - t_green_v(l)%t(nzb_wall,m) ) |
---|
7270 | |
---|
7271 | !-- ground/wall/roof surface heat flux |
---|
7272 | surf_usm_v(l)%wshf_eb(m) = - f_shf * ( surf_usm_v(l)%pt1(m) - t_surf_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(0,m) & |
---|
7273 | - f_shf_window * ( surf_usm_v(l)%pt1(m) - t_surf_window_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(2,m) & |
---|
7274 | - f_shf_green * ( surf_usm_v(l)%pt1(m) - t_surf_green_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(1,m) |
---|
7275 | |
---|
7276 | ! |
---|
7277 | !-- store kinematic surface heat fluxes for utilization in other processes |
---|
7278 | !-- diffusion_s, surface_layer_fluxes,... |
---|
7279 | surf_usm_v(l)%shf(m) = surf_usm_v(l)%wshf_eb(m) / cp |
---|
7280 | |
---|
7281 | ENDDO |
---|
7282 | |
---|
7283 | ENDDO |
---|
7284 | ! |
---|
7285 | !-- Add-up anthropogenic heat, for now only at upward-facing surfaces |
---|
7286 | IF ( usm_anthropogenic_heat .AND. & |
---|
7287 | intermediate_timestep_count == intermediate_timestep_count_max ) THEN |
---|
7288 | !-- application of the additional anthropogenic heat sources |
---|
7289 | !-- we considere the traffic for now so all heat is absorbed |
---|
7290 | !-- to the first layer, generalization would be worth. |
---|
7291 | |
---|
7292 | !-- calculation of actual profile coefficient |
---|
7293 | !-- ??? check time_since_reference_point ??? |
---|
7294 | dtime = mod(simulated_time + time_utc_init, 24.0_wp*3600.0_wp) |
---|
7295 | dhour = INT(dtime/3600.0_wp) |
---|
7296 | !-- linear interpolation of coeficient |
---|
7297 | acoef = (REAL(dhour+1,wp)-dtime/3600.0_wp)*aheatprof(dhour) + (dtime/3600.0_wp-REAL(dhour,wp))*aheatprof(dhour+1) |
---|
7298 | |
---|
7299 | DO m = 1, surf_usm_h%ns |
---|
7300 | ! |
---|
7301 | !-- Get indices of respective grid point |
---|
7302 | i = surf_usm_h%i(m) |
---|
7303 | j = surf_usm_h%j(m) |
---|
7304 | k = surf_usm_h%k(m) |
---|
7305 | |
---|
7306 | IF ( aheat(j,i) > 0.0_wp ) THEN |
---|
7307 | !-- TODO the increase of pt in box i,j,nzb_s_inner(j,i)+1 in time dt_3d |
---|
7308 | !-- given to anthropogenic heat aheat*acoef (W*m-2) |
---|
7309 | !-- k = nzb_s_inner(j,i)+1 |
---|
7310 | !-- pt(k,j,i) = pt(k,j,i) + aheat(j,i)*acoef*dt_3d/(exn(k)*rho_cp*dz) |
---|
7311 | !-- Instead of this, we can adjust shf in case AH only at surface |
---|
7312 | surf_usm_h%shf(m) = surf_usm_h%shf(m) + & |
---|
7313 | aheat(j,i) * acoef * ddx * ddy / cp |
---|
7314 | ENDIF |
---|
7315 | ENDDO |
---|
7316 | |
---|
7317 | ENDIF |
---|
7318 | |
---|
7319 | !-- pt and shf are defined on nxlg:nxrg,nysg:nyng |
---|
7320 | !-- get the borders from neighbours |
---|
7321 | #if ! defined( __nopointer ) |
---|
7322 | CALL exchange_horiz( pt, nbgp ) |
---|
7323 | #endif |
---|
7324 | |
---|
7325 | !-- calculation of force_radiation_call: |
---|
7326 | !-- Make logical OR for all processes. |
---|
7327 | !-- Force radiation call if at least one processor forces it. |
---|
7328 | IF ( intermediate_timestep_count == intermediate_timestep_count_max-1 )& |
---|
7329 | THEN |
---|
7330 | #if defined( __parallel ) |
---|
7331 | IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) |
---|
7332 | CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call, & |
---|
7333 | 1, MPI_LOGICAL, MPI_LOR, comm2d, ierr ) |
---|
7334 | #else |
---|
7335 | force_radiation_call = force_radiation_call_l |
---|
7336 | #endif |
---|
7337 | force_radiation_call_l = .FALSE. |
---|
7338 | ENDIF |
---|
7339 | |
---|
7340 | END SUBROUTINE usm_surface_energy_balance |
---|
7341 | |
---|
7342 | |
---|
7343 | !------------------------------------------------------------------------------! |
---|
7344 | ! Description: |
---|
7345 | ! ------------ |
---|
7346 | !> Swapping of timelevels for t_surf and t_wall |
---|
7347 | !> called out from subroutine swap_timelevel |
---|
7348 | !------------------------------------------------------------------------------! |
---|
7349 | SUBROUTINE usm_swap_timelevel ( mod_count ) |
---|
7350 | |
---|
7351 | IMPLICIT NONE |
---|
7352 | |
---|
7353 | INTEGER(iwp), INTENT(IN) :: mod_count |
---|
7354 | INTEGER(iwp) :: i |
---|
7355 | |
---|
7356 | #if defined( __nopointer ) |
---|
7357 | t_surf_h = t_surf_h_p |
---|
7358 | t_wall_h = t_wall_h_p |
---|
7359 | t_surf_v = t_surf_v_p |
---|
7360 | t_wall_v = t_wall_v_p |
---|
7361 | t_surf_window_h = t_surf_window_h_p |
---|
7362 | t_window_h = t_window_h_p |
---|
7363 | t_surf_window_v = t_surf_window_v_p |
---|
7364 | t_window_v = t_window_v_p |
---|
7365 | t_surf_green_h = t_surf_green_h_p |
---|
7366 | t_surf_green_v = t_surf_green_v_p |
---|
7367 | t_green_h = t_green_h_p |
---|
7368 | t_green_v = t_green_v_p |
---|
7369 | t_surf_whole_h = t_surf_whole_h_p |
---|
7370 | t_surf_whole_v = t_surf_whole_v_p |
---|
7371 | #else |
---|
7372 | SELECT CASE ( mod_count ) |
---|
7373 | CASE ( 0 ) |
---|
7374 | ! |
---|
7375 | !-- Horizontal surfaces |
---|
7376 | t_surf_h => t_surf_h_1; t_surf_h_p => t_surf_h_2 |
---|
7377 | t_wall_h => t_wall_h_1; t_wall_h_p => t_wall_h_2 |
---|
7378 | t_surf_window_h => t_surf_window_h_1; t_surf_window_h_p => t_surf_window_h_2 |
---|
7379 | t_window_h => t_window_h_1; t_window_h_p => t_window_h_2 |
---|
7380 | t_surf_green_h => t_surf_green_h_1; t_surf_green_h_p => t_surf_green_h_2 |
---|
7381 | t_green_h => t_green_h_1; t_green_h_p => t_green_h_2 |
---|
7382 | t_surf_whole_h => t_surf_whole_h_1; t_surf_whole_h_p => t_surf_whole_h_2 |
---|
7383 | ! |
---|
7384 | !-- Vertical surfaces |
---|
7385 | t_surf_v => t_surf_v_1; t_surf_v_p => t_surf_v_2 |
---|
7386 | t_wall_v => t_wall_v_1; t_wall_v_p => t_wall_v_2 |
---|
7387 | t_surf_window_v => t_surf_window_v_1; t_surf_window_v_p => t_surf_window_v_2 |
---|
7388 | t_window_v => t_window_v_1; t_window_v_p => t_window_v_2 |
---|
7389 | t_surf_green_v => t_surf_green_v_1; t_surf_green_v_p => t_surf_green_v_2 |
---|
7390 | t_green_v => t_green_v_1; t_green_v_p => t_green_v_2 |
---|
7391 | t_surf_whole_v => t_surf_whole_v_1; t_surf_whole_v_p => t_surf_whole_v_2 |
---|
7392 | CASE ( 1 ) |
---|
7393 | ! |
---|
7394 | !-- Horizontal surfaces |
---|
7395 | t_surf_h => t_surf_h_2; t_surf_h_p => t_surf_h_1 |
---|
7396 | t_wall_h => t_wall_h_2; t_wall_h_p => t_wall_h_1 |
---|
7397 | t_surf_window_h => t_surf_window_h_2; t_surf_window_h_p => t_surf_window_h_1 |
---|
7398 | t_window_h => t_window_h_2; t_window_h_p => t_window_h_1 |
---|
7399 | t_surf_green_h => t_surf_green_h_2; t_surf_green_h_p => t_surf_green_h_1 |
---|
7400 | t_green_h => t_green_h_2; t_green_h_p => t_green_h_1 |
---|
7401 | t_surf_whole_h => t_surf_whole_h_2; t_surf_whole_h_p => t_surf_whole_h_1 |
---|
7402 | ! |
---|
7403 | !-- Vertical surfaces |
---|
7404 | t_surf_v => t_surf_v_2; t_surf_v_p => t_surf_v_1 |
---|
7405 | t_wall_v => t_wall_v_2; t_wall_v_p => t_wall_v_1 |
---|
7406 | t_surf_window_v => t_surf_window_v_2; t_surf_window_v_p => t_surf_window_v_1 |
---|
7407 | t_window_v => t_window_v_2; t_window_v_p => t_window_v_1 |
---|
7408 | t_surf_green_v => t_surf_green_v_2; t_surf_green_v_p => t_surf_green_v_1 |
---|
7409 | t_green_v => t_green_v_2; t_green_v_p => t_green_v_1 |
---|
7410 | t_surf_whole_v => t_surf_whole_v_2; t_surf_whole_v_p => t_surf_whole_v_1 |
---|
7411 | END SELECT |
---|
7412 | #endif |
---|
7413 | |
---|
7414 | END SUBROUTINE usm_swap_timelevel |
---|
7415 | |
---|
7416 | !------------------------------------------------------------------------------! |
---|
7417 | ! |
---|
7418 | ! Description: |
---|
7419 | ! ------------ |
---|
7420 | !> Subroutine writes t_surf and t_wall data into restart files |
---|
7421 | !kanani: Renamed this routine according to corresponging routines in PALM |
---|
7422 | !kanani: Modified the routine to match write_var_list, from where usm_write_restart_data |
---|
7423 | ! shall be called in the future. This part has not been tested yet. (see virtual_flight_mod) |
---|
7424 | ! Also, I had some trouble with the allocation of t_surf, since this is a pointer. |
---|
7425 | ! So, I added some directives here. |
---|
7426 | !------------------------------------------------------------------------------! |
---|
7427 | SUBROUTINE usm_write_restart_data |
---|
7428 | |
---|
7429 | IMPLICIT NONE |
---|
7430 | |
---|
7431 | CHARACTER(LEN=1) :: dum !< dummy string to create output-variable name |
---|
7432 | INTEGER(iwp) :: l !< index surface type orientation |
---|
7433 | |
---|
7434 | WRITE ( 14 ) 'ns_h_on_file_usm ' |
---|
7435 | WRITE ( 14 ) surf_usm_h%ns |
---|
7436 | WRITE ( 14 ) 'ns_v_on_file_usm ' |
---|
7437 | WRITE ( 14 ) surf_usm_v(0:3)%ns |
---|
7438 | |
---|
7439 | WRITE ( 14 ) 'usm_start_index_h ' |
---|
7440 | WRITE ( 14 ) surf_usm_h%start_index |
---|
7441 | WRITE ( 14 ) 'usm_end_index_h ' |
---|
7442 | WRITE ( 14 ) surf_usm_h%end_index |
---|
7443 | WRITE ( 14 ) 't_surf_h ' |
---|
7444 | WRITE ( 14 ) t_surf_h |
---|
7445 | WRITE ( 14 ) 't_surf_window_h ' |
---|
7446 | WRITE ( 14 ) t_surf_window_h |
---|
7447 | WRITE ( 14 ) 't_surf_green_h ' |
---|
7448 | WRITE ( 14 ) t_surf_green_h |
---|
7449 | |
---|
7450 | DO l = 0, 3 |
---|
7451 | WRITE ( 14 ) 'usm_start_index_v ' |
---|
7452 | WRITE ( 14 ) surf_usm_v(l)%start_index |
---|
7453 | WRITE ( 14 ) 'usm_end_index_v ' |
---|
7454 | WRITE ( 14 ) surf_usm_v(l)%end_index |
---|
7455 | WRITE( dum, '(I1)') l |
---|
7456 | WRITE ( 14 ) 't_surf_v(' // dum // ') ' |
---|
7457 | WRITE ( 14 ) t_surf_v(l)%t |
---|
7458 | WRITE ( 14 ) 't_surf_window_v(' // dum // ') ' |
---|
7459 | WRITE ( 14 ) t_surf_window_v(l)%t |
---|
7460 | WRITE ( 14 ) 't_surf_green_v(' // dum // ') ' |
---|
7461 | WRITE ( 14 ) t_surf_green_v(l)%t |
---|
7462 | ENDDO |
---|
7463 | |
---|
7464 | WRITE ( 14 ) 'usm_start_index_h ' |
---|
7465 | WRITE ( 14 ) surf_usm_h%start_index |
---|
7466 | WRITE ( 14 ) 'usm_end_index_h ' |
---|
7467 | WRITE ( 14 ) surf_usm_h%end_index |
---|
7468 | WRITE ( 14 ) 't_wall_h ' |
---|
7469 | WRITE ( 14 ) t_wall_h |
---|
7470 | WRITE ( 14 ) 't_window_h ' |
---|
7471 | WRITE ( 14 ) t_window_h |
---|
7472 | WRITE ( 14 ) 't_green_h ' |
---|
7473 | WRITE ( 14 ) t_green_h |
---|
7474 | DO l = 0, 3 |
---|
7475 | WRITE ( 14 ) 'usm_start_index_v ' |
---|
7476 | WRITE ( 14 ) surf_usm_v(l)%start_index |
---|
7477 | WRITE ( 14 ) 'usm_end_index_v ' |
---|
7478 | WRITE ( 14 ) surf_usm_v(l)%end_index |
---|
7479 | WRITE( dum, '(I1)') l |
---|
7480 | WRITE ( 14 ) 't_wall_v(' // dum // ') ' |
---|
7481 | WRITE ( 14 ) t_wall_v(l)%t |
---|
7482 | WRITE ( 14 ) 't_window_v(' // dum // ') ' |
---|
7483 | WRITE ( 14 ) t_window_v(l)%t |
---|
7484 | WRITE ( 14 ) 't_green_v(' // dum // ') ' |
---|
7485 | WRITE ( 14 ) t_green_v(l)%t |
---|
7486 | ENDDO |
---|
7487 | |
---|
7488 | WRITE ( 14 ) '*** end usm *** ' |
---|
7489 | |
---|
7490 | END SUBROUTINE usm_write_restart_data |
---|
7491 | |
---|
7492 | ! |
---|
7493 | !-- Integrated stability function for heat and moisture |
---|
7494 | FUNCTION psi_h( zeta ) |
---|
7495 | |
---|
7496 | USE kinds |
---|
7497 | |
---|
7498 | IMPLICIT NONE |
---|
7499 | |
---|
7500 | REAL(wp) :: psi_h !< Integrated similarity function result |
---|
7501 | REAL(wp) :: zeta !< Stability parameter z/L |
---|
7502 | REAL(wp) :: x !< dummy variable |
---|
7503 | |
---|
7504 | REAL(wp), PARAMETER :: a = 1.0_wp !< constant |
---|
7505 | REAL(wp), PARAMETER :: b = 0.66666666666_wp !< constant |
---|
7506 | REAL(wp), PARAMETER :: c = 5.0_wp !< constant |
---|
7507 | REAL(wp), PARAMETER :: d = 0.35_wp !< constant |
---|
7508 | REAL(wp), PARAMETER :: c_d_d = c / d !< constant |
---|
7509 | REAL(wp), PARAMETER :: bc_d_d = b * c / d !< constant |
---|
7510 | |
---|
7511 | |
---|
7512 | IF ( zeta < 0.0_wp ) THEN |
---|
7513 | x = SQRT( 1.0_wp - 16.0_wp * zeta ) |
---|
7514 | psi_h = 2.0_wp * LOG( (1.0_wp + x ) / 2.0_wp ) |
---|
7515 | ELSE |
---|
7516 | psi_h = - b * ( zeta - c_d_d ) * EXP( -d * zeta ) - (1.0_wp & |
---|
7517 | + 0.66666666666_wp * a * zeta )**1.5_wp - bc_d_d & |
---|
7518 | + 1.0_wp |
---|
7519 | ! |
---|
7520 | !-- Old version for stable conditions (only valid for z/L < 0.5) |
---|
7521 | !-- psi_h = - 5.0_wp * zeta |
---|
7522 | ENDIF |
---|
7523 | |
---|
7524 | END FUNCTION psi_h |
---|
7525 | |
---|
7526 | END MODULE urban_surface_mod |
---|