Changeset 4671 for palm/trunk/SOURCE/indoor_model_mod.f90
- Timestamp:
- Sep 9, 2020 8:27:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/indoor_model_mod.f90
r4646 r4671 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Implementation of downward facing USM and LSM surfaces 28 ! 29 ! 4646 2020-08-24 16:02:40Z raasch 27 30 ! file re-formatted to follow the PALM coding standard 28 31 ! … … 801 804 !-- Horizontal facades 802 805 buildings(:)%num_facades_per_building_h_l = 0 803 DO m = 1, surf_usm_h%ns 804 ! 805 !-- For the current facade element determine corresponding building index. 806 !-- First, obtain j,j,k indices of the building. Please note the offset between facade/surface 807 !-- element and building location (for horizontal surface elements the horizontal offsets are 808 !-- zero). 809 i = surf_usm_h%i(m) + surf_usm_h%ioff 810 j = surf_usm_h%j(m) + surf_usm_h%joff 811 k = surf_usm_h%k(m) + surf_usm_h%koff 812 ! 813 !-- Determine building index and check whether building is on PE. 814 nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) 815 816 IF ( buildings(nb)%on_pe ) THEN 817 ! 818 !-- Count number of facade elements at each height level. 819 buildings(nb)%num_facade_h(k) = buildings(nb)%num_facade_h(k) + 1 820 ! 821 !-- Moreover, sum up number of local facade elements per building. 822 buildings(nb)%num_facades_per_building_h_l = & 806 DO l = 0, 1 807 DO m = 1, surf_usm_h(l)%ns 808 ! 809 !-- For the current facade element determine corresponding building index. 810 !-- First, obtain j,j,k indices of the building. Please note the offset between facade/surface 811 !-- element and building location (for horizontal surface elements the horizontal offsets are 812 !-- zero). 813 i = surf_usm_h(l)%i(m) + surf_usm_h(l)%ioff 814 j = surf_usm_h(l)%j(m) + surf_usm_h(l)%joff 815 k = surf_usm_h(l)%k(m) + surf_usm_h(l)%koff 816 ! 817 !-- Determine building index and check whether building is on PE. 818 nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) 819 820 IF ( buildings(nb)%on_pe ) THEN 821 ! 822 !-- Count number of facade elements at each height level. 823 buildings(nb)%num_facade_h(k) = buildings(nb)%num_facade_h(k) + 1 824 ! 825 !-- Moreover, sum up number of local facade elements per building. 826 buildings(nb)%num_facades_per_building_h_l = & 823 827 buildings(nb)%num_facades_per_building_h_l + 1 824 ENDIF 828 ENDIF 829 ENDDO 825 830 ENDDO 826 831 ! … … 944 949 n_fa = 1 945 950 946 DO m = 1, surf_usm_h%ns 947 i = surf_usm_h%i(m) + surf_usm_h%ioff 948 j = surf_usm_h%j(m) + surf_usm_h%joff 949 950 nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) 951 952 IF ( buildings(nb)%on_pe ) THEN 953 buildings(nb)%m_h(n_fa(nb)) = m 954 n_fa(nb) = n_fa(nb) + 1 955 ENDIF 951 DO l = 0, 1 952 DO m = 1, surf_usm_h(l)%ns 953 i = surf_usm_h(l)%i(m) + surf_usm_h(l)%ioff 954 j = surf_usm_h(l)%j(m) + surf_usm_h(l)%joff 955 956 nb = MINLOC( ABS( buildings(:)%id - building_id_f%var(j,i) ), DIM=1 ) 957 958 IF ( buildings(nb)%on_pe ) THEN 959 buildings(nb)%m_h(n_fa(nb)) = m 960 n_fa(nb) = n_fa(nb) + 1 961 ENDIF 962 ENDDO 956 963 ENDDO 957 964 … … 1212 1219 DO fa = 1, buildings(nb)%num_facades_per_building_h_l 1213 1220 ! 1214 !-- Determine index where corresponding surface-type information is stored. 1215 m = buildings(nb)%m_h(fa) 1221 !-- Determine indices where corresponding surface-type information is stored. 1222 l = buildings(nb)%l_v(fa) 1223 m = buildings(nb)%m_v(fa) 1216 1224 ! 1217 1225 !-- Determine building height level index. 1218 kk = surf_usm_h %k(m) + surf_usm_h%koff1226 kk = surf_usm_h(l)%k(m) + surf_usm_h(l)%koff 1219 1227 ! 1220 1228 !-- Building geometries --> not time-dependent … … 1225 1233 ( buildings(nb)%num_facades_per_building_h + & 1226 1234 buildings(nb)%num_facades_per_building_v ) !< [m2] area of total facade 1227 window_area_per_facade = surf_usm_h %frac(m,ind_wat_win) * facade_element_area !< [m2] window area per facade1235 window_area_per_facade = surf_usm_h(l)%frac(m,ind_wat_win) * facade_element_area !< [m2] window area per facade 1228 1236 !< element 1229 1237 … … 1274 1282 ! 1275 1283 !-- Net short-wave radiation through window area (was i_global) 1276 net_sw_in = surf_usm_h %rad_sw_in(m) - surf_usm_h%rad_sw_out(m)1284 net_sw_in = surf_usm_h(l)%rad_sw_in(m) - surf_usm_h(l)%rad_sw_out(m) 1277 1285 ! 1278 1286 !-- Quantities needed for im_calc_temperatures 1279 i = surf_usm_h %i(m)1280 j = surf_usm_h %j(m)1281 k = surf_usm_h %k(m)1282 near_facade_temperature = surf_usm_h %pt_10cm(m)1283 indoor_wall_window_temperature = &1284 surf_usm_h %frac(m,ind_veg_wall) * t_wall_h(nzt_wall,m) &1285 + surf_usm_h %frac(m,ind_wat_win) * t_window_h(nzt_wall,m)1287 i = surf_usm_h(l)%i(m) 1288 j = surf_usm_h(l)%j(m) 1289 k = surf_usm_h(l)%k(m) 1290 near_facade_temperature = surf_usm_h(l)%pt_10cm(m) 1291 indoor_wall_window_temperature = & 1292 surf_usm_h(l)%frac(m,ind_veg_wall) * t_wall_h(l)%val(nzt_wall,m) & 1293 + surf_usm_h(l)%frac(m,ind_wat_win) * t_window_h(l)%val(nzt_wall,m) 1286 1294 ! 1287 1295 !-- Solar thermal gains. If net_sw_in larger than sun-protection threshold parameter … … 1393 1401 !-- Will be used for thermal comfort calculations. 1394 1402 theta_op = 0.3_wp * theta_air_ac + 0.7_wp * theta_s !< [degree_C] operative Temperature Eq. (C.12) 1395 ! surf_usm_h %t_indoor(m) = theta_op !< not integrated now1403 ! surf_usm_h(l)%t_indoor(m) = theta_op !< not integrated now 1396 1404 ! 1397 1405 !-- Heat flux into the wall. Value needed in urban_surface_mod to … … 1403 1411 ! 1404 1412 !-- Transfer q_wall_win back to USM (innermost wall/window layer) 1405 surf_usm_h %iwghf_eb(m) = q_wall_win1406 surf_usm_h %iwghf_eb_window(m) = q_wall_win1413 surf_usm_h(l)%iwghf_eb(m) = q_wall_win 1414 surf_usm_h(l)%iwghf_eb_window(m) = q_wall_win 1407 1415 ! 1408 1416 !-- Sum up operational indoor temperature per kk-level. Further below, this temperature is … … 1425 1433 ) / facade_element_area !< [W/m2] , observe the directional 1426 1434 !< convention in PALM! 1427 surf_usm_h %waste_heat(m) = q_waste_heat1435 surf_usm_h(l)%waste_heat(m) = q_waste_heat 1428 1436 ENDDO !< Horizontal surfaces loop 1429 1437 ! … … 1510 1518 near_facade_temperature = surf_usm_v(l)%pt_10cm(m) 1511 1519 indoor_wall_window_temperature = & 1512 surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)% t(nzt_wall,m) &1513 + surf_usm_v(l)%frac(m,ind_wat_win) * t_window_v(l)% t(nzt_wall,m)1520 surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)%val(nzt_wall,m) & 1521 + surf_usm_v(l)%frac(m,ind_wat_win) * t_window_v(l)%val(nzt_wall,m) 1514 1522 ! 1515 1523 !-- Solar thermal gains. If net_sw_in larger than sun-protection … … 1885 1893 CASE ( 'im_hf_roof' ) 1886 1894 IF ( av == 0 ) THEN 1887 DO m = 1, surf_usm_h %ns1888 i = surf_usm_h %i(m) !+ surf_usm_h%ioff1889 j = surf_usm_h %j(m) !+ surf_usm_h%joff1890 k = surf_usm_h %k(m) !+ surf_usm_h%koff1891 local_pf(i,j,k) = surf_usm_h %iwghf_eb(m)1895 DO m = 1, surf_usm_h(0)%ns 1896 i = surf_usm_h(0)%i(m) !+ surf_usm_h%ioff 1897 j = surf_usm_h(0)%j(m) !+ surf_usm_h%joff 1898 k = surf_usm_h(0)%k(m) !+ surf_usm_h%koff 1899 local_pf(i,j,k) = surf_usm_h(0)%iwghf_eb(m) 1892 1900 ENDDO 1893 1901 ENDIF … … 1895 1903 CASE ( 'im_hf_roof_waste' ) 1896 1904 IF ( av == 0 ) THEN 1897 DO m = 1, surf_usm_h %ns1898 i = surf_usm_h %i(m) !+ surf_usm_h%ioff1899 j = surf_usm_h %j(m) !+ surf_usm_h%joff1900 k = surf_usm_h %k(m) !+ surf_usm_h%koff1901 local_pf(i,j,k) = surf_usm_h %waste_heat(m)1905 DO m = 1, surf_usm_h(0)%ns 1906 i = surf_usm_h(0)%i(m) !+ surf_usm_h%ioff 1907 j = surf_usm_h(0)%j(m) !+ surf_usm_h%joff 1908 k = surf_usm_h(0)%k(m) !+ surf_usm_h%koff 1909 local_pf(i,j,k) = surf_usm_h(0)%waste_heat(m) 1902 1910 ENDDO 1903 1911 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.