Index: palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4208)
+++ palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4209)
@@ -25,5 +25,10 @@
 ! Former revisions:
 ! -----------------
-! $Id: indoor_model_mod.f90 
+! $Id$
+! - Bugfix in initialization of indoor temperature
+! - Prescibe default indoor temperature in case it is not given in the 
+!   namelist input
+! 
+! 
 ! Corrected "Former revisions" section
 ! 
@@ -183,63 +188,73 @@
     INTEGER(iwp) ::  solar_protection_on     !< Solar protection on
 
-    REAL(wp) ::  a_m                           !< [m2] the effective mass-related area
-    REAL(wp) ::  air_change                    !< [1/h] Airflow
-    REAL(wp) ::  c_m                           !< [J/K] internal heat storage capacity
-    REAL(wp) ::  dt_indoor = 3600.0_wp         !< [s] namelist parameter: time interval for indoor-model application
-    REAL(wp) ::  facade_element_area           !< [m2_facade] building surface facade
-    REAL(wp) ::  floor_area_per_facade         !< [m2/m2] floor area per facade area
-    REAL(wp) ::  h_t_1                         !< [W/K] Heat transfer coefficient auxiliary variable 1
-    REAL(wp) ::  h_t_2                         !< [W/K] Heat transfer coefficient auxiliary variable 2
-    REAL(wp) ::  h_t_3                         !< [W/K] Heat transfer coefficient auxiliary variable 3 
-    REAL(wp) ::  h_t_wm                        !< [W/K] Heat transfer coefficient of the emmision (got with h_t_ms the thermal mass)
-    REAL(wp) ::  h_t_is                        !< [W/K] thermal coupling conductance (Thermischer Kopplungsleitwert)
-    REAL(wp) ::  h_t_ms                        !< [W/K] Heat transfer conductance term (got with h_t_wm the thermal mass)
-    REAL(wp) ::  h_t_wall                      !< [W/K] heat transfer coefficient of opaque components (assumption: got all thermal mass) contains of h_t_wm and h_t_ms
-    REAL(wp) ::  h_t_es                        !< [W/K] heat transfer coefficient of doors, windows, curtain walls and glazed walls (assumption: thermal mass=0)
-    REAL(wp) ::  h_v                           !< [W/K] heat transfer of ventilation
-    REAL(wp) ::  indoor_volume_per_facade      !< [m3] indoor air volume per facade element
-    REAL(wp) ::  initial_indoor_temperature    !< [K] initial indoor temperature (namelist parameter)
-    REAL(wp) ::  net_sw_in                     !< [W/m2] net short-wave radiation
-    REAL(wp) ::  phi_hc_nd                     !< [W] heating demand and/or cooling demand
-    REAL(wp) ::  phi_hc_nd_10                  !< [W] heating demand and/or cooling demand for heating or cooling 
-    REAL(wp) ::  phi_hc_nd_ac                  !< [W] actual heating demand and/or cooling demand
-    REAL(wp) ::  phi_hc_nd_un                  !< [W] unlimited heating demand and/or cooling demand which is necessary to reach the demanded required temperature (heating is positive, cooling is negative) 
-    REAL(wp) ::  phi_ia                        !< [W] internal air load = internal loads * 0.5, Eq. (C.1)
-    REAL(wp) ::  phi_m                         !< [W] mass specific thermal load (internal and external)
-    REAL(wp) ::  phi_mtot                      !< [W] total mass specific thermal load (internal and external)
-    REAL(wp) ::  phi_sol                       !< [W] solar loads
-    REAL(wp) ::  phi_st                        !< [W] mass specific thermal load implied non thermal mass 
-    REAL(wp) ::  q_wall_win                    !< [W/m2]heat flux from indoor into wall/window
-    REAL(wp) ::  q_waste_heat                  !< [W/m2]waste heat, sum of waste heat over the roof to Palm
-    
-    REAL(wp) ::  q_c_m                         !< [W] Energy of thermal storage mass specific thermal load for internal and external heatsources (for energy bilanz)
-    REAL(wp) ::  q_c_st                        !< [W] Energy of thermal storage mass specific thermal load implied non thermal mass (for energy bilanz)
-    REAL(wp) ::  q_int                         !< [W] Energy of internal air load (for energy bilanz)
-    REAL(wp) ::  q_sol                         !< [W] Energy of solar (for energy bilanz)
-    REAL(wp) ::  q_trans                       !< [W] Energy of transmission (for energy bilanz)
-    REAL(wp) ::  q_vent                        !< [W] Energy of ventilation (for energy bilanz)
-    
-    REAL(wp) ::  schedule_d                    !< [-] activation for internal loads (low or high + low)
-    REAL(wp) ::  skip_time_do_indoor = 0.0_wp  !< [s] Indoor model is not called before this time
-    REAL(wp) ::  theta_air                     !< [degree_C] air temperature of the RC-node
-    REAL(wp) ::  theta_air_0                   !< [degree_C] air temperature of the RC-node in equilibrium
-    REAL(wp) ::  theta_air_10                  !< [degree_C] air temperature of the RC-node from a heating capacity of 10 W/m2
-    REAL(wp) ::  theta_air_ac                  !< [degree_C] actual room temperature after heating/cooling
-    REAL(wp) ::  theta_air_set                 !< [degree_C] Setpoint_temperature for the room
-    REAL(wp) ::  theta_m                       !< [degree_C} inner temperature of the RC-node
-    REAL(wp) ::  theta_m_t                     !< [degree_C] (Fictive) component temperature timestep
-    REAL(wp) ::  theta_m_t_prev                !< [degree_C] (Fictive) component temperature previous timestep (do not change)
-    REAL(wp) ::  theta_op                      !< [degree_C] operative temperature
-    REAL(wp) ::  theta_s                       !< [degree_C] surface temperature of the RC-node
-    REAL(wp) ::  time_indoor = 0.0_wp          !< [s] time since last call of indoor model
-    REAL(wp) ::  total_area                    !< [m2] area of all surfaces pointing to zone
-    REAL(wp) ::  window_area_per_facade        !< [m2] window area per facade element
-    
-    REAL(wp), PARAMETER ::  h_is                     = 3.45_wp     !< [W/(m2 K)] surface-related heat transfer coefficient between surface and air (chap. 7.2.2.2)
+    REAL(wp) ::  a_m                                 !< [m2] the effective mass-related area
+    REAL(wp) ::  air_change                          !< [1/h] Airflow
+    REAL(wp) ::  c_m                                 !< [J/K] internal heat storage capacity
+    REAL(wp) ::  dt_indoor = 3600.0_wp               !< [s] namelist parameter: time interval for indoor-model application
+    REAL(wp) ::  facade_element_area                 !< [m2_facade] building surface facade
+    REAL(wp) ::  floor_area_per_facade               !< [m2/m2] floor area per facade area
+    REAL(wp) ::  h_t_1                               !< [W/K] Heat transfer coefficient auxiliary variable 1
+    REAL(wp) ::  h_t_2                               !< [W/K] Heat transfer coefficient auxiliary variable 2
+    REAL(wp) ::  h_t_3                               !< [W/K] Heat transfer coefficient auxiliary variable 3 
+    REAL(wp) ::  h_t_wm                              !< [W/K] Heat transfer coefficient of the emmision (got with h_t_ms the thermal mass)
+    REAL(wp) ::  h_t_is                              !< [W/K] thermal coupling conductance (Thermischer Kopplungsleitwert)
+    REAL(wp) ::  h_t_ms                              !< [W/K] Heat transfer conductance term (got with h_t_wm the thermal mass)
+    REAL(wp) ::  h_t_wall                            !< [W/K] heat transfer coefficient of opaque components (assumption: got all
+                                                     !< thermal mass) contains of h_t_wm and h_t_ms
+    REAL(wp) ::  h_t_es                              !< [W/K] heat transfer coefficient of doors, windows, curtain walls and 
+                                                     !< glazed walls (assumption: thermal mass=0)
+    REAL(wp) ::  h_v                                 !< [W/K] heat transfer of ventilation
+    REAL(wp) ::  indoor_volume_per_facade            !< [m3] indoor air volume per facade element
+    REAL(wp) ::  initial_indoor_temperature = 293.15 !< [K] initial indoor temperature (namelist parameter)
+    REAL(wp) ::  net_sw_in                           !< [W/m2] net short-wave radiation
+    REAL(wp) ::  phi_hc_nd                           !< [W] heating demand and/or cooling demand
+    REAL(wp) ::  phi_hc_nd_10                        !< [W] heating demand and/or cooling demand for heating or cooling 
+    REAL(wp) ::  phi_hc_nd_ac                        !< [W] actual heating demand and/or cooling demand
+    REAL(wp) ::  phi_hc_nd_un                        !< [W] unlimited heating demand and/or cooling demand which is necessary to
+                                                     !< reach the demanded required temperature (heating is positive, 
+                                                     !< cooling is negative) 
+    REAL(wp) ::  phi_ia                              !< [W] internal air load = internal loads * 0.5, Eq. (C.1)
+    REAL(wp) ::  phi_m                               !< [W] mass specific thermal load (internal and external)
+    REAL(wp) ::  phi_mtot                            !< [W] total mass specific thermal load (internal and external)
+    REAL(wp) ::  phi_sol                             !< [W] solar loads
+    REAL(wp) ::  phi_st                              !< [W] mass specific thermal load implied non thermal mass 
+    REAL(wp) ::  q_wall_win                          !< [W/m2]heat flux from indoor into wall/window
+    REAL(wp) ::  q_waste_heat                        !< [W/m2]waste heat, sum of waste heat over the roof to Palm
+                                                     
+    REAL(wp) ::  q_c_m                               !< [W] Energy of thermal storage mass specific thermal load for internal
+                                                     !< and external heatsources (for energy bilanz)
+    REAL(wp) ::  q_c_st                              !< [W] Energy of thermal storage mass specific thermal load implied non thermal mass (for energy bilanz)
+    REAL(wp) ::  q_int                               !< [W] Energy of internal air load (for energy bilanz)
+    REAL(wp) ::  q_sol                               !< [W] Energy of solar (for energy bilanz)
+    REAL(wp) ::  q_trans                             !< [W] Energy of transmission (for energy bilanz)
+    REAL(wp) ::  q_vent                              !< [W] Energy of ventilation (for energy bilanz)
+                                                     
+    REAL(wp) ::  schedule_d                          !< [-] activation for internal loads (low or high + low)
+    REAL(wp) ::  skip_time_do_indoor = 0.0_wp        !< [s] Indoor model is not called before this time
+    REAL(wp) ::  theta_air                           !< [degree_C] air temperature of the RC-node
+    REAL(wp) ::  theta_air_0                         !< [degree_C] air temperature of the RC-node in equilibrium
+    REAL(wp) ::  theta_air_10                        !< [degree_C] air temperature of the RC-node from a heating capacity 
+                                                     !< of 10 W/m2
+    REAL(wp) ::  theta_air_ac                        !< [degree_C] actual room temperature after heating/cooling
+    REAL(wp) ::  theta_air_set                       !< [degree_C] Setpoint_temperature for the room
+    REAL(wp) ::  theta_m                             !< [degree_C} inner temperature of the RC-node
+    REAL(wp) ::  theta_m_t                           !< [degree_C] (Fictive) component temperature timestep
+    REAL(wp) ::  theta_m_t_prev                      !< [degree_C] (Fictive) component temperature previous timestep (do not change)
+    REAL(wp) ::  theta_op                            !< [degree_C] operative temperature
+    REAL(wp) ::  theta_s                             !< [degree_C] surface temperature of the RC-node
+    REAL(wp) ::  time_indoor = 0.0_wp                !< [s] time since last call of indoor model
+    REAL(wp) ::  total_area                          !< [m2] area of all surfaces pointing to zone
+    REAL(wp) ::  window_area_per_facade              !< [m2] window area per facade element
+    
+    REAL(wp), PARAMETER ::  h_is                     = 3.45_wp     !< [W/(m2 K)] surface-related heat transfer coefficient between
+                                                                   !< surface and air (chap. 7.2.2.2)
     REAL(wp), PARAMETER ::  h_ms                     = 9.1_wp      !< [W/(m2 K)] surface-related heat transfer coefficient between component and surface (chap. 12.2.2)
     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
-    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) 
-    REAL(wp), PARAMETER ::  params_f_win             = 0.5_wp      !< [-] proportion of window area, Database A_win aus Datenbank 27 window_area_per_facade_percent
-    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
+    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) 
+    REAL(wp), PARAMETER ::  params_f_win             = 0.5_wp      !< [-] proportion of window area, Database A_win aus 
+                                                                   !< Datenbank 27 window_area_per_facade_percent
+    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
 
     
@@ -525,5 +540,4 @@
     build_ids = build_ids_l
 #endif
-
 !
 !-- Note: in parallel mode, building IDs can occur mutliple times, as 
@@ -749,5 +763,4 @@
        ENDDO
     ENDDO
-
 !
 !-- Determine total number of facade elements per building and assign number to 
@@ -887,5 +900,4 @@
     ENDDO
     DEALLOCATE( n_fa )
-
 !
 !-- Initialize building parameters, first by mean building type. Note,
@@ -992,5 +1004,4 @@
         ENDDO
     ENDIF
-
 !
 !-- Calculation of surface-related heat transfer coeffiecient
@@ -1017,5 +1028,6 @@
 !-- Initialize indoor temperature. Actually only for output at initial state.
     DO  nb = 1, num_build
-       buildings(nb)%t_in(:) = initial_indoor_temperature
+       IF ( buildings(nb)%on_pe )                                              &
+          buildings(nb)%t_in(:) = initial_indoor_temperature
     ENDDO
 
