- Timestamp:
- Feb 15, 2019 6:38:58 PM (6 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r3737 r3744 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # Add Netcdf data output for indoor model 23 # Remove some dependencies 23 24 # 24 25 # Former revisions: … … 33 34 # 3700 2019-01-26 17:03:42Z knoop 34 35 # Rename surface_output_mod into surface_data_output_mod 35 # 36 # 36 37 # 3637 2018-12-20 01:51:36Z knoop 37 38 # Implementation of the PALM module interface 38 # 39 # 39 40 # 3634 2018-12-18 12:31:28Z knoop 40 41 # OpenACC port for SPEC 41 # 42 # 42 43 # 3579 2018-11-29 15:32:39Z suehring 43 44 # Dependency for check_parameters on nesting_offl_mod added 44 # 45 # 45 46 # 3569 2018-11-27 17:03:40Z kanani 46 47 # dom_dwd_user, Schrempf: … … 50 51 # 3525 2018-11-14 16:06:14Z kanani 51 52 # Changes related to clean-up of biometeorology (dom_dwd_user) 52 # 53 # 53 54 # 3522 2018-11-13 12:14:36Z suehring 54 55 # Dependencies for virtual measurement module added 55 # 56 # 56 57 # 3494 2018-11-06 14:51:27Z suehring 57 58 # Surface output revised 58 # 59 # 59 60 # 3474 2018-10-30 21:07:39Z kanani 60 61 # Add virtual measurement module 61 # 62 # 62 63 # 3472 2018-10-30 20:43:50Z suehring 63 64 # Add indoor model (kanani, srissman, tlang), 64 65 # minor formatting 65 # 66 # 66 67 # 3467 2018-10-30 19:05:21Z suehring 67 68 # Implementation of a new aerosol module salsa. 68 # 69 # 69 # 70 # 70 71 # 3458 2018-10-30 14:51:23Z kanani 71 72 # from chemistry branch r3443, banzhafs, Russo, forkel, basit: … … 74 75 # Added chemistry emission module 75 76 # chemistry_model_mod added to flow_statistics 76 # 77 # 77 78 # 3448 2018-10-29 18:14:31Z kanani 78 79 # Adjustment of biometeorology dependencies 79 # 80 # 80 81 # 3436 2018-10-26 18:35:15Z gronemeier 81 82 # Add surface_mod to user_data_output_mask 82 # 83 # 83 84 # 3435 2018-10-26 18:25:44Z gronemeier 84 85 # - Add surface_mod to data_output_mask 85 86 # - Add chemistry_model_mod and surface_mod to init_masks 86 # 87 # 87 88 # 3421 2018-10-24 18:39:32Z gronemeier 88 89 # Add netcdf_data_input_mod to netcdf_interface_mod 89 90 # bugfix: add dependencies to chemistry_model_mod 90 91 # Add module for surface data output 91 # 92 # 92 93 # 3381 2018-10-19 13:09:06Z raasch 93 94 # dependencies for ocean_mod fixed 94 # 95 # 95 96 # 3355 2018-10-16 14:03:34Z knoop 96 97 # Add module for offline nesting; … … 98 99 # Bugfix, missing dependency for turbulence generator in init_3d_model; 99 100 # Some formatting ajdustments 100 # 101 # 101 102 # 3343 2018-10-15 10:38:52Z suehring 102 103 # (from branch resler) 103 104 # Add biometeorology 104 # 105 # 105 # 106 # 106 107 # 3322 2018-10-09 10:02:39Z kanani 107 108 # Formatting and cleanup 108 # 109 # 109 110 # 3298 2018-10-02 12:21:11Z kanani 110 111 # Added missing dependencies and replaced blanks with tabs (forkel) … … 115 116 # changes related to modularization of the ocean mode, 116 117 # bugfix: dependency to advec_ws was missed in chemistry_model_mod 117 # 118 # 118 119 # 3274 2018-09-24 15:42:55Z knoop 119 120 # Added palm dependency of multi_agent_system_mod, because of mas_last_actions 120 121 # call at the end of palm run 121 # 122 # 122 123 # 3167 2018-07-24 18:17:30Z suehring 123 124 # Bugfix, add missing dependencies for multi-agent system 124 # 125 # 125 126 # 3159 2018-07-20 11:20:01Z sward 126 127 # Added multi agent system 127 # 128 # 128 129 # 3130 2018-07-16 11:08:55Z gronemeier 129 130 # add surface_layer_fluxes_mod to turbulence_closure_mod 130 # 131 # 131 132 # 3129 2018-07-16 07:45:13Z gronemeier 132 133 # add turbulence_closure_mod to parin 133 # 134 # 134 135 # 2963 2018-04-12 14:47:44Z suehring 135 # Introduce index for vegetation/wall, pavement/green-wall and water/window 136 # Introduce index for vegetation/wall, pavement/green-wall and water/window 136 137 # surfaces, for clearer access of surface fraction, albedo, emissivity, etc. . 137 # 138 # 138 139 # 2955 2018-04-09 15:14:01Z suehring 139 140 # Add log-points to measure CPU time of NetCDF data input. 140 # 141 # 141 142 # 2938 2018-03-27 15:52:42Z suehring 142 143 # No initialization of child domains via dynamic input file, except for soil 143 144 # moisture and temperature 144 145 # Apply turbulence generator at non-cyclic lateral boundary in nesting case 145 # 146 # 146 147 # 2936 2018-03-27 14:49:27Z suehring 147 148 # Added dependencies for parent and child synchronization 148 # 149 # 149 150 # 2921 2018-03-22 15:05:23Z Giersch 150 151 # date_and_time_mod dependency has been added to read/write_restart_data_mod 151 # 152 # 152 153 # 2918 2018-03-21 15:52:14Z gronemeier 153 # read/write_3d_binary and read/write_var_list has been removed, 154 # read/write_3d_binary and read/write_var_list has been removed, 154 155 # read/write_restart_data_mod, wrd_write_string and 155 # user_read/write_restart_data_mod has been added, dependencies with respect to 156 # user_read/write_restart_data_mod has been added, dependencies with respect to 156 157 # the aforementioned routines have been added/removed 157 158 # 158 159 # 2847 2018-03-02 21:45:58Z suehring 159 160 # Changed format and enforced sorting 160 # 161 # 161 162 # 2817 2018-02-19 16:32:21Z knoop 162 163 # Preliminary gust module interface implemented 163 # 164 # 164 165 # 2802 2018-02-14 16:21:39Z thiele 165 166 # Changed lpm from subroutine to module. 166 167 # Introduce particle transfer in nested models. 167 # 168 # 168 169 # 2773 2018-01-30 14:12:54Z suehring 169 170 # Nesting of chemical species 170 # 171 # 171 172 # 2718 2018-01-02 08:49:38Z maronga 172 173 # Corrected "Former revisions" section 173 # 174 # 174 175 # 2697 2017-12-14 17:57:20Z kanani 175 176 # Bugfix, missing dependencies 176 # 177 # 177 178 # 2696 2017-12-14 17:12:51Z kanani 178 179 # Change in file header (GPL part) 179 180 # Implementation of uv exposure model (FK) 180 # Bugfix, removed loop dependcy for vertical_nesting_mod and 181 # Bugfix, removed loop dependcy for vertical_nesting_mod and 181 182 # turbulence_closure_mod, added depencies for vertical_nesting_mod (TG) 182 183 # implemented turbulence_closure_mod (TG) … … 186 187 # For LSM, add dependency on calc_mean_profile (??) 187 188 # poismg_noopt modularized and renamed into poismg_noopt_mod 188 # add dependencies for netcdf_data_input_mod, calc_mean_profile, 189 # add dependencies for netcdf_data_input_mod, calc_mean_profile, 189 190 # radiation_module_mod, land_surface_model_mod (MS) 190 # 191 # 191 192 # 2608 2017-11-13 14:04:26Z schwenkel 192 # Added diagnostic_quantities_mod 193 # 193 # Added diagnostic_quantities_mod 194 # 194 195 # 2600 2017-11-01 14:11:20Z raasch 195 196 # comment line concerning bound checks removed 196 # 197 # 197 198 # 2599 2017-11-01 13:18:45Z hellstea 198 199 # virtual_flight_mod, synthetic_turbulence_generator_mod and … … 201 202 # 2563 2017-10-19 15:36:10Z Giersch 202 203 # wind_turbine_model_mod and synthetic_turbulence_generator_mod were added to 203 # write_var_list and virtual_flight_mod was deleted from read_var_list 204 # write_var_list and virtual_flight_mod was deleted from read_var_list 204 205 # 205 206 # 2544 2017-10-13 18:09:32Z maronga 206 # Added date_and_time_mod 207 # 207 # Added date_and_time_mod 208 # 208 209 # 2371 2017-08-24 13:01:17Z kanani 209 210 # Corrected dependencies for vertical_nesting_mod 210 # 211 # 211 212 # 2370 2017-08-23 06:11:43Z raasch 212 213 # dependency bugfix for synthetic_turbulence_generator 213 # 214 # 214 215 # 2365 2017-08-21 14:59:59Z kanani 215 216 # Added dependencies for vertical_nesting_mod 216 # 217 # 217 218 # 2339 2017-08-07 13:55:26Z gronemeier 218 219 # corrected timestamp in header 219 # 220 # 220 221 # 2338 2017-08-07 12:15:38Z gronemeier 221 222 # Modularize 1D model 222 # 223 # 223 224 # 2320 2017-07-21 12:47:43Z suehring 224 225 # -ls_forcing nudging 225 226 # +large_scale_forcing_nudging 226 # 227 # 227 228 # 2318 2017-07-20 17:27:44Z suehring 228 229 # Add further dependencies on surface_mod 229 # 230 # 230 231 # 2317 2017-07-20 17:27:19Z suehring 231 232 # Added time_integration_spinup 232 # 233 # 233 234 # 2269 2017-06-09 11:57:32Z suehring 234 235 # Add dependency in read_3d_binary 235 # 236 # 236 237 # 2263 2017-06-08 14:59:01Z schwenkel 237 238 # Implemented splitting and merging algorithm 238 # 239 # 239 240 # 2259 2017-06-08 09:09:11Z gronemeier 240 241 # Implemented synthetic turbulence generator … … 242 243 # 2256 2017-06-07 13:58:08Z suehring 243 244 # Remove ring dependency in init_pegrid 244 # 245 # 245 246 # 2238 2017-05-31 16:49:16Z suehring 246 247 # Bugfix, further missing dependency on surface_mod 247 # 248 # 248 249 # 2237 2017-05-31 10:34:53Z suehring 249 # Bugfix, add dependencies on surface_mod for surface_coupler, 250 # plant_canopy_model_mod and ls_forcing_mod 251 # 250 # Bugfix, add dependencies on surface_mod for surface_coupler, 251 # plant_canopy_model_mod and ls_forcing_mod 252 # 252 253 # 2233 2017-05-30 18:08:54Z suehring 253 254 # … … 255 256 # +dependencies for surface_mod 256 257 # -wall_fluxes 257 # 258 # 258 259 # 2130 2017-01-24 16:25:39Z raasch 259 260 # dependency for timestep updated … … 261 262 # 2118 2017-01-17 16:38:49Z raasch 262 263 # -cuda_fft_interfaces_mod 263 # 264 # 264 265 # 2050 2016-11-08 15:00:55Z gronemeier 265 266 # Implement turbulent outflow method 266 # 267 # 267 268 # 2007 2016-08-24 15:47:17Z kanani 268 269 # urban surface module added, 269 270 # cleaned up some lines (compiler flags/options), which were accidentally 270 271 # added in rev1938 271 # 272 # 272 273 # 1998 2016-08-20 18:45:34Z knoop 273 274 # Bugfix: added netcdf_interface to dependency list for user_init_land_surface … … 275 276 # 1986 2016-08-10 14:07:17Z gronemeier 276 277 # POSIX-calls module added 277 # 278 # 278 279 # 1972 2016-07-26 07:52:02Z maronga 279 280 # Removed some dependencies due to further modularization of land surface model 280 # 281 # 281 282 # 1957 2016-07-07 10:43:48Z suehring 282 283 # flight module added … … 286 287 # 287 288 # 1938 2016-06-13 15:26:05Z hellstea 288 # Some dependency errors corrected 289 # 289 # Some dependency errors corrected 290 # 290 291 # 1934 2016-06-13 09:46:57Z hellstea 291 292 # poismg renamed poismg_noopt, poismg_fast_mod renamed poismg_mod 292 # 293 # 293 294 # 1914 2016-05-26 14:44:07Z witha 294 295 # Added wind_turbine_model_mod … … 301 302 # 302 303 # 1850 2016-04-08 13:29:27Z maronga 303 # Adapted for modularization of microphysics 304 # Adapted for modularization of microphysics 304 305 # Several files renamed --> _mod 305 306 # Bugfix for previous commit … … 316 317 # 1833 2016-04-07 14:23:03Z raasch 317 318 # spectrum renamed spectra_mod, depencies for spectra changed 318 # 319 # 319 320 # 1826 2016-04-07 12:01:39Z maronga 320 321 # Renamed radiation_model to radiation_model_mod. 321 322 # Renamed plant_canopy_model to plant_canopy_model_mod. 322 # 323 # 323 324 # 1822 2016-04-07 07:49:42Z hoffmann 324 325 # Tails removed. lpm_release_set removed. calc_precipitation, impact_of_latent_heat 325 # removed. 326 # removed. 326 327 # 327 328 # 1817 2016-04-06 15:44:20Z maronga 328 329 # Renamed land_surface_model to land_surface_model_mod. 329 # 330 # 330 331 # 1808 2016-04-05 19:44:00Z raasch 331 332 # -local_flush, -local_getenv … … 353 354 # 354 355 # 1762 2016-02-25 12:31:13Z hellstea 355 # +pmc_interface, +pmc routines 356 # +pmc_interface, +pmc routines 356 357 # 357 358 # 1747 2016-02-08 12:25:53Z raasch … … 359 360 # 360 361 # 1691 2015-10-26 16:17:44Z maronga 361 # Replaced prandtl_fluxes with surface_layer_fluxes. Added radiation_model to 362 # Replaced prandtl_fluxes with surface_layer_fluxes. Added radiation_model to 362 363 # prognostic_equations 363 # 364 # 364 365 # 1585 2015-04-30 07:05:52Z maronga 365 366 # Added user_init_radiation.f90 366 # 367 # 367 368 # 1575 2015-03-27 09:56:27Z raasch 368 369 # +poismg_fast … … 370 371 # 1551 2015-03-03 14:18:16Z maronga 371 372 # Bugfix: further adjustments for the land surface model and radiation model 372 # 373 # 373 374 # 1517 2015-01-07 19:12:25Z hoffmann 374 375 # advec_s_bc added to prognostic_equations … … 376 377 # 1500 2014-12-03 17:42:41Z maronga 377 378 # Bugfix: missing adjustments for land surface model and radiation model 378 # 379 # 379 380 # 1496 2014-12-02 17:25:50Z maronga 380 # Added land surface model and radiation model files: land_surface_model, 381 # Added land surface model and radiation model files: land_surface_model, 381 382 # radiation_model, user_init_land_surface 382 # 383 # 383 384 # 1484 2014-10-21 10:53:05Z kanani 384 385 # plant_canopy_model-dependency added for check_parameters, header, init_3d_model, 385 386 # package_parin, read_var_list, user_init_plant_canopy, write_var_list 386 # 387 # 387 388 # 1444 2014-08-02 20:10:32Z letzel 388 389 # bugfix: cpulog added to lpm_advec 389 # 390 # 390 391 # 1404 2014-05-14 09:01:39Z keck 391 392 # bugfix: dependencies added for progress_bar … … 393 394 # 1402 2014-05-09 14:25:13Z raasch 394 395 # progress_bar added 395 # 396 # 396 397 # 1400 2014-05-09 14:03:54Z knoop 397 398 # Added new module random_generator_parallel 398 # 399 # 399 400 # 1380 2014-04-28 12:40:45Z heinze 400 401 # bugfix: mod_particle_attributes added to check_open 401 # nudging added to time_integration 402 # nudging added to time_integration 402 403 # 403 404 # 1374 2014-04-25 12:55:07Z raasch … … 407 408 # Added new module calc_mean_profile, previously in module buoyancy, 408 409 # removed buoyancy dependency from nudging 409 # 410 # 410 411 # 1363 2014-04-17 12:28:49Z keck 411 412 # bugfix: cpulog added to lpm_pack_arrays … … 413 414 # 1361 2014-04-16 15:17:48Z hoffmann 414 415 # cpulog added to microphysics 415 # 416 # 416 417 # 1359 2014-04-11 17:15:14Z hoffmann 417 # mod_particle_attributes added, lpm_sort_arrays removed, 418 # mod_particle_attributes added, lpm_sort_arrays removed, 418 419 # lpm_extend_particle_array removed 419 420 # … … 722 723 723 724 CC = cc 724 CFLAGS = -O 725 CFLAGS = -O 725 726 726 727 F90 = … … 1349 1350 chemistry_model_mod.o \ 1350 1351 gust_mod.o \ 1352 indoor_model_mod.o \ 1351 1353 land_surface_model_mod.o \ 1352 1354 mod_kinds.o \ … … 1750 1752 modules.o \ 1751 1753 netcdf_data_input_mod.o \ 1752 plant_canopy_model_mod.o \1753 1754 radiation_model_mod.o \ 1754 1755 surface_mod.o -
palm/trunk/SOURCE/indoor_model_mod.f90
r3685 r3744 21 21 ! Current revisions: 22 22 ! ----------------- 23 ! 23 ! - remove building_type from module 24 ! - initialize parameters for each building individually instead of a bulk 25 ! initializaion with identical building type for all 26 ! - output revised 27 ! - add missing _wp 28 ! - some restructuring of variables in building data structure 24 29 ! 25 30 ! Former revisions: … … 76 81 77 82 USE kinds 83 84 USE netcdf_data_input_mod, & 85 ONLY: building_id_f, building_type_f 78 86 79 87 USE surface_mod, & … … 105 113 INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: num_facade_v !< number of vertical facades elements per buidling 106 114 !< and height level 115 116 INTEGER(iwp) :: ventilation_int_loads 107 117 108 118 LOGICAL :: on_pe = .FALSE. !< flag indicating whether a building with certain ID is on local subdomain 119 120 121 REAL(wp) :: lambda_layer3 !< [W/(m*K)] Thermal conductivity of the inner layer 122 REAL(wp) :: s_layer3 !< [m] half thickness of the inner layer (layer_3) 123 REAL(wp) :: f_c_win !< [-] shading factor 124 REAL(wp) :: g_value_win !< [-] SHGC factor 125 REAL(wp) :: u_value_win !< [W/(m2*K)] transmittance 126 REAL(wp) :: air_change_low !< [1/h] air changes per time_utc_hour 127 REAL(wp) :: air_change_high !< [1/h] air changes per time_utc_hour 128 REAL(wp) :: eta_ve !< [-] heat recovery efficiency 129 REAL(wp) :: factor_a !< [-] Dynamic parameters specific effective surface according to Table 12; 2.5 130 !< (very light, light and medium), 3.0 (heavy), 3.5 (very heavy) 131 REAL(wp) :: factor_c !< [J/(m2 K)] Dynamic parameters inner heatstorage according to Table 12; 80000 132 !< (very light), 110000 (light), 165000 (medium), 260000 (heavy), 370000 (very heavy) 133 REAL(wp) :: lambda_at !< [-] ratio internal surface/floor area chap. 7.2.2.2. 134 REAL(wp) :: theta_int_h_set !< [degree_C] Max. Setpoint temperature (winter) 135 REAL(wp) :: theta_int_c_set !< [degree_C] Max. Setpoint temperature (summer) 136 REAL(wp) :: phi_h_max !< [W] Max. Heating capacity (negative) 137 REAL(wp) :: phi_c_max !< [W] Max. Cooling capacity (negative) 138 REAL(wp) :: qint_high !< [W/m2] internal heat gains, option Database qint_0-23 139 REAL(wp) :: qint_low !< [W/m2] internal heat gains, option Database qint_0-23 140 REAL(wp) :: height_storey !< [m] storey heigth 141 REAL(wp) :: height_cei_con !< [m] ceiling construction heigth 109 142 110 143 REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in !< mean building indoor temperature, height dependent … … 113 146 REAL(wp), DIMENSION(:), ALLOCATABLE :: vol_frac !< fraction of local on total building volume, height dependent 114 147 REAL(wp), DIMENSION(:), ALLOCATABLE :: vpf !< building volume volume per facade element, height dependent 115 148 116 149 END TYPE build 117 150 … … 130 163 !-- Declare all global variables within the module 131 164 132 INTEGER(iwp) :: building_type = 1 !< namelist parameter with165 ! INTEGER(iwp) :: building_type = 1 !< namelist parameter with 133 166 !< X1=construction year (cy) 1950, X2=cy 2000, X3=cy 2050 134 167 !< R=Residental building, O=Office, RW=Enlarged Windows, P=Panel type (Plattenbau) WBS 70, H=Hospital (in progress), I=Industrial halls (in progress), S=Special Building (in progress) … … 139 172 INTEGER(iwp) :: solar_protection_on !< Solar protection on 140 173 141 REAL(wp) :: air_change_high !< [1/h] air changes per time_utc_hour 142 REAL(wp) :: air_change_low !< [1/h] air changes per time_utc_hour 143 REAL(wp) :: eff_mass_area !< [m²] the effective mass-related area 144 REAL(wp) :: floor_area_per_facade !< [m²] net floor area (Sum of all floors) 145 REAL(wp) :: total_area !<! [m²] area of all surfaces pointing to zone 174 REAL(wp) :: eff_mass_area !< [m2] the effective mass-related area 175 REAL(wp) :: floor_area_per_facade !< [m2] net floor area (Sum of all floors) 176 REAL(wp) :: total_area !<! [m2] area of all surfaces pointing to zone 146 177 REAL(wp) :: window_area_per_facade !< [m2] window area per facade element 147 178 REAL(wp) :: air_change !< [1/h] Airflow 148 REAL(wp) :: bldg_part_surf_i = 4 !< [m²_surf,i] part building surface, from Palm, das mÃŒsste mittlerweile "facade_element_area" sein! 149 REAL(wp) :: facade_element_area !< [m²_facade] building surface facade 150 REAL(wp) :: indoor_volume_per_facade !< [m³] indoor air volume per facade element 179 REAL(wp) :: facade_element_area !< [m2_facade] building surface facade 180 REAL(wp) :: indoor_volume_per_facade !< [m3] indoor air volume per facade element 151 181 REAL(wp) :: c_m !< [J/K] internal heat storage capacity 152 182 REAL(wp) :: dt_indoor = 3600.0_wp !< [s] namelist parameter: time interval for indoor-model application 153 REAL(wp) :: eta_ve !< [-] heat recovery efficiency154 REAL(wp) :: f_c_win !< [-] shading factor155 REAL(wp) :: factor_a !< [-] Dynamic parameters specific effective surface according to Table 12; 2.5 (very light, light and medium), 3.0 (heavy), 3.5 (very heavy)156 REAL(wp) :: factor_c !< [J/(m2 K)] Dynamic parameters inner heatstorage according to Table 12; 80000 (very light), 110000 (light), 165000 (medium), 260000 (heavy), 370000 (very heavy)157 REAL(wp) :: g_value_win !< [-] SHGC factor158 183 REAL(wp) :: h_tr_1 !<! [W/K] Heat transfer coefficient auxiliary variable 1 159 184 REAL(wp) :: h_tr_2 !<! [W/K] Heat transfer coefficient auxiliary variable 2 … … 165 190 REAL(wp) :: h_tr_w !<! [W/K] heat transfer coefficient of doors, windows, curtain walls and glazed walls (assumption: thermal mass=0) 166 191 REAL(wp) :: h_ve !<! [W/K] heat transfer of ventilation 167 REAL(wp) :: height_storey !< [m] storey heigth168 REAL(wp) :: height_cei_con !< [m] ceiling construction heigth169 192 REAL(wp) :: initial_indoor_temperature !< namelist parameter 170 REAL(wp) :: lambda_at !< [-] ratio internal surface/floor area chap. 7.2.2.2.171 REAL(wp) :: lambda_layer3 !< [W/(m*K)] Thermal conductivity of the inner layer172 193 REAL(wp) :: net_sw_in !< net short-wave radiation (in - out; was i_global --> CORRECT?) 173 REAL(wp) :: qint_high !< [W/m2] internal heat gains, option Database qint_0-23174 REAL(wp) :: qint_low !< [W/m2] internal heat gains, option Database qint_0-23175 REAL(wp) :: phi_c_max !< [W] Max. Cooling capacity (negative)176 REAL(wp) :: phi_h_max !< [W] Max. Heating capacity (negative)177 194 REAL(wp) :: phi_hc_nd !<! [W] heating demand and/or cooling demand 178 195 REAL(wp) :: phi_hc_nd_10 !<! [W] heating demand and/or cooling demand for heating or cooling … … 185 202 REAL(wp) :: phi_st !<! [W] mass specific thermal load implied non thermal mass 186 203 REAL(wp) :: q_emission !< emissions, in first version = 0, option for second part of the project 187 REAL(wp) :: q_wall_win !< heat flux from indoor into wall/window204 REAL(wp) :: q_wall_win !< heat flux from indoor into wall/window 188 205 REAL(wp) :: q_waste_heat !< waste heat, sum of waste heat over the roof to Palm 189 206 REAL(wp) :: q_waste_heat_bldg !< [W/building] waste heat of the complete building, in Palm sum of all indoor_model-calculations 190 REAL(wp) :: s_layer3 !< [m] half thickness of the inner layer (layer_3)191 207 REAL(wp) :: schedule_d !< activation for internal loads (low or high + low) 192 208 REAL(wp) :: skip_time_do_indoor = 0.0_wp !< [s] Indoor model is not called before this time 193 209 REAL(wp) :: theta_air !<! [degree_C] air temperature of the RC-node 194 210 REAL(wp) :: theta_air_0 !<! [degree_C] air temperature of the RC-node in equilibrium 195 REAL(wp) :: theta_air_10 !<! [degree_C] air temperature of the RC-node from a heating capacity of 10 W/m ²211 REAL(wp) :: theta_air_10 !<! [degree_C] air temperature of the RC-node from a heating capacity of 10 W/m2 196 212 REAL(wp) :: theta_air_ac !< [degree_C] actual room temperature after heating/cooling 197 213 REAL(wp) :: theta_air_set !< [degree_C] Setpoint_temperature for the room 198 REAL(wp) :: theta_int_c_set !< [degree_C] Max. Setpoint temperature (summer)199 REAL(wp) :: theta_int_h_set !< [degree_C] Max. Setpoint temperature (winter)200 214 REAL(wp) :: theta_m !<! [degree_C} inner temperature of the RC-node 201 215 REAL(wp) :: theta_m_t !<! [degree_C] (Fictive) component temperature timestep … … 205 219 REAL(wp) :: time_indoor = 0.0_wp !< [s] time since last call of indoor model 206 220 REAL(wp) :: time_utc_hour !< Time in hours per day (UTC) 207 REAL(wp) :: u_value_win !< [W/(m2*K)] transmittance208 221 REAL(wp) :: ventilation_int_loads !< Zuteilung der GebÀude fÃŒr Verlauf/AktivitÀt der LÃŒftung und internen Lasten 209 210 ! 211 !-- Declare all global parameters within the module 222 223 REAL(wp) :: f_sr !< [-] factor surface reduction 224 REAL(wp) :: f_cei !< [-] ceiling reduction factor 225 REAL(wp) :: ngs !< [m2] netto ground surface 226 REAL(wp) :: building_height 227 212 228 REAL(wp), PARAMETER :: params_f_f = 0.3_wp !< [-] frame ratio chap. 8.3.2.1.1 for buildings with mostly cooling 2.0_wp 213 229 REAL(wp), PARAMETER :: params_f_w = 0.9_wp !< [-] correction factor (fuer nicht senkrechten Stahlungseinfall DIN 4108-2 chap.8, (hier konstant, keine WinkelabhÀngigkeit) … … 218 234 REAL(wp), PARAMETER :: h_is = 3.45_wp !< [W/(m^2 K)] h_is = 3.45 between surface and air (chap. 7.2.2.2) 219 235 REAL(wp), PARAMETER :: h_ms = 9.1_wp !< [W/K] h_ms = 9.10 W / (m2 K) between component and surface (chap. 12.2.2) 220 236 237 238 221 239 SAVE 222 240 … … 226 244 ! 227 245 !-- Add INTERFACES that must be available to other modules 228 PUBLIC im_init, im_main_heatcool, im_parin 246 PUBLIC im_init, im_main_heatcool, im_parin, im_define_netcdf_grid, & 247 im_check_data_output, im_data_output_3d, im_check_parameters 248 229 249 230 250 ! … … 232 252 PUBLIC dt_indoor, skip_time_do_indoor, time_indoor 233 253 254 ! 255 !-- PALM interfaces: 256 !-- Data output checks for 2D/3D data to be done in check_parameters 257 INTERFACE im_check_data_output 258 MODULE PROCEDURE im_check_data_output 259 END INTERFACE im_check_data_output 260 ! 261 !-- Input parameter checks to be done in check_parameters 262 INTERFACE im_check_parameters 263 MODULE PROCEDURE im_check_parameters 264 END INTERFACE im_check_parameters 265 ! 266 !-- Data output of 3D data 267 INTERFACE im_data_output_3d 268 MODULE PROCEDURE im_data_output_3d 269 END INTERFACE im_data_output_3d 270 271 ! 272 !-- Definition of data output quantities 273 INTERFACE im_define_netcdf_grid 274 MODULE PROCEDURE im_define_netcdf_grid 275 END INTERFACE im_define_netcdf_grid 276 ! 277 ! ! 278 ! !-- Output of information to the header file 279 ! INTERFACE im_header 280 ! MODULE PROCEDURE im_header 281 ! END INTERFACE im_header 282 283 !-- Data Output 284 ! INTERFACE im_data_output 285 ! MODULE PROCEDURE im_data_output 286 ! END INTERFACE im_data_output 234 287 ! 235 288 !-- Calculations for indoor temperatures … … 242 295 MODULE PROCEDURE im_init 243 296 END INTERFACE im_init 244 245 297 ! 246 298 !-- Main part of indoor model … … 268 320 USE arrays_3d, & 269 321 ONLY: pt 270 271 322 323 272 324 IMPLICIT NONE 273 325 … … 280 332 REAL(wp) :: near_facade_temperature 281 333 REAL(wp) :: phi_hc_nd_dummy 334 282 335 283 336 !< Calculation of total mass specific thermal load (internal and external) … … 292 345 !< Calculation of component temperature at factual timestep 293 346 theta_m_t = ( ( theta_m_t_prev & 294 * ( ( c_m / 3600 ) - 0.5* ( h_tr_3 + h_tr_em ) ) + phi_mtot &347 * ( ( c_m / 3600.0_wp ) - 0.5_wp * ( h_tr_3 + h_tr_em ) ) + phi_mtot & 295 348 ) & 296 / ( ( c_m / 3600 ) + 0.5* ( h_tr_3 + h_tr_em ) ) &349 / ( ( c_m / 3600.0_wp ) + 0.5_wp * ( h_tr_3 + h_tr_em ) ) & 297 350 ) !< [degree_C] Eq. (C.4) 298 351 299 352 !< Calculation of mean inner temperature for the RC-node in actual timestep 300 theta_m = ( theta_m_t + theta_m_t_prev ) * 0.5 !< [degree_C] Eq. (C.9)353 theta_m = ( theta_m_t + theta_m_t_prev ) * 0.5_wp !< [degree_C] Eq. (C.9) 301 354 302 355 !< Calculation of mean surface temperature of the RC-node in actual timestep … … 343 396 ONLY: dx, dy 344 397 345 USE netcdf_data_input_mod, &346 ONLY: building_id_f347 348 398 USE pegrid 349 399 … … 356 406 IMPLICIT NONE 357 407 408 INTEGER(iwp) :: bt !< local building type 358 409 INTEGER(iwp) :: fa !< running index for facade elements of each building 359 410 INTEGER(iwp) :: i !< running index along x-direction … … 384 435 INTEGER(iwp), DIMENSION(0:numprocs-1) :: num_buildings !< number of buildings with different ID on entire model domain 385 436 INTEGER(iwp), DIMENSION(0:numprocs-1) :: num_buildings_l !< number of buildings with different ID on local subdomain 386 437 387 438 REAL(wp), DIMENSION(:), ALLOCATABLE :: local_weight !< dummy representing fraction of local on total building volume, 388 439 !< height dependent … … 503 554 !-- the respective building is present (in order to reduce memory demands). 504 555 ALLOCATE( buildings(1:num_build) ) 556 505 557 ! 506 558 !-- Store building IDs and check if building with certain ID is present on … … 792 844 793 845 ! 794 !-- Building parameters by type of building. Assigned in urban_surface_mod.f90 795 796 lambda_layer3 = building_pars(63, building_type) 797 s_layer3 = building_pars(57, building_type) 798 f_c_win = building_pars(119, building_type) 799 g_value_win = building_pars(120, building_type) 800 u_value_win = building_pars(121, building_type) 801 air_change_low = building_pars(122, building_type) 802 air_change_high = building_pars(123, building_type) 803 eta_ve = building_pars(124, building_type) 804 factor_a = building_pars(125, building_type) 805 factor_c = building_pars(126, building_type) 806 lambda_at = building_pars(127, building_type) 807 theta_int_h_set = building_pars(118, building_type) 808 theta_int_c_set = building_pars(117, building_type) 809 phi_h_max = building_pars(128, building_type) 810 phi_c_max = building_pars(129, building_type) 811 qint_high = building_pars(130, building_type) 812 qint_low = building_pars(131, building_type) 813 height_storey = building_pars(132, building_type) 814 height_cei_con = building_pars(133, building_type) 815 816 ! 817 !-- Setting of initial room temperature [K] 846 !-- Initialize building parameters, first by mean building type. Note, 847 !-- in this case all buildings have the same type. 848 !-- In a second step initialize with building tpyes from static input file, 849 !-- where building types can be individual for each building. 850 buildings(:)%lambda_layer3 = building_pars(63,building_type) 851 buildings(:)%s_layer3 = building_pars(57,building_type) 852 buildings(:)%f_c_win = building_pars(119,building_type) 853 buildings(:)%g_value_win = building_pars(120,building_type) 854 buildings(:)%u_value_win = building_pars(121,building_type) 855 buildings(:)%air_change_low = building_pars(122,building_type) 856 buildings(:)%air_change_high = building_pars(123,building_type) 857 buildings(:)%eta_ve = building_pars(124,building_type) 858 buildings(:)%factor_a = building_pars(125,building_type) 859 buildings(:)%factor_c = building_pars(126,building_type) 860 buildings(:)%lambda_at = building_pars(127,building_type) 861 buildings(:)%theta_int_h_set = building_pars(118,building_type) 862 buildings(:)%theta_int_c_set = building_pars(117,building_type) 863 buildings(:)%phi_h_max = building_pars(128,building_type) 864 buildings(:)%phi_c_max = building_pars(129,building_type) 865 buildings(:)%qint_high = building_pars(130,building_type) 866 buildings(:)%qint_low = building_pars(131,building_type) 867 buildings(:)%height_storey = building_pars(132,building_type) 868 buildings(:)%height_cei_con = building_pars(133,building_type) 869 ! 870 !-- Initialize ventilaation load. Please note, building types > 7 are actually 871 !-- not allowed (check already in urban_surface_mod and netcdf_data_input_mod. 872 !-- However, the building data base may be later extended. 873 IF ( building_type == 1 .OR. building_type == 2 .OR. & 874 building_type == 3 .OR. building_type == 10 .OR. & 875 building_type == 11 .OR. building_type == 12 ) THEN 876 buildings(nb)%ventilation_int_loads = 1 877 ! 878 !-- Office, building with large windows 879 ELSEIF ( building_type == 4 .OR. building_type == 5 .OR. & 880 building_type == 6 .OR. building_type == 7 .OR. & 881 building_type == 8 .OR. building_type == 9) THEN 882 buildings(nb)%ventilation_int_loads = 2 883 ! 884 !-- Industry, hospitals 885 ELSEIF ( building_type == 13 .OR. building_type == 14 .OR. & 886 building_type == 15 .OR. building_type == 16 .OR. & 887 building_type == 17 .OR. building_type == 18 ) THEN 888 buildings(nb)%ventilation_int_loads = 3 889 ENDIF 890 ! 891 !-- Initialization of building parameters - level 2 892 IF ( building_type_f%from_file ) THEN 893 DO i = nxl, nxr 894 DO j = nys, nyn 895 IF ( building_id_f%var(j,i) /= building_id_f%fill ) THEN 896 nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), & 897 DIM = 1 ) 898 bt = building_type_f%var(j,i) 899 900 buildings(nb)%lambda_layer3 = building_pars(63,bt) 901 buildings(nb)%s_layer3 = building_pars(57,bt) 902 buildings(nb)%f_c_win = building_pars(119,bt) 903 buildings(nb)%g_value_win = building_pars(120,bt) 904 buildings(nb)%u_value_win = building_pars(121,bt) 905 buildings(nb)%air_change_low = building_pars(122,bt) 906 buildings(nb)%air_change_high = building_pars(123,bt) 907 buildings(nb)%eta_ve = building_pars(124,bt) 908 buildings(nb)%factor_a = building_pars(125,bt) 909 buildings(nb)%factor_c = building_pars(126,bt) 910 buildings(nb)%lambda_at = building_pars(127,bt) 911 buildings(nb)%theta_int_h_set = building_pars(118,bt) 912 buildings(nb)%theta_int_c_set = building_pars(117,bt) 913 buildings(nb)%phi_h_max = building_pars(128,bt) 914 buildings(nb)%phi_c_max = building_pars(129,bt) 915 buildings(nb)%qint_high = building_pars(130,bt) 916 buildings(nb)%qint_low = building_pars(131,bt) 917 buildings(nb)%height_storey = building_pars(132,bt) 918 buildings(nb)%height_cei_con = building_pars(133,bt) 919 ! 920 !-- Initialize ventilaation load. Please note, building types > 7 921 !-- are actually not allowed (check already in urban_surface_mod 922 !-- and netcdf_data_input_mod. However, the building data base may 923 !-- be later extended. 924 IF ( bt == 1 .OR. bt == 2 .OR. & 925 bt == 3 .OR. bt == 10 .OR. & 926 bt == 11 .OR. bt == 12 ) THEN 927 buildings(nb)%ventilation_int_loads = 1 928 ! 929 !-- Office, building with large windows 930 ELSEIF ( bt == 4 .OR. bt == 5 .OR. & 931 bt == 6 .OR. bt == 7 .OR. & 932 bt == 8 .OR. bt == 9) THEN 933 buildings(nb)%ventilation_int_loads = 2 934 ! 935 !-- Industry, hospitals 936 ELSEIF ( bt == 13 .OR. bt == 14 .OR. & 937 bt == 15 .OR. bt == 16 .OR. & 938 bt == 17 .OR. bt == 18 ) THEN 939 buildings(nb)%ventilation_int_loads = 3 940 ENDIF 941 ENDIF 942 ENDDO 943 ENDDO 944 ENDIF 945 ! 946 !-- Initial room temperature [K] 818 947 !-- (after first loop, use theta_m_t as theta_m_t_prev) 819 948 theta_m_t_prev = initial_indoor_temperature 949 ! 950 !-- Initialize indoor temperature. Actually only for output at initial state. 951 DO nb = 1, num_build 952 buildings(nb)%t_in(:) = initial_indoor_temperature 953 ENDDO 820 954 821 955 CALL location_message( 'finished', .TRUE. ) … … 874 1008 REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in_l_send !< dummy send buffer used for summing-up indoor temperature per kk-level 875 1009 REAL(wp), DIMENSION(:), ALLOCATABLE :: t_in_recv !< dummy recv buffer used for summing-up indoor temperature per kk-level 876 877 ! 878 !-- Daily schedule, here for 08:00-18:00 = 1, other hours = 0. 879 !-- time_utc_hour is calculated here based on time_utc [s] from 880 !-- date_and_time_mod. 881 !-- (kanani: Does this schedule not depend on if it's an office or resident 882 !-- building?) 1010 ! 1011 !-- Determine time of day in hours. 883 1012 time_utc_hour = time_utc / 3600.0_wp 884 885 !886 !-- Allocation of the load profiles to the building types887 !-- Residental Building, panel WBS 70888 if (building_type == 1 .OR. &889 building_type == 2 .OR. &890 building_type == 3 .OR. &891 building_type == 10 .OR. &892 building_type == 11 .OR. &893 building_type == 12) then894 ventilation_int_loads = 1895 !-- Office, building with large windows896 else if (building_type == 4 .OR. &897 building_type == 5 .OR. &898 building_type == 6 .OR. &899 building_type == 7 .OR. &900 building_type == 8 .OR. &901 building_type == 9) then902 ventilation_int_loads = 2903 !-- Industry, hospitals904 else if (building_type == 13 .OR. &905 building_type == 14 .OR. &906 building_type == 15 .OR. &907 building_type == 16 .OR. &908 building_type == 17 .OR. &909 building_type == 18) then910 ventilation_int_loads = 3911 912 end if913 914 !-- Residental Building, panel WBS 70915 916 if (ventilation_int_loads == 1) THEN917 if ( time_utc_hour >= 6.0_wp .AND. time_utc_hour <= 8.0_wp ) THEN918 schedule_d = 1919 else if ( time_utc_hour >= 18.0_wp .AND. time_utc_hour <= 23.0_wp ) THEN920 schedule_d = 1921 else922 schedule_d = 0923 end if924 end if925 926 !-- Office, building with large windows927 928 if (ventilation_int_loads == 2) THEN929 if ( time_utc_hour >= 8.0_wp .AND. time_utc_hour <= 18.0_wp ) THEN930 schedule_d = 1931 else932 schedule_d = 0933 end if934 end if935 936 !-- Industry, hospitals937 if (ventilation_int_loads == 3) THEN938 if ( time_utc_hour >= 6.0_wp .AND. time_utc_hour <= 22.0_wp ) THEN939 schedule_d = 1940 else941 schedule_d = 0942 end if943 end if944 945 946 1013 ! 947 1014 !-- Following calculations must be done for each facade element. … … 951 1018 IF ( buildings(nb)%on_pe ) THEN 952 1019 ! 1020 !-- Determine daily schedule. 08:00-18:00 = 1, other hours = 0. 1021 !-- Residental Building, panel WBS 70 1022 IF ( buildings(nb)%ventilation_int_loads == 1 ) THEN 1023 IF ( time_utc_hour >= 6.0_wp .AND. time_utc_hour <= 8.0_wp ) THEN 1024 schedule_d = 1 1025 ELSEIF ( time_utc_hour >= 18.0_wp .AND. time_utc_hour <= 23.0_wp ) THEN 1026 schedule_d = 1 1027 ELSE 1028 schedule_d = 0 1029 ENDIF 1030 ENDIF 1031 ! 1032 !-- Office, building with large windows 1033 IF ( buildings(nb)%ventilation_int_loads == 2 ) THEN 1034 IF ( time_utc_hour >= 8.0_wp .AND. time_utc_hour <= 18.0_wp ) THEN 1035 schedule_d = 1 1036 ELSE 1037 schedule_d = 0 1038 ENDIF 1039 ENDIF 1040 ! 1041 !-- Industry, hospitals 1042 IF ( buildings(nb)%ventilation_int_loads == 3 ) THEN 1043 IF ( time_utc_hour >= 6.0_wp .AND. time_utc_hour <= 22.0_wp ) THEN 1044 schedule_d = 1 1045 ELSE 1046 schedule_d = 0 1047 ENDIF 1048 ENDIF 1049 ! 953 1050 !-- Initialize/reset indoor temperature 954 buildings(nb)%t_in = 0.0_wp955 1051 buildings(nb)%t_in_l = 0.0_wp 956 1052 ! … … 970 1066 indoor_volume_per_facade = buildings(nb)%vpf(kk) !< [m3] indoor air volume per facade element 971 1067 window_area_per_facade = surf_usm_h%frac(ind_wat_win,m) * facade_element_area !< [m2] window area per facade element 972 eff_mass_area = factor_a * floor_area_per_facade !< [m2] standard values according to Table 12 section 12.3.1.2 (calculate over Eq. (65) according to section 12.3.1.2) 973 c_m = factor_c * floor_area_per_facade !< [J/K] standard values according to table 12 section 12.3.1.2 (calculate over Eq. (66) according to section 12.3.1.2) 974 total_area = lambda_at * floor_area_per_facade !< [m2] area of all surfaces pointing to zone Eq. (9) according to section 7.2.2.2 1068 1069 ! building_height = buildings(nb)%num_facades_per_building_v_l * 0.1 * dzw(kk) 1070 building_height = buildings(nb)%kb_max * dzw(kk) 1071 1072 ! print*, "building_height", building_height 1073 ! print*, "num_facades_v_l", buildings(nb)%num_facades_per_building_v_l 1074 ! print*, "num_facades_v", buildings(nb)%num_facades_per_building_v 1075 ! print*, "kb_min_max", buildings(nb)%kb_min, buildings(nb)%kb_max 1076 ! print*, "dzw kk", dzw(kk), kk 1077 1078 f_cei = building_height/(buildings(nb)%height_storey-buildings(nb)%height_cei_con) !< [-] factor for ceiling redcution 1079 ngs = buildings(nb)%vpf(kk)/f_cei !< [m2] calculation of netto ground surface 1080 f_sr = ngs/floor_area_per_facade !< [-] factor for surface reduction 1081 eff_mass_area = buildings(nb)%factor_a * ngs !< [m2] standard values according to Table 12 section 12.3.1.2 (calculate over Eq. (65) according to section 12.3.1.2) 1082 c_m = buildings(nb)%factor_c * ngs !< [J/K] standard values according to table 12 section 12.3.1.2 (calculate over Eq. (66) according to section 12.3.1.2) 1083 total_area = buildings(nb)%lambda_at * floor_area_per_facade !< [m2] area of all surfaces pointing to zone Eq. (9) according to section 7.2.2.2 975 1084 976 1085 !-- Calculation of heat transfer coefficient for transmission --> not time-dependent 977 h_tr_w = window_area_per_facade * u_value_win !< [W/K] only for windows1086 h_tr_w = window_area_per_facade * buildings(nb)%u_value_win !< [W/K] only for windows 978 1087 h_tr_is = total_area * h_is !< [W/K] with h_is = 3.45 W / (m2 K) between surface and air, Eq. (9) 979 1088 h_tr_ms = eff_mass_area * h_ms !< [W/K] with h_ms = 9.10 W / (m2 K) between component and surface, Eq. (64) 980 h_tr_op = 1 / ( 1/ ( ( facade_element_area - window_area_per_facade ) &981 * lambda_layer3 / s_layer3 * 0.5 ) + 1/ h_tr_ms )982 h_tr_em = 1 / ( 1 / h_tr_op - 1/ h_tr_ms ) !< [W/K] Eq. (63), Section 12.2.21089 h_tr_op = 1.0_wp / ( 1.0_wp / ( ( facade_element_area - window_area_per_facade ) & 1090 * buildings(nb)%lambda_layer3 / buildings(nb)%s_layer3 * 0.5_wp ) + 1.0_wp / h_tr_ms ) 1091 h_tr_em = 1.0_wp / ( 1.0_wp / h_tr_op - 1.0_wp / h_tr_ms ) !< [W/K] Eq. (63), Section 12.2.2 983 1092 ! 984 1093 !-- internal air loads dependent on the occupacy of the room 985 1094 !-- basical internal heat gains (qint_low) with additional internal heat gains by occupancy (qint_high) (0,5*phi_int) 986 phi_ia = 0.5 * ( ( qint_high * schedule_d +qint_low ) &987 * floor_area_per_facade) !< [W] Eq. (C.1)1095 phi_ia = 0.5_wp * ( ( buildings(nb)%qint_high * schedule_d + buildings(nb)%qint_low ) & 1096 * ngs ) !< [W] Eq. (C.1) 988 1097 ! 989 1098 !-- Airflow dependent on the occupacy of the room 990 1099 !-- basical airflow (air_change_low) with additional airflow gains by occupancy (air_change_high) 991 air_change = ( air_change_high * schedule_d +air_change_low ) !< [1/h]?1100 air_change = ( buildings(nb)%air_change_high * schedule_d + buildings(nb)%air_change_low ) !< [1/h]? 992 1101 ! 993 1102 !-- Heat transfer of ventilation … … 995 1104 !-- with heat capacity of air 0.33 Wh/m2K 996 1105 h_ve = MAX( 0.01_wp , ( air_change * indoor_volume_per_facade * & 997 0.33_wp * (1 -eta_ve ) ) ) !< [W/K] from ISO 13789 Eq.(10)1106 0.33_wp * (1.0_wp - buildings(nb)%eta_ve ) ) ) !< [W/K] from ISO 13789 Eq.(10) 998 1107 999 1108 !-- Heat transfer coefficient auxiliary variables 1000 h_tr_1 = 1 / ( ( 1 / h_ve ) + ( 1/ h_tr_is ) ) !< [W/K] Eq. (C.6)1109 h_tr_1 = 1.0_wp / ( ( 1.0_wp / h_ve ) + ( 1.0_wp / h_tr_is ) ) !< [W/K] Eq. (C.6) 1001 1110 h_tr_2 = h_tr_1 + h_tr_w !< [W/K] Eq. (C.7) 1002 h_tr_3 = 1 / ( ( 1 / h_tr_2 ) + ( 1/ h_tr_ms ) ) !< [W/K] Eq. (C.8)1111 h_tr_3 = 1.0_wp / ( ( 1.0_wp / h_tr_2 ) + ( 1.0_wp / h_tr_ms ) ) !< [W/K] Eq. (C.8) 1003 1112 ! 1004 1113 !-- Net short-wave radiation through window area (was i_global) … … 1028 1137 !-- DIN 4108 - 2 chap.8 1029 1138 phi_sol = ( window_area_per_facade * net_sw_in * solar_protection_off & 1030 + window_area_per_facade * net_sw_in * f_c_win * solar_protection_on ) &1031 * g_value_win * ( 1- params_f_f ) * params_f_w !< [W]1139 + window_area_per_facade * net_sw_in * buildings(nb)%f_c_win * solar_protection_on ) & 1140 * buildings(nb)%g_value_win * ( 1.0_wp - params_f_f ) * params_f_w !< [W] 1032 1141 ! 1033 1142 !-- Calculation of the mass specific thermal load for internal and external heatsources of the inner node … … 1035 1144 ! 1036 1145 !-- Calculation mass specific thermal load implied non thermal mass 1037 phi_st = ( 1 - ( eff_mass_area / total_area ) - ( h_tr_w / ( 9.1* total_area ) ) ) &1146 phi_st = ( 1.0_wp - ( eff_mass_area / total_area ) - ( h_tr_w / ( 9.1_wp * total_area ) ) ) & 1038 1147 * ( phi_ia + phi_sol ) !< [W] Eq. (C.3) with phi_ia=0,5*phi_int 1039 1148 ! … … 1041 1150 !-- Step 1: Indoor temperature without heating and cooling 1042 1151 !-- section C.4.1 Picture C.2 zone 3) 1043 phi_hc_nd = 0 1152 phi_hc_nd = 0.0_wp 1044 1153 1045 1154 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & … … 1047 1156 ! 1048 1157 !-- If air temperature between border temperatures of heating and cooling, assign output variable, then ready 1049 IF ( theta_int_h_set <= theta_air .AND. theta_air <=theta_int_c_set ) THEN1050 phi_hc_nd_ac = 0 1158 IF ( buildings(nb)%theta_int_h_set <= theta_air .AND. theta_air <= buildings(nb)%theta_int_c_set ) THEN 1159 phi_hc_nd_ac = 0.0_wp 1051 1160 phi_hc_nd = phi_hc_nd_ac 1052 1161 theta_air_ac = theta_air 1053 1162 ! 1054 !-- Step 2: Else, apply 10 W/m ²heating/cooling power and calculate indoor temperature1163 !-- Step 2: Else, apply 10 W/m2 heating/cooling power and calculate indoor temperature 1055 1164 !-- again. 1056 1165 ELSE … … 1060 1169 1061 1170 !-- Heating or cooling? 1062 IF ( theta_air > theta_int_c_set ) THEN1063 theta_air_set = theta_int_c_set1171 IF ( theta_air > buildings(nb)%theta_int_c_set ) THEN 1172 theta_air_set = buildings(nb)%theta_int_c_set 1064 1173 ELSE 1065 theta_air_set = theta_int_h_set1174 theta_air_set = buildings(nb)%theta_int_h_set 1066 1175 ENDIF 1067 1176 … … 1079 1188 / (theta_air_10 - theta_air_0) !< Eq. (C.13) 1080 1189 1081 1082 1083 1190 !-- Step 3: With temperature ratio to determine the heating or cooling capacity 1084 1191 !-- If necessary, limit the power to maximum power 1085 1192 !-- section C.4.1 Picture C.2 zone 2) and 4) 1086 IF ( phi_c_max < phi_hc_nd_un .AND. phi_hc_nd_un <phi_h_max ) THEN1193 IF ( buildings(nb)%phi_c_max < phi_hc_nd_un .AND. phi_hc_nd_un < buildings(nb)%phi_h_max ) THEN 1087 1194 phi_hc_nd_ac = phi_hc_nd_un 1088 1195 phi_hc_nd = phi_hc_nd_un … … 1090 1197 !-- Step 4: Inner temperature with maximum heating (phi_hc_nd_un positive) or cooling (phi_hc_nd_un negative) 1091 1198 !-- section C.4.1 Picture C.2 zone 1) and 5) 1092 IF ( phi_hc_nd_un > 0 ) THEN1093 phi_hc_nd_ac = phi_h_max !< Limit heating1199 IF ( phi_hc_nd_un > 0.0_wp ) THEN 1200 phi_hc_nd_ac = buildings(nb)%phi_h_max !< Limit heating 1094 1201 ELSE 1095 phi_hc_nd_ac = phi_c_max !< Limit cooling1202 phi_hc_nd_ac = buildings(nb)%phi_c_max !< Limit cooling 1096 1203 ENDIF 1097 1204 ENDIF … … 1112 1219 !-- Calculate the operating temperature with weighted mean temperature of air and mean solar temperature 1113 1220 !-- Will be used for thermal comfort calculations 1114 theta_op = 0.3 * theta_air_ac + 0.7* theta_s !< [degree_C] operative Temperature Eq. (C.12)1221 theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s !< [degree_C] operative Temperature Eq. (C.12) 1115 1222 ! 1116 1223 !-- Heat flux into the wall. Value needed in urban_surface_mod to … … 1132 1239 !-- Calculation of waste heat 1133 1240 !-- Anthropogenic heat output 1134 IF ( phi_hc_nd_ac > 0) THEN1135 1136 1137 1138 1139 1140 1141 1142 q_waste_heat = (phi_hc_nd * (params_waste_heat_h * heating_on + params_waste_heat_c * cooling_on)) !< [W/m2] anthropogenic heat output1143 ! surf_usm_h%shf(m)=q_waste_heat1241 IF ( phi_hc_nd_ac > 0.0_wp ) THEN 1242 heating_on = 1 1243 cooling_on = 0 1244 ELSE 1245 heating_on = 0 1246 cooling_on = 1 1247 ENDIF 1248 1249 q_waste_heat = (phi_hc_nd * (params_waste_heat_h * heating_on + params_waste_heat_c * cooling_on))!< [W/GebÀudemodell] , observe the directional convention in PALM! 1250 surf_usm_h%waste_heat(m) = q_waste_heat 1144 1251 1145 1252 ENDDO !< Horizontal surfaces loop … … 1156 1263 kk = surf_usm_v(l)%k(m) + surf_usm_v(l)%koff 1157 1264 ! 1265 !-- (SOME OF THE FOLLOWING (not time-dependent COULD PROBABLY GO INTO A FUNCTION 1266 !-- EXCEPT facade_element_area, EVERYTHING IS CALCULATED EQUALLY) 1158 1267 !-- Building geometries --> not time-dependent 1159 1268 IF ( l == 0 .OR. l == 1 ) facade_element_area = dx * dzw(kk) !< [m2] surface area per facade element … … 1162 1271 indoor_volume_per_facade = buildings(nb)%vpf(kk) !< [m3] indoor air volume per facade element 1163 1272 window_area_per_facade = surf_usm_v(l)%frac(ind_wat_win,m) * facade_element_area !< [m2] window area per facade element 1164 eff_mass_area = factor_a * floor_area_per_facade !< [m2] standard values according to Table 12 section 12.3.1.2 (calculate over Eq. (65) according to section 12.3.1.2) 1165 c_m = factor_c * floor_area_per_facade !< [J/K] standard values according to table 12 section 12.3.1.2 (calculate over Eq. (66) according to section 12.3.1.2) 1166 total_area = lambda_at * floor_area_per_facade !< [m2] area of all surfaces pointing to zone Eq. (9) according to section 7.2.2.2 1273 1274 building_height = buildings(nb)%kb_max * dzw(kk) 1275 f_cei = building_height/(buildings(nb)%height_storey-buildings(nb)%height_cei_con) !< [-] factor for ceiling redcution 1276 ngs = buildings(nb)%vpf(kk)/f_cei !< [m2] calculation of netto ground surface 1277 f_sr = ngs/floor_area_per_facade !< [-] factor for surface reduction 1278 eff_mass_area = buildings(nb)%factor_a * ngs !< [m2] standard values according to Table 12 section 12.3.1.2 (calculate over Eq. (65) according to section 12.3.1.2) 1279 c_m = buildings(nb)%factor_c * ngs !< [J/K] standard values according to table 12 section 12.3.1.2 (calculate over Eq. (66) according to section 12.3.1.2) 1280 total_area = buildings(nb)%lambda_at * floor_area_per_facade !< [m2] area of all surfaces pointing to zone Eq. (9) according to section 7.2.2.2 1167 1281 ! 1168 1282 !-- Calculation of heat transfer coefficient for transmission --> not time-dependent 1169 h_tr_w = window_area_per_facade * u_value_win !< [W/K] only for windows1283 h_tr_w = window_area_per_facade * buildings(nb)%u_value_win !< [W/K] only for windows 1170 1284 h_tr_is = total_area * h_is !< [W/K] with h_is = 3.45 W / (m2 K) between surface and air, Eq. (9) 1171 1285 h_tr_ms = eff_mass_area * h_ms !< [W/K] with h_ms = 9.10 W / (m2 K) between component and surface, Eq. (64) 1172 h_tr_op = 1 / ( 1/ ( ( facade_element_area - window_area_per_facade ) &1173 * lambda_layer3 / s_layer3 * 0.5 ) + 1/ h_tr_ms )1174 h_tr_em = 1 / ( 1 / h_tr_op - 1/ h_tr_ms ) !< [W/K] Eq. (63), Section 12.2.21286 h_tr_op = 1.0_wp / ( 1.0_wp / ( ( facade_element_area - window_area_per_facade ) & 1287 * buildings(nb)%lambda_layer3 / buildings(nb)%s_layer3 * 0.5_wp ) + 1.0_wp / h_tr_ms ) 1288 h_tr_em = 1.0_wp / ( 1.0_wp / h_tr_op - 1.0_wp / h_tr_ms ) !< [W/K] Eq. (63), Section 12.2.2 1175 1289 ! 1176 1290 !-- internal air loads dependent on the occupacy of the room 1177 1291 !-- basical internal heat gains (qint_low) with additional internal heat gains by occupancy (qint_high) (0,5*phi_int) 1178 phi_ia = 0.5 * ( ( qint_high * schedule_d +qint_low ) &1179 * floor_area_per_facade) !< [W] Eq. (C.1)1292 phi_ia = 0.5_wp * ( ( buildings(nb)%qint_high * schedule_d + buildings(nb)%qint_low ) & 1293 * ngs ) !< [W] Eq. (C.1) 1180 1294 ! 1181 1295 !-- Airflow dependent on the occupacy of the room 1182 1296 !-- basical airflow (air_change_low) with additional airflow gains by occupancy (air_change_high) 1183 air_change = ( air_change_high * schedule_d +air_change_low )1297 air_change = ( buildings(nb)%air_change_high * schedule_d + buildings(nb)%air_change_low ) 1184 1298 ! 1185 1299 !-- Heat transfer of ventilation … … 1187 1301 !-- with heat capacity of air 0.33 Wh/m2K 1188 1302 h_ve = MAX( 0.01_wp , ( air_change * indoor_volume_per_facade * & 1189 0.33_wp * (1 - eta_ve ) ) ) !< [W/K] from ISO 13789 Eq.(10)1303 0.33_wp * (1 - buildings(nb)%eta_ve ) ) ) !< [W/K] from ISO 13789 Eq.(10) 1190 1304 1191 1305 !-- Heat transfer coefficient auxiliary variables 1192 h_tr_1 = 1 / ( ( 1 / h_ve ) + ( 1/ h_tr_is ) ) !< [W/K] Eq. (C.6)1306 h_tr_1 = 1.0_wp / ( ( 1.0_wp / h_ve ) + ( 1.0_wp / h_tr_is ) ) !< [W/K] Eq. (C.6) 1193 1307 h_tr_2 = h_tr_1 + h_tr_w !< [W/K] Eq. (C.7) 1194 h_tr_3 = 1 / ( ( 1 / h_tr_2 ) + ( 1/ h_tr_ms ) ) !< [W/K] Eq. (C.8)1308 h_tr_3 = 1.0_wp / ( ( 1.0_wp / h_tr_2 ) + ( 1.0_wp / h_tr_ms ) ) !< [W/K] Eq. (C.8) 1195 1309 ! 1196 1310 !-- Net short-wave radiation through window area (was i_global) … … 1220 1334 !-- DIN 4108 - 2 chap.8 1221 1335 phi_sol = ( window_area_per_facade * net_sw_in * solar_protection_off & 1222 + window_area_per_facade * net_sw_in * f_c_win * solar_protection_on ) &1223 * g_value_win * ( 1- params_f_f ) * params_f_w1336 + window_area_per_facade * net_sw_in * buildings(nb)%f_c_win * solar_protection_on ) & 1337 * buildings(nb)%g_value_win * ( 1.0_wp - params_f_f ) * params_f_w 1224 1338 ! 1225 1339 !-- Calculation of the mass specific thermal load for internal and external heatsources … … 1227 1341 ! 1228 1342 !-- Calculation mass specific thermal load implied non thermal mass 1229 phi_st = ( 1 - ( eff_mass_area / total_area ) - ( h_tr_w / ( 9.1* total_area ) ) ) &1343 phi_st = ( 1.0_wp - ( eff_mass_area / total_area ) - ( h_tr_w / ( 9.1_wp * total_area ) ) ) & 1230 1344 * ( phi_ia + phi_sol ) !< [W] Eq. (C.3) with phi_ia=0,5*phi_int 1231 1345 ! … … 1233 1347 !-- Step 1: Indoor temperature without heating and cooling 1234 1348 !-- section C.4.1 Picture C.2 zone 3) 1235 phi_hc_nd = 0 1236 1349 phi_hc_nd = 0.0_wp 1237 1350 CALL im_calc_temperatures ( i, j, k, indoor_wall_window_temperature, & 1238 1351 near_facade_temperature, phi_hc_nd ) 1239 1352 ! 1240 1353 !-- If air temperature between border temperatures of heating and cooling, assign output variable, then ready 1241 IF ( theta_int_h_set <= theta_air .AND. theta_air <=theta_int_c_set ) THEN1242 phi_hc_nd_ac = 0 1354 IF ( buildings(nb)%theta_int_h_set <= theta_air .AND. theta_air <= buildings(nb)%theta_int_c_set ) THEN 1355 phi_hc_nd_ac = 0.0_wp 1243 1356 phi_hc_nd = phi_hc_nd_ac 1244 1357 theta_air_ac = theta_air 1245 1358 ! 1246 !-- Step 2: Else, apply 10 W/m ²heating/cooling power and calculate indoor temperature1359 !-- Step 2: Else, apply 10 W/m2 heating/cooling power and calculate indoor temperature 1247 1360 !-- again. 1248 1361 ELSE … … 1252 1365 1253 1366 !-- Heating or cooling? 1254 IF ( theta_air > theta_int_c_set ) THEN1255 theta_air_set = theta_int_c_set1367 IF ( theta_air > buildings(nb)%theta_int_c_set ) THEN 1368 theta_air_set = buildings(nb)%theta_int_c_set 1256 1369 ELSE 1257 theta_air_set = theta_int_h_set1370 theta_air_set = buildings(nb)%theta_int_h_set 1258 1371 ENDIF 1259 1372 … … 1274 1387 !-- If necessary, limit the power to maximum power 1275 1388 !-- section C.4.1 Picture C.2 zone 2) and 4) 1276 IF ( phi_c_max < phi_hc_nd_un .AND. phi_hc_nd_un <phi_h_max ) THEN1389 IF ( buildings(nb)%phi_c_max < phi_hc_nd_un .AND. phi_hc_nd_un < buildings(nb)%phi_h_max ) THEN 1277 1390 phi_hc_nd_ac = phi_hc_nd_un 1278 1391 phi_hc_nd = phi_hc_nd_un … … 1280 1393 !-- Step 4: Inner temperature with maximum heating (phi_hc_nd_un positive) or cooling (phi_hc_nd_un negative) 1281 1394 !-- section C.4.1 Picture C.2 zone 1) and 5) 1282 IF ( phi_hc_nd_un > 0 ) THEN1283 phi_hc_nd_ac = phi_h_max !< Limit heating1395 IF ( phi_hc_nd_un > 0.0_wp ) THEN 1396 phi_hc_nd_ac = buildings(nb)%phi_h_max !< Limit heating 1284 1397 ELSE 1285 phi_hc_nd_ac = phi_c_max !< Limit cooling1398 phi_hc_nd_ac = buildings(nb)%phi_c_max !< Limit cooling 1286 1399 ENDIF 1287 1400 ENDIF … … 1302 1415 !-- Calculate the operating temperature with weighted mean of temperature of air and mean 1303 1416 !-- Will be used for thermal comfort calculations 1304 theta_op = 0.3 * theta_air_ac + 0.7* theta_s1417 theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s 1305 1418 ! 1306 1419 !-- Heat flux into the wall. Value needed in urban_surface_mod to … … 1322 1435 !-- Calculation of waste heat 1323 1436 !-- Anthropogenic heat output 1324 IF ( phi_hc_nd_ac > 0) THEN1325 1326 1327 1328 1329 1330 1331 1332 q_waste_heat = (phi_hc_nd * (params_waste_heat_h * heating_on + params_waste_heat_c * cooling_on)) !< [W/m2] , anthropogenic heat output1333 ! surf_usm_v(l)%waste_heat(m)=q_waste_heat1334 1437 IF ( phi_hc_nd_ac > 0.0_wp ) THEN 1438 heating_on = 1 1439 cooling_on = 0 1440 ELSE 1441 heating_on = 0 1442 cooling_on = 1 1443 ENDIF 1444 1445 q_waste_heat = (phi_hc_nd * (params_waste_heat_h * heating_on + params_waste_heat_c * cooling_on))!< [W/GebÀudemodell] , observe the directional convention in PALM! 1446 surf_usm_v(l)%waste_heat(m) = q_waste_heat 1447 1335 1448 ENDDO !< Vertical surfaces loop 1336 1449 … … 1339 1452 1340 1453 ! 1341 !-- Determine total number of facade elements per building and assign number to 1342 !-- building data type. 1454 !-- Determine the mean building temperature. 1343 1455 DO nb = 1, num_build 1344 1456 ! … … 1383 1495 END SUBROUTINE im_main_heatcool 1384 1496 1497 !-----------------------------------------------------------------------------! 1498 ! Description: 1499 !------------- 1500 !> Check data output for plant canopy model 1501 !-----------------------------------------------------------------------------! 1502 SUBROUTINE im_check_data_output( var, unit ) 1503 1504 IMPLICIT NONE 1505 1506 CHARACTER (LEN=*) :: unit !< 1507 CHARACTER (LEN=*) :: var !< 1508 1509 SELECT CASE ( TRIM( var ) ) 1510 1511 1512 CASE ( 'im_hf_roof') 1513 unit = 'W m-2' 1514 1515 CASE ( 'im_hf_wall_win' ) 1516 unit = 'W m-2' 1517 1518 CASE ( 'im_hf_wall_win_waste' ) 1519 unit = 'W m-2' 1520 1521 CASE ( 'im_hf_roof_waste' ) 1522 unit = 'W m-2' 1523 1524 CASE ( 'im_t_indoor' ) 1525 unit = 'K' 1526 1527 CASE DEFAULT 1528 unit = 'illegal' 1529 1530 END SELECT 1531 1532 END SUBROUTINE 1533 1534 1535 !-----------------------------------------------------------------------------! 1536 ! Description: 1537 !------------- 1538 !> Check parameters routine for plant canopy model 1539 !-----------------------------------------------------------------------------! 1540 SUBROUTINE im_check_parameters 1541 1542 !!!! USE control_parameters, 1543 !!!! ONLY: message_string 1544 1545 IMPLICIT NONE 1546 1547 END SUBROUTINE im_check_parameters 1548 1549 !-----------------------------------------------------------------------------! 1550 ! Description: 1551 !------------- 1552 !> Subroutine defining appropriate grid for netcdf variables. 1553 !> It is called from subroutine netcdf. 1554 !-----------------------------------------------------------------------------! 1555 SUBROUTINE im_define_netcdf_grid( var, found, grid_x, grid_y, grid_z ) 1556 1557 IMPLICIT NONE 1558 1559 CHARACTER (LEN=*), INTENT(IN) :: var 1560 LOGICAL, INTENT(OUT) :: found 1561 CHARACTER (LEN=*), INTENT(OUT) :: grid_x 1562 CHARACTER (LEN=*), INTENT(OUT) :: grid_y 1563 CHARACTER (LEN=*), INTENT(OUT) :: grid_z 1564 1565 found = .TRUE. 1566 1567 ! 1568 !-- Check for the grid 1569 SELECT CASE ( TRIM( var ) ) 1570 1571 CASE ( 'im_hf_roof', 'im_hf_roof_waste' ) 1572 grid_x = 'x' 1573 grid_y = 'y' 1574 grid_z = 'zw' 1575 ! 1576 !-- Heat fluxes at vertical walls are actually defined on stagged grid, i.e. xu, yv. 1577 CASE ( 'im_hf_wall_win', 'im_hf_wall_win_waste' ) 1578 grid_x = 'x' 1579 grid_y = 'y' 1580 grid_z = 'zu' 1581 1582 CASE ( 'im_t_indoor' ) 1583 grid_x = 'x' 1584 grid_y = 'y' 1585 grid_z = 'zw' 1586 1587 CASE DEFAULT 1588 found = .FALSE. 1589 grid_x = 'none' 1590 grid_y = 'none' 1591 grid_z = 'none' 1592 END SELECT 1593 1594 END SUBROUTINE im_define_netcdf_grid 1595 1596 !------------------------------------------------------------------------------! 1597 ! Description: 1598 ! ------------ 1599 !> Subroutine defining 3D output variables 1600 !------------------------------------------------------------------------------! 1601 SUBROUTINE im_data_output_3d( av, variable, found, local_pf, fill_value, & 1602 nzb_do, nzt_do ) 1603 1604 USE indices 1605 1606 USE kinds 1607 1608 IMPLICIT NONE 1609 1610 CHARACTER (LEN=*) :: variable !< 1611 1612 INTEGER(iwp) :: av !< 1613 INTEGER(iwp) :: i !< 1614 INTEGER(iwp) :: j !< 1615 INTEGER(iwp) :: k !< 1616 INTEGER(iwp) :: l !< 1617 INTEGER(iwp) :: m !< 1618 INTEGER(iwp) :: nb !< index of the building in the building data structure 1619 INTEGER(iwp) :: nzb_do !< lower limit of the data output (usually 0) 1620 INTEGER(iwp) :: nzt_do !< vertical upper limit of the data output (usually nz_do3d) 1621 1622 1623 LOGICAL :: found !< 1624 1625 REAL(wp), INTENT(IN) :: fill_value !< value for the _FillValue attribute 1626 1627 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 1628 1629 local_pf = fill_value 1630 1631 found = .TRUE. 1632 1633 SELECT CASE ( TRIM( variable ) ) 1634 ! 1635 !-- Output of indoor temperature. All grid points within the building are 1636 !-- filled with values, while atmospheric grid points are set to _FillValues. 1637 CASE ( 'im_t_indoor' ) 1638 IF ( av == 0 ) THEN 1639 DO i = nxl, nxr 1640 DO j = nys, nyn 1641 IF ( building_id_f%var(j,i) /= building_id_f%fill ) THEN 1642 ! 1643 !-- Determine index of the building within the building data structure. 1644 nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), & 1645 DIM = 1 ) 1646 ! 1647 !-- Write mean building temperature onto output array. Please note, 1648 !-- in contrast to many other loops in the output, the vertical 1649 !-- bounds are determined by the lowest and hightest vertical index 1650 !-- occupied by the building. 1651 DO k = buildings(nb)%kb_min, buildings(nb)%kb_max 1652 local_pf(i,j,k) = buildings(nb)%t_in(k) 1653 ENDDO 1654 ENDIF 1655 ENDDO 1656 ENDDO 1657 ENDIF 1658 1659 CASE ( 'im_hf_roof' ) 1660 IF ( av == 0 ) THEN 1661 DO m = 1, surf_usm_h%ns 1662 i = surf_usm_h%i(m) !+ surf_usm_h%ioff 1663 j = surf_usm_h%j(m) !+ surf_usm_h%joff 1664 k = surf_usm_h%k(m) !+ surf_usm_h%koff 1665 local_pf(i,j,k) = surf_usm_h%iwghf_eb(m) 1666 ENDDO 1667 ENDIF 1668 1669 CASE ( 'im_hf_roof_waste' ) 1670 IF ( av == 0 ) THEN 1671 DO m = 1, surf_usm_h%ns 1672 i = surf_usm_h%i(m) !+ surf_usm_h%ioff 1673 j = surf_usm_h%j(m) !+ surf_usm_h%joff 1674 k = surf_usm_h%k(m) !+ surf_usm_h%koff 1675 local_pf(i,j,k) = surf_usm_h%waste_heat(m) 1676 ENDDO 1677 ENDIF 1678 1679 CASE ( 'im_hf_wall_win' ) 1680 IF ( av == 0 ) THEN 1681 DO l = 0, 3 1682 DO m = 1, surf_usm_v(l)%ns 1683 i = surf_usm_v(l)%i(m) !+ surf_usm_v(l)%ioff 1684 j = surf_usm_v(l)%j(m) !+ surf_usm_v(l)%joff 1685 k = surf_usm_v(l)%k(m) !+ surf_usm_v(l)%koff 1686 local_pf(i,j,k) = surf_usm_v(l)%iwghf_eb(m) 1687 ENDDO 1688 ENDDO 1689 ENDIF 1690 1691 CASE ( 'im_hf_wall_win_waste' ) 1692 IF ( av == 0 ) THEN 1693 DO l = 0, 3 1694 DO m = 1, surf_usm_v(l)%ns 1695 i = surf_usm_v(l)%i(m) !+ surf_usm_v(l)%ioff 1696 j = surf_usm_v(l)%j(m) !+ surf_usm_v(l)%joff 1697 k = surf_usm_v(l)%k(m) !+ surf_usm_v(l)%koff 1698 local_pf(i,j,k) = surf_usm_v(l)%waste_heat(m) 1699 ENDDO 1700 ENDDO 1701 ENDIF 1702 1703 CASE DEFAULT 1704 found = .FALSE. 1705 1706 END SELECT 1707 1708 END SUBROUTINE im_data_output_3d 1385 1709 !------------------------------------------------------------------------------! 1386 1710 ! Description: … … 1397 1721 CHARACTER (LEN=80) :: line !< string containing current line of file PARIN 1398 1722 1399 1400 1401 NAMELIST /indoor_parameters/ building_type, dt_indoor, & 1402 initial_indoor_temperature 1403 1404 ! line = ' ' 1723 NAMELIST /indoor_parameters/ dt_indoor, initial_indoor_temperature 1405 1724 1406 1725 ! … … 1410 1729 DO WHILE ( INDEX( line, '&indoor_parameters' ) == 0 ) 1411 1730 READ ( 11, '(A)', END=10 ) line 1412 ! PRINT*, 'line: ', line1413 1731 ENDDO 1414 1732 BACKSPACE ( 11 ) -
palm/trunk/SOURCE/module_interface.f90
r3739 r3744 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Add indoor model 23 23 ! 24 24 ! Former revisions: … … 174 174 USE indoor_model_mod, & 175 175 ONLY: im_parin, & 176 im_check_data_output, & 177 im_check_parameters, & 178 im_data_output_3d, & 176 179 im_init 177 180 … … 497 500 IF ( air_chemistry ) CALL chem_check_parameters 498 501 IF ( gust_module_enabled ) CALL gust_check_parameters 502 IF ( indoor_model ) CALL im_check_parameters 499 503 IF ( land_surface ) CALL lsm_check_parameters 500 504 IF ( large_scale_forcing .OR. nudging ) CALL lsf_nudging_check_parameters ! ToDo: create single module switch … … 647 651 ENDIF 648 652 653 IF ( unit == 'illegal' .AND. indoor_model ) THEN 654 CALL im_check_data_output( variable, unit ) 655 ENDIF 656 649 657 IF ( unit == 'illegal' .AND. urban_surface & 650 658 .AND. variable(1:4) == 'usm_' ) THEN ! ToDo: remove aditional conditions … … 1022 1030 IF ( .NOT. found .AND. gust_module_enabled ) THEN 1023 1031 CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) 1032 resorted = .TRUE. 1033 ENDIF 1034 1035 IF ( .NOT. found .AND. indoor_model ) THEN 1036 CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) 1024 1037 resorted = .TRUE. 1025 1038 ENDIF -
palm/trunk/SOURCE/netcdf_data_input_mod.f90
r3737 r3744 20 20 ! Current revisions: 21 21 ! ----------------- 22 !23 22 ! 24 23 ! Former revisions: -
palm/trunk/SOURCE/netcdf_interface_mod.f90
r3729 r3744 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Add indoor model 23 23 ! 24 24 ! Former revisions: … … 660 660 do2d_yz_time_count, dt_data_output_av, dt_do2d_xy, dt_do2d_xz, & 661 661 dt_do2d_yz, dt_do3d, dt_write_agent_data, mask_size, & 662 do2d_xy_time_count, 663 do3d_time_count, domask_time_count, end_time, land_surface,&662 do2d_xy_time_count, do3d_time_count, domask_time_count, & 663 end_time, indoor_model, land_surface, & 664 664 mask_size_l, mask_i, mask_i_global, mask_j, mask_j_global, & 665 665 mask_k_global, mask_surface, & … … 683 683 USE kinds 684 684 685 USE indoor_model_mod, & 686 ONLY: im_define_netcdf_grid 687 685 688 USE land_surface_model_mod, & 686 689 ONLY: lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs … … 1911 1914 CALL gust_define_netcdf_grid( do3d(av,i), found, grid_x, & 1912 1915 grid_y, grid_z ) 1916 ENDIF 1917 ! 1918 !-- Check for indoor model quantities 1919 IF ( .NOT. found .AND. indoor_model ) THEN 1920 CALL im_define_netcdf_grid( do3d(av,i), found, & 1921 grid_x, grid_x, grid_z ) 1913 1922 ENDIF 1914 1923 -
palm/trunk/SOURCE/plant_canopy_model_mod.f90
r3685 r3744 22 22 ! Current revisions: 23 23 ! ------------------ 24 ! 24 ! Bugfix in transpiration, floating invalid when temperature 25 ! becomes > 40 degrees 25 26 ! 26 27 ! Former revisions: … … 236 237 !> 2) Calculation of sinks and sources of momentum, heat and scalar concentration 237 238 !> due to canopy elements (subroutine pcm_tendency). 239 ! 240 ! @todo - precalculate constant terms in pcm_calc_transpiration_rate 238 241 !------------------------------------------------------------------------------! 239 242 MODULE plant_canopy_model_mod … … 422 425 sat_press_d = sat_press * 17.27_wp * 237.3_wp / (temp + 237.3_wp)**2 423 426 !-- Wind speed 424 wind_speed = SQRT( ( (u(k,j,i) + u(k,j,i+1))/2.0_wp )**2 +&425 ( (v(k,j,i) + v(k,j,i+1))/2.0_wp )**2 +&426 ( (w(k,j,i) + w(k,j,i+1))/2.0_wp)**2 )427 wind_speed = SQRT( ( 0.5_wp * ( u(k,j,i) + u(k,j,i+1) ) )**2 + & 428 ( 0.5_wp * ( v(k,j,i) + v(k,j,i+1) ) )**2 + & 429 ( 0.5_wp * ( w(k,j,i) + w(k,j,i+1) ) )**2 ) 427 430 !-- Aerodynamic conductivity (Daudet et al. (1999) eq. 14 428 431 g_b = 0.01_wp * wind_speed + 0.0071_wp … … 434 437 !-- Second function for calculation of stomatal conductivity (temperature dependency) 435 438 !-- Stewart (1988; Agric. and Forest. Meteorol. 43) eq. 21 436 f2 = MAX(t2_min, (temp-t2_min) * (t2_max-temp)**((t2_max-16.9_wp)/(16.9_wp-t2_min)) / &439 f2 = MAX(t2_min, (temp-t2_min) * MAX(0.0_wp,t2_max-temp)**((t2_max-16.9_wp)/(16.9_wp-t2_min)) / & 437 440 ((16.9_wp-t2_min) * (t2_max-16.9_wp)**((t2_max-16.9_wp)/(16.9_wp-t2_min))) ) 438 441 !-- Water pressure deficit -
palm/trunk/SOURCE/surface_data_output_mod.f90
r3736 r3744 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Output of waste_heat and innermost wall flux from indoor model 23 23 ! 24 24 ! Former revisions: … … 28 28 ! clean-up coding layout 29 29 ! 30 ! 3735 2019-02-12 09:52:40Z dom_dwd_user30 ! 3735 2019-02-12 09:52:40Z suehring 31 31 ! - Split initialization into initialization of arrays and further initialization 32 32 ! in order to enable reading of restart data. … … 76 76 ! Authors: 77 77 ! -------- 78 ! @author Klaus Ketelsen, Matthias Suehring 78 ! @author Klaus Ketelsen, Matthias Suehring, Tobias Gronemeier 79 79 ! 80 80 ! Description: … … 2778 2778 2779 2779 ENDIF 2780 2780 2781 2781 CASE ( 'uvw1' ) 2782 2782 ! … … 2807 2807 2808 2808 ENDIF 2809 2809 ! 2810 !-- Waste heat from indoor model 2811 CASE ( 'waste_heat' ) 2812 ! 2813 !-- Output of instantaneous data 2814 IF ( av == 0 ) THEN 2815 CALL surface_data_output_collect( surf_def_h(0)%waste_heat, & 2816 surf_def_h(1)%waste_heat, & 2817 surf_lsm_h%waste_heat, & 2818 surf_usm_h%waste_heat, & 2819 surf_def_v(0)%waste_heat, & 2820 surf_lsm_v(0)%waste_heat, & 2821 surf_usm_v(0)%waste_heat, & 2822 surf_def_v(1)%waste_heat, & 2823 surf_lsm_v(1)%waste_heat, & 2824 surf_usm_v(1)%waste_heat, & 2825 surf_def_v(2)%waste_heat, & 2826 surf_lsm_v(2)%waste_heat, & 2827 surf_usm_v(2)%waste_heat, & 2828 surf_def_v(3)%waste_heat, & 2829 surf_lsm_v(3)%waste_heat, & 2830 surf_usm_v(3)%waste_heat ) 2831 ELSE 2832 ! 2833 !-- Output of averaged data 2834 surfaces%var_out(:) = surfaces%var_av(:,n_out) / & 2835 REAL( average_count_surf, KIND=wp ) 2836 surfaces%var_av(:,n_out) = 0.0_wp 2837 2838 ENDIF 2839 ! 2840 !-- Innermost building wall flux from indoor model 2841 CASE ( 'im_hf' ) 2842 ! 2843 !-- Output of instantaneous data 2844 IF ( av == 0 ) THEN 2845 CALL surface_data_output_collect( surf_def_h(0)%iwghf_eb, & 2846 surf_def_h(1)%iwghf_eb, & 2847 surf_lsm_h%iwghf_eb, & 2848 surf_usm_h%iwghf_eb, & 2849 surf_def_v(0)%iwghf_eb, & 2850 surf_lsm_v(0)%iwghf_eb, & 2851 surf_usm_v(0)%iwghf_eb, & 2852 surf_def_v(1)%iwghf_eb, & 2853 surf_lsm_v(1)%iwghf_eb, & 2854 surf_usm_v(1)%iwghf_eb, & 2855 surf_def_v(2)%iwghf_eb, & 2856 surf_lsm_v(2)%iwghf_eb, & 2857 surf_usm_v(2)%iwghf_eb, & 2858 surf_def_v(3)%iwghf_eb, & 2859 surf_lsm_v(3)%iwghf_eb, & 2860 surf_usm_v(3)%iwghf_eb ) 2861 ELSE 2862 ! 2863 !-- Output of averaged data 2864 surfaces%var_out(:) = surfaces%var_av(:,n_out) / & 2865 REAL( average_count_surf, KIND=wp ) 2866 surfaces%var_av(:,n_out) = 0.0_wp 2867 2868 ENDIF 2810 2869 ! 2811 2870 !-- Add further variables: … … 3706 3765 surf_lsm_v(3)%uvw_abs, & 3707 3766 surf_usm_v(3)%uvw_abs, n_out ) 3767 3768 CASE ( 'waste_heat' ) 3769 CALL surface_data_output_sum_up( surf_def_h(0)%waste_heat, & 3770 surf_def_h(1)%waste_heat, & 3771 surf_lsm_h%waste_heat, & 3772 surf_usm_h%waste_heat, & 3773 surf_def_v(0)%waste_heat, & 3774 surf_lsm_v(0)%waste_heat, & 3775 surf_usm_v(0)%waste_heat, & 3776 surf_def_v(1)%waste_heat, & 3777 surf_lsm_v(1)%waste_heat, & 3778 surf_usm_v(1)%waste_heat, & 3779 surf_def_v(2)%waste_heat, & 3780 surf_lsm_v(2)%waste_heat, & 3781 surf_usm_v(2)%waste_heat, & 3782 surf_def_v(3)%waste_heat, & 3783 surf_lsm_v(3)%waste_heat, & 3784 surf_usm_v(3)%waste_heat, n_out ) 3785 3786 CASE ( 'im_hf' ) 3787 CALL surface_data_output_sum_up( surf_def_h(0)%iwghf_eb, & 3788 surf_def_h(1)%iwghf_eb, & 3789 surf_lsm_h%iwghf_eb, & 3790 surf_usm_h%iwghf_eb, & 3791 surf_def_v(0)%iwghf_eb, & 3792 surf_lsm_v(0)%iwghf_eb, & 3793 surf_usm_v(0)%iwghf_eb, & 3794 surf_def_v(1)%iwghf_eb, & 3795 surf_lsm_v(1)%iwghf_eb, & 3796 surf_usm_v(1)%iwghf_eb, & 3797 surf_def_v(2)%iwghf_eb, & 3798 surf_lsm_v(2)%iwghf_eb, & 3799 surf_usm_v(2)%iwghf_eb, & 3800 surf_def_v(3)%iwghf_eb, & 3801 surf_lsm_v(3)%iwghf_eb, & 3802 surf_usm_v(3)%iwghf_eb, n_out ) 3708 3803 3709 3804 END SELECT … … 4161 4256 4162 4257 USE control_parameters, & 4163 ONLY: averaging_interval, dt_data_output, in itializing_actions,&4164 message_string4258 ONLY: averaging_interval, dt_data_output, indoor_model, & 4259 initializing_actions, message_string 4165 4260 4166 4261 USE pegrid, & … … 4293 4388 CASE ( 'r_a', 'r_canopy', 'r_soil', 'r_s' ) 4294 4389 unit = 's/m' 4390 4391 CASE ( 'waste_heat', 'im_hf' ) 4392 IF ( .NOT. indoor_model ) THEN 4393 message_string = TRIM( trimvar ) // & 4394 ' requires the indoor model' 4395 CALL message( 'surface_data_output_check_parameters', & 4396 'PA0588', 1, 2, 0, 6, 0 ) 4397 ENDIF 4398 4399 unit = 'W/m2' 4295 4400 4296 4401 CASE DEFAULT -
palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
r3685 r3744 21 21 ! Current revisions: 22 22 ! ------------------ 23 ! 23 ! Bugfix, missing calculation of 10cm temperature at vertical building walls, 24 ! required for indoor model 24 25 ! 25 26 ! Former revisions: … … 443 444 CALL calc_pt_near_surface ( '2m' ) 444 445 ENDIF 445 IF ( indoor_model ) THEN 446 CALL calc_pt_near_surface ( '10cm' ) 447 ENDIF446 ! 447 !-- Calculate 10cm temperature, required in indoor model 448 IF ( indoor_model ) CALL calc_pt_near_surface ( '10cm' ) 448 449 ENDIF 449 450 … … 548 549 !-- Compute respective surface fluxes for momentum and TKE 549 550 CALL calc_surface_fluxes 551 ! 552 !-- Calculate 10cm temperature, required in indoor model 553 IF ( indoor_model ) CALL calc_pt_near_surface ( '10cm' ) 550 554 ENDIF 551 555 ENDDO … … 566 570 !-- Compute respective surface fluxes for momentum and TKE 567 571 CALL calc_surface_fluxes 572 568 573 ENDIF 569 574 ENDDO … … 625 630 !-- Compute respective surface fluxes for momentum and TKE 626 631 CALL calc_surface_fluxes 632 ! 633 !-- Calculate 10cm temperature, required in indoor model 634 IF ( indoor_model ) CALL calc_pt_near_surface ( '10cm' ) 627 635 ENDIF 628 636 ENDDO … … 2020 2028 k = surf%k(m) 2021 2029 2022 surf%pt_10cm(m) = surf%pt_surface(m) + surf%ts(m) / kappa &2023 * ( log( 0.1_wp / surf%z0h(m) )&2024 - psi_h( 0.1_wp / surf%ol(m) ) 2030 surf%pt_10cm(m) = surf%pt_surface(m) + surf%ts(m) / kappa & 2031 * ( LOG( 0.1_wp / surf%z0h(m) ) & 2032 - psi_h( 0.1_wp / surf%ol(m) ) & 2025 2033 + psi_h( surf%z0h(m) / surf%ol(m) ) ) 2026 2034 2027 2035 ENDDO 2028 2036 … … 2036 2044 k = surf%k(m) 2037 2045 2038 surf%pt_2m(m) = surf%pt_surface(m) + surf%ts(m) / kappa &2039 * ( log( 2.0_wp / surf%z0h(m) )&2040 - psi_h( 2.0_wp / surf%ol(m) ) 2046 surf%pt_2m(m) = surf%pt_surface(m) + surf%ts(m) / kappa & 2047 * ( LOG( 2.0_wp / surf%z0h(m) ) & 2048 - psi_h( 2.0_wp / surf%ol(m) ) & 2041 2049 + psi_h( surf%z0h(m) / surf%ol(m) ) ) 2042 2050 -
palm/trunk/SOURCE/surface_mod.f90
r3655 r3744 21 21 ! Current revisions: 22 22 ! ------------------ 23 ! 23 ! +waste_heat 24 24 ! 25 25 ! Former revisions: … … 455 455 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: rho_c_total !< volumetric heat capacity of the actual soil matrix (J/m3/K) 456 456 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: root_fr !< root fraction within the soil layers 457 458 !-- Indoor model variables 459 REAL(wp), DIMENSION(:), ALLOCATABLE :: waste_heat !< waste heat 457 460 ! 458 461 !-- Urban surface variables … … 1243 1246 !-- Characteristic temperature and surface flux of sensible heat 1244 1247 DEALLOCATE ( surfaces%ts ) 1245 DEALLOCATE ( surfaces%shf ) 1248 DEALLOCATE ( surfaces%shf ) 1246 1249 ! 1247 1250 !-- surface temperature … … 1371 1374 !-- Characteristic temperature and surface flux of sensible heat 1372 1375 ALLOCATE ( surfaces%ts(1:surfaces%ns) ) 1373 ALLOCATE ( surfaces%shf(1:surfaces%ns) ) 1376 ALLOCATE ( surfaces%shf(1:surfaces%ns) ) 1374 1377 ! 1375 1378 !-- Surface temperature … … 1537 1540 ! 1538 1541 !-- Sensible heat flux 1539 DEALLOCATE ( surfaces%shf ) 1542 DEALLOCATE ( surfaces%shf ) 1540 1543 ! 1541 1544 !-- Latent heat flux … … 1609 1612 ! 1610 1613 !-- Sensible heat flux 1611 ALLOCATE ( surfaces%shf(1:surfaces%ns) ) 1614 ALLOCATE ( surfaces%shf(1:surfaces%ns) ) 1612 1615 ! 1613 1616 !-- Latent heat flux … … 3637 3640 CALL wrd_write_string( 'surf_h(' // dum // ')%sasws' ) 3638 3641 WRITE ( 14 ) surf_h(l)%sasws 3639 ENDIF 3642 ENDIF 3640 3643 3641 3644 ENDDO … … 3781 3784 WRITE ( 14 ) surf_v(l)%mom_flux_tke 3782 3785 ENDIF 3783 3786 3784 3787 ENDDO 3785 3788 -
palm/trunk/SOURCE/time_integration.f90
r3742 r3744 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Call indoor model after first timestep 23 23 ! 24 24 ! Former revisions: … … 1413 1413 !-- If required, calculate indoor temperature, waste heat, heat flux 1414 1414 !-- through wall, etc. 1415 !-- dt_indoor steers the frequency of the indoor model calculations 1415 !-- dt_indoor steers the frequency of the indoor model calculations. 1416 !-- Note, at first timestep indoor model is called, in order to provide 1417 !-- a waste heat flux. 1416 1418 IF ( indoor_model ) THEN 1417 1419 1418 1420 time_indoor = time_indoor + dt_3d 1419 1421 1420 IF ( time_indoor >= dt_indoor ) THEN 1422 IF ( time_indoor >= dt_indoor .OR. current_timestep_number == 0 ) & 1423 THEN 1421 1424 1422 1425 time_indoor = time_indoor - dt_indoor -
palm/trunk/SOURCE/urban_surface_mod.f90
r3743 r3744 23 23 ! Current revisions: 24 24 ! ------------------ 25 ! 25 ! - Remove internal flag indoor_model (is a global control parameter) 26 ! - add waste heat from buildings to the kinmatic heat flux 27 ! - consider waste heat in restart data 28 ! - remove unused USE statements 26 29 ! 27 30 ! Former revisions: … … 401 404 !> @todo Output of _av variables in case of restarts 402 405 !> @todo Revise flux conversion in energy-balance solver 403 !> @todo Bugfixing in nopointer branch404 406 !> @todo Check optimizations for RMA operations 405 407 !> @todo Alternatives for MPI_WIN_ALLOCATE? (causes problems with openmpi) 406 408 !> @todo Check for load imbalances in CPU measures, e.g. for exchange_horiz_prog 407 409 !> factor 3 between min and max time 408 !> @todo Move setting of flag indoor_model to indoor_model_mod once available409 410 !> @todo Check divisions in wtend (etc.) calculations for possible division 410 411 !> by zero, e.g. in case fraq(0,m) + fraq(1,m) = 0?! … … 424 425 425 426 USE control_parameters, & 426 ONLY: coupling_start_time, topography, dt_3d, humidity, 427 ONLY: coupling_start_time, topography, dt_3d, humidity, indoor_model, & 427 428 intermediate_timestep_count, initializing_actions, & 428 429 intermediate_timestep_count_max, simulated_time, end_time, & … … 431 432 pt_surface, large_scale_forcing, lsf_surf, spinup, & 432 433 spinup_pt_mean, spinup_time, time_do3d, dt_do3d, & 433 average_count_3d, varnamelength, urban_surface, & 434 plant_canopy, dz 434 average_count_3d, varnamelength, urban_surface, dz 435 435 436 436 USE bulk_cloud_model_mod, & … … 455 455 456 456 USE pegrid 457 458 USE plant_canopy_model_mod, & 459 ONLY: pc_heating_rate, pc_transpiration_rate, pc_latent_rate 460 457 461 458 USE radiation_model_mod, & 462 459 ONLY: albedo_type, radiation_interaction, calc_zenith, zenith, & … … 535 532 !< (e.g.transportation) are used 536 533 LOGICAL :: force_radiation_call_l = .FALSE. !< flag parameter for unscheduled radiation model calls 537 LOGICAL :: indoor_model = .FALSE. !< whether to use the indoor model538 534 LOGICAL :: read_wall_temp_3d = .FALSE. 539 535 LOGICAL :: usm_wall_mod = .FALSE. !< reduces conductivity of the first 2 wall layers by factor 0.1 … … 1257 1253 ALLOCATE ( surf_usm_v(l)%target_temp_summer(1:surf_usm_v(l)%ns) ) 1258 1254 ALLOCATE ( surf_usm_v(l)%target_temp_winter(1:surf_usm_v(l)%ns) ) 1259 ENDDO 1255 ENDDO 1256 ! 1257 !-- In case the indoor model is applied, allocate memory for waste heat 1258 !-- and indoor temperature. 1259 IF ( indoor_model ) THEN 1260 ALLOCATE ( surf_usm_h%waste_heat(1:surf_usm_h%ns) ) 1261 surf_usm_h%waste_heat = 0.0_wp 1262 DO l = 0, 3 1263 ALLOCATE ( surf_usm_v(l)%waste_heat(1:surf_usm_v(l)%ns) ) 1264 surf_usm_v(l)%waste_heat = 0.0_wp 1265 ENDDO 1266 ENDIF 1260 1267 ! 1261 1268 !-- Allocate flag indicating ground floor level surface elements … … 6054 6061 usm_material_model, & 6055 6062 wall_category, & 6056 indoor_model, &6057 6063 wall_inner_temperature, & 6058 6064 roof_inner_temperature, & … … 6073 6079 usm_material_model, & 6074 6080 wall_category, & 6075 indoor_model, &6076 6081 wall_inner_temperature, & 6077 6082 roof_inner_temperature, & … … 6264 6269 6265 6270 LOGICAL, INTENT(OUT) :: found 6271 !!! suehring: Why the SAVE attribute? 6272 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_wall_h 6273 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_window_h 6274 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_green_h 6275 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_waste_h 6266 6276 6267 REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE :: tmp_surf_wall_h, tmp_surf_window_h, tmp_surf_green_h 6268 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_wall_h, tmp_window_h, tmp_green_h 6277 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_wall_h 6278 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_window_h 6279 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: tmp_green_h 6269 6280 6270 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_wall_v, tmp_surf_window_v, tmp_surf_green_v 6271 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_wall_v, tmp_window_v, tmp_green_v 6281 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_wall_v 6282 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_window_v 6283 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_green_v 6284 TYPE( t_surf_vertical ), DIMENSION(0:3), SAVE :: tmp_surf_waste_v 6285 6286 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_wall_v 6287 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_window_v 6288 TYPE( t_wall_vertical ), DIMENSION(0:3), SAVE :: tmp_green_v 6272 6289 6273 6290 … … 6289 6306 DEALLOCATE( tmp_surf_green_h ) 6290 6307 IF ( ALLOCATED( tmp_green_h) ) DEALLOCATE( tmp_green_h ) 6308 IF ( ALLOCATED( tmp_surf_waste_h) ) & 6309 DEALLOCATE( tmp_surf_waste_h ) 6291 6310 6292 6311 ! … … 6305 6324 ALLOCATE( tmp_green_h(nzb_wall:nzt_wall+1, & 6306 6325 1:ns_h_on_file_usm) ) 6326 ALLOCATE( tmp_surf_waste_h(1:ns_h_on_file_usm) ) 6307 6327 6308 6328 ENDIF … … 6325 6345 IF ( ALLOCATED( tmp_green_v(l)%t ) ) & 6326 6346 DEALLOCATE( tmp_green_v(l)%t ) 6347 IF ( ALLOCATED( tmp_surf_waste_v(l)%t ) ) & 6348 DEALLOCATE( tmp_surf_waste_v(l)%t ) 6327 6349 ENDDO 6328 6350 … … 6343 6365 ALLOCATE( tmp_green_v(l)%t(nzb_wall:nzt_wall+1, & 6344 6366 1:ns_v_on_file_usm(l) ) ) 6367 ALLOCATE( tmp_surf_waste_v(l)%t(1:ns_v_on_file_usm(l)) ) 6345 6368 ENDDO 6346 6369 … … 6614 6637 t_surf_window_v_1(3)%t, & 6615 6638 tmp_surf_window_v(3)%t, & 6639 surf_usm_v(3)%start_index, & 6640 start_index_on_file, & 6641 end_index_on_file, & 6642 nxlc, nysc, & 6643 nxlf, nxrf, nysf, nynf, & 6644 nys_on_file, nyn_on_file, & 6645 nxl_on_file,nxr_on_file ) 6646 6647 CASE ( 'waste_heat_h' ) 6648 IF ( k == 1 ) THEN 6649 IF ( .NOT. ALLOCATED( surf_usm_h%waste_heat ) ) & 6650 ALLOCATE( surf_usm_h%waste_heat(1:surf_usm_h%ns) ) 6651 READ ( 13 ) tmp_surf_waste_h 6652 ENDIF 6653 CALL surface_restore_elements( & 6654 surf_usm_h%waste_heat, & 6655 tmp_surf_waste_h, & 6656 surf_usm_h%start_index, & 6657 start_index_on_file, & 6658 end_index_on_file, & 6659 nxlc, nysc, & 6660 nxlf, nxrf, nysf, nynf, & 6661 nys_on_file, nyn_on_file, & 6662 nxl_on_file,nxr_on_file ) 6663 6664 CASE ( 'waste_heat_v(0)' ) 6665 IF ( k == 1 ) THEN 6666 IF ( .NOT. ALLOCATED( surf_usm_v(0)%waste_heat ) ) & 6667 ALLOCATE( surf_usm_v(0)%waste_heat(1:surf_usm_v(0)%ns) ) 6668 READ ( 13 ) tmp_surf_waste_v(0)%t 6669 ENDIF 6670 CALL surface_restore_elements( & 6671 surf_usm_v(0)%waste_heat, & 6672 tmp_surf_waste_v(0)%t, & 6673 surf_usm_v(0)%start_index, & 6674 start_index_on_file, & 6675 end_index_on_file, & 6676 nxlc, nysc, & 6677 nxlf, nxrf, nysf, nynf, & 6678 nys_on_file, nyn_on_file, & 6679 nxl_on_file,nxr_on_file ) 6680 6681 CASE ( 'waste_heat_v(1)' ) 6682 IF ( k == 1 ) THEN 6683 IF ( .NOT. ALLOCATED( surf_usm_v(1)%waste_heat ) ) & 6684 ALLOCATE( surf_usm_v(1)%waste_heat(1:surf_usm_v(1)%ns) ) 6685 READ ( 13 ) tmp_surf_waste_v(1)%t 6686 ENDIF 6687 CALL surface_restore_elements( & 6688 surf_usm_v(1)%waste_heat, & 6689 tmp_surf_waste_v(1)%t, & 6690 surf_usm_v(1)%start_index, & 6691 start_index_on_file, & 6692 end_index_on_file, & 6693 nxlc, nysc, & 6694 nxlf, nxrf, nysf, nynf, & 6695 nys_on_file, nyn_on_file, & 6696 nxl_on_file,nxr_on_file ) 6697 6698 CASE ( 'waste_heat_v(2)' ) 6699 IF ( k == 1 ) THEN 6700 IF ( .NOT. ALLOCATED( surf_usm_v(2)%waste_heat ) ) & 6701 ALLOCATE( surf_usm_v(2)%waste_heat(1:surf_usm_v(2)%ns) ) 6702 READ ( 13 ) tmp_surf_waste_v(2)%t 6703 ENDIF 6704 CALL surface_restore_elements( & 6705 surf_usm_v(2)%waste_heat, & 6706 tmp_surf_waste_v(2)%t, & 6707 surf_usm_v(2)%start_index, & 6708 start_index_on_file, & 6709 end_index_on_file, & 6710 nxlc, nysc, & 6711 nxlf, nxrf, nysf, nynf, & 6712 nys_on_file, nyn_on_file, & 6713 nxl_on_file,nxr_on_file ) 6714 6715 CASE ( 'waste_heat_v(3)' ) 6716 IF ( k == 1 ) THEN 6717 IF ( .NOT. ALLOCATED( surf_usm_v(3)%waste_heat ) ) & 6718 ALLOCATE( surf_usm_v(3)%waste_heat(1:surf_usm_v(3)%ns) ) 6719 READ ( 13 ) tmp_surf_waste_v(3)%t 6720 ENDIF 6721 CALL surface_restore_elements( & 6722 surf_usm_v(3)%waste_heat, & 6723 tmp_surf_waste_v(3)%t, & 6616 6724 surf_usm_v(3)%start_index, & 6617 6725 start_index_on_file, & … … 7627 7735 j_off = surf_usm_h%joff 7628 7736 i_off = surf_usm_h%ioff 7629 7737 7630 7738 ! 7631 7739 !-- First, treat horizontal surface elements … … 7957 8065 !-- diffusion_s, surface_layer_fluxes,... 7958 8066 surf_usm_h%shf(m) = surf_usm_h%wshf_eb(m) / c_p 8067 ! 8068 !-- If the indoor model is applied, further add waste heat from buildings to the 8069 !-- kinematic flux. 8070 IF ( indoor_model ) THEN 8071 surf_usm_h%shf(m) = surf_usm_h%shf(m) + surf_usm_h%waste_heat(m) / rho_cp 8072 ENDIF 7959 8073 7960 8074 … … 8382 8496 !-- diffusion_s, surface_layer_fluxes,... 8383 8497 surf_usm_v(l)%shf(m) = surf_usm_v(l)%wshf_eb(m) / c_p 8498 ! 8499 !-- If the indoor model is applied, further add waste heat from buildings to the 8500 !-- kinematic flux. 8501 IF ( indoor_model ) THEN 8502 surf_usm_v(l)%shf(m) = surf_usm_v(l)%shf(m) + & 8503 surf_usm_v(l)%waste_heat(m) / rho_cp 8504 ENDIF 8384 8505 8385 8506 IF ( surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp ) THEN … … 8685 8806 CALL wrd_write_string( 't_surf_green_h' ) 8686 8807 WRITE ( 14 ) t_surf_green_h 8687 8808 ! 8809 !-- Write restart data which is especially needed for the urban-surface 8810 !-- model. In order to do not fill up the restart routines in 8811 !-- surface_mod. 8812 !-- Output of waste heat from indoor model. Restart data is required in 8813 !-- this special case, because the indoor model where waste heat is 8814 !-- computed is call each hour (current default), so that waste heat would 8815 !-- have zero value until next call of indoor model. 8816 IF ( indoor_model ) THEN 8817 CALL wrd_write_string( 'waste_heat_h' ) 8818 WRITE ( 14 ) surf_usm_h%waste_heat 8819 ENDIF 8820 8688 8821 DO l = 0, 3 8689 8822 … … 8703 8836 8704 8837 CALL wrd_write_string( 't_surf_green_v(' // dum // ')' ) 8705 WRITE ( 14 ) t_surf_green_v(l)%t 8838 WRITE ( 14 ) t_surf_green_v(l)%t 8839 8840 IF ( indoor_model ) THEN 8841 CALL wrd_write_string( 'waste_heat_v(' // dum // ')' ) 8842 WRITE ( 14 ) surf_usm_v(l)%waste_heat 8843 ENDIF 8706 8844 8707 8845 ENDDO … … 8742 8880 8743 8881 ENDDO 8744 8745 8882 8746 8883 END SUBROUTINE usm_wrd_local
Note: See TracChangeset
for help on using the changeset viewer.