[4246] | 1 | !> @file indoor_model_mod.f90 |
---|
[4646] | 2 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 3 | ! This file is part of the PALM model system. |
---|
| 4 | ! |
---|
[4646] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General |
---|
| 6 | ! Public License as published by the Free Software Foundation, either version 3 of the License, or |
---|
| 7 | ! (at your option) any later version. |
---|
[4246] | 8 | ! |
---|
[4646] | 9 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
---|
| 10 | ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
| 11 | ! Public License for more details. |
---|
[4246] | 12 | ! |
---|
[4646] | 13 | ! You should have received a copy of the GNU General Public License along with PALM. If not, see |
---|
| 14 | ! <http://www.gnu.org/licenses/>. |
---|
[4246] | 15 | ! |
---|
[4481] | 16 | ! Copyright 2018-2020 Leibniz Universitaet Hannover |
---|
| 17 | ! Copyright 2018-2020 Hochschule Offenburg |
---|
[4646] | 18 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 19 | ! |
---|
| 20 | ! Current revisions: |
---|
| 21 | ! ----------------- |
---|
[4646] | 22 | ! |
---|
| 23 | ! |
---|
[4246] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: indoor_model_mod.f90 4704 2020-09-28 10:13:03Z suehring $ |
---|
[4704] | 27 | ! Bugfix: avoid division by zero in case of zero window fraction |
---|
| 28 | ! |
---|
| 29 | ! 4702 2020-09-27 18:39:00Z maronga |
---|
[4702] | 30 | ! Removed unused variable indoor_wall_window_temperature |
---|
| 31 | ! |
---|
| 32 | ! 4701 2020-09-27 11:02:15Z maronga |
---|
[4701] | 33 | ! Heat transfer for wall and windows back to USM separated into q_wall and q_win (instead q_wall_win). |
---|
| 34 | ! Heat flow direction revised (heat flow positive from outside to inside). |
---|
| 35 | ! New variable indoor_wall_temperature (for q_wall). |
---|
| 36 | ! Removed unused quantity q_trans. |
---|
| 37 | ! |
---|
| 38 | ! 4698 2020-09-25 08:37:55Z maronga |
---|
[4698] | 39 | ! Fixed faulty characters |
---|
| 40 | ! |
---|
| 41 | ! 4687 2020-09-21 19:40:16Z maronga |
---|
[4687] | 42 | ! Bugfix: values of theta_m_t_prev were not stored for individual surfaces and thus re-used by all |
---|
| 43 | ! surfaces and buildings, which led to excessive indoor temperatures |
---|
| 44 | ! |
---|
| 45 | ! 4681 2020-09-16 10:23:06Z pavelkrc |
---|
[4681] | 46 | ! Bugfix for implementation of downward surfaces |
---|
| 47 | ! |
---|
| 48 | ! 4671 2020-09-09 20:27:58Z pavelkrc |
---|
[4671] | 49 | ! Implementation of downward facing USM and LSM surfaces |
---|
| 50 | ! |
---|
| 51 | ! 4646 2020-08-24 16:02:40Z raasch |
---|
[4646] | 52 | ! file re-formatted to follow the PALM coding standard |
---|
| 53 | ! |
---|
| 54 | ! 4481 2020-03-31 18:55:54Z maronga |
---|
| 55 | ! Change order of dimension in surface array %frac to allow for better vectorization. |
---|
| 56 | ! |
---|
[4442] | 57 | ! 4441 2020-03-04 19:20:35Z suehring |
---|
[4646] | 58 | ! Major bugfix in calculation of energy demand - floor-area-per-facade was wrongly calculated |
---|
| 59 | ! leading to unrealistically high energy demands and thus to unreallistically high waste-heat |
---|
| 60 | ! fluxes. |
---|
| 61 | ! |
---|
[4402] | 62 | ! 4346 2019-12-18 11:55:56Z motisi |
---|
[4646] | 63 | ! Introduction of wall_flags_total_0, which currently sets bits based on static topography |
---|
| 64 | ! information used in wall_flags_static_0 |
---|
| 65 | ! |
---|
[4346] | 66 | ! 4329 2019-12-10 15:46:36Z motisi |
---|
[4329] | 67 | ! Renamed wall_flags_0 to wall_flags_static_0 |
---|
[4646] | 68 | ! |
---|
[4329] | 69 | ! 4310 2019-11-26 19:01:28Z suehring |
---|
[4646] | 70 | ! Remove dt_indoor from namelist input. The indoor model is an hourly-based model, calling it |
---|
| 71 | ! more/less often lead to inaccurate results. |
---|
| 72 | ! |
---|
[4310] | 73 | ! 4299 2019-11-22 10:13:38Z suehring |
---|
[4646] | 74 | ! Output of indoor temperature revised (to avoid non-defined values within buildings) |
---|
| 75 | ! |
---|
[4299] | 76 | ! 4267 2019-10-16 18:58:49Z suehring |
---|
[4267] | 77 | ! Bugfix in initialization, some indices to access building_pars where wrong. |
---|
| 78 | ! Introduction of seasonal parameters. |
---|
[4646] | 79 | ! |
---|
[4267] | 80 | ! 4246 2019-09-30 09:27:52Z pavelkrc |
---|
[4646] | 81 | ! |
---|
| 82 | ! |
---|
[4245] | 83 | ! 4242 2019-09-27 12:59:10Z suehring |
---|
[4246] | 84 | ! Bugfix in array index |
---|
[4646] | 85 | ! |
---|
[4246] | 86 | ! 4238 2019-09-25 16:06:01Z suehring |
---|
| 87 | ! - Bugfix in determination of minimum facade height and in location message |
---|
| 88 | ! - Bugfix, avoid division by zero |
---|
[4646] | 89 | ! - Some optimization |
---|
| 90 | ! |
---|
[4246] | 91 | ! 4227 2019-09-10 18:04:34Z gronemeier |
---|
| 92 | ! implement new palm_date_time_mod |
---|
| 93 | ! |
---|
| 94 | ! 4217 2019-09-04 09:47:05Z scharf |
---|
| 95 | ! Corrected "Former revisions" section |
---|
| 96 | ! |
---|
| 97 | ! 4209 2019-09-02 12:00:03Z suehring |
---|
| 98 | ! - Bugfix in initialization of indoor temperature |
---|
[4646] | 99 | ! - Prescibe default indoor temperature in case it is not given in the namelist input |
---|
[4246] | 100 | ! |
---|
| 101 | ! 4182 2019-08-21 14:37:54Z scharf |
---|
| 102 | ! Corrected "Former revisions" section |
---|
[4646] | 103 | ! |
---|
[4246] | 104 | ! 4148 2019-08-08 11:26:00Z suehring |
---|
[4646] | 105 | ! Bugfix in case of non grid-resolved buildings. Further, vertical grid spacing is now considered at |
---|
| 106 | ! the correct level. |
---|
[4246] | 107 | ! - change calculation of a_m and c_m |
---|
| 108 | ! - change calculation of u-values (use h_es in building array) |
---|
| 109 | ! - rename h_tr_... to h_t_... |
---|
| 110 | ! h_tr_em to h_t_wm |
---|
| 111 | ! h_tr_op to h_t_wall |
---|
| 112 | ! h_tr_w to h_t_es |
---|
| 113 | ! - rename h_ve to h_v |
---|
| 114 | ! - rename h_is to h_ms |
---|
| 115 | ! - inserted net_floor_area |
---|
| 116 | ! - inserted params_waste_heat_h, params_waste_heat_c from building database |
---|
| 117 | ! in building array |
---|
| 118 | ! - change calculation of q_waste_heat |
---|
[4646] | 119 | ! - bugfix in averaging mean indoor temperature |
---|
| 120 | ! |
---|
[4246] | 121 | ! 3759 2019-02-21 15:53:45Z suehring |
---|
| 122 | ! - Calculation of total building volume |
---|
| 123 | ! - Several bugfixes |
---|
| 124 | ! - Calculation of building height revised |
---|
[4646] | 125 | ! |
---|
[4246] | 126 | ! 3745 2019-02-15 18:57:56Z suehring |
---|
| 127 | ! - remove building_type from module |
---|
[4646] | 128 | ! - initialize parameters for each building individually instead of a bulk initializaion with |
---|
| 129 | ! identical building type for all |
---|
[4246] | 130 | ! - output revised |
---|
| 131 | ! - add missing _wp |
---|
| 132 | ! - some restructuring of variables in building data structure |
---|
[4646] | 133 | ! |
---|
[4246] | 134 | ! 3744 2019-02-15 18:38:58Z suehring |
---|
| 135 | ! Some interface calls moved to module_interface + cleanup |
---|
[4646] | 136 | ! |
---|
[4246] | 137 | ! 3469 2018-10-30 20:05:07Z kanani |
---|
| 138 | ! Initial revision (tlang, suehring, kanani, srissman)! |
---|
| 139 | ! |
---|
| 140 | ! Authors: |
---|
| 141 | ! -------- |
---|
| 142 | ! @author Tobias Lang |
---|
| 143 | ! @author Jens Pfafferott |
---|
| 144 | ! @author Farah Kanani-Suehring |
---|
| 145 | ! @author Matthias Suehring |
---|
[4698] | 146 | ! @author Sascha Rissmann |
---|
| 147 | ! @author Bjoern Maronga |
---|
[4246] | 148 | ! |
---|
| 149 | ! |
---|
| 150 | ! Description: |
---|
| 151 | ! ------------ |
---|
| 152 | !> Module for Indoor Climate Model (ICM) |
---|
| 153 | !> The module is based on the DIN EN ISO 13790 with simplified hour-based procedure. |
---|
| 154 | !> This model is a equivalent circuit diagram of a three-point RC-model (5R1C). |
---|
[4646] | 155 | !> This module differs between indoor-air temperature an average temperature of indoor surfaces which make it prossible to determine |
---|
| 156 | !> thermal comfort |
---|
| 157 | !> the heat transfer between indoor and outdoor is simplified |
---|
[4246] | 158 | |
---|
[4646] | 159 | !> @todo Many statement comments that are given as doxygen comments need to be changed to normal comments |
---|
[4246] | 160 | !> @todo Replace window_area_per_facade by %frac(1,m) for window |
---|
[4646] | 161 | !> @todo emissivity change for window blinds if solar_protection_on=1 |
---|
[4246] | 162 | |
---|
| 163 | !> @note Do we allow use of integer flags, or only logical flags? (concerns e.g. cooling_on, heating_on) |
---|
| 164 | !> @note How to write indoor temperature output to pt array? |
---|
| 165 | !> |
---|
[4687] | 166 | !> @bug Calculation of iwghf_eb and iwghf_eb_window is faulty |
---|
[4646] | 167 | !--------------------------------------------------------------------------------------------------! |
---|
| 168 | MODULE indoor_model_mod |
---|
[4246] | 169 | |
---|
[4646] | 170 | USE arrays_3d, & |
---|
| 171 | ONLY: ddzw, & |
---|
| 172 | dzw, & |
---|
[4402] | 173 | pt |
---|
| 174 | |
---|
[4646] | 175 | USE control_parameters, & |
---|
[4246] | 176 | ONLY: initializing_actions |
---|
| 177 | |
---|
| 178 | USE kinds |
---|
[4646] | 179 | |
---|
| 180 | USE netcdf_data_input_mod, & |
---|
[4246] | 181 | ONLY: building_id_f, building_type_f |
---|
| 182 | |
---|
[4646] | 183 | USE palm_date_time_mod, & |
---|
| 184 | ONLY: get_date_time, northward_equinox, seconds_per_hour, southward_equinox |
---|
[4267] | 185 | |
---|
[4646] | 186 | USE surface_mod, & |
---|
[4246] | 187 | ONLY: surf_usm_h, surf_usm_v |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | IMPLICIT NONE |
---|
| 191 | |
---|
| 192 | ! |
---|
| 193 | !-- Define data structure for buidlings. |
---|
| 194 | TYPE build |
---|
| 195 | |
---|
| 196 | INTEGER(iwp) :: id !< building ID |
---|
[4646] | 197 | INTEGER(iwp) :: kb_max !< highest vertical index of a building |
---|
[4246] | 198 | INTEGER(iwp) :: kb_min !< lowest vertical index of a building |
---|
| 199 | INTEGER(iwp) :: num_facades_per_building_h = 0 !< total number of horizontal facades elements |
---|
| 200 | INTEGER(iwp) :: num_facades_per_building_h_l = 0 !< number of horizontal facade elements on local subdomain |
---|
| 201 | INTEGER(iwp) :: num_facades_per_building_v = 0 !< total number of vertical facades elements |
---|
| 202 | INTEGER(iwp) :: num_facades_per_building_v_l = 0 !< number of vertical facade elements on local subdomain |
---|
| 203 | INTEGER(iwp) :: ventilation_int_loads !< [-] allocation of activity in the building |
---|
| 204 | |
---|
[4681] | 205 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: l_h !< index array linking surface-element orientation index |
---|
| 206 | !< for horizontal surfaces with building |
---|
[4246] | 207 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: l_v !< index array linking surface-element orientation index |
---|
[4646] | 208 | !< for vertical surfaces with building |
---|
[4246] | 209 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: m_h !< index array linking surface-element index for |
---|
| 210 | !< horizontal surfaces with building |
---|
[4646] | 211 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: m_v !< index array linking surface-element index for |
---|
[4246] | 212 | !< vertical surfaces with building |
---|
[4646] | 213 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: num_facade_h !< number of horizontal facade elements per buidling |
---|
[4246] | 214 | !< and height level |
---|
| 215 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: num_facade_v !< number of vertical facades elements per buidling |
---|
| 216 | !< and height level |
---|
| 217 | |
---|
[4646] | 218 | |
---|
[4246] | 219 | LOGICAL :: on_pe = .FALSE. !< flag indicating whether a building with certain ID is on local subdomain |
---|
[4646] | 220 | |
---|
[4246] | 221 | REAL(wp) :: air_change_high !< [1/h] air changes per time_utc_hour |
---|
| 222 | REAL(wp) :: air_change_low !< [1/h] air changes per time_utc_hour |
---|
| 223 | REAL(wp) :: area_facade !< [m2] area of total facade |
---|
| 224 | REAL(wp) :: building_height !< building height |
---|
| 225 | REAL(wp) :: eta_ve !< [-] heat recovery efficiency |
---|
| 226 | REAL(wp) :: factor_a !< [-] Dynamic parameters specific effective surface according to Table 12; 2.5 |
---|
| 227 | !< (very light, light and medium), 3.0 (heavy), 3.5 (very heavy) |
---|
[4646] | 228 | REAL(wp) :: factor_c !< [J/(m2 K)] Dynamic parameters inner heatstorage according to Table 12; 80000 |
---|
[4246] | 229 | !< (very light), 110000 (light), 165000 (medium), 260000 (heavy), 370000 (very heavy) |
---|
| 230 | REAL(wp) :: f_c_win !< [-] shading factor |
---|
[4402] | 231 | REAL(wp) :: fapf !< [m2/m2] floor area per facade |
---|
[4246] | 232 | REAL(wp) :: g_value_win !< [-] SHGC factor |
---|
[4646] | 233 | REAL(wp) :: h_es !< [W/(m2 K)] surface-related heat transfer coefficient between extern and surface |
---|
[4246] | 234 | REAL(wp) :: height_cei_con !< [m] ceiling construction heigth |
---|
| 235 | REAL(wp) :: height_storey !< [m] storey heigth |
---|
| 236 | REAL(wp) :: params_waste_heat_c !< [-] anthropogenic heat outputs for cooling e.g. 1.33 for KKM with COP = 3 |
---|
[4646] | 237 | REAL(wp) :: params_waste_heat_h !< [-] anthropogenic heat outputs for heating e.g. 1 - 0.9 = 0.1 for combustion with |
---|
| 238 | !< eta = 0.9 or -2 for WP with COP = 3 |
---|
[4246] | 239 | REAL(wp) :: phi_c_max !< [W] Max. Cooling capacity (negative) |
---|
| 240 | REAL(wp) :: phi_h_max !< [W] Max. Heating capacity (positive) |
---|
| 241 | REAL(wp) :: q_c_max !< [W/m2] Max. Cooling heat flux per netto floor area (negative) |
---|
| 242 | REAL(wp) :: q_h_max !< [W/m2] Max. Heating heat flux per netto floor area (positive) |
---|
| 243 | REAL(wp) :: qint_high !< [W/m2] internal heat gains, option Database qint_0-23 |
---|
| 244 | REAL(wp) :: qint_low !< [W/m2] internal heat gains, option Database qint_0-23 |
---|
| 245 | REAL(wp) :: lambda_at !< [-] ratio internal surface/floor area chap. 7.2.2.2. |
---|
| 246 | REAL(wp) :: lambda_layer3 !< [W/(m*K)] Thermal conductivity of the inner layer |
---|
| 247 | REAL(wp) :: net_floor_area !< [m2] netto ground area |
---|
| 248 | REAL(wp) :: s_layer3 !< [m] half thickness of the inner layer (layer_3) |
---|
| 249 | REAL(wp) :: theta_int_c_set !< [degree_C] Max. Setpoint temperature (summer) |
---|
| 250 | REAL(wp) :: theta_int_h_set !< [degree_C] Max. Setpoint temperature (winter) |
---|
| 251 | REAL(wp) :: u_value_win !< [W/(m2*K)] transmittance |
---|
| 252 | REAL(wp) :: vol_tot !< [m3] total building volume |
---|
| 253 | |
---|
| 254 | REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in !< mean building indoor temperature, height dependent |
---|
| 255 | REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in_l !< mean building indoor temperature on local subdomain, height dependent |
---|
[4687] | 256 | REAL(wp), DIMENSION(:), ALLOCATABLE :: theta_m_t_prev_h !< [degree_C] value of theta_m_t from previous time step (horizontal) |
---|
| 257 | REAL(wp), DIMENSION(:), ALLOCATABLE :: theta_m_t_prev_v !< [degree_C] value of theta_m_t from previous time step (vertical) |
---|
[4246] | 258 | REAL(wp), DIMENSION(:), ALLOCATABLE :: volume !< total building volume, height dependent |
---|
| 259 | REAL(wp), DIMENSION(:), ALLOCATABLE :: vol_frac !< fraction of local on total building volume, height dependent |
---|
| 260 | REAL(wp), DIMENSION(:), ALLOCATABLE :: vpf !< building volume volume per facade element, height dependent |
---|
[4646] | 261 | |
---|
[4246] | 262 | END TYPE build |
---|
| 263 | |
---|
| 264 | TYPE(build), DIMENSION(:), ALLOCATABLE :: buildings !< building array |
---|
| 265 | |
---|
| 266 | INTEGER(iwp) :: num_build !< total number of buildings in domain |
---|
| 267 | ! |
---|
| 268 | !-- Declare all global variables within the module |
---|
[4646] | 269 | |
---|
| 270 | REAL(wp), PARAMETER :: dt_indoor = 3600.0_wp !< [s] time interval for indoor-model application, fixed to |
---|
| 271 | !< 3600.0 due to model requirements |
---|
| 272 | REAL(wp), PARAMETER :: h_is = 3.45_wp !< [W/(m2 K)] surface-related heat transfer coefficient between |
---|
| 273 | !< surface and air (chap. 7.2.2.2) |
---|
| 274 | REAL(wp), PARAMETER :: h_ms = 9.1_wp !< [W/(m2 K)] surface-related heat transfer coefficient between |
---|
| 275 | !< component and surface (chap. 12.2.2) |
---|
| 276 | REAL(wp), PARAMETER :: params_f_f = 0.3_wp !< [-] frame ratio chap. 8.3.2.1.1 for buildings with mostly |
---|
| 277 | !< cooling 2.0_wp |
---|
| 278 | REAL(wp), PARAMETER :: params_f_w = 0.9_wp !< [-] correction factor (fuer nicht senkrechten Stahlungseinfall |
---|
| 279 | !< DIN 4108-2 chap.8, (hier konstant, keine WinkelabhÀngigkeit) |
---|
| 280 | REAL(wp), PARAMETER :: params_f_win = 0.5_wp !< [-] proportion of window area, Database A_win aus |
---|
| 281 | !< Datenbank 27 window_area_per_facade_percent |
---|
| 282 | REAL(wp), PARAMETER :: params_solar_protection = 300.0_wp !< [W/m2] chap. G.5.3.1 sun protection closed, if the radiation |
---|
| 283 | !< on facade exceeds this value |
---|
| 284 | |
---|
[4246] | 285 | INTEGER(iwp) :: cooling_on !< Indoor cooling flag (0=off, 1=on) |
---|
| 286 | INTEGER(iwp) :: heating_on !< Indoor heating flag (0=off, 1=on) |
---|
| 287 | INTEGER(iwp) :: solar_protection_off !< Solar protection off |
---|
| 288 | INTEGER(iwp) :: solar_protection_on !< Solar protection on |
---|
| 289 | |
---|
[4310] | 290 | |
---|
[4246] | 291 | REAL(wp) :: a_m !< [m2] the effective mass-related area |
---|
| 292 | REAL(wp) :: air_change !< [1/h] Airflow |
---|
| 293 | REAL(wp) :: c_m !< [J/K] internal heat storage capacity |
---|
| 294 | REAL(wp) :: facade_element_area !< [m2_facade] building surface facade |
---|
| 295 | REAL(wp) :: floor_area_per_facade !< [m2/m2] floor area per facade area |
---|
| 296 | REAL(wp) :: h_t_1 !< [W/K] Heat transfer coefficient auxiliary variable 1 |
---|
| 297 | REAL(wp) :: h_t_2 !< [W/K] Heat transfer coefficient auxiliary variable 2 |
---|
[4646] | 298 | REAL(wp) :: h_t_3 !< [W/K] Heat transfer coefficient auxiliary variable 3 |
---|
| 299 | REAL(wp) :: h_t_es !< [W/K] heat transfer coefficient of doors, windows, curtain walls and |
---|
| 300 | !< glazed walls (assumption: thermal mass=0) |
---|
[4246] | 301 | REAL(wp) :: h_t_is !< [W/K] thermal coupling conductance (Thermischer Kopplungsleitwert) |
---|
| 302 | REAL(wp) :: h_t_ms !< [W/K] Heat transfer conductance term (got with h_t_wm the thermal mass) |
---|
| 303 | REAL(wp) :: h_t_wall !< [W/K] heat transfer coefficient of opaque components (assumption: got all |
---|
| 304 | !< thermal mass) contains of h_t_wm and h_t_ms |
---|
[4646] | 305 | REAL(wp) :: h_t_wm !< [W/K] Heat transfer coefficient of the emmision (got with h_t_ms the |
---|
| 306 | !< thermal mass) |
---|
[4246] | 307 | REAL(wp) :: h_v !< [W/K] heat transfer of ventilation |
---|
| 308 | REAL(wp) :: indoor_volume_per_facade !< [m3] indoor air volume per facade element |
---|
| 309 | REAL(wp) :: initial_indoor_temperature = 293.15 !< [K] initial indoor temperature (namelist parameter) |
---|
| 310 | REAL(wp) :: net_sw_in !< [W/m2] net short-wave radiation |
---|
| 311 | REAL(wp) :: phi_hc_nd !< [W] heating demand and/or cooling demand |
---|
[4646] | 312 | REAL(wp) :: phi_hc_nd_10 !< [W] heating demand and/or cooling demand for heating or cooling |
---|
[4246] | 313 | REAL(wp) :: phi_hc_nd_ac !< [W] actual heating demand and/or cooling demand |
---|
| 314 | REAL(wp) :: phi_hc_nd_un !< [W] unlimited heating demand and/or cooling demand which is necessary to |
---|
[4646] | 315 | !< reach the demanded required temperature (heating is positive, |
---|
| 316 | !< cooling is negative) |
---|
[4246] | 317 | REAL(wp) :: phi_ia !< [W] internal air load = internal loads * 0.5, Eq. (C.1) |
---|
| 318 | REAL(wp) :: phi_m !< [W] mass specific thermal load (internal and external) |
---|
| 319 | REAL(wp) :: phi_mtot !< [W] total mass specific thermal load (internal and external) |
---|
| 320 | REAL(wp) :: phi_sol !< [W] solar loads |
---|
[4646] | 321 | REAL(wp) :: phi_st !< [W] mass specific thermal load implied non thermal mass |
---|
[4701] | 322 | REAL(wp) :: q_wall !< [W/m2]heat flux from indoor into wall |
---|
| 323 | REAL(wp) :: q_win !< [W/m2]heat flux from indoor into window |
---|
[4246] | 324 | REAL(wp) :: q_waste_heat !< [W/m2]waste heat, sum of waste heat over the roof to Palm |
---|
[4646] | 325 | |
---|
[4246] | 326 | REAL(wp) :: q_c_m !< [W] Energy of thermal storage mass specific thermal load for internal |
---|
| 327 | !< and external heatsources (for energy bilanz) |
---|
[4646] | 328 | REAL(wp) :: q_c_st !< [W] Energy of thermal storage mass specific thermal load implied non |
---|
| 329 | !< thermal mass (for energy bilanz) |
---|
[4246] | 330 | REAL(wp) :: q_int !< [W] Energy of internal air load (for energy bilanz) |
---|
| 331 | REAL(wp) :: q_sol !< [W] Energy of solar (for energy bilanz) |
---|
| 332 | REAL(wp) :: q_vent !< [W] Energy of ventilation (for energy bilanz) |
---|
[4646] | 333 | |
---|
[4246] | 334 | REAL(wp) :: schedule_d !< [-] activation for internal loads (low or high + low) |
---|
| 335 | REAL(wp) :: skip_time_do_indoor = 0.0_wp !< [s] Indoor model is not called before this time |
---|
| 336 | REAL(wp) :: theta_air !< [degree_C] air temperature of the RC-node |
---|
| 337 | REAL(wp) :: theta_air_0 !< [degree_C] air temperature of the RC-node in equilibrium |
---|
[4646] | 338 | REAL(wp) :: theta_air_10 !< [degree_C] air temperature of the RC-node from a heating capacity |
---|
[4246] | 339 | !< of 10 W/m2 |
---|
| 340 | REAL(wp) :: theta_air_ac !< [degree_C] actual room temperature after heating/cooling |
---|
| 341 | REAL(wp) :: theta_air_set !< [degree_C] Setpoint_temperature for the room |
---|
| 342 | REAL(wp) :: theta_m !< [degree_C} inner temperature of the RC-node |
---|
[4687] | 343 | REAL(wp) :: theta_m_t !< [degree_C] (Fictive) component temperature during timestep |
---|
[4246] | 344 | REAL(wp) :: theta_op !< [degree_C] operative temperature |
---|
| 345 | REAL(wp) :: theta_s !< [degree_C] surface temperature of the RC-node |
---|
| 346 | REAL(wp) :: time_indoor = 0.0_wp !< [s] time since last call of indoor model |
---|
| 347 | REAL(wp) :: total_area !< [m2] area of all surfaces pointing to zone |
---|
| 348 | REAL(wp) :: window_area_per_facade !< [m2] window area per facade element |
---|
[4646] | 349 | |
---|
[4267] | 350 | ! |
---|
| 351 | !-- Definition of seasonal parameters, summer and winter, for different building types |
---|
[4646] | 352 | REAL(wp), DIMENSION(0:1,1:7) :: summer_pars = RESHAPE( (/ & ! building_type 1 |
---|
| 353 | 0.5_wp, & ! basical airflow without occupancy of the room |
---|
| 354 | 2.0_wp, & ! additional airflow depend of occupancy of the room |
---|
| 355 | 0.5_wp, & ! building_type 2: basical airflow without occupancy |
---|
| 356 | ! of the room |
---|
| 357 | 2.0_wp, & ! additional airflow depend of occupancy of the room |
---|
| 358 | 0.8_wp, & ! building_type 3: basical airflow without occupancy |
---|
| 359 | ! of the room |
---|
| 360 | 2.0_wp, & ! additional airflow depend of occupancy of the room |
---|
| 361 | 0.1_wp, & ! building_type 4: basical airflow without occupancy |
---|
| 362 | ! of the room |
---|
| 363 | 1.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 364 | 0.1_wp, & ! building_type 5: basical airflow without occupancy |
---|
| 365 | ! of the room |
---|
| 366 | 1.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 367 | 0.1_wp, & ! building_type 6: basical airflow without occupancy |
---|
| 368 | ! of the room |
---|
| 369 | 1.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 370 | 0.1_wp, & ! building_type 7: basical airflow without occupancy |
---|
| 371 | ! of the room |
---|
| 372 | 1.5_wp & ! additional airflow depend of occupancy of the room |
---|
[4267] | 373 | /), (/ 2, 7 /) ) |
---|
[4246] | 374 | |
---|
[4646] | 375 | REAL(wp), DIMENSION(0:1,1:7) :: winter_pars = RESHAPE( (/ & ! building_type 1 |
---|
| 376 | 0.1_wp, & ! basical airflow without occupancy of the room |
---|
| 377 | 0.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 378 | 0.1_wp, & ! building_type 2: basical airflow without occupancy |
---|
| 379 | ! of the room |
---|
| 380 | 0.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 381 | 0.1_wp, & ! building_type 3: basical airflow without occupancy |
---|
| 382 | ! of the room |
---|
| 383 | 0.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 384 | 0.1_wp, & ! building_type 4: basical airflow without occupancy |
---|
| 385 | ! of the room |
---|
| 386 | 1.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 387 | 0.1_wp, & ! building_type 5: basical airflow without occupancy |
---|
| 388 | ! of the room |
---|
| 389 | 1.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 390 | 0.1_wp, & ! building_type 6: basical airflow without occupancy |
---|
| 391 | ! of the room |
---|
| 392 | 1.5_wp, & ! additional airflow depend of occupancy of the room |
---|
| 393 | 0.1_wp, & ! building_type 7: basical airflow without occupancy |
---|
| 394 | ! of the room |
---|
| 395 | 1.5_wp & ! additional airflow depend of occupancy of the room |
---|
[4267] | 396 | /), (/ 2, 7 /) ) |
---|
| 397 | |
---|
[4246] | 398 | SAVE |
---|
| 399 | |
---|
| 400 | |
---|
| 401 | PRIVATE |
---|
[4646] | 402 | |
---|
[4246] | 403 | ! |
---|
| 404 | !-- Add INTERFACES that must be available to other modules |
---|
[4646] | 405 | PUBLIC im_init, im_main_heatcool, im_parin, im_define_netcdf_grid, im_check_data_output, & |
---|
| 406 | im_data_output_3d, im_check_parameters |
---|
[4246] | 407 | |
---|
[4646] | 408 | |
---|
[4246] | 409 | ! |
---|
| 410 | !-- Add VARIABLES that must be available to other modules |
---|
| 411 | PUBLIC dt_indoor, skip_time_do_indoor, time_indoor |
---|
| 412 | |
---|
| 413 | ! |
---|
| 414 | !-- PALM interfaces: |
---|
| 415 | !-- Data output checks for 2D/3D data to be done in check_parameters |
---|
| 416 | INTERFACE im_check_data_output |
---|
| 417 | MODULE PROCEDURE im_check_data_output |
---|
| 418 | END INTERFACE im_check_data_output |
---|
| 419 | ! |
---|
| 420 | !-- Input parameter checks to be done in check_parameters |
---|
| 421 | INTERFACE im_check_parameters |
---|
| 422 | MODULE PROCEDURE im_check_parameters |
---|
| 423 | END INTERFACE im_check_parameters |
---|
| 424 | ! |
---|
| 425 | !-- Data output of 3D data |
---|
| 426 | INTERFACE im_data_output_3d |
---|
| 427 | MODULE PROCEDURE im_data_output_3d |
---|
| 428 | END INTERFACE im_data_output_3d |
---|
| 429 | |
---|
| 430 | ! |
---|
| 431 | !-- Definition of data output quantities |
---|
| 432 | INTERFACE im_define_netcdf_grid |
---|
| 433 | MODULE PROCEDURE im_define_netcdf_grid |
---|
| 434 | END INTERFACE im_define_netcdf_grid |
---|
[4646] | 435 | ! |
---|
[4246] | 436 | ! ! |
---|
| 437 | ! !-- Output of information to the header file |
---|
| 438 | ! INTERFACE im_header |
---|
| 439 | ! MODULE PROCEDURE im_header |
---|
| 440 | ! END INTERFACE im_header |
---|
| 441 | ! |
---|
[4646] | 442 | !-- Calculations for indoor temperatures |
---|
[4246] | 443 | INTERFACE im_calc_temperatures |
---|
| 444 | MODULE PROCEDURE im_calc_temperatures |
---|
| 445 | END INTERFACE im_calc_temperatures |
---|
| 446 | ! |
---|
[4646] | 447 | !-- Initialization actions |
---|
[4246] | 448 | INTERFACE im_init |
---|
| 449 | MODULE PROCEDURE im_init |
---|
| 450 | END INTERFACE im_init |
---|
| 451 | ! |
---|
[4646] | 452 | !-- Main part of indoor model |
---|
[4246] | 453 | INTERFACE im_main_heatcool |
---|
| 454 | MODULE PROCEDURE im_main_heatcool |
---|
| 455 | END INTERFACE im_main_heatcool |
---|
| 456 | ! |
---|
| 457 | !-- Reading of NAMELIST parameters |
---|
| 458 | INTERFACE im_parin |
---|
| 459 | MODULE PROCEDURE im_parin |
---|
| 460 | END INTERFACE im_parin |
---|
| 461 | |
---|
| 462 | CONTAINS |
---|
| 463 | |
---|
[4646] | 464 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 465 | ! Description: |
---|
| 466 | ! ------------ |
---|
[4646] | 467 | !< Calculation of the air temperatures and mean radiation temperature. |
---|
| 468 | !< This is basis for the operative temperature. |
---|
| 469 | !< Based on a Crank-Nicholson scheme with a timestep of a hour. |
---|
| 470 | !--------------------------------------------------------------------------------------------------! |
---|
[4702] | 471 | SUBROUTINE im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 472 | near_facade_temperature, phi_hc_nd_dummy, theta_m_t_prev ) |
---|
[4402] | 473 | |
---|
[4246] | 474 | INTEGER(iwp) :: i |
---|
| 475 | INTEGER(iwp) :: j |
---|
| 476 | INTEGER(iwp) :: k |
---|
[4646] | 477 | |
---|
[4701] | 478 | REAL(wp) :: indoor_wall_temperature !< temperature of innermost wall layer evtl in im_calc_temperatures einfÃŒgen |
---|
[4246] | 479 | REAL(wp) :: near_facade_temperature |
---|
| 480 | REAL(wp) :: phi_hc_nd_dummy |
---|
[4687] | 481 | REAL(wp), INTENT(IN) :: theta_m_t_prev |
---|
[4246] | 482 | ! |
---|
| 483 | !-- Calculation of total mass specific thermal load (internal and external) |
---|
[4701] | 484 | phi_mtot = ( phi_m + h_t_wm * indoor_wall_temperature & |
---|
[4646] | 485 | + h_t_3 * ( phi_st + h_t_es * pt(k,j,i) & |
---|
| 486 | + h_t_1 * & |
---|
| 487 | ( ( ( phi_ia + phi_hc_nd_dummy ) / h_v ) & |
---|
| 488 | + near_facade_temperature ) & |
---|
| 489 | ) / h_t_2 & |
---|
[4246] | 490 | ) !< [degree_C] Eq. (C.5) |
---|
[4646] | 491 | ! |
---|
[4687] | 492 | !-- Calculation of component temperature at current timestep |
---|
[4646] | 493 | theta_m_t = ( ( theta_m_t_prev & |
---|
| 494 | * ( ( c_m / 3600.0_wp ) - 0.5_wp * ( h_t_3 + h_t_wm ) ) & |
---|
| 495 | + phi_mtot & |
---|
| 496 | ) & |
---|
| 497 | / ( ( c_m / 3600.0_wp ) + 0.5_wp * ( h_t_3 + h_t_wm ) ) & |
---|
[4246] | 498 | ) !< [degree_C] Eq. (C.4) |
---|
| 499 | ! |
---|
[4687] | 500 | !-- Calculation of mean inner temperature for the RC-node in current timestep |
---|
[4246] | 501 | theta_m = ( theta_m_t + theta_m_t_prev ) * 0.5_wp !< [degree_C] Eq. (C.9) |
---|
[4646] | 502 | |
---|
[4246] | 503 | ! |
---|
[4687] | 504 | !-- Calculation of mean surface temperature of the RC-node in current timestep |
---|
[4646] | 505 | theta_s = ( ( h_t_ms * theta_m + phi_st + h_t_es * pt(k,j,i) & |
---|
| 506 | + h_t_1 * ( near_facade_temperature & |
---|
| 507 | + ( phi_ia + phi_hc_nd_dummy ) / h_v ) & |
---|
| 508 | ) & |
---|
| 509 | / ( h_t_ms + h_t_es + h_t_1 ) & |
---|
[4246] | 510 | ) !< [degree_C] Eq. (C.10) |
---|
[4646] | 511 | |
---|
[4246] | 512 | ! |
---|
| 513 | !-- Calculation of the air temperature of the RC-node |
---|
[4687] | 514 | |
---|
| 515 | |
---|
[4646] | 516 | theta_air = ( h_t_is * theta_s + h_v * near_facade_temperature + phi_ia + phi_hc_nd_dummy ) / & |
---|
| 517 | ( h_t_is + h_v ) !< [degree_C] Eq. (C.11) |
---|
[4246] | 518 | |
---|
[4687] | 519 | |
---|
[4246] | 520 | END SUBROUTINE im_calc_temperatures |
---|
| 521 | |
---|
[4646] | 522 | |
---|
| 523 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 524 | ! Description: |
---|
| 525 | ! ------------ |
---|
| 526 | !> Initialization of the indoor model. |
---|
[4646] | 527 | !> Static information are calculated here, e.g. building parameters and geometrical information, |
---|
| 528 | !> anything that doesn't change in time. |
---|
[4246] | 529 | ! |
---|
| 530 | !-- Input values |
---|
| 531 | !-- Input datas from Palm, M4 |
---|
| 532 | ! i_global --> net_sw_in !< global radiation [W/m2] |
---|
| 533 | ! theta_e --> pt(k,j,i) !< undisturbed outside temperature, 1. PALM volume, for windows |
---|
| 534 | ! theta_sup = theta_f --> surf_usm_h%pt_10cm(m) |
---|
[4646] | 535 | ! surf_usm_v(l)%pt_10cm(m) !< Air temperature, facade near (10cm) air temperature from |
---|
| 536 | !< 1. Palm volume |
---|
[4246] | 537 | ! theta_node --> t_wall_h(nzt_wall,m) |
---|
| 538 | ! t_wall_v(l)%t(nzt_wall,m) !< Temperature of innermost wall layer, for opaque wall |
---|
[4646] | 539 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 540 | SUBROUTINE im_init |
---|
| 541 | |
---|
[4646] | 542 | USE control_parameters, & |
---|
[4267] | 543 | ONLY: message_string, time_since_reference_point |
---|
[4246] | 544 | |
---|
[4646] | 545 | USE indices, & |
---|
[4346] | 546 | ONLY: nxl, nxr, nyn, nys, nzb, nzt, wall_flags_total_0 |
---|
[4246] | 547 | |
---|
[4646] | 548 | USE grid_variables, & |
---|
[4246] | 549 | ONLY: dx, dy |
---|
| 550 | |
---|
| 551 | USE pegrid |
---|
| 552 | |
---|
[4646] | 553 | USE surface_mod, & |
---|
[4246] | 554 | ONLY: surf_usm_h, surf_usm_v |
---|
[4646] | 555 | |
---|
| 556 | USE urban_surface_mod, & |
---|
[4246] | 557 | ONLY: building_pars, building_type |
---|
| 558 | |
---|
[4267] | 559 | INTEGER(iwp) :: bt !< local building type |
---|
| 560 | INTEGER(iwp) :: day_of_year !< day of the year |
---|
| 561 | INTEGER(iwp) :: i !< running index along x-direction |
---|
| 562 | INTEGER(iwp) :: j !< running index along y-direction |
---|
| 563 | INTEGER(iwp) :: k !< running index along z-direction |
---|
| 564 | INTEGER(iwp) :: l !< running index for surface-element orientation |
---|
| 565 | INTEGER(iwp) :: m !< running index surface elements |
---|
| 566 | INTEGER(iwp) :: n !< building index |
---|
| 567 | INTEGER(iwp) :: nb !< building index |
---|
[4246] | 568 | |
---|
| 569 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: build_ids !< building IDs on entire model domain |
---|
[4646] | 570 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: build_ids_final !< building IDs on entire model domain, |
---|
| 571 | !< multiple occurences are sorted out |
---|
[4246] | 572 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: build_ids_final_tmp !< temporary array used for resizing |
---|
| 573 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: build_ids_l !< building IDs on local subdomain |
---|
| 574 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: build_ids_l_tmp !< temporary array used to resize array of building IDs |
---|
| 575 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: displace_dum !< displacements of start addresses, used for MPI_ALLGATHERV |
---|
| 576 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: k_max_l !< highest vertical index of a building on subdomain |
---|
| 577 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: k_min_l !< lowest vertical index of a building on subdomain |
---|
| 578 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: n_fa !< counting array |
---|
[4646] | 579 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: num_facades_h !< dummy array used for summing-up total number of |
---|
[4246] | 580 | !< horizontal facade elements |
---|
[4646] | 581 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: num_facades_v !< dummy array used for summing-up total number of |
---|
[4246] | 582 | !< vertical facade elements |
---|
[4646] | 583 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: receive_dum_h !< dummy array used for MPI_ALLREDUCE |
---|
| 584 | INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: receive_dum_v !< dummy array used for MPI_ALLREDUCE |
---|
| 585 | |
---|
[4246] | 586 | INTEGER(iwp), DIMENSION(0:numprocs-1) :: num_buildings !< number of buildings with different ID on entire model domain |
---|
| 587 | INTEGER(iwp), DIMENSION(0:numprocs-1) :: num_buildings_l !< number of buildings with different ID on local subdomain |
---|
[4646] | 588 | |
---|
[4246] | 589 | REAL(wp) :: u_tmp !< dummy for temporary calculation of u-value without h_is |
---|
| 590 | REAL(wp) :: du_tmp !< 1/u_tmp |
---|
| 591 | REAL(wp) :: du_win_tmp !< 1/building(nb)%u_value_win |
---|
| 592 | REAL(wp) :: facade_area_v !< dummy to compute the total facade area from vertical walls |
---|
| 593 | |
---|
| 594 | REAL(wp), DIMENSION(:), ALLOCATABLE :: volume !< total building volume at each discrete height level |
---|
| 595 | REAL(wp), DIMENSION(:), ALLOCATABLE :: volume_l !< total building volume at each discrete height level, |
---|
| 596 | !< on local subdomain |
---|
| 597 | |
---|
| 598 | CALL location_message( 'initializing indoor model', 'start' ) |
---|
| 599 | ! |
---|
[4646] | 600 | !-- Initializing of indoor model is only possible if buildings can be distinguished by their IDs. |
---|
[4246] | 601 | IF ( .NOT. building_id_f%from_file ) THEN |
---|
| 602 | message_string = 'Indoor model requires information about building_id' |
---|
| 603 | CALL message( 'im_init', 'PA0999', 1, 2, 0, 6, 0 ) |
---|
| 604 | ENDIF |
---|
| 605 | ! |
---|
| 606 | !-- Determine number of different building IDs on local subdomain. |
---|
| 607 | num_buildings_l = 0 |
---|
| 608 | num_buildings = 0 |
---|
| 609 | ALLOCATE( build_ids_l(1) ) |
---|
| 610 | DO i = nxl, nxr |
---|
| 611 | DO j = nys, nyn |
---|
| 612 | IF ( building_id_f%var(j,i) /= building_id_f%fill ) THEN |
---|
| 613 | IF ( num_buildings_l(myid) > 0 ) THEN |
---|
[4646] | 614 | IF ( ANY( building_id_f%var(j,i) == build_ids_l ) ) THEN |
---|
[4246] | 615 | CYCLE |
---|
| 616 | ELSE |
---|
| 617 | num_buildings_l(myid) = num_buildings_l(myid) + 1 |
---|
| 618 | ! |
---|
| 619 | !-- Resize array with different local building ids |
---|
| 620 | ALLOCATE( build_ids_l_tmp(1:SIZE(build_ids_l)) ) |
---|
| 621 | build_ids_l_tmp = build_ids_l |
---|
| 622 | DEALLOCATE( build_ids_l ) |
---|
| 623 | ALLOCATE( build_ids_l(1:num_buildings_l(myid)) ) |
---|
[4646] | 624 | build_ids_l(1:num_buildings_l(myid)-1) = & |
---|
| 625 | build_ids_l_tmp(1:num_buildings_l(myid)-1) |
---|
[4246] | 626 | build_ids_l(num_buildings_l(myid)) = building_id_f%var(j,i) |
---|
| 627 | DEALLOCATE( build_ids_l_tmp ) |
---|
| 628 | ENDIF |
---|
| 629 | ! |
---|
[4646] | 630 | !-- First occuring building id on PE |
---|
| 631 | ELSE |
---|
[4246] | 632 | num_buildings_l(myid) = num_buildings_l(myid) + 1 |
---|
| 633 | build_ids_l(1) = building_id_f%var(j,i) |
---|
| 634 | ENDIF |
---|
| 635 | ENDIF |
---|
| 636 | ENDDO |
---|
| 637 | ENDDO |
---|
| 638 | ! |
---|
[4646] | 639 | !-- Determine number of building IDs for the entire domain. (Note, building IDs can appear multiple |
---|
| 640 | !-- times as buildings might be distributed over several PEs.) |
---|
| 641 | #if defined( __parallel ) |
---|
| 642 | CALL MPI_ALLREDUCE( num_buildings_l, num_buildings, numprocs, MPI_INTEGER, MPI_SUM, comm2d, & |
---|
| 643 | ierr ) |
---|
[4246] | 644 | #else |
---|
| 645 | num_buildings = num_buildings_l |
---|
| 646 | #endif |
---|
| 647 | ALLOCATE( build_ids(1:SUM(num_buildings)) ) |
---|
| 648 | ! |
---|
[4646] | 649 | !-- Gather building IDs. Therefore, first, determine displacements used required for MPI_GATHERV |
---|
| 650 | !-- call. |
---|
[4246] | 651 | ALLOCATE( displace_dum(0:numprocs-1) ) |
---|
| 652 | displace_dum(0) = 0 |
---|
| 653 | DO i = 1, numprocs-1 |
---|
| 654 | displace_dum(i) = displace_dum(i-1) + num_buildings(i-1) |
---|
| 655 | ENDDO |
---|
| 656 | |
---|
[4646] | 657 | #if defined( __parallel ) |
---|
| 658 | CALL MPI_ALLGATHERV( build_ids_l(1:num_buildings_l(myid)), & |
---|
| 659 | num_buildings(myid), & |
---|
| 660 | MPI_INTEGER, & |
---|
| 661 | build_ids, & |
---|
| 662 | num_buildings, & |
---|
| 663 | displace_dum, & |
---|
| 664 | MPI_INTEGER, & |
---|
| 665 | comm2d, ierr ) |
---|
[4246] | 666 | |
---|
| 667 | DEALLOCATE( displace_dum ) |
---|
| 668 | |
---|
| 669 | #else |
---|
| 670 | build_ids = build_ids_l |
---|
| 671 | #endif |
---|
| 672 | ! |
---|
[4646] | 673 | !-- Note: in parallel mode, building IDs can occur mutliple times, as each PE has send its own ids. |
---|
| 674 | !-- Therefore, sort out building IDs which appear multiple times. |
---|
[4246] | 675 | num_build = 0 |
---|
| 676 | DO n = 1, SIZE(build_ids) |
---|
| 677 | |
---|
| 678 | IF ( ALLOCATED(build_ids_final) ) THEN |
---|
| 679 | IF ( ANY( build_ids(n) == build_ids_final ) ) THEN |
---|
| 680 | CYCLE |
---|
| 681 | ELSE |
---|
| 682 | num_build = num_build + 1 |
---|
| 683 | ! |
---|
| 684 | !-- Resize |
---|
| 685 | ALLOCATE( build_ids_final_tmp(1:num_build) ) |
---|
| 686 | build_ids_final_tmp(1:num_build-1) = build_ids_final(1:num_build-1) |
---|
| 687 | DEALLOCATE( build_ids_final ) |
---|
| 688 | ALLOCATE( build_ids_final(1:num_build) ) |
---|
| 689 | build_ids_final(1:num_build-1) = build_ids_final_tmp(1:num_build-1) |
---|
| 690 | build_ids_final(num_build) = build_ids(n) |
---|
| 691 | DEALLOCATE( build_ids_final_tmp ) |
---|
[4646] | 692 | ENDIF |
---|
[4246] | 693 | ELSE |
---|
| 694 | num_build = num_build + 1 |
---|
| 695 | ALLOCATE( build_ids_final(1:num_build) ) |
---|
| 696 | build_ids_final(num_build) = build_ids(n) |
---|
| 697 | ENDIF |
---|
| 698 | ENDDO |
---|
| 699 | |
---|
| 700 | ! |
---|
[4646] | 701 | !-- Allocate building-data structure array. Note, this is a global array and all building IDs on |
---|
| 702 | !-- domain are known by each PE. Further attributes, e.g. height-dependent arrays, however, are only |
---|
| 703 | !-- allocated on PEs where the respective building is present (in order to reduce memory demands). |
---|
[4246] | 704 | ALLOCATE( buildings(1:num_build) ) |
---|
| 705 | |
---|
| 706 | ! |
---|
[4646] | 707 | !-- Store building IDs and check if building with certain ID is present on subdomain. |
---|
[4246] | 708 | DO nb = 1, num_build |
---|
| 709 | buildings(nb)%id = build_ids_final(nb) |
---|
| 710 | |
---|
[4646] | 711 | IF ( ANY( building_id_f%var(nys:nyn,nxl:nxr) == buildings(nb)%id ) ) & |
---|
[4246] | 712 | buildings(nb)%on_pe = .TRUE. |
---|
[4646] | 713 | ENDDO |
---|
[4246] | 714 | ! |
---|
[4646] | 715 | !-- Determine the maximum vertical dimension occupied by each building. |
---|
[4246] | 716 | ALLOCATE( k_min_l(1:num_build) ) |
---|
| 717 | ALLOCATE( k_max_l(1:num_build) ) |
---|
| 718 | k_min_l = nzt + 1 |
---|
[4646] | 719 | k_max_l = 0 |
---|
[4246] | 720 | |
---|
| 721 | DO i = nxl, nxr |
---|
| 722 | DO j = nys, nyn |
---|
| 723 | IF ( building_id_f%var(j,i) /= building_id_f%fill ) THEN |
---|
[4646] | 724 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 725 | DO k = nzb, nzt+1 |
---|
| 726 | ! |
---|
[4646] | 727 | !-- Check if grid point belongs to a building. |
---|
[4346] | 728 | IF ( BTEST( wall_flags_total_0(k,j,i), 6 ) ) THEN |
---|
[4246] | 729 | k_min_l(nb) = MIN( k_min_l(nb), k ) |
---|
| 730 | k_max_l(nb) = MAX( k_max_l(nb), k ) |
---|
| 731 | ENDIF |
---|
| 732 | |
---|
| 733 | ENDDO |
---|
| 734 | ENDIF |
---|
| 735 | ENDDO |
---|
| 736 | ENDDO |
---|
| 737 | |
---|
[4646] | 738 | #if defined( __parallel ) |
---|
| 739 | CALL MPI_ALLREDUCE( k_min_l(:), buildings(:)%kb_min, num_build, MPI_INTEGER, MPI_MIN, comm2d, & |
---|
| 740 | ierr ) |
---|
| 741 | CALL MPI_ALLREDUCE( k_max_l(:), buildings(:)%kb_max, num_build, MPI_INTEGER, MPI_MAX, comm2d, & |
---|
| 742 | ierr ) |
---|
[4246] | 743 | #else |
---|
| 744 | buildings(:)%kb_min = k_min_l(:) |
---|
| 745 | buildings(:)%kb_max = k_max_l(:) |
---|
| 746 | #endif |
---|
| 747 | |
---|
| 748 | DEALLOCATE( k_min_l ) |
---|
| 749 | DEALLOCATE( k_max_l ) |
---|
| 750 | ! |
---|
| 751 | !-- Calculate building height. |
---|
| 752 | DO nb = 1, num_build |
---|
| 753 | buildings(nb)%building_height = 0.0_wp |
---|
| 754 | DO k = buildings(nb)%kb_min, buildings(nb)%kb_max |
---|
[4646] | 755 | buildings(nb)%building_height = buildings(nb)%building_height + dzw(k+1) |
---|
[4246] | 756 | ENDDO |
---|
| 757 | ENDDO |
---|
| 758 | ! |
---|
| 759 | !-- Calculate building volume |
---|
| 760 | DO nb = 1, num_build |
---|
| 761 | ! |
---|
| 762 | !-- Allocate temporary array for summing-up building volume |
---|
| 763 | ALLOCATE( volume(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 764 | ALLOCATE( volume_l(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 765 | volume = 0.0_wp |
---|
| 766 | volume_l = 0.0_wp |
---|
| 767 | ! |
---|
[4646] | 768 | !-- Calculate building volume per height level on each PE where these building is present. |
---|
[4246] | 769 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 770 | |
---|
| 771 | ALLOCATE( buildings(nb)%volume(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 772 | ALLOCATE( buildings(nb)%vol_frac(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 773 | buildings(nb)%volume = 0.0_wp |
---|
| 774 | buildings(nb)%vol_frac = 0.0_wp |
---|
[4646] | 775 | |
---|
| 776 | IF ( ANY( building_id_f%var(nys:nyn,nxl:nxr) == buildings(nb)%id ) ) THEN |
---|
[4246] | 777 | DO i = nxl, nxr |
---|
| 778 | DO j = nys, nyn |
---|
| 779 | DO k = buildings(nb)%kb_min, buildings(nb)%kb_max |
---|
[4646] | 780 | IF ( building_id_f%var(j,i) /= building_id_f%fill ) & |
---|
[4246] | 781 | volume_l(k) = volume_l(k) + dx * dy * dzw(k+1) |
---|
| 782 | ENDDO |
---|
| 783 | ENDDO |
---|
| 784 | ENDDO |
---|
| 785 | ENDIF |
---|
| 786 | ENDIF |
---|
| 787 | ! |
---|
| 788 | !-- Sum-up building volume from all subdomains |
---|
[4646] | 789 | #if defined( __parallel ) |
---|
| 790 | CALL MPI_ALLREDUCE( volume_l, volume, SIZE(volume), MPI_REAL, MPI_SUM, comm2d, ierr ) |
---|
[4246] | 791 | #else |
---|
| 792 | volume = volume_l |
---|
| 793 | #endif |
---|
| 794 | ! |
---|
[4646] | 795 | !-- Save total building volume as well as local fraction on volume on building data structure. |
---|
[4246] | 796 | IF ( ALLOCATED( buildings(nb)%volume ) ) buildings(nb)%volume = volume |
---|
| 797 | ! |
---|
| 798 | !-- Determine fraction of local on total building volume |
---|
| 799 | IF ( buildings(nb)%on_pe ) buildings(nb)%vol_frac = volume_l / volume |
---|
| 800 | ! |
---|
| 801 | !-- Calculate total building volume |
---|
[4646] | 802 | IF ( ALLOCATED( buildings(nb)%volume ) ) buildings(nb)%vol_tot = SUM( buildings(nb)%volume ) |
---|
[4246] | 803 | |
---|
| 804 | DEALLOCATE( volume ) |
---|
| 805 | DEALLOCATE( volume_l ) |
---|
| 806 | |
---|
| 807 | ENDDO |
---|
| 808 | ! |
---|
[4646] | 809 | !-- Allocate arrays for indoor temperature. |
---|
[4246] | 810 | DO nb = 1, num_build |
---|
| 811 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 812 | ALLOCATE( buildings(nb)%t_in(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 813 | ALLOCATE( buildings(nb)%t_in_l(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 814 | buildings(nb)%t_in = 0.0_wp |
---|
| 815 | buildings(nb)%t_in_l = 0.0_wp |
---|
| 816 | ENDIF |
---|
| 817 | ENDDO |
---|
| 818 | ! |
---|
[4646] | 819 | !-- Allocate arrays for number of facades per height level. Distinguish between horizontal and |
---|
| 820 | !-- vertical facades. |
---|
[4246] | 821 | DO nb = 1, num_build |
---|
| 822 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 823 | ALLOCATE( buildings(nb)%num_facade_h(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 824 | ALLOCATE( buildings(nb)%num_facade_v(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 825 | |
---|
| 826 | buildings(nb)%num_facade_h = 0 |
---|
| 827 | buildings(nb)%num_facade_v = 0 |
---|
| 828 | ENDIF |
---|
| 829 | ENDDO |
---|
| 830 | ! |
---|
| 831 | !-- Determine number of facade elements per building on local subdomain. |
---|
| 832 | !-- Distinguish between horizontal and vertical facade elements. |
---|
| 833 | ! |
---|
| 834 | !-- Horizontal facades |
---|
| 835 | buildings(:)%num_facades_per_building_h_l = 0 |
---|
[4671] | 836 | DO l = 0, 1 |
---|
| 837 | DO m = 1, surf_usm_h(l)%ns |
---|
[4246] | 838 | ! |
---|
[4671] | 839 | !-- For the current facade element determine corresponding building index. |
---|
| 840 | !-- First, obtain j,j,k indices of the building. Please note the offset between facade/surface |
---|
| 841 | !-- element and building location (for horizontal surface elements the horizontal offsets are |
---|
| 842 | !-- zero). |
---|
| 843 | i = surf_usm_h(l)%i(m) + surf_usm_h(l)%ioff |
---|
| 844 | j = surf_usm_h(l)%j(m) + surf_usm_h(l)%joff |
---|
| 845 | k = surf_usm_h(l)%k(m) + surf_usm_h(l)%koff |
---|
[4246] | 846 | ! |
---|
[4671] | 847 | !-- Determine building index and check whether building is on PE. |
---|
| 848 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 849 | |
---|
[4671] | 850 | IF ( buildings(nb)%on_pe ) THEN |
---|
[4246] | 851 | ! |
---|
[4671] | 852 | !-- Count number of facade elements at each height level. |
---|
| 853 | buildings(nb)%num_facade_h(k) = buildings(nb)%num_facade_h(k) + 1 |
---|
[4246] | 854 | ! |
---|
[4671] | 855 | !-- Moreover, sum up number of local facade elements per building. |
---|
| 856 | buildings(nb)%num_facades_per_building_h_l = & |
---|
[4646] | 857 | buildings(nb)%num_facades_per_building_h_l + 1 |
---|
[4671] | 858 | ENDIF |
---|
| 859 | ENDDO |
---|
[4246] | 860 | ENDDO |
---|
| 861 | ! |
---|
| 862 | !-- Vertical facades |
---|
| 863 | buildings(:)%num_facades_per_building_v_l = 0 |
---|
| 864 | DO l = 0, 3 |
---|
| 865 | DO m = 1, surf_usm_v(l)%ns |
---|
| 866 | ! |
---|
| 867 | !-- For the current facade element determine corresponding building index. |
---|
[4646] | 868 | !-- First, obtain j,j,k indices of the building. Please note the offset between facade/surface |
---|
| 869 | !-- element and building location (for vertical surface elements the vertical offsets are |
---|
| 870 | !-- zero). |
---|
[4246] | 871 | i = surf_usm_v(l)%i(m) + surf_usm_v(l)%ioff |
---|
| 872 | j = surf_usm_v(l)%j(m) + surf_usm_v(l)%joff |
---|
| 873 | k = surf_usm_v(l)%k(m) + surf_usm_v(l)%koff |
---|
| 874 | |
---|
[4646] | 875 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 876 | IF ( buildings(nb)%on_pe ) THEN |
---|
[4646] | 877 | buildings(nb)%num_facade_v(k) = buildings(nb)%num_facade_v(k) + 1 |
---|
| 878 | buildings(nb)%num_facades_per_building_v_l = & |
---|
| 879 | buildings(nb)%num_facades_per_building_v_l + 1 |
---|
[4246] | 880 | ENDIF |
---|
| 881 | ENDDO |
---|
| 882 | ENDDO |
---|
| 883 | ! |
---|
[4646] | 884 | !-- Determine total number of facade elements per building and assign number to building data type. |
---|
[4246] | 885 | DO nb = 1, num_build |
---|
| 886 | ! |
---|
[4646] | 887 | !-- Allocate dummy array used for summing-up facade elements. |
---|
| 888 | !-- Please note, dummy arguments are necessary as building-date type arrays are not necessarily |
---|
| 889 | !-- allocated on all PEs. |
---|
[4246] | 890 | ALLOCATE( num_facades_h(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 891 | ALLOCATE( num_facades_v(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 892 | ALLOCATE( receive_dum_h(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 893 | ALLOCATE( receive_dum_v(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 894 | num_facades_h = 0 |
---|
| 895 | num_facades_v = 0 |
---|
| 896 | receive_dum_h = 0 |
---|
| 897 | receive_dum_v = 0 |
---|
| 898 | |
---|
| 899 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 900 | num_facades_h = buildings(nb)%num_facade_h |
---|
| 901 | num_facades_v = buildings(nb)%num_facade_v |
---|
| 902 | ENDIF |
---|
| 903 | |
---|
[4646] | 904 | #if defined( __parallel ) |
---|
| 905 | CALL MPI_ALLREDUCE( num_facades_h, & |
---|
| 906 | receive_dum_h, & |
---|
| 907 | buildings(nb)%kb_max - buildings(nb)%kb_min + 1, & |
---|
| 908 | MPI_INTEGER, & |
---|
| 909 | MPI_SUM, & |
---|
| 910 | comm2d, & |
---|
[4246] | 911 | ierr ) |
---|
| 912 | |
---|
[4646] | 913 | CALL MPI_ALLREDUCE( num_facades_v, & |
---|
| 914 | receive_dum_v, & |
---|
| 915 | buildings(nb)%kb_max - buildings(nb)%kb_min + 1, & |
---|
| 916 | MPI_INTEGER, & |
---|
| 917 | MPI_SUM, & |
---|
| 918 | comm2d, & |
---|
[4246] | 919 | ierr ) |
---|
[4646] | 920 | IF ( ALLOCATED( buildings(nb)%num_facade_h ) ) buildings(nb)%num_facade_h = receive_dum_h |
---|
| 921 | IF ( ALLOCATED( buildings(nb)%num_facade_v ) ) buildings(nb)%num_facade_v = receive_dum_v |
---|
[4246] | 922 | #else |
---|
| 923 | buildings(nb)%num_facade_h = num_facades_h |
---|
| 924 | buildings(nb)%num_facade_v = num_facades_v |
---|
| 925 | #endif |
---|
| 926 | |
---|
| 927 | ! |
---|
| 928 | !-- Deallocate dummy arrays |
---|
| 929 | DEALLOCATE( num_facades_h ) |
---|
| 930 | DEALLOCATE( num_facades_v ) |
---|
| 931 | DEALLOCATE( receive_dum_h ) |
---|
| 932 | DEALLOCATE( receive_dum_v ) |
---|
| 933 | ! |
---|
| 934 | !-- Allocate index arrays which link facade elements with surface-data type. |
---|
[4646] | 935 | !-- Please note, no height levels are considered here (information is stored in surface-data type |
---|
| 936 | !-- itself). |
---|
[4246] | 937 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 938 | ! |
---|
| 939 | !-- Determine number of facade elements per building. |
---|
| 940 | buildings(nb)%num_facades_per_building_h = SUM( buildings(nb)%num_facade_h ) |
---|
| 941 | buildings(nb)%num_facades_per_building_v = SUM( buildings(nb)%num_facade_v ) |
---|
| 942 | ! |
---|
[4646] | 943 | !-- Allocate arrays which link the building with the horizontal and vertical urban-type |
---|
| 944 | !-- surfaces. Please note, linking arrays are allocated over all facade elements, which is |
---|
| 945 | !-- required in case a building is located at the subdomain boundaries, where the building and |
---|
| 946 | !-- the corresponding surface elements are located on different subdomains. |
---|
[4681] | 947 | ALLOCATE( buildings(nb)%l_h(1:buildings(nb)%num_facades_per_building_h_l) ) |
---|
[4246] | 948 | ALLOCATE( buildings(nb)%m_h(1:buildings(nb)%num_facades_per_building_h_l) ) |
---|
| 949 | |
---|
| 950 | ALLOCATE( buildings(nb)%l_v(1:buildings(nb)%num_facades_per_building_v_l) ) |
---|
| 951 | ALLOCATE( buildings(nb)%m_v(1:buildings(nb)%num_facades_per_building_v_l) ) |
---|
[4687] | 952 | |
---|
| 953 | ALLOCATE( buildings(nb)%theta_m_t_prev_h(1:buildings(nb)%num_facades_per_building_h_l) ) |
---|
| 954 | ALLOCATE( buildings(nb)%theta_m_t_prev_v(1:buildings(nb)%num_facades_per_building_v_l) ) |
---|
[4246] | 955 | ENDIF |
---|
[4402] | 956 | |
---|
[4246] | 957 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 958 | ALLOCATE( buildings(nb)%vpf(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 959 | buildings(nb)%vpf = 0.0_wp |
---|
[4402] | 960 | |
---|
[4646] | 961 | facade_area_v = 0.0_wp |
---|
[4246] | 962 | DO k = buildings(nb)%kb_min, buildings(nb)%kb_max |
---|
[4646] | 963 | facade_area_v = facade_area_v + buildings(nb)%num_facade_v(k) * dzw(k+1) * dx |
---|
[4246] | 964 | ENDDO |
---|
[4402] | 965 | ! |
---|
[4646] | 966 | !-- Determine volume per total facade area (vpf). For the horizontal facade area |
---|
| 967 | !-- num_facades_per_building_h can be taken, multiplied with dx*dy. |
---|
| 968 | !-- However, due to grid stretching, vertical facade elements must be summed-up vertically. |
---|
| 969 | !-- Please note, if dx /= dy, an error is made! |
---|
| 970 | buildings(nb)%vpf = buildings(nb)%vol_tot / & |
---|
| 971 | ( buildings(nb)%num_facades_per_building_h * dx * dy + facade_area_v ) |
---|
[4402] | 972 | ! |
---|
| 973 | !-- Determine floor-area-per-facade. |
---|
[4646] | 974 | buildings(nb)%fapf = buildings(nb)%num_facades_per_building_h * dx * dy & |
---|
| 975 | / ( buildings(nb)%num_facades_per_building_h * dx * dy & |
---|
| 976 | + facade_area_v ) |
---|
[4246] | 977 | ENDIF |
---|
| 978 | ENDDO |
---|
| 979 | ! |
---|
[4646] | 980 | !-- Link facade elements with surface data type. |
---|
[4246] | 981 | !-- Allocate array for counting. |
---|
| 982 | ALLOCATE( n_fa(1:num_build) ) |
---|
| 983 | n_fa = 1 |
---|
| 984 | |
---|
[4671] | 985 | DO l = 0, 1 |
---|
| 986 | DO m = 1, surf_usm_h(l)%ns |
---|
| 987 | i = surf_usm_h(l)%i(m) + surf_usm_h(l)%ioff |
---|
| 988 | j = surf_usm_h(l)%j(m) + surf_usm_h(l)%joff |
---|
[4246] | 989 | |
---|
[4671] | 990 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 991 | |
---|
[4671] | 992 | IF ( buildings(nb)%on_pe ) THEN |
---|
[4681] | 993 | buildings(nb)%l_h(n_fa(nb)) = l |
---|
[4671] | 994 | buildings(nb)%m_h(n_fa(nb)) = m |
---|
| 995 | n_fa(nb) = n_fa(nb) + 1 |
---|
| 996 | ENDIF |
---|
| 997 | ENDDO |
---|
[4246] | 998 | ENDDO |
---|
| 999 | |
---|
| 1000 | n_fa = 1 |
---|
| 1001 | DO l = 0, 3 |
---|
| 1002 | DO m = 1, surf_usm_v(l)%ns |
---|
| 1003 | i = surf_usm_v(l)%i(m) + surf_usm_v(l)%ioff |
---|
| 1004 | j = surf_usm_v(l)%j(m) + surf_usm_v(l)%joff |
---|
| 1005 | |
---|
[4646] | 1006 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 1007 | |
---|
| 1008 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 1009 | buildings(nb)%l_v(n_fa(nb)) = l |
---|
| 1010 | buildings(nb)%m_v(n_fa(nb)) = m |
---|
[4646] | 1011 | n_fa(nb) = n_fa(nb) + 1 |
---|
[4246] | 1012 | ENDIF |
---|
| 1013 | ENDDO |
---|
| 1014 | ENDDO |
---|
| 1015 | DEALLOCATE( n_fa ) |
---|
| 1016 | ! |
---|
[4646] | 1017 | !-- Initialize building parameters, first by mean building type. Note, in this case all buildings |
---|
| 1018 | !-- have the same type. |
---|
| 1019 | !-- In a second step initialize with building tpyes from static input file, where building types can |
---|
| 1020 | !-- be individual for each building. |
---|
[4267] | 1021 | buildings(:)%lambda_layer3 = building_pars(31,building_type) |
---|
| 1022 | buildings(:)%s_layer3 = building_pars(44,building_type) |
---|
[4246] | 1023 | buildings(:)%f_c_win = building_pars(119,building_type) |
---|
[4646] | 1024 | buildings(:)%g_value_win = building_pars(120,building_type) |
---|
| 1025 | buildings(:)%u_value_win = building_pars(121,building_type) |
---|
| 1026 | buildings(:)%eta_ve = building_pars(124,building_type) |
---|
| 1027 | buildings(:)%factor_a = building_pars(125,building_type) |
---|
[4246] | 1028 | buildings(:)%factor_c = building_pars(126,building_type) |
---|
[4646] | 1029 | buildings(:)%lambda_at = building_pars(127,building_type) |
---|
| 1030 | buildings(:)%theta_int_h_set = building_pars(13,building_type) |
---|
[4267] | 1031 | buildings(:)%theta_int_c_set = building_pars(12,building_type) |
---|
[4646] | 1032 | buildings(:)%q_h_max = building_pars(128,building_type) |
---|
| 1033 | buildings(:)%q_c_max = building_pars(129,building_type) |
---|
[4246] | 1034 | buildings(:)%qint_high = building_pars(130,building_type) |
---|
| 1035 | buildings(:)%qint_low = building_pars(131,building_type) |
---|
| 1036 | buildings(:)%height_storey = building_pars(132,building_type) |
---|
| 1037 | buildings(:)%height_cei_con = building_pars(133,building_type) |
---|
| 1038 | buildings(:)%params_waste_heat_h = building_pars(134,building_type) |
---|
| 1039 | buildings(:)%params_waste_heat_c = building_pars(135,building_type) |
---|
| 1040 | ! |
---|
[4267] | 1041 | !-- Initialize seasonal dependent parameters, depending on day of the year. |
---|
[4646] | 1042 | !-- First, calculated day of the year. |
---|
[4267] | 1043 | CALL get_date_time( time_since_reference_point, day_of_year = day_of_year ) |
---|
| 1044 | ! |
---|
[4646] | 1045 | !-- Summer is defined in between northward- and southward equinox. |
---|
| 1046 | IF ( day_of_year >= northward_equinox .AND. day_of_year <= southward_equinox ) THEN |
---|
| 1047 | buildings(:)%air_change_low = summer_pars(0,building_type) |
---|
[4267] | 1048 | buildings(:)%air_change_high = summer_pars(1,building_type) |
---|
| 1049 | ELSE |
---|
[4646] | 1050 | buildings(:)%air_change_low = winter_pars(0,building_type) |
---|
[4267] | 1051 | buildings(:)%air_change_high = winter_pars(1,building_type) |
---|
| 1052 | ENDIF |
---|
| 1053 | ! |
---|
[4646] | 1054 | !-- Initialize ventilation load. Please note, building types > 7 are actually not allowed (check |
---|
| 1055 | !-- already in urban_surface_mod and netcdf_data_input_mod. |
---|
| 1056 | !-- However, the building data base may be later extended. |
---|
| 1057 | IF ( building_type == 1 .OR. building_type == 2 .OR. & |
---|
| 1058 | building_type == 3 .OR. building_type == 10 .OR. & |
---|
[4246] | 1059 | building_type == 11 .OR. building_type == 12 ) THEN |
---|
| 1060 | buildings(:)%ventilation_int_loads = 1 |
---|
| 1061 | ! |
---|
| 1062 | !-- Office, building with large windows |
---|
[4646] | 1063 | ELSEIF ( building_type == 4 .OR. building_type == 5 .OR. & |
---|
| 1064 | building_type == 6 .OR. building_type == 7 .OR. & |
---|
[4246] | 1065 | building_type == 8 .OR. building_type == 9) THEN |
---|
| 1066 | buildings(:)%ventilation_int_loads = 2 |
---|
| 1067 | ! |
---|
| 1068 | !-- Industry, hospitals |
---|
[4646] | 1069 | ELSEIF ( building_type == 13 .OR. building_type == 14 .OR. & |
---|
| 1070 | building_type == 15 .OR. building_type == 16 .OR. & |
---|
[4246] | 1071 | building_type == 17 .OR. building_type == 18 ) THEN |
---|
| 1072 | buildings(:)%ventilation_int_loads = 3 |
---|
| 1073 | ENDIF |
---|
| 1074 | ! |
---|
| 1075 | !-- Initialization of building parameters - level 2 |
---|
| 1076 | IF ( building_type_f%from_file ) THEN |
---|
| 1077 | DO i = nxl, nxr |
---|
| 1078 | DO j = nys, nyn |
---|
| 1079 | IF ( building_id_f%var(j,i) /= building_id_f%fill ) THEN |
---|
[4646] | 1080 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 1081 | bt = building_type_f%var(j,i) |
---|
[4646] | 1082 | |
---|
[4267] | 1083 | buildings(nb)%lambda_layer3 = building_pars(31,bt) |
---|
| 1084 | buildings(nb)%s_layer3 = building_pars(44,bt) |
---|
[4246] | 1085 | buildings(nb)%f_c_win = building_pars(119,bt) |
---|
[4646] | 1086 | buildings(nb)%g_value_win = building_pars(120,bt) |
---|
| 1087 | buildings(nb)%u_value_win = building_pars(121,bt) |
---|
| 1088 | buildings(nb)%eta_ve = building_pars(124,bt) |
---|
| 1089 | buildings(nb)%factor_a = building_pars(125,bt) |
---|
[4246] | 1090 | buildings(nb)%factor_c = building_pars(126,bt) |
---|
[4646] | 1091 | buildings(nb)%lambda_at = building_pars(127,bt) |
---|
| 1092 | buildings(nb)%theta_int_h_set = building_pars(13,bt) |
---|
[4267] | 1093 | buildings(nb)%theta_int_c_set = building_pars(12,bt) |
---|
[4646] | 1094 | buildings(nb)%q_h_max = building_pars(128,bt) |
---|
| 1095 | buildings(nb)%q_c_max = building_pars(129,bt) |
---|
[4246] | 1096 | buildings(nb)%qint_high = building_pars(130,bt) |
---|
| 1097 | buildings(nb)%qint_low = building_pars(131,bt) |
---|
| 1098 | buildings(nb)%height_storey = building_pars(132,bt) |
---|
[4646] | 1099 | buildings(nb)%height_cei_con = building_pars(133,bt) |
---|
[4246] | 1100 | buildings(nb)%params_waste_heat_h = building_pars(134,bt) |
---|
| 1101 | buildings(nb)%params_waste_heat_c = building_pars(135,bt) |
---|
[4267] | 1102 | |
---|
[4646] | 1103 | IF ( day_of_year >= northward_equinox .AND. day_of_year <= southward_equinox ) THEN |
---|
| 1104 | buildings(nb)%air_change_low = summer_pars(0,bt) |
---|
[4267] | 1105 | buildings(nb)%air_change_high = summer_pars(1,bt) |
---|
| 1106 | ELSE |
---|
[4646] | 1107 | buildings(nb)%air_change_low = winter_pars(0,bt) |
---|
[4267] | 1108 | buildings(nb)%air_change_high = winter_pars(1,bt) |
---|
| 1109 | ENDIF |
---|
| 1110 | |
---|
[4246] | 1111 | ! |
---|
[4646] | 1112 | !-- Initialize ventilaation load. Please note, building types > 7 |
---|
| 1113 | !-- are actually not allowed (check already in urban_surface_mod |
---|
| 1114 | !-- and netcdf_data_input_mod. However, the building data base may |
---|
| 1115 | !-- be later extended. |
---|
| 1116 | IF ( bt == 1 .OR. bt == 2 .OR. & |
---|
| 1117 | bt == 3 .OR. bt == 10 .OR. & |
---|
[4246] | 1118 | bt == 11 .OR. bt == 12 ) THEN |
---|
| 1119 | buildings(nb)%ventilation_int_loads = 1 |
---|
[4646] | 1120 | ! |
---|
[4246] | 1121 | !-- Office, building with large windows |
---|
[4646] | 1122 | ELSEIF ( bt == 4 .OR. bt == 5 .OR. & |
---|
| 1123 | bt == 6 .OR. bt == 7 .OR. & |
---|
[4246] | 1124 | bt == 8 .OR. bt == 9) THEN |
---|
| 1125 | buildings(nb)%ventilation_int_loads = 2 |
---|
| 1126 | ! |
---|
| 1127 | !-- Industry, hospitals |
---|
[4646] | 1128 | ELSEIF ( bt == 13 .OR. bt == 14 .OR. & |
---|
| 1129 | bt == 15 .OR. bt == 16 .OR. & |
---|
[4246] | 1130 | bt == 17 .OR. bt == 18 ) THEN |
---|
| 1131 | buildings(nb)%ventilation_int_loads = 3 |
---|
| 1132 | ENDIF |
---|
| 1133 | ENDIF |
---|
| 1134 | ENDDO |
---|
| 1135 | ENDDO |
---|
| 1136 | ENDIF |
---|
| 1137 | ! |
---|
[4646] | 1138 | !-- Calculation of surface-related heat transfer coeffiecient out of standard u-values from building |
---|
| 1139 | !-- database. |
---|
| 1140 | !-- Only amount of extern and surface is used. |
---|
| 1141 | !-- Otherwise amount between air and surface taken account twice. |
---|
[4246] | 1142 | DO nb = 1, num_build |
---|
[4646] | 1143 | IF ( buildings(nb)%on_pe ) THEN |
---|
[4246] | 1144 | du_win_tmp = 1.0_wp / buildings(nb)%u_value_win |
---|
[4646] | 1145 | u_tmp = buildings(nb)%u_value_win * ( du_win_tmp / ( du_win_tmp - & |
---|
[4246] | 1146 | 0.125_wp + ( 1.0_wp / h_is ) ) ) |
---|
[4646] | 1147 | |
---|
[4246] | 1148 | du_tmp = 1.0_wp / u_tmp |
---|
[4646] | 1149 | |
---|
[4267] | 1150 | buildings(nb)%h_es = 1.0_wp / ( du_tmp - ( 1.0_wp / h_is ) ) |
---|
| 1151 | |
---|
[4246] | 1152 | ENDIF |
---|
| 1153 | ENDDO |
---|
| 1154 | ! |
---|
| 1155 | !-- Initialize indoor temperature. Actually only for output at initial state. |
---|
| 1156 | DO nb = 1, num_build |
---|
[4687] | 1157 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 1158 | buildings(nb)%t_in(:) = initial_indoor_temperature |
---|
| 1159 | |
---|
| 1160 | ! |
---|
| 1161 | !-- (after first loop, use theta_m_t as theta_m_t_prev) |
---|
| 1162 | buildings(nb)%theta_m_t_prev_h(:) = initial_indoor_temperature |
---|
| 1163 | buildings(nb)%theta_m_t_prev_v(:) = initial_indoor_temperature |
---|
| 1164 | |
---|
| 1165 | ENDIF |
---|
[4246] | 1166 | ENDDO |
---|
| 1167 | |
---|
| 1168 | CALL location_message( 'initializing indoor model', 'finished' ) |
---|
| 1169 | |
---|
| 1170 | END SUBROUTINE im_init |
---|
| 1171 | |
---|
| 1172 | |
---|
[4646] | 1173 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1174 | ! Description: |
---|
| 1175 | ! ------------ |
---|
| 1176 | !> Main part of the indoor model. |
---|
| 1177 | !> Calculation of .... (kanani: Please describe) |
---|
[4646] | 1178 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1179 | SUBROUTINE im_main_heatcool |
---|
| 1180 | |
---|
| 1181 | ! USE basic_constants_and_equations_mod, & |
---|
| 1182 | ! ONLY: c_p |
---|
| 1183 | |
---|
[4646] | 1184 | USE control_parameters, & |
---|
[4246] | 1185 | ONLY: time_since_reference_point |
---|
| 1186 | |
---|
[4646] | 1187 | USE grid_variables, & |
---|
[4246] | 1188 | ONLY: dx, dy |
---|
| 1189 | |
---|
| 1190 | USE pegrid |
---|
[4646] | 1191 | |
---|
| 1192 | USE surface_mod, & |
---|
[4246] | 1193 | ONLY: ind_veg_wall, ind_wat_win, surf_usm_h, surf_usm_v |
---|
| 1194 | |
---|
[4646] | 1195 | USE urban_surface_mod, & |
---|
| 1196 | ONLY: building_type, nzt_wall, t_wall_h, t_wall_v, t_window_h, t_window_v |
---|
[4246] | 1197 | |
---|
[4646] | 1198 | |
---|
| 1199 | INTEGER(iwp) :: fa !< running index for facade elements of each building |
---|
[4246] | 1200 | INTEGER(iwp) :: i !< index of facade-adjacent atmosphere grid point in x-direction |
---|
| 1201 | INTEGER(iwp) :: j !< index of facade-adjacent atmosphere grid point in y-direction |
---|
| 1202 | INTEGER(iwp) :: k !< index of facade-adjacent atmosphere grid point in z-direction |
---|
| 1203 | INTEGER(iwp) :: kk !< vertical index of indoor grid point adjacent to facade |
---|
| 1204 | INTEGER(iwp) :: l !< running index for surface-element orientation |
---|
| 1205 | INTEGER(iwp) :: m !< running index surface elements |
---|
| 1206 | INTEGER(iwp) :: nb !< running index for buildings |
---|
| 1207 | |
---|
| 1208 | REAL(wp) :: indoor_wall_window_temperature !< weighted temperature of innermost wall/window layer |
---|
[4701] | 1209 | |
---|
| 1210 | REAL(wp) :: indoor_wall_temperature !< temperature of innermost wall layer evtl in im_calc_temperatures einfÃŒgen |
---|
| 1211 | |
---|
[4246] | 1212 | REAL(wp) :: near_facade_temperature !< outside air temperature 10cm away from facade |
---|
| 1213 | REAL(wp) :: second_of_day !< second of the current day |
---|
| 1214 | REAL(wp) :: time_utc_hour !< time of day (hour UTC) |
---|
| 1215 | |
---|
| 1216 | REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in_l_send !< dummy send buffer used for summing-up indoor temperature per kk-level |
---|
| 1217 | REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in_recv !< dummy recv buffer used for summing-up indoor temperature per kk-level |
---|
| 1218 | ! |
---|
[4646] | 1219 | !-- Determine time of day in hours. |
---|
[4246] | 1220 | CALL get_date_time( time_since_reference_point, second_of_day=second_of_day ) |
---|
| 1221 | time_utc_hour = second_of_day / seconds_per_hour |
---|
| 1222 | ! |
---|
| 1223 | !-- Following calculations must be done for each facade element. |
---|
| 1224 | DO nb = 1, num_build |
---|
| 1225 | ! |
---|
[4646] | 1226 | !-- First, check whether building is present on local subdomain. |
---|
[4246] | 1227 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 1228 | ! |
---|
| 1229 | !-- Determine daily schedule. 08:00-18:00 = 1, other hours = 0. |
---|
[4646] | 1230 | !-- Residental Building, panel WBS 70 |
---|
[4246] | 1231 | IF ( buildings(nb)%ventilation_int_loads == 1 ) THEN |
---|
[4267] | 1232 | IF ( time_utc_hour >= 8.0_wp .AND. time_utc_hour <= 18.0_wp ) THEN |
---|
| 1233 | schedule_d = 0 |
---|
| 1234 | ELSE |
---|
[4246] | 1235 | schedule_d = 1 |
---|
| 1236 | ENDIF |
---|
| 1237 | ENDIF |
---|
| 1238 | ! |
---|
| 1239 | !-- Office, building with large windows |
---|
| 1240 | IF ( buildings(nb)%ventilation_int_loads == 2 ) THEN |
---|
| 1241 | IF ( time_utc_hour >= 8.0_wp .AND. time_utc_hour <= 18.0_wp ) THEN |
---|
| 1242 | schedule_d = 1 |
---|
| 1243 | ELSE |
---|
| 1244 | schedule_d = 0 |
---|
| 1245 | ENDIF |
---|
| 1246 | ENDIF |
---|
[4646] | 1247 | ! |
---|
[4246] | 1248 | !-- Industry, hospitals |
---|
| 1249 | IF ( buildings(nb)%ventilation_int_loads == 3 ) THEN |
---|
| 1250 | IF ( time_utc_hour >= 6.0_wp .AND. time_utc_hour <= 22.0_wp ) THEN |
---|
| 1251 | schedule_d = 1 |
---|
| 1252 | ELSE |
---|
| 1253 | schedule_d = 0 |
---|
| 1254 | ENDIF |
---|
| 1255 | ENDIF |
---|
| 1256 | ! |
---|
| 1257 | !-- Initialize/reset indoor temperature |
---|
[4646] | 1258 | buildings(nb)%t_in_l = 0.0_wp |
---|
[4246] | 1259 | ! |
---|
| 1260 | !-- Horizontal surfaces |
---|
| 1261 | DO fa = 1, buildings(nb)%num_facades_per_building_h_l |
---|
| 1262 | ! |
---|
[4671] | 1263 | !-- Determine indices where corresponding surface-type information is stored. |
---|
[4681] | 1264 | l = buildings(nb)%l_h(fa) |
---|
| 1265 | m = buildings(nb)%m_h(fa) |
---|
[4246] | 1266 | ! |
---|
[4646] | 1267 | !-- Determine building height level index. |
---|
[4671] | 1268 | kk = surf_usm_h(l)%k(m) + surf_usm_h(l)%koff |
---|
[4402] | 1269 | ! |
---|
[4246] | 1270 | !-- Building geometries --> not time-dependent |
---|
[4646] | 1271 | facade_element_area = dx * dy !< [m2] surface area per facade element |
---|
[4402] | 1272 | floor_area_per_facade = buildings(nb)%fapf !< [m2/m2] floor area per facade area |
---|
[4646] | 1273 | indoor_volume_per_facade = buildings(nb)%vpf(kk) !< [m3/m2] indoor air volume per facade area |
---|
| 1274 | buildings(nb)%area_facade = facade_element_area * & |
---|
| 1275 | ( buildings(nb)%num_facades_per_building_h + & |
---|
| 1276 | buildings(nb)%num_facades_per_building_v ) !< [m2] area of total facade |
---|
[4681] | 1277 | window_area_per_facade = surf_usm_h(l)%frac(m,ind_wat_win) * facade_element_area !< [m2] window area per facade |
---|
[4646] | 1278 | !< element |
---|
[4246] | 1279 | |
---|
| 1280 | buildings(nb)%net_floor_area = buildings(nb)%vol_tot / ( buildings(nb)%height_storey ) |
---|
[4646] | 1281 | total_area = buildings(nb)%net_floor_area !< [m2] area of all surfaces |
---|
| 1282 | !< pointing to zone Eq. (9) according to section 7.2.2.2 |
---|
| 1283 | a_m = buildings(nb)%factor_a * total_area * & |
---|
| 1284 | ( facade_element_area / buildings(nb)%area_facade ) * & |
---|
| 1285 | buildings(nb)%lambda_at !< [m2] standard values |
---|
| 1286 | !< according to Table 12 section 12.3.1.2 (calculate over Eq. (65) according to section 12.3.1.2) |
---|
| 1287 | c_m = buildings(nb)%factor_c * total_area * & |
---|
| 1288 | ( facade_element_area / buildings(nb)%area_facade ) !< [J/K] standard values |
---|
| 1289 | !< according to table 12 section 12.3.1.2 (calculate over Eq. (66) according to section 12.3.1.2) |
---|
[4246] | 1290 | ! |
---|
| 1291 | !-- Calculation of heat transfer coefficient for transmission --> not time-dependent |
---|
| 1292 | h_t_es = window_area_per_facade * buildings(nb)%h_es !< [W/K] only for windows |
---|
| 1293 | |
---|
[4646] | 1294 | h_t_is = buildings(nb)%area_facade * h_is !< [W/K] with h_is = 3.45 W / |
---|
| 1295 | !< (m2 K) between surface and air, Eq. (9) |
---|
| 1296 | h_t_ms = a_m * h_ms !< [W/K] with h_ms = 9.10 W / |
---|
| 1297 | !< (m2 K) between component and surface, Eq. (64) |
---|
| 1298 | h_t_wall = 1.0_wp / ( 1.0_wp / ( ( facade_element_area - window_area_per_facade ) & !< [W/K] |
---|
[4246] | 1299 | * buildings(nb)%lambda_layer3 / buildings(nb)%s_layer3 * 0.5_wp & |
---|
| 1300 | ) + 1.0_wp / h_t_ms ) !< [W/K] opaque components |
---|
[4646] | 1301 | h_t_wm = 1.0_wp / ( 1.0_wp / h_t_wall - 1.0_wp / h_t_ms ) !< [W/K] emmision Eq. (63), |
---|
| 1302 | !< Section 12.2.2 |
---|
[4246] | 1303 | ! |
---|
[4646] | 1304 | !-- Internal air loads dependent on the occupacy of the room. |
---|
| 1305 | !-- Basical internal heat gains (qint_low) with additional internal heat gains by occupancy (qint_high) (0,5*phi_int). |
---|
| 1306 | phi_ia = 0.5_wp * ( ( buildings(nb)%qint_high * schedule_d + buildings(nb)%qint_low ) & |
---|
| 1307 | * floor_area_per_facade ) |
---|
[4246] | 1308 | q_int = phi_ia / total_area |
---|
| 1309 | ! |
---|
[4646] | 1310 | !-- Airflow dependent on the occupacy of the room. |
---|
| 1311 | !-- Basical airflow (air_change_low) with additional airflow gains by occupancy (air_change_high) |
---|
| 1312 | air_change = ( buildings(nb)%air_change_high * schedule_d + buildings(nb)%air_change_low ) !< [1/h]? |
---|
[4246] | 1313 | ! |
---|
[4646] | 1314 | !-- Heat transfer of ventilation. |
---|
| 1315 | !-- Not less than 0.01 W/K to avoid division by 0 in further calculations with heat |
---|
| 1316 | !-- capacity of air 0.33 Wh/m2K. |
---|
| 1317 | h_v = MAX( 0.01_wp , ( air_change * indoor_volume_per_facade * & |
---|
| 1318 | 0.33_wp * (1.0_wp - buildings(nb)%eta_ve ) ) ) !< [W/K] from ISO 13789 Eq.(10) |
---|
[4246] | 1319 | |
---|
| 1320 | !-- Heat transfer coefficient auxiliary variables |
---|
| 1321 | h_t_1 = 1.0_wp / ( ( 1.0_wp / h_v ) + ( 1.0_wp / h_t_is ) ) !< [W/K] Eq. (C.6) |
---|
| 1322 | h_t_2 = h_t_1 + h_t_es !< [W/K] Eq. (C.7) |
---|
| 1323 | h_t_3 = 1.0_wp / ( ( 1.0_wp / h_t_2 ) + ( 1.0_wp / h_t_ms ) ) !< [W/K] Eq. (C.8) |
---|
| 1324 | ! |
---|
| 1325 | !-- Net short-wave radiation through window area (was i_global) |
---|
[4671] | 1326 | net_sw_in = surf_usm_h(l)%rad_sw_in(m) - surf_usm_h(l)%rad_sw_out(m) |
---|
[4246] | 1327 | ! |
---|
| 1328 | !-- Quantities needed for im_calc_temperatures |
---|
[4671] | 1329 | i = surf_usm_h(l)%i(m) |
---|
| 1330 | j = surf_usm_h(l)%j(m) |
---|
| 1331 | k = surf_usm_h(l)%k(m) |
---|
| 1332 | near_facade_temperature = surf_usm_h(l)%pt_10cm(m) |
---|
| 1333 | indoor_wall_window_temperature = & |
---|
| 1334 | surf_usm_h(l)%frac(m,ind_veg_wall) * t_wall_h(l)%val(nzt_wall,m) & |
---|
| 1335 | + surf_usm_h(l)%frac(m,ind_wat_win) * t_window_h(l)%val(nzt_wall,m) |
---|
[4701] | 1336 | indoor_wall_temperature = surf_usm_h(l)%frac(m,ind_veg_wall) * t_wall_h(l)%val(nzt_wall,m) |
---|
[4246] | 1337 | ! |
---|
[4646] | 1338 | !-- Solar thermal gains. If net_sw_in larger than sun-protection threshold parameter |
---|
| 1339 | !-- (params_solar_protection), sun protection will be activated. |
---|
| 1340 | IF ( net_sw_in <= params_solar_protection ) THEN |
---|
[4246] | 1341 | solar_protection_off = 1 |
---|
| 1342 | solar_protection_on = 0 |
---|
[4646] | 1343 | ELSE |
---|
[4246] | 1344 | solar_protection_off = 0 |
---|
| 1345 | solar_protection_on = 1 |
---|
| 1346 | ENDIF |
---|
| 1347 | ! |
---|
[4646] | 1348 | !-- Calculation of total heat gains from net_sw_in through windows [W] in respect on |
---|
| 1349 | !-- automatic sun protection. |
---|
[4246] | 1350 | !-- DIN 4108 - 2 chap.8 |
---|
[4646] | 1351 | phi_sol = ( window_area_per_facade * net_sw_in * solar_protection_off & |
---|
| 1352 | + window_area_per_facade * net_sw_in * buildings(nb)%f_c_win * & |
---|
| 1353 | solar_protection_on ) & |
---|
[4246] | 1354 | * buildings(nb)%g_value_win * ( 1.0_wp - params_f_f ) * params_f_w |
---|
[4646] | 1355 | q_sol = phi_sol |
---|
[4246] | 1356 | ! |
---|
[4646] | 1357 | !-- Calculation of the mass specific thermal load for internal and external heatsources of |
---|
| 1358 | !-- the inner node. |
---|
| 1359 | phi_m = (a_m / total_area) * ( phi_ia + phi_sol ) !< [W] Eq. (C.2) with |
---|
| 1360 | !< phi_ia=0,5*phi_int |
---|
[4246] | 1361 | q_c_m = phi_m |
---|
| 1362 | ! |
---|
[4646] | 1363 | !-- Calculation mass specific thermal load implied non thermal mass |
---|
| 1364 | phi_st = ( 1.0_wp - ( a_m / total_area ) - ( h_t_es / ( 9.1_wp * total_area ) ) ) & |
---|
| 1365 | * ( phi_ia + phi_sol ) !< [W] Eq. (C.3) with |
---|
| 1366 | !< phi_ia=0,5*phi_int |
---|
| 1367 | q_c_st = phi_st |
---|
[4246] | 1368 | ! |
---|
| 1369 | !-- Calculations for deriving indoor temperature and heat flux into the wall |
---|
[4646] | 1370 | !-- Step 1: indoor temperature without heating and cooling |
---|
[4246] | 1371 | !-- section C.4.1 Picture C.2 zone 3) |
---|
| 1372 | phi_hc_nd = 0.0_wp |
---|
[4646] | 1373 | |
---|
[4702] | 1374 | CALL im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 1375 | near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) ) |
---|
[4246] | 1376 | ! |
---|
[4646] | 1377 | !-- If air temperature between border temperatures of heating and cooling, assign output |
---|
| 1378 | !-- variable, then ready. |
---|
| 1379 | IF ( buildings(nb)%theta_int_h_set <= theta_air .AND. & |
---|
| 1380 | theta_air <= buildings(nb)%theta_int_c_set ) THEN |
---|
[4246] | 1381 | phi_hc_nd_ac = 0.0_wp |
---|
[4646] | 1382 | phi_hc_nd = phi_hc_nd_ac |
---|
[4246] | 1383 | theta_air_ac = theta_air |
---|
| 1384 | ! |
---|
| 1385 | !-- Step 2: Else, apply 10 W/m2 heating/cooling power and calculate indoor temperature |
---|
| 1386 | !-- again. |
---|
| 1387 | ELSE |
---|
| 1388 | ! |
---|
| 1389 | !-- Temperature not correct, calculation method according to section C4.2 |
---|
[4646] | 1390 | theta_air_0 = theta_air !< temperature without heating/cooling |
---|
[4246] | 1391 | ! |
---|
| 1392 | !-- Heating or cooling? |
---|
| 1393 | IF ( theta_air_0 > buildings(nb)%theta_int_c_set ) THEN |
---|
| 1394 | theta_air_set = buildings(nb)%theta_int_c_set |
---|
[4646] | 1395 | ELSE |
---|
| 1396 | theta_air_set = buildings(nb)%theta_int_h_set |
---|
[4246] | 1397 | ENDIF |
---|
| 1398 | ! |
---|
[4646] | 1399 | !-- Calculate the temperature with phi_hc_nd_10 |
---|
[4246] | 1400 | phi_hc_nd_10 = 10.0_wp * floor_area_per_facade |
---|
| 1401 | phi_hc_nd = phi_hc_nd_10 |
---|
[4646] | 1402 | |
---|
[4702] | 1403 | CALL im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 1404 | near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) ) |
---|
[4246] | 1405 | theta_air_10 = theta_air !< temperature with 10 W/m2 of heating |
---|
[4646] | 1406 | phi_hc_nd_un = phi_hc_nd_10 * (theta_air_set - theta_air_0) & |
---|
[4246] | 1407 | / (theta_air_10 - theta_air_0) !< Eq. (C.13) |
---|
| 1408 | ! |
---|
[4646] | 1409 | !-- Step 3: with temperature ratio to determine the heating or cooling capacity. |
---|
| 1410 | !-- If necessary, limit the power to maximum power. |
---|
[4246] | 1411 | !-- section C.4.1 Picture C.2 zone 2) and 4) |
---|
[4646] | 1412 | buildings(nb)%phi_c_max = buildings(nb)%q_c_max * floor_area_per_facade |
---|
[4246] | 1413 | buildings(nb)%phi_h_max = buildings(nb)%q_h_max * floor_area_per_facade |
---|
[4646] | 1414 | IF ( buildings(nb)%phi_c_max < phi_hc_nd_un .AND. & |
---|
| 1415 | phi_hc_nd_un < buildings(nb)%phi_h_max ) THEN |
---|
[4246] | 1416 | phi_hc_nd_ac = phi_hc_nd_un |
---|
[4646] | 1417 | phi_hc_nd = phi_hc_nd_un |
---|
[4246] | 1418 | ELSE |
---|
| 1419 | ! |
---|
[4646] | 1420 | !-- Step 4: inner temperature with maximum heating (phi_hc_nd_un positive) or cooling |
---|
| 1421 | !-- (phi_hc_nd_un negative) |
---|
[4246] | 1422 | !-- section C.4.1 Picture C.2 zone 1) and 5) |
---|
| 1423 | IF ( phi_hc_nd_un > 0.0_wp ) THEN |
---|
| 1424 | phi_hc_nd_ac = buildings(nb)%phi_h_max !< Limit heating |
---|
[4646] | 1425 | ELSE |
---|
[4246] | 1426 | phi_hc_nd_ac = buildings(nb)%phi_c_max !< Limit cooling |
---|
| 1427 | ENDIF |
---|
| 1428 | ENDIF |
---|
[4646] | 1429 | phi_hc_nd = phi_hc_nd_ac |
---|
[4246] | 1430 | ! |
---|
| 1431 | !-- Calculate the temperature with phi_hc_nd_ac (new) |
---|
[4702] | 1432 | CALL im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 1433 | near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_h(fa) ) |
---|
[4246] | 1434 | theta_air_ac = theta_air |
---|
| 1435 | ENDIF |
---|
| 1436 | ! |
---|
| 1437 | !-- Update theta_m_t_prev |
---|
[4687] | 1438 | buildings(nb)%theta_m_t_prev_h(fa) = theta_m_t |
---|
[4646] | 1439 | |
---|
[4687] | 1440 | |
---|
[4246] | 1441 | q_vent = h_v * ( theta_air - near_facade_temperature ) |
---|
| 1442 | ! |
---|
[4646] | 1443 | !-- Calculate the operating temperature with weighted mean temperature of air and mean |
---|
| 1444 | !-- solar temperature. |
---|
| 1445 | !-- Will be used for thermal comfort calculations. |
---|
[4246] | 1446 | theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s !< [degree_C] operative Temperature Eq. (C.12) |
---|
[4687] | 1447 | |
---|
[4671] | 1448 | ! surf_usm_h(l)%t_indoor(m) = theta_op !< not integrated now |
---|
[4246] | 1449 | ! |
---|
[4646] | 1450 | !-- Heat flux into the wall. Value needed in urban_surface_mod to |
---|
[4246] | 1451 | !-- calculate heat transfer through wall layers towards the facade |
---|
| 1452 | !-- (use c_p * rho_surface to convert [W/m2] into [K m/s]) |
---|
[4704] | 1453 | IF ( (facade_element_area - window_area_per_facade) > 0.0_wp ) THEN |
---|
| 1454 | q_wall = h_t_wm * ( indoor_wall_temperature - theta_m ) & |
---|
[4646] | 1455 | / ( facade_element_area - window_area_per_facade ) |
---|
[4704] | 1456 | ELSE |
---|
| 1457 | q_wall = 0.0_wp |
---|
| 1458 | ENDIF |
---|
| 1459 | |
---|
| 1460 | IF ( window_area_per_facade > 0.0_wp ) THEN |
---|
| 1461 | q_win = h_t_es * ( pt(k,j,i) - theta_s ) / ( window_area_per_facade ) |
---|
| 1462 | ELSE |
---|
| 1463 | q_win = 0.0_wp |
---|
| 1464 | ENDIF |
---|
[4246] | 1465 | ! |
---|
[4701] | 1466 | !-- Transfer q_wall & q_win back to USM (innermost wall/window layer) |
---|
| 1467 | surf_usm_h(l)%iwghf_eb(m) = - q_wall |
---|
| 1468 | surf_usm_h(l)%iwghf_eb_window(m) = - q_win |
---|
[4246] | 1469 | ! |
---|
[4646] | 1470 | !-- Sum up operational indoor temperature per kk-level. Further below, this temperature is |
---|
| 1471 | !-- reduced by MPI to one temperature per kk-level and building (processor overlapping). |
---|
[4246] | 1472 | buildings(nb)%t_in_l(kk) = buildings(nb)%t_in_l(kk) + theta_op |
---|
| 1473 | ! |
---|
[4646] | 1474 | !-- Calculation of waste heat. |
---|
| 1475 | !-- Anthropogenic heat output. |
---|
| 1476 | IF ( phi_hc_nd_ac > 0.0_wp ) THEN |
---|
[4246] | 1477 | heating_on = 1 |
---|
| 1478 | cooling_on = 0 |
---|
[4646] | 1479 | ELSE |
---|
[4246] | 1480 | heating_on = 0 |
---|
| 1481 | cooling_on = -1 |
---|
| 1482 | ENDIF |
---|
| 1483 | |
---|
[4646] | 1484 | q_waste_heat = ( phi_hc_nd * ( & |
---|
| 1485 | buildings(nb)%params_waste_heat_h * heating_on + & |
---|
| 1486 | buildings(nb)%params_waste_heat_c * cooling_on ) & |
---|
| 1487 | ) / facade_element_area !< [W/m2] , observe the directional |
---|
| 1488 | !< convention in PALM! |
---|
[4687] | 1489 | surf_usm_h(l)%waste_heat(m) = 0.0_wp !q_waste_heat |
---|
[4246] | 1490 | ENDDO !< Horizontal surfaces loop |
---|
| 1491 | ! |
---|
| 1492 | !-- Vertical surfaces |
---|
| 1493 | DO fa = 1, buildings(nb)%num_facades_per_building_v_l |
---|
| 1494 | ! |
---|
[4646] | 1495 | !-- Determine indices where corresponding surface-type information is stored. |
---|
[4246] | 1496 | l = buildings(nb)%l_v(fa) |
---|
| 1497 | m = buildings(nb)%m_v(fa) |
---|
| 1498 | ! |
---|
[4646] | 1499 | !-- Determine building height level index. |
---|
[4246] | 1500 | kk = surf_usm_v(l)%k(m) + surf_usm_v(l)%koff |
---|
| 1501 | ! |
---|
[4646] | 1502 | !-- (SOME OF THE FOLLOWING (not time-dependent) COULD PROBABLY GO INTO A FUNCTION |
---|
[4246] | 1503 | !-- EXCEPT facade_element_area, EVERYTHING IS CALCULATED EQUALLY) |
---|
| 1504 | !-- Building geometries --> not time-dependent |
---|
[4402] | 1505 | IF ( l == 0 .OR. l == 1 ) facade_element_area = dx * dzw(kk+1) !< [m2] surface area per facade element |
---|
| 1506 | IF ( l == 2 .OR. l == 3 ) facade_element_area = dy * dzw(kk+1) !< [m2] surface area per facade element |
---|
| 1507 | |
---|
| 1508 | floor_area_per_facade = buildings(nb)%fapf !< [m2/m2] floor area per facade area |
---|
[4646] | 1509 | indoor_volume_per_facade = buildings(nb)%vpf(kk) !< [m3/m2] indoor air volume per facade area |
---|
| 1510 | buildings(nb)%area_facade = facade_element_area * & |
---|
| 1511 | ( buildings(nb)%num_facades_per_building_h + & |
---|
| 1512 | buildings(nb)%num_facades_per_building_v ) !< [m2] area of total facade |
---|
| 1513 | window_area_per_facade = surf_usm_v(l)%frac(m,ind_wat_win) * facade_element_area !< [m2] window area per |
---|
| 1514 | !< facade element |
---|
[4246] | 1515 | |
---|
| 1516 | buildings(nb)%net_floor_area = buildings(nb)%vol_tot / ( buildings(nb)%height_storey ) |
---|
[4646] | 1517 | total_area = buildings(nb)%net_floor_area !< [m2] area of all surfaces |
---|
| 1518 | !< pointing to zone Eq. (9) according to section 7.2.2.2 |
---|
| 1519 | a_m = buildings(nb)%factor_a * total_area * & |
---|
| 1520 | ( facade_element_area / buildings(nb)%area_facade ) * & |
---|
| 1521 | buildings(nb)%lambda_at !< [m2] standard values |
---|
| 1522 | !< according to Table 12 section 12.3.1.2 (calculate over Eq. (65) according to section 12.3.1.2) |
---|
[4246] | 1523 | c_m = buildings(nb)%factor_c * total_area * & |
---|
[4646] | 1524 | ( facade_element_area / buildings(nb)%area_facade ) !< [J/K] standard values |
---|
| 1525 | !< according to table 12 section 12.3.1.2 (calculate over Eq. (66) according to section 12.3.1.2) |
---|
[4246] | 1526 | ! |
---|
| 1527 | !-- Calculation of heat transfer coefficient for transmission --> not time-dependent |
---|
| 1528 | h_t_es = window_area_per_facade * buildings(nb)%h_es !< [W/K] only for windows |
---|
| 1529 | |
---|
[4646] | 1530 | h_t_is = buildings(nb)%area_facade * h_is !< [W/K] with h_is = 3.45 W / |
---|
| 1531 | !< (m2 K) between surface and air, Eq. (9) |
---|
| 1532 | h_t_ms = a_m * h_ms !< [W/K] with h_ms = 9.10 W / |
---|
| 1533 | !< (m2 K) between component and surface, Eq. (64) |
---|
| 1534 | h_t_wall = 1.0_wp / ( 1.0_wp / ( ( facade_element_area - window_area_per_facade ) & !< [W/K] |
---|
[4246] | 1535 | * buildings(nb)%lambda_layer3 / buildings(nb)%s_layer3 * 0.5_wp & |
---|
| 1536 | ) + 1.0_wp / h_t_ms ) !< [W/K] opaque components |
---|
| 1537 | h_t_wm = 1.0_wp / ( 1.0_wp / h_t_wall - 1.0_wp / h_t_ms ) !< [W/K] emmision Eq. (63), Section 12.2.2 |
---|
| 1538 | ! |
---|
[4646] | 1539 | !-- Internal air loads dependent on the occupacy of the room. |
---|
| 1540 | !-- Basical internal heat gains (qint_low) with additional internal heat gains by occupancy |
---|
| 1541 | !-- (qint_high) (0,5*phi_int) |
---|
| 1542 | phi_ia = 0.5_wp * ( ( buildings(nb)%qint_high * schedule_d + buildings(nb)%qint_low ) & |
---|
| 1543 | * floor_area_per_facade ) |
---|
[4246] | 1544 | q_int = phi_ia |
---|
| 1545 | |
---|
| 1546 | ! |
---|
[4646] | 1547 | !-- Airflow dependent on the occupacy of the room. |
---|
| 1548 | !-- Basical airflow (air_change_low) with additional airflow gains by occupancy |
---|
| 1549 | !-- (air_change_high) |
---|
| 1550 | air_change = ( buildings(nb)%air_change_high * schedule_d + & |
---|
| 1551 | buildings(nb)%air_change_low ) |
---|
[4246] | 1552 | ! |
---|
[4646] | 1553 | !-- Heat transfer of ventilation. |
---|
| 1554 | !-- Not less than 0.01 W/K to avoid division by 0 in further calculations with heat |
---|
| 1555 | !-- capacity of air 0.33 Wh/m2K |
---|
| 1556 | h_v = MAX( 0.01_wp , ( air_change * indoor_volume_per_facade * & |
---|
| 1557 | 0.33_wp * (1.0_wp - buildings(nb)%eta_ve ) ) ) !< [W/K] from ISO 13789 |
---|
| 1558 | !< Eq.(10) |
---|
| 1559 | |
---|
[4246] | 1560 | !-- Heat transfer coefficient auxiliary variables |
---|
| 1561 | h_t_1 = 1.0_wp / ( ( 1.0_wp / h_v ) + ( 1.0_wp / h_t_is ) ) !< [W/K] Eq. (C.6) |
---|
| 1562 | h_t_2 = h_t_1 + h_t_es !< [W/K] Eq. (C.7) |
---|
| 1563 | h_t_3 = 1.0_wp / ( ( 1.0_wp / h_t_2 ) + ( 1.0_wp / h_t_ms ) ) !< [W/K] Eq. (C.8) |
---|
| 1564 | ! |
---|
| 1565 | !-- Net short-wave radiation through window area (was i_global) |
---|
| 1566 | net_sw_in = surf_usm_v(l)%rad_sw_in(m) - surf_usm_v(l)%rad_sw_out(m) |
---|
| 1567 | ! |
---|
| 1568 | !-- Quantities needed for im_calc_temperatures |
---|
| 1569 | i = surf_usm_v(l)%i(m) |
---|
[4646] | 1570 | j = surf_usm_v(l)%j(m) |
---|
[4246] | 1571 | k = surf_usm_v(l)%k(m) |
---|
| 1572 | near_facade_temperature = surf_usm_v(l)%pt_10cm(m) |
---|
[4687] | 1573 | indoor_wall_window_temperature = & |
---|
| 1574 | surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)%val(nzt_wall,m) & |
---|
[4671] | 1575 | + surf_usm_v(l)%frac(m,ind_wat_win) * t_window_v(l)%val(nzt_wall,m) |
---|
[4701] | 1576 | indoor_wall_temperature = surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)%val(nzt_wall,m) |
---|
[4687] | 1577 | |
---|
[4246] | 1578 | ! |
---|
[4646] | 1579 | !-- Solar thermal gains. If net_sw_in larger than sun-protection |
---|
| 1580 | !-- threshold parameter (params_solar_protection), sun protection will |
---|
[4246] | 1581 | !-- be activated |
---|
[4646] | 1582 | IF ( net_sw_in <= params_solar_protection ) THEN |
---|
[4246] | 1583 | solar_protection_off = 1 |
---|
[4646] | 1584 | solar_protection_on = 0 |
---|
| 1585 | ELSE |
---|
[4246] | 1586 | solar_protection_off = 0 |
---|
[4646] | 1587 | solar_protection_on = 1 |
---|
[4246] | 1588 | ENDIF |
---|
| 1589 | ! |
---|
[4646] | 1590 | !-- Calculation of total heat gains from net_sw_in through windows [W] in respect on |
---|
| 1591 | !-- automatic sun protection. |
---|
[4246] | 1592 | !-- DIN 4108 - 2 chap.8 |
---|
[4646] | 1593 | phi_sol = ( window_area_per_facade * net_sw_in * solar_protection_off & |
---|
| 1594 | + window_area_per_facade * net_sw_in * buildings(nb)%f_c_win * & |
---|
| 1595 | solar_protection_on ) & |
---|
[4246] | 1596 | * buildings(nb)%g_value_win * ( 1.0_wp - params_f_f ) * params_f_w |
---|
| 1597 | q_sol = phi_sol |
---|
| 1598 | ! |
---|
[4646] | 1599 | !-- Calculation of the mass specific thermal load for internal and external heatsources. |
---|
[4246] | 1600 | phi_m = (a_m / total_area) * ( phi_ia + phi_sol ) !< [W] Eq. (C.2) with phi_ia=0,5*phi_int |
---|
| 1601 | q_c_m = phi_m |
---|
| 1602 | ! |
---|
[4646] | 1603 | !-- Calculation mass specific thermal load implied non thermal mass. |
---|
| 1604 | phi_st = ( 1.0_wp - ( a_m / total_area ) - ( h_t_es / ( 9.1_wp * total_area ) ) ) & |
---|
| 1605 | * ( phi_ia + phi_sol ) !< [W] Eq. (C.3) with |
---|
| 1606 | !< phi_ia=0,5*phi_int |
---|
| 1607 | q_c_st = phi_st |
---|
[4246] | 1608 | ! |
---|
[4646] | 1609 | !-- Calculations for deriving indoor temperature and heat flux into the wall. |
---|
| 1610 | !-- Step 1: indoor temperature without heating and cooling. |
---|
[4246] | 1611 | !-- section C.4.1 Picture C.2 zone 3) |
---|
| 1612 | phi_hc_nd = 0.0_wp |
---|
[4702] | 1613 | CALL im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 1614 | near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_v(fa) ) |
---|
[4246] | 1615 | ! |
---|
[4646] | 1616 | !-- If air temperature between border temperatures of heating and cooling, assign output |
---|
| 1617 | !-- variable, then ready. |
---|
| 1618 | IF ( buildings(nb)%theta_int_h_set <= theta_air .AND. & |
---|
| 1619 | theta_air <= buildings(nb)%theta_int_c_set ) THEN |
---|
[4246] | 1620 | phi_hc_nd_ac = 0.0_wp |
---|
| 1621 | phi_hc_nd = phi_hc_nd_ac |
---|
| 1622 | theta_air_ac = theta_air |
---|
| 1623 | ! |
---|
| 1624 | !-- Step 2: Else, apply 10 W/m2 heating/cooling power and calculate indoor temperature |
---|
| 1625 | !-- again. |
---|
| 1626 | ELSE |
---|
| 1627 | ! |
---|
| 1628 | !-- Temperature not correct, calculation method according to section C4.2 |
---|
| 1629 | theta_air_0 = theta_air !< Note temperature without heating/cooling |
---|
| 1630 | ! |
---|
| 1631 | !-- Heating or cooling? |
---|
| 1632 | IF ( theta_air_0 > buildings(nb)%theta_int_c_set ) THEN |
---|
| 1633 | theta_air_set = buildings(nb)%theta_int_c_set |
---|
[4646] | 1634 | ELSE |
---|
| 1635 | theta_air_set = buildings(nb)%theta_int_h_set |
---|
[4246] | 1636 | ENDIF |
---|
| 1637 | |
---|
| 1638 | !-- Calculate the temperature with phi_hc_nd_10 |
---|
| 1639 | phi_hc_nd_10 = 10.0_wp * floor_area_per_facade |
---|
| 1640 | phi_hc_nd = phi_hc_nd_10 |
---|
| 1641 | |
---|
[4702] | 1642 | CALL im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 1643 | near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_v(fa) ) |
---|
[4646] | 1644 | |
---|
[4246] | 1645 | theta_air_10 = theta_air !< Note the temperature with 10 W/m2 of heating |
---|
| 1646 | |
---|
[4646] | 1647 | phi_hc_nd_un = phi_hc_nd_10 * ( theta_air_set - theta_air_0 ) & |
---|
[4246] | 1648 | / ( theta_air_10 - theta_air_0 ) !< Eq. (C.13) |
---|
| 1649 | ! |
---|
[4646] | 1650 | !-- Step 3: with temperature ratio to determine the heating or cooling capacity |
---|
| 1651 | !-- If necessary, limit the power to maximum power. |
---|
[4246] | 1652 | !-- section C.4.1 Picture C.2 zone 2) and 4) |
---|
| 1653 | buildings(nb)%phi_c_max = buildings(nb)%q_c_max * floor_area_per_facade |
---|
| 1654 | buildings(nb)%phi_h_max = buildings(nb)%q_h_max * floor_area_per_facade |
---|
[4646] | 1655 | IF ( buildings(nb)%phi_c_max < phi_hc_nd_un .AND. & |
---|
| 1656 | phi_hc_nd_un < buildings(nb)%phi_h_max ) THEN |
---|
[4246] | 1657 | phi_hc_nd_ac = phi_hc_nd_un |
---|
| 1658 | phi_hc_nd = phi_hc_nd_un |
---|
| 1659 | ELSE |
---|
| 1660 | ! |
---|
[4646] | 1661 | !-- Step 4: inner temperature with maximum heating (phi_hc_nd_un positive) or cooling |
---|
| 1662 | !-- (phi_hc_nd_un negative) |
---|
[4246] | 1663 | !-- section C.4.1 Picture C.2 zone 1) and 5) |
---|
| 1664 | IF ( phi_hc_nd_un > 0.0_wp ) THEN |
---|
| 1665 | phi_hc_nd_ac = buildings(nb)%phi_h_max !< Limit heating |
---|
[4646] | 1666 | ELSE |
---|
[4246] | 1667 | phi_hc_nd_ac = buildings(nb)%phi_c_max !< Limit cooling |
---|
| 1668 | ENDIF |
---|
| 1669 | ENDIF |
---|
[4646] | 1670 | phi_hc_nd = phi_hc_nd_ac |
---|
[4246] | 1671 | ! |
---|
| 1672 | !-- Calculate the temperature with phi_hc_nd_ac (new) |
---|
[4702] | 1673 | CALL im_calc_temperatures ( i, j, k, indoor_wall_temperature, & |
---|
[4687] | 1674 | near_facade_temperature, phi_hc_nd, buildings(nb)%theta_m_t_prev_v(fa) ) |
---|
[4246] | 1675 | theta_air_ac = theta_air |
---|
| 1676 | ENDIF |
---|
| 1677 | ! |
---|
| 1678 | !-- Update theta_m_t_prev |
---|
[4687] | 1679 | buildings(nb)%theta_m_t_prev_v(fa) = theta_m_t |
---|
[4646] | 1680 | |
---|
[4687] | 1681 | |
---|
[4246] | 1682 | q_vent = h_v * ( theta_air - near_facade_temperature ) |
---|
| 1683 | ! |
---|
[4646] | 1684 | !-- Calculate the operating temperature with weighted mean of temperature of air and mean. |
---|
| 1685 | !-- Will be used for thermal comfort calculations. |
---|
[4246] | 1686 | theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s |
---|
[4687] | 1687 | |
---|
[4246] | 1688 | ! surf_usm_v(l)%t_indoor(m) = theta_op !< not integrated yet |
---|
| 1689 | ! |
---|
[4646] | 1690 | !-- Heat flux into the wall. Value needed in urban_surface_mod to |
---|
[4246] | 1691 | !-- calculate heat transfer through wall layers towards the facade |
---|
[4701] | 1692 | q_wall = h_t_wm * ( indoor_wall_temperature - theta_m ) & |
---|
[4646] | 1693 | / ( facade_element_area - window_area_per_facade ) |
---|
[4701] | 1694 | q_win = h_t_es * ( pt(k,j,i) - theta_s ) & |
---|
| 1695 | / ( window_area_per_facade ) |
---|
[4246] | 1696 | ! |
---|
[4701] | 1697 | !-- Transfer q_wall & q_win back to USM (innermost wall/window layer) |
---|
| 1698 | surf_usm_v(l)%iwghf_eb(m) = - q_wall |
---|
| 1699 | surf_usm_v(l)%iwghf_eb_window(m) = - q_win |
---|
[4246] | 1700 | ! |
---|
[4646] | 1701 | !-- Sum up operational indoor temperature per kk-level. Further below, this temperature is |
---|
| 1702 | !-- reduced by MPI to one temperature per kk-level and building (processor overlapping). |
---|
[4246] | 1703 | buildings(nb)%t_in_l(kk) = buildings(nb)%t_in_l(kk) + theta_op |
---|
| 1704 | ! |
---|
[4646] | 1705 | !-- Calculation of waste heat. |
---|
| 1706 | !-- Anthropogenic heat output. |
---|
| 1707 | IF ( phi_hc_nd_ac > 0.0_wp ) THEN |
---|
[4246] | 1708 | heating_on = 1 |
---|
| 1709 | cooling_on = 0 |
---|
[4646] | 1710 | ELSE |
---|
[4246] | 1711 | heating_on = 0 |
---|
| 1712 | cooling_on = -1 |
---|
| 1713 | ENDIF |
---|
| 1714 | |
---|
[4646] | 1715 | q_waste_heat = ( phi_hc_nd * ( buildings(nb)%params_waste_heat_h * heating_on + & |
---|
| 1716 | buildings(nb)%params_waste_heat_c * cooling_on ) & |
---|
| 1717 | ) / facade_element_area !< [W/m2] , observe the directional convention in |
---|
| 1718 | !< PALM! |
---|
[4687] | 1719 | surf_usm_v(l)%waste_heat(m) = 0.0_wp !q_waste_heat |
---|
[4246] | 1720 | ENDDO !< Vertical surfaces loop |
---|
| 1721 | ENDIF !< buildings(nb)%on_pe |
---|
| 1722 | ENDDO !< buildings loop |
---|
| 1723 | |
---|
| 1724 | ! |
---|
[4646] | 1725 | !-- Determine the mean building temperature. |
---|
[4246] | 1726 | DO nb = 1, num_build |
---|
| 1727 | ! |
---|
[4646] | 1728 | !-- Allocate dummy array used for summing-up facade elements. |
---|
| 1729 | !-- Please note, dummy arguments are necessary as building-date type arrays are not necessarily |
---|
| 1730 | !-- allocated on all PEs. |
---|
[4246] | 1731 | ALLOCATE( t_in_l_send(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 1732 | ALLOCATE( t_in_recv(buildings(nb)%kb_min:buildings(nb)%kb_max) ) |
---|
| 1733 | t_in_l_send = 0.0_wp |
---|
| 1734 | t_in_recv = 0.0_wp |
---|
| 1735 | |
---|
| 1736 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 1737 | t_in_l_send = buildings(nb)%t_in_l |
---|
| 1738 | ENDIF |
---|
| 1739 | |
---|
| 1740 | |
---|
[4646] | 1741 | #if defined( __parallel ) |
---|
| 1742 | CALL MPI_ALLREDUCE( t_in_l_send, & |
---|
| 1743 | t_in_recv, & |
---|
| 1744 | buildings(nb)%kb_max - buildings(nb)%kb_min + 1, & |
---|
| 1745 | MPI_REAL, & |
---|
| 1746 | MPI_SUM, & |
---|
| 1747 | comm2d, & |
---|
[4246] | 1748 | ierr ) |
---|
| 1749 | |
---|
[4646] | 1750 | IF ( ALLOCATED( buildings(nb)%t_in ) ) buildings(nb)%t_in = t_in_recv |
---|
[4246] | 1751 | #else |
---|
[4646] | 1752 | IF ( ALLOCATED( buildings(nb)%t_in ) ) buildings(nb)%t_in = buildings(nb)%t_in_l |
---|
[4246] | 1753 | #endif |
---|
| 1754 | |
---|
| 1755 | IF ( ALLOCATED( buildings(nb)%t_in ) ) THEN |
---|
| 1756 | ! |
---|
[4646] | 1757 | !-- Average indoor temperature. Note, in case a building is completely surrounded by higher |
---|
| 1758 | !-- buildings, it may have no facade elements at some height levels, which will lead to a |
---|
| 1759 | !-- division by zero. |
---|
[4246] | 1760 | DO k = buildings(nb)%kb_min, buildings(nb)%kb_max |
---|
[4646] | 1761 | IF ( buildings(nb)%num_facade_h(k) + buildings(nb)%num_facade_v(k) > 0 ) THEN |
---|
| 1762 | buildings(nb)%t_in(k) = buildings(nb)%t_in(k) / & |
---|
| 1763 | REAL( buildings(nb)%num_facade_h(k) + & |
---|
| 1764 | buildings(nb)%num_facade_v(k), KIND = wp ) |
---|
[4246] | 1765 | ENDIF |
---|
| 1766 | ENDDO |
---|
[4299] | 1767 | ! |
---|
[4646] | 1768 | !-- If indoor temperature is not defined because of missing facade elements, the values from |
---|
| 1769 | !-- the above-lying level will be taken. |
---|
| 1770 | !-- At least at the top of the buildings facades are defined, so that at least there an indoor |
---|
| 1771 | !-- temperature is defined. This information will propagate downwards the building. |
---|
[4299] | 1772 | DO k = buildings(nb)%kb_max-1, buildings(nb)%kb_min, -1 |
---|
[4646] | 1773 | IF ( buildings(nb)%num_facade_h(k) + buildings(nb)%num_facade_v(k) <= 0 ) THEN |
---|
[4299] | 1774 | buildings(nb)%t_in(k) = buildings(nb)%t_in(k+1) |
---|
| 1775 | ENDIF |
---|
| 1776 | ENDDO |
---|
[4246] | 1777 | ENDIF |
---|
| 1778 | |
---|
[4646] | 1779 | |
---|
[4246] | 1780 | ! |
---|
| 1781 | !-- Deallocate dummy arrays |
---|
| 1782 | DEALLOCATE( t_in_l_send ) |
---|
| 1783 | DEALLOCATE( t_in_recv ) |
---|
| 1784 | |
---|
| 1785 | ENDDO |
---|
[4646] | 1786 | |
---|
[4246] | 1787 | END SUBROUTINE im_main_heatcool |
---|
| 1788 | |
---|
[4646] | 1789 | |
---|
| 1790 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1791 | ! Description: |
---|
| 1792 | !------------- |
---|
| 1793 | !> Check data output for plant canopy model |
---|
[4646] | 1794 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1795 | SUBROUTINE im_check_data_output( var, unit ) |
---|
[4402] | 1796 | |
---|
[4246] | 1797 | CHARACTER (LEN=*) :: unit !< |
---|
| 1798 | CHARACTER (LEN=*) :: var !< |
---|
[4646] | 1799 | |
---|
[4246] | 1800 | SELECT CASE ( TRIM( var ) ) |
---|
[4646] | 1801 | |
---|
| 1802 | |
---|
[4246] | 1803 | CASE ( 'im_hf_roof') |
---|
| 1804 | unit = 'W m-2' |
---|
[4646] | 1805 | |
---|
[4246] | 1806 | CASE ( 'im_hf_wall_win' ) |
---|
| 1807 | unit = 'W m-2' |
---|
[4646] | 1808 | |
---|
[4246] | 1809 | CASE ( 'im_hf_wall_win_waste' ) |
---|
| 1810 | unit = 'W m-2' |
---|
[4646] | 1811 | |
---|
[4246] | 1812 | CASE ( 'im_hf_roof_waste' ) |
---|
| 1813 | unit = 'W m-2' |
---|
[4646] | 1814 | |
---|
[4246] | 1815 | CASE ( 'im_t_indoor_mean' ) |
---|
| 1816 | unit = 'K' |
---|
[4646] | 1817 | |
---|
[4246] | 1818 | CASE ( 'im_t_indoor_roof' ) |
---|
| 1819 | unit = 'K' |
---|
[4646] | 1820 | |
---|
[4246] | 1821 | CASE ( 'im_t_indoor_wall_win' ) |
---|
| 1822 | unit = 'K' |
---|
[4701] | 1823 | |
---|
| 1824 | CASE ( 'im_t_indoor_wall' ) |
---|
| 1825 | unit = 'K' |
---|
[4646] | 1826 | |
---|
[4246] | 1827 | CASE DEFAULT |
---|
| 1828 | unit = 'illegal' |
---|
[4646] | 1829 | |
---|
[4246] | 1830 | END SELECT |
---|
[4646] | 1831 | |
---|
[4246] | 1832 | END SUBROUTINE |
---|
| 1833 | |
---|
| 1834 | |
---|
[4646] | 1835 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1836 | ! Description: |
---|
| 1837 | !------------- |
---|
| 1838 | !> Check parameters routine for plant canopy model |
---|
[4646] | 1839 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1840 | SUBROUTINE im_check_parameters |
---|
| 1841 | |
---|
| 1842 | ! USE control_parameters, |
---|
| 1843 | ! ONLY: message_string |
---|
[4646] | 1844 | |
---|
[4246] | 1845 | END SUBROUTINE im_check_parameters |
---|
| 1846 | |
---|
[4646] | 1847 | |
---|
| 1848 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1849 | ! Description: |
---|
| 1850 | !------------- |
---|
| 1851 | !> Subroutine defining appropriate grid for netcdf variables. |
---|
| 1852 | !> It is called from subroutine netcdf. |
---|
[4646] | 1853 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1854 | SUBROUTINE im_define_netcdf_grid( var, found, grid_x, grid_y, grid_z ) |
---|
| 1855 | |
---|
[4646] | 1856 | CHARACTER (LEN=*), INTENT(OUT) :: grid_x |
---|
| 1857 | CHARACTER (LEN=*), INTENT(OUT) :: grid_y |
---|
| 1858 | CHARACTER (LEN=*), INTENT(OUT) :: grid_z |
---|
| 1859 | CHARACTER (LEN=*), INTENT(IN) :: var |
---|
| 1860 | |
---|
| 1861 | LOGICAL, INTENT(OUT) :: found |
---|
| 1862 | |
---|
| 1863 | |
---|
| 1864 | found = .TRUE. |
---|
[4246] | 1865 | ! |
---|
| 1866 | !-- Check for the grid |
---|
| 1867 | SELECT CASE ( TRIM( var ) ) |
---|
| 1868 | |
---|
| 1869 | CASE ( 'im_hf_roof', 'im_hf_roof_waste' ) |
---|
| 1870 | grid_x = 'x' |
---|
| 1871 | grid_y = 'y' |
---|
| 1872 | grid_z = 'zw' |
---|
| 1873 | ! |
---|
| 1874 | !-- Heat fluxes at vertical walls are actually defined on stagged grid, i.e. xu, yv. |
---|
| 1875 | CASE ( 'im_hf_wall_win', 'im_hf_wall_win_waste' ) |
---|
| 1876 | grid_x = 'x' |
---|
| 1877 | grid_y = 'y' |
---|
| 1878 | grid_z = 'zu' |
---|
| 1879 | |
---|
[4701] | 1880 | CASE ( 'im_t_indoor_mean', 'im_t_indoor_roof', 'im_t_indoor_wall_win', 'indoor_wall' ) |
---|
[4246] | 1881 | grid_x = 'x' |
---|
| 1882 | grid_y = 'y' |
---|
| 1883 | grid_z = 'zw' |
---|
[4646] | 1884 | |
---|
[4246] | 1885 | CASE DEFAULT |
---|
| 1886 | found = .FALSE. |
---|
| 1887 | grid_x = 'none' |
---|
| 1888 | grid_y = 'none' |
---|
| 1889 | grid_z = 'none' |
---|
| 1890 | END SELECT |
---|
[4646] | 1891 | |
---|
[4246] | 1892 | END SUBROUTINE im_define_netcdf_grid |
---|
| 1893 | |
---|
[4646] | 1894 | |
---|
| 1895 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 1896 | ! Description: |
---|
| 1897 | ! ------------ |
---|
| 1898 | !> Subroutine defining 3D output variables |
---|
[4646] | 1899 | !--------------------------------------------------------------------------------------------------! |
---|
| 1900 | SUBROUTINE im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
[4246] | 1901 | |
---|
[4402] | 1902 | USE indices |
---|
| 1903 | |
---|
| 1904 | USE kinds |
---|
| 1905 | |
---|
[4646] | 1906 | CHARACTER (LEN=*) :: variable !< |
---|
[4246] | 1907 | |
---|
[4646] | 1908 | INTEGER(iwp) :: av !< |
---|
| 1909 | INTEGER(iwp) :: i !< |
---|
| 1910 | INTEGER(iwp) :: j !< |
---|
| 1911 | INTEGER(iwp) :: k !< |
---|
[4246] | 1912 | INTEGER(iwp) :: l !< |
---|
[4646] | 1913 | INTEGER(iwp) :: m !< |
---|
| 1914 | INTEGER(iwp) :: nb !< index of the building in the building data structure |
---|
[4246] | 1915 | INTEGER(iwp) :: nzb_do !< lower limit of the data output (usually 0) |
---|
| 1916 | INTEGER(iwp) :: nzt_do !< vertical upper limit of the data output (usually nz_do3d) |
---|
| 1917 | |
---|
[4646] | 1918 | LOGICAL :: found !< |
---|
| 1919 | |
---|
[4246] | 1920 | REAL(wp), INTENT(IN) :: fill_value !< value for the _FillValue attribute |
---|
| 1921 | |
---|
[4646] | 1922 | REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< |
---|
| 1923 | |
---|
[4246] | 1924 | local_pf = fill_value |
---|
[4646] | 1925 | |
---|
[4246] | 1926 | found = .TRUE. |
---|
[4646] | 1927 | |
---|
[4246] | 1928 | SELECT CASE ( TRIM( variable ) ) |
---|
| 1929 | ! |
---|
[4646] | 1930 | !-- Output of indoor temperature. All grid points within the building are filled with values, |
---|
| 1931 | !-- while atmospheric grid points are set to _FillValues. |
---|
[4246] | 1932 | CASE ( 'im_t_indoor_mean' ) |
---|
| 1933 | IF ( av == 0 ) THEN |
---|
| 1934 | DO i = nxl, nxr |
---|
| 1935 | DO j = nys, nyn |
---|
| 1936 | IF ( building_id_f%var(j,i) /= building_id_f%fill ) THEN |
---|
| 1937 | ! |
---|
[4646] | 1938 | !-- Determine index of the building within the building data structure. |
---|
| 1939 | nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) |
---|
[4246] | 1940 | IF ( buildings(nb)%on_pe ) THEN |
---|
| 1941 | ! |
---|
[4646] | 1942 | !-- Write mean building temperature onto output array. Please note, in |
---|
| 1943 | !-- contrast to many other loops in the output, the vertical bounds are |
---|
| 1944 | !-- determined by the lowest and hightest vertical index occupied by the |
---|
| 1945 | !-- building. |
---|
[4246] | 1946 | DO k = buildings(nb)%kb_min, buildings(nb)%kb_max |
---|
| 1947 | local_pf(i,j,k) = buildings(nb)%t_in(k) |
---|
| 1948 | ENDDO |
---|
| 1949 | ENDIF |
---|
| 1950 | ENDIF |
---|
| 1951 | ENDDO |
---|
| 1952 | ENDDO |
---|
[4646] | 1953 | ENDIF |
---|
[4246] | 1954 | |
---|
| 1955 | CASE ( 'im_hf_roof' ) |
---|
[4646] | 1956 | IF ( av == 0 ) THEN |
---|
[4671] | 1957 | DO m = 1, surf_usm_h(0)%ns |
---|
| 1958 | i = surf_usm_h(0)%i(m) !+ surf_usm_h%ioff |
---|
| 1959 | j = surf_usm_h(0)%j(m) !+ surf_usm_h%joff |
---|
| 1960 | k = surf_usm_h(0)%k(m) !+ surf_usm_h%koff |
---|
| 1961 | local_pf(i,j,k) = surf_usm_h(0)%iwghf_eb(m) |
---|
[4246] | 1962 | ENDDO |
---|
[4646] | 1963 | ENDIF |
---|
[4246] | 1964 | |
---|
| 1965 | CASE ( 'im_hf_roof_waste' ) |
---|
[4646] | 1966 | IF ( av == 0 ) THEN |
---|
[4671] | 1967 | DO m = 1, surf_usm_h(0)%ns |
---|
| 1968 | i = surf_usm_h(0)%i(m) !+ surf_usm_h%ioff |
---|
| 1969 | j = surf_usm_h(0)%j(m) !+ surf_usm_h%joff |
---|
| 1970 | k = surf_usm_h(0)%k(m) !+ surf_usm_h%koff |
---|
| 1971 | local_pf(i,j,k) = surf_usm_h(0)%waste_heat(m) |
---|
[4246] | 1972 | ENDDO |
---|
| 1973 | ENDIF |
---|
| 1974 | |
---|
| 1975 | CASE ( 'im_hf_wall_win' ) |
---|
[4646] | 1976 | IF ( av == 0 ) THEN |
---|
[4246] | 1977 | DO l = 0, 3 |
---|
| 1978 | DO m = 1, surf_usm_v(l)%ns |
---|
| 1979 | i = surf_usm_v(l)%i(m) !+ surf_usm_v(l)%ioff |
---|
| 1980 | j = surf_usm_v(l)%j(m) !+ surf_usm_v(l)%joff |
---|
| 1981 | k = surf_usm_v(l)%k(m) !+ surf_usm_v(l)%koff |
---|
| 1982 | local_pf(i,j,k) = surf_usm_v(l)%iwghf_eb(m) |
---|
| 1983 | ENDDO |
---|
| 1984 | ENDDO |
---|
| 1985 | ENDIF |
---|
| 1986 | |
---|
| 1987 | CASE ( 'im_hf_wall_win_waste' ) |
---|
[4646] | 1988 | IF ( av == 0 ) THEN |
---|
[4246] | 1989 | DO l = 0, 3 |
---|
[4646] | 1990 | DO m = 1, surf_usm_v(l)%ns |
---|
[4246] | 1991 | i = surf_usm_v(l)%i(m) !+ surf_usm_v(l)%ioff |
---|
| 1992 | j = surf_usm_v(l)%j(m) !+ surf_usm_v(l)%joff |
---|
| 1993 | k = surf_usm_v(l)%k(m) !+ surf_usm_v(l)%koff |
---|
[4646] | 1994 | local_pf(i,j,k) = surf_usm_v(l)%waste_heat(m) |
---|
[4246] | 1995 | ENDDO |
---|
| 1996 | ENDDO |
---|
| 1997 | ENDIF |
---|
| 1998 | |
---|
| 1999 | ! |
---|
| 2000 | !< NOTE im_t_indoor_roof and im_t_indoor_wall_win not work yet |
---|
| 2001 | |
---|
| 2002 | ! CASE ( 'im_t_indoor_roof' ) |
---|
[4646] | 2003 | ! IF ( av == 0 ) THEN |
---|
[4246] | 2004 | ! DO m = 1, surf_usm_h%ns |
---|
| 2005 | ! i = surf_usm_h%i(m) !+ surf_usm_h%ioff |
---|
| 2006 | ! j = surf_usm_h%j(m) !+ surf_usm_h%joff |
---|
| 2007 | ! k = surf_usm_h%k(m) !+ surf_usm_h%koff |
---|
| 2008 | ! local_pf(i,j,k) = surf_usm_h%t_indoor(m) |
---|
| 2009 | ! ENDDO |
---|
| 2010 | ! ENDIF |
---|
[4646] | 2011 | ! |
---|
[4246] | 2012 | ! CASE ( 'im_t_indoor_wall_win' ) |
---|
[4646] | 2013 | ! IF ( av == 0 ) THEN |
---|
[4246] | 2014 | ! DO l = 0, 3 |
---|
| 2015 | ! DO m = 1, surf_usm_v(l)%ns |
---|
| 2016 | ! i = surf_usm_v(l)%i(m) !+ surf_usm_v(l)%ioff |
---|
| 2017 | ! j = surf_usm_v(l)%j(m) !+ surf_usm_v(l)%joff |
---|
| 2018 | ! k = surf_usm_v(l)%k(m) !+ surf_usm_v(l)%koff |
---|
| 2019 | ! local_pf(i,j,k) = surf_usm_v(l)%t_indoor(m) |
---|
| 2020 | ! ENDDO |
---|
| 2021 | ! ENDDO |
---|
| 2022 | ! ENDIF |
---|
| 2023 | |
---|
| 2024 | CASE DEFAULT |
---|
| 2025 | found = .FALSE. |
---|
| 2026 | |
---|
[4646] | 2027 | END SELECT |
---|
| 2028 | |
---|
| 2029 | END SUBROUTINE im_data_output_3d |
---|
| 2030 | |
---|
| 2031 | |
---|
| 2032 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 2033 | ! Description: |
---|
| 2034 | ! ------------ |
---|
| 2035 | !> Parin for &indoor_parameters for indoor model |
---|
[4646] | 2036 | !--------------------------------------------------------------------------------------------------! |
---|
[4246] | 2037 | SUBROUTINE im_parin |
---|
[4646] | 2038 | |
---|
| 2039 | USE control_parameters, & |
---|
[4246] | 2040 | ONLY: indoor_model |
---|
| 2041 | |
---|
[4402] | 2042 | |
---|
[4246] | 2043 | CHARACTER (LEN=80) :: line !< string containing current line of file PARIN |
---|
| 2044 | |
---|
[4310] | 2045 | NAMELIST /indoor_parameters/ initial_indoor_temperature |
---|
[4246] | 2046 | |
---|
[4646] | 2047 | |
---|
[4246] | 2048 | ! |
---|
| 2049 | !-- Try to find indoor model package |
---|
| 2050 | REWIND ( 11 ) |
---|
| 2051 | line = ' ' |
---|
[4646] | 2052 | DO WHILE ( INDEX( line, '&indoor_parameters' ) == 0 ) |
---|
[4246] | 2053 | READ ( 11, '(A)', END=10 ) line |
---|
| 2054 | ENDDO |
---|
| 2055 | BACKSPACE ( 11 ) |
---|
| 2056 | |
---|
| 2057 | ! |
---|
| 2058 | !-- Read user-defined namelist |
---|
| 2059 | READ ( 11, indoor_parameters ) |
---|
| 2060 | ! |
---|
| 2061 | !-- Set flag that indicates that the indoor model is switched on |
---|
| 2062 | indoor_model = .TRUE. |
---|
| 2063 | |
---|
| 2064 | ! |
---|
| 2065 | !-- Activate spinup (maybe later |
---|
| 2066 | ! IF ( spinup_time > 0.0_wp ) THEN |
---|
| 2067 | ! coupling_start_time = spinup_time |
---|
| 2068 | ! end_time = end_time + spinup_time |
---|
| 2069 | ! IF ( spinup_pt_mean == 9999999.9_wp ) THEN |
---|
| 2070 | ! spinup_pt_mean = pt_surface |
---|
| 2071 | ! ENDIF |
---|
| 2072 | ! spinup = .TRUE. |
---|
| 2073 | ! ENDIF |
---|
| 2074 | |
---|
| 2075 | 10 CONTINUE |
---|
[4646] | 2076 | |
---|
[4246] | 2077 | END SUBROUTINE im_parin |
---|
| 2078 | |
---|
| 2079 | |
---|
| 2080 | END MODULE indoor_model_mod |
---|