Index: /palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4266)
+++ /palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4267)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Bugfix in initialization, some indices to access building_pars where wrong.
+! Introduction of seasonal parameters.
+! 
+! 4246 2019-09-30 09:27:52Z pavelkrc
 ! 
 ! 
@@ -121,4 +125,8 @@
     USE netcdf_data_input_mod,                                                 &
         ONLY:  building_id_f, building_type_f
+
+    USE palm_date_time_mod,                                                    &
+        ONLY:  get_date_time, northward_equinox, seconds_per_hour,             &
+               southward_equinox
 
     USE surface_mod,                                                           &
@@ -273,6 +281,40 @@
     REAL(wp), PARAMETER ::  params_solar_protection  = 300.0_wp    !< [W/m2] chap. G.5.3.1 sun protection closed, if the radiation 
                                                                    !< on facade exceeds this value
-
-    
+!
+!-- Definition of seasonal parameters, summer and winter, for different building types
+    REAL(wp), DIMENSION(0:1,1:7) ::  summer_pars = RESHAPE( (/               & ! building_type 1
+                                          0.5_wp,                              & ! basical airflow without occupancy of the room
+                                          2.0_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.5_wp,                              & ! building_type 2: basical airflow without occupancy of the room
+                                          2.0_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.8_wp,                              & ! building_type 3: basical airflow without occupancy of the room
+                                          2.0_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 4: basical airflow without occupancy of the room
+                                          1.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 5: basical airflow without occupancy of the room
+                                          1.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 6: basical airflow without occupancy of the room
+                                          1.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 7: basical airflow without occupancy of the room
+                                          1.5_wp                               & ! additional airflow depend of occupancy of the room
+                                                           /), (/ 2, 7 /) )
+
+    REAL(wp), DIMENSION(0:1,1:7) ::  winter_pars = RESHAPE( (/               & ! building_type 1
+                                          0.1_wp,                              & ! basical airflow without occupancy of the room
+                                          0.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 2: basical airflow without occupancy of the room
+                                          0.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 3: basical airflow without occupancy of the room
+                                          0.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 4: basical airflow without occupancy of the room
+                                          1.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 5: basical airflow without occupancy of the room
+                                          1.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 6: basical airflow without occupancy of the room
+                                          1.5_wp,                              & ! additional airflow depend of occupancy of the room
+                                          0.1_wp,                              & ! building_type 7: basical airflow without occupancy of the room
+                                          1.5_wp                               & ! additional airflow depend of occupancy of the room
+                                                           /), (/ 2, 7 /) )
+
     SAVE
 
@@ -424,5 +466,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  message_string
+        ONLY:  message_string, time_since_reference_point
 
     USE indices,                                                               &
@@ -442,12 +484,13 @@
     IMPLICIT NONE
 
-    INTEGER(iwp) ::  bt   !< local building type
-    INTEGER(iwp) ::  i    !< running index along x-direction
-    INTEGER(iwp) ::  j    !< running index along y-direction
-    INTEGER(iwp) ::  k    !< running index along z-direction
-    INTEGER(iwp) ::  l    !< running index for surface-element orientation
-    INTEGER(iwp) ::  m    !< running index surface elements
-    INTEGER(iwp) ::  n    !< building index
-    INTEGER(iwp) ::  nb   !< building index
+    INTEGER(iwp) ::  bt          !< local building type
+    INTEGER(iwp) ::  day_of_year !< day of the year
+    INTEGER(iwp) ::  i           !< running index along x-direction
+    INTEGER(iwp) ::  j           !< running index along y-direction
+    INTEGER(iwp) ::  k           !< running index along z-direction
+    INTEGER(iwp) ::  l           !< running index for surface-element orientation
+    INTEGER(iwp) ::  m           !< running index surface elements
+    INTEGER(iwp) ::  n           !< building index
+    INTEGER(iwp) ::  nb          !< building index
 
     INTEGER(iwp), DIMENSION(:), ALLOCATABLE ::  build_ids           !< building IDs on entire model domain
@@ -927,17 +970,15 @@
 !-- In a second step initialize with building tpyes from static input file, 
 !-- where building types can be individual for each building.
-    buildings(:)%lambda_layer3       = building_pars(63,building_type)
-    buildings(:)%s_layer3            = building_pars(57,building_type)
+    buildings(:)%lambda_layer3       = building_pars(31,building_type)
+    buildings(:)%s_layer3            = building_pars(44,building_type)
     buildings(:)%f_c_win             = building_pars(119,building_type)
     buildings(:)%g_value_win         = building_pars(120,building_type)    
-    buildings(:)%u_value_win         = building_pars(121,building_type)    
-    buildings(:)%air_change_low      = building_pars(122,building_type)    
-    buildings(:)%air_change_high     = building_pars(123,building_type)    
+    buildings(:)%u_value_win         = building_pars(121,building_type)       
     buildings(:)%eta_ve              = building_pars(124,building_type)    
     buildings(:)%factor_a            = building_pars(125,building_type)    
     buildings(:)%factor_c            = building_pars(126,building_type)
     buildings(:)%lambda_at           = building_pars(127,building_type)    
-    buildings(:)%theta_int_h_set     = building_pars(118,building_type)    
-    buildings(:)%theta_int_c_set     = building_pars(117,building_type)
+    buildings(:)%theta_int_h_set     = building_pars(13,building_type)    
+    buildings(:)%theta_int_c_set     = building_pars(12,building_type)
     buildings(:)%q_h_max             = building_pars(128,building_type)    
     buildings(:)%q_c_max             = building_pars(129,building_type)          
@@ -948,4 +989,18 @@
     buildings(:)%params_waste_heat_h = building_pars(134,building_type)
     buildings(:)%params_waste_heat_c = building_pars(135,building_type)
+!
+!-- Initialize seasonal dependent parameters, depending on day of the year.
+!-- First, calculated day of the year. 
+    CALL get_date_time( time_since_reference_point, day_of_year = day_of_year )
+!
+!-- Summer is defined in between northward- and southward equinox. 
+    IF ( day_of_year >= northward_equinox  .AND.                               &
+         day_of_year <= southward_equinox )  THEN
+       buildings(:)%air_change_low      = summer_pars(0,building_type)    
+       buildings(:)%air_change_high     = summer_pars(1,building_type)
+    ELSE
+       buildings(:)%air_change_low      = winter_pars(0,building_type)    
+       buildings(:)%air_change_high     = winter_pars(1,building_type)
+    ENDIF
 !
 !-- Initialize ventilaation load. Please note, building types > 7 are actually
@@ -979,17 +1034,15 @@
                  bt = building_type_f%var(j,i)
                  
-                 buildings(nb)%lambda_layer3       = building_pars(63,bt)
-                 buildings(nb)%s_layer3            = building_pars(57,bt)
+                 buildings(nb)%lambda_layer3       = building_pars(31,bt)
+                 buildings(nb)%s_layer3            = building_pars(44,bt)
                  buildings(nb)%f_c_win             = building_pars(119,bt)
                  buildings(nb)%g_value_win         = building_pars(120,bt)    
                  buildings(nb)%u_value_win         = building_pars(121,bt)    
-                 buildings(nb)%air_change_low      = building_pars(122,bt)    
-                 buildings(nb)%air_change_high     = building_pars(123,bt)    
                  buildings(nb)%eta_ve              = building_pars(124,bt)    
                  buildings(nb)%factor_a            = building_pars(125,bt)    
                  buildings(nb)%factor_c            = building_pars(126,bt)
                  buildings(nb)%lambda_at           = building_pars(127,bt)    
-                 buildings(nb)%theta_int_h_set     = building_pars(118,bt)    
-                 buildings(nb)%theta_int_c_set     = building_pars(117,bt)
+                 buildings(nb)%theta_int_h_set     = building_pars(13,bt)    
+                 buildings(nb)%theta_int_c_set     = building_pars(12,bt)
                  buildings(nb)%q_h_max             = building_pars(128,bt)    
                  buildings(nb)%q_c_max             = building_pars(129,bt)          
@@ -1000,4 +1053,14 @@
                  buildings(nb)%params_waste_heat_h = building_pars(134,bt)
                  buildings(nb)%params_waste_heat_c = building_pars(135,bt)
+
+              IF ( day_of_year >= northward_equinox  .AND.                     &
+                   day_of_year <= southward_equinox )  THEN
+                 buildings(nb)%air_change_low      = summer_pars(0,bt)    
+                 buildings(nb)%air_change_high     = summer_pars(1,bt)
+              ELSE
+                 buildings(nb)%air_change_low      = winter_pars(0,bt)    
+                 buildings(nb)%air_change_high     = winter_pars(1,bt)
+              ENDIF
+
 !
 !--              Initialize ventilaation load. Please note, building types > 7 
@@ -1039,6 +1102,6 @@
           du_tmp = 1.0_wp / u_tmp
           
-          buildings(nb)%h_es = ( du_tmp / ( du_tmp - ( 1.0_wp / h_is ) ) ) *   &
-                                 u_tmp   
+          buildings(nb)%h_es = 1.0_wp / ( du_tmp - ( 1.0_wp / h_is ) )
+
        ENDIF
     ENDDO
@@ -1078,7 +1141,4 @@
     USE grid_variables,                                                        &
         ONLY:  dx, dy
-
-    USE palm_date_time_mod,                                                    &
-        ONLY:  get_date_time, seconds_per_hour
 
     USE pegrid
@@ -1124,10 +1184,8 @@
 !--       Residental Building, panel WBS 70    
           IF ( buildings(nb)%ventilation_int_loads == 1 )  THEN
-             IF ( time_utc_hour >= 6.0_wp  .AND.  time_utc_hour <= 8.0_wp )  THEN
+             IF ( time_utc_hour >= 8.0_wp  .AND.  time_utc_hour <= 18.0_wp )  THEN
+                schedule_d = 0
+             ELSE
                 schedule_d = 1
-             ELSEIF ( time_utc_hour >= 18.0_wp  .AND.  time_utc_hour <= 23.0_wp )  THEN
-                schedule_d = 1
-             ELSE
-                schedule_d = 0
              ENDIF
           ENDIF
Index: /palm/trunk/SOURCE/palm_date_time_mod.f90
===================================================================
--- /palm/trunk/SOURCE/palm_date_time_mod.f90	(revision 4266)
+++ /palm/trunk/SOURCE/palm_date_time_mod.f90	(revision 4267)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Add days of northward- and southward equinox
+! 
+! 4227 2019-09-10 18:04:34Z gronemeier
 ! Complete rework of module date_and_time_mod:
 !  - renamed module to prevent confusion with
@@ -64,4 +67,9 @@
     INTEGER(iwp), PARAMETER ::  minutes_per_hour   = 60_iwp                                 !< minutes in an hour
     INTEGER(iwp), PARAMETER ::  months_per_year    = 12_iwp                                 !< months in a year
+!
+!-- Definition of mean northward and southward equinox (summer and winter half year) 
+!-- in days of year. For simplicity, March 21 and September 21 is assumed.
+    INTEGER(iwp), PARAMETER ::  northward_equinox  = 80_iwp
+    INTEGER(iwp), PARAMETER ::  southward_equinox  = 264_iwp
 
     REAL(wp),     PARAMETER ::  seconds_per_minute = 60.0_wp                                !< seconds in a minute
@@ -146,7 +154,9 @@
        minutes_per_hour,   &
        months_per_year,    &
+       northward_equinox,  &
        seconds_per_minute, &
        seconds_per_hour,   &
        seconds_per_day,    &
+       southward_equinox,  &
        weekdays
 
Index: /palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4266)
+++ /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4267)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Revision of some indoor-model parameters
+! 
+! 4259 2019-10-09 10:05:22Z suehring
 ! Instead of terminate the job in case the relative wall fractions do not 
 ! sum-up to one, give only an informative message and normalize the fractions.
@@ -9176,14 +9179,14 @@
            0.76_wp,        &  !< parameter 120 - g-value windows
            5.0_wp,         &  !< parameter 121 - u-value windows
-           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room
-           0.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room
+           0.5_wp,         &  !< parameter 122 - basical airflow without occupancy of the room for - summer 0.5_wp, winter 0.1
+           2.0_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room for - summer 2.0_wp, winter 0.5
            0.0_wp,         &  !< parameter 124 - heat recovery efficiency
            3.5_wp,         &  !< parameter 125 - dynamic parameter specific effective surface
            370000.0_wp,    &  !< parameter 126 - dynamic parameter innner heatstorage
            4.5_wp,         &  !< parameter 127 - ratio internal surface/floor area
-           100000.0_wp,    &  !< parameter 128 - maximal heating capacity
+           100.0_wp,       &  !< parameter 128 - maximal heating capacity
            0.0_wp,         &  !< parameter 129 - maximal cooling capacity
-           3.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
-           10.0_wp,        &  !< parameter 131 - basic internal heat gains without occupancy of the room
+           2.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
+           6.0_wp,         &  !< parameter 131 - basic internal heat gains without occupancy of the room
            3.0_wp,         &  !< parameter 132 - storey height
            0.2_wp,         &  !< parameter 133 - ceiling construction height
@@ -9192,5 +9195,5 @@
                             /)
                             
-        building_pars(:,2) = (/   &
+     building_pars(:,2) = (/   &
            0.73_wp,        &  !< parameter 0   - wall fraction above ground floor level
            0.27_wp,        &  !< parameter 1   - window fraction above ground floor level
@@ -9315,14 +9318,14 @@
            0.6_wp,         &  !< parameter 120 - g-value windows
            3.0_wp,         &  !< parameter 121 - u-value windows
-           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room
-           0.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room
+           0.5_wp,         &  !< parameter 122 - basical airflow without occupancy of the room for - summer 0.5_wp for winter 0.1
+           2.0_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room for - summer 2.0_wp for winter 0.5
            0.0_wp,         &  !< parameter 124 - heat recovery efficiency
            2.5_wp,         &  !< parameter 125 - dynamic parameter specific effective surface
            165000.0_wp,    &  !< parameter 126 - dynamic parameter innner heatstorage
            4.5_wp,         &  !< parameter 127 - ratio internal surface/floor area
-           100000.0_wp,    &  !< parameter 128 - maximal heating capacity
+           100.0_wp,       &  !< parameter 128 - maximal heating capacity
            0.0_wp,         &  !< parameter 129 - maximal cooling capacity
-           4.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
-           8.0_wp,         &  !< parameter 131 - basic internal heat gains without occupancy of the room
+           2.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
+           6.0_wp,         &  !< parameter 131 - basic internal heat gains without occupancy of the room
            3.0_wp,         &  !< parameter 132 - storey height
            0.2_wp,         &  !< parameter 133 - ceiling construction height
@@ -9330,6 +9333,6 @@
            1.333_wp        &  !< parameter 135 - anthropogenic heat output for cooling
                             /)
-                            
-        building_pars(:,3) = (/   &
+
+  building_pars(:,3) = (/   &
            0.7_wp,         &  !< parameter 0   - wall fraction above ground floor level
            0.3_wp,         &  !< parameter 1   - window fraction above ground floor level
@@ -9451,22 +9454,22 @@
            5.0_wp,         &  !< parameter 117 - green albedo roof
            0.0_wp,         &  !< parameter 118 - green type roof
-           0.8_wp,         &  !< parameter 119 - shading factor
+           0.3_wp,         &  !< parameter 119 - shading factor
            0.5_wp,         &  !< parameter 120 - g-value windows
-           2.5_wp,         &  !< parameter 121 - u-value windows
-           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room
-           0.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room
+           1.0_wp,         &  !< parameter 121 - u-value windows
+           0.8_wp,         &  !< parameter 122 - basical airflow without occupancy of the room for - summer 0.8_wp, winter 0.1
+           2.0_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room for - summer 2.0_wp, winter 0.5
            0.8_wp,         &  !< parameter 124 - heat recovery efficiency
            2.5_wp,         &  !< parameter 125 - dynamic parameter specific effective surface
            80000.0_wp,     &  !< parameter 126 - dynamic parameter innner heatstorage
            4.5_wp,         &  !< parameter 127 - ratio internal surface/floor area
-           100000.0_wp,    &  !< parameter 128 - maximal heating capacity
+           100.0_wp,       &  !< parameter 128 - maximal heating capacity
            0.0_wp,         &  !< parameter 129 - maximal cooling capacity
-           3.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
-           8.0_wp,         &  !< parameter 131 - basic internal heat gains without occupancy of the room
+           2.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
+           6.0_wp,         &  !< parameter 131 - basic internal heat gains without occupancy of the room
            3.0_wp,         &  !< parameter 132 - storey height
            0.2_wp,         &  !< parameter 133 - ceiling construction height
            -2.0_wp,        &  !< parameter 134 - anthropogenic heat output for heating
            1.25_wp         &  !< parameter 135 - anthropogenic heat output for cooling
-                            /) 
+                            /)    
                             
         building_pars(:,4) = (/   &
@@ -9590,15 +9593,15 @@
            5.0_wp,         &  !< parameter 117 - green albedo roof
            0.0_wp,         &  !< parameter 118 - green type roof
-           0.8_wp,         &  !< parameter 119 - shading factor
+           0.25_wp,        &  !< parameter 119 - shading factor
            0.76_wp,        &  !< parameter 120 - g-value windows
            5.0_wp,         &  !< parameter 121 - u-value windows
-           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room
-           1.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room
+           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room for - summer 0.1_wp, winter 0.1
+           1.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room for - summer 1.5_wp, winter 1.5
            0.0_wp,         &  !< parameter 124 - heat recovery efficiency
            3.5_wp,         &  !< parameter 125 - dynamic parameter specific effective surface
            370000.0_wp,    &  !< parameter 126 - dynamic parameter innner heatstorage
            4.5_wp,         &  !< parameter 127 - ratio internal surface/floor area
-           100000.0_wp,    &  !< parameter 128 - maximal heating capacity
-           0.0_wp,         &  !< parameter 129 - maximal cooling capacity
+           100.0_wp,       &  !< parameter 128 - maximal heating capacity
+           -200.0_wp,      &  !< parameter 129 - maximal cooling capacity
            3.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
            10.0_wp,        &  !< parameter 131 - basic internal heat gains without occupancy of the room
@@ -9729,15 +9732,15 @@
            5.0_wp,         &  !< parameter 117 - green albedo roof
            0.0_wp,         &  !< parameter 118 - green type roof
-           0.8_wp,         &  !< parameter 119 - shading factor
+           0.25_wp,        &  !< parameter 119 - shading factor
            0.6_wp,         &  !< parameter 120 - g-value windows
            3.0_wp,         &  !< parameter 121 - u-value windows
-           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room
-           1.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room
+           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room for - summer 0.1_wp, winter 0.1
+           1.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room for - summer 1.5_wp, winter 1.5
            0.65_wp,        &  !< parameter 124 - heat recovery efficiency
            2.5_wp,         &  !< parameter 125 - dynamic parameter specific effective surface
            165000.0_wp,    &  !< parameter 126 - dynamic parameter innner heatstorage
            4.5_wp,         &  !< parameter 127 - ratio internal surface/floor area
-           100000.0_wp,    &  !< parameter 128 - maximal heating capacity
-           0.0_wp,         &  !< parameter 129 - maximal cooling capacity
+           100.0_wp,       &  !< parameter 128 - maximal heating capacity
+           -200.0_wp,      &  !< parameter 129 - maximal cooling capacity
            7.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
            20.0_wp,        &  !< parameter 131 - basic internal heat gains without occupancy of the room
@@ -9868,15 +9871,15 @@
            5.0_wp,         &  !< parameter 117 - green albedo roof
            0.0_wp,         &  !< parameter 118 - green type roof
-           0.8_wp,         &  !< parameter 119 - shading factor
+           0.25_wp,        &  !< parameter 119 - shading factor
            0.5_wp,         &  !< parameter 120 - g-value windows
            2.5_wp,         &  !< parameter 121 - u-value windows
-           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room
-           1.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room
+           0.1_wp,         &  !< parameter 122 - basical airflow without occupancy of the room for - summer 0.1_wp, winter 0.1
+           1.5_wp,         &  !< parameter 123 - additional airflow depend of occupancy of the room for - summer 1.5_wp, winter 1.5
            0.9_wp,         &  !< parameter 124 - heat recovery efficiency
            2.5_wp,         &  !< parameter 125 - dynamic parameter specific effective surface
            80000.0_wp,     &  !< parameter 126 - dynamic parameter innner heatstorage
            4.5_wp,         &  !< parameter 127 - ratio internal surface/floor area
-           100000.0_wp,    &  !< parameter 128 - maximal heating capacity
-           0.0_wp,         &  !< parameter 129 - maximal cooling capacity
+           100.0_wp,       &  !< parameter 128 - maximal heating capacity
+           -80.0_wp,       &  !< parameter 129 - maximal cooling capacity
            5.0_wp,         &  !< parameter 130 - additional internal heat gains dependent on occupancy of the room
            15.0_wp,        &  !< parameter 131 - basic internal heat gains without occupancy of the room
