Index: palm/trunk/SOURCE/surface_data_output_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_data_output_mod.f90	(revision 3736)
+++ palm/trunk/SOURCE/surface_data_output_mod.f90	(revision 3744)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! Output of waste_heat and innermost wall flux from indoor model
 ! 
 ! Former revisions:
@@ -28,5 +28,5 @@
 ! clean-up coding layout
 ! 
-! 3735 2019-02-12 09:52:40Z dom_dwd_user
+! 3735 2019-02-12 09:52:40Z suehring
 ! - Split initialization into initialization of arrays and further initialization
 !   in order to enable reading of restart data.
@@ -76,5 +76,5 @@
 ! Authors:
 ! --------
-! @author Klaus Ketelsen, Matthias Suehring
+! @author Klaus Ketelsen, Matthias Suehring, Tobias Gronemeier
 !
 ! Description:
@@ -2778,5 +2778,5 @@
 
                ENDIF
-
+               
             CASE ( 'uvw1' )
 !
@@ -2807,5 +2807,64 @@
 
                ENDIF
-
+!
+!--         Waste heat from indoor model
+            CASE ( 'waste_heat' )
+!
+!--            Output of instantaneous data
+               IF ( av == 0 )  THEN
+                  CALL surface_data_output_collect( surf_def_h(0)%waste_heat,  &
+                                               surf_def_h(1)%waste_heat,       &
+                                               surf_lsm_h%waste_heat,          &
+                                               surf_usm_h%waste_heat,          &
+                                               surf_def_v(0)%waste_heat,       &
+                                               surf_lsm_v(0)%waste_heat,       &
+                                               surf_usm_v(0)%waste_heat,       &
+                                               surf_def_v(1)%waste_heat,       &
+                                               surf_lsm_v(1)%waste_heat,       &
+                                               surf_usm_v(1)%waste_heat,       &
+                                               surf_def_v(2)%waste_heat,       &
+                                               surf_lsm_v(2)%waste_heat,       &
+                                               surf_usm_v(2)%waste_heat,       &
+                                               surf_def_v(3)%waste_heat,       &
+                                               surf_lsm_v(3)%waste_heat,       &
+                                               surf_usm_v(3)%waste_heat )
+               ELSE
+!
+!--               Output of averaged data
+                  surfaces%var_out(:) = surfaces%var_av(:,n_out) /             &
+                                        REAL( average_count_surf, KIND=wp )
+                  surfaces%var_av(:,n_out) = 0.0_wp
+
+               ENDIF
+!
+!--         Innermost building wall flux from indoor model
+            CASE ( 'im_hf' )
+!
+!--            Output of instantaneous data
+               IF ( av == 0 )  THEN
+                  CALL surface_data_output_collect( surf_def_h(0)%iwghf_eb,    &
+                                               surf_def_h(1)%iwghf_eb,         &
+                                               surf_lsm_h%iwghf_eb,            &
+                                               surf_usm_h%iwghf_eb,            &
+                                               surf_def_v(0)%iwghf_eb,         &
+                                               surf_lsm_v(0)%iwghf_eb,         &
+                                               surf_usm_v(0)%iwghf_eb,         &
+                                               surf_def_v(1)%iwghf_eb,         &
+                                               surf_lsm_v(1)%iwghf_eb,         &
+                                               surf_usm_v(1)%iwghf_eb,         &
+                                               surf_def_v(2)%iwghf_eb,         &
+                                               surf_lsm_v(2)%iwghf_eb,         &
+                                               surf_usm_v(2)%iwghf_eb,         &
+                                               surf_def_v(3)%iwghf_eb,         &
+                                               surf_lsm_v(3)%iwghf_eb,         &
+                                               surf_usm_v(3)%iwghf_eb )
+               ELSE
+!
+!--               Output of averaged data
+                  surfaces%var_out(:) = surfaces%var_av(:,n_out) /             &
+                                        REAL( average_count_surf, KIND=wp )
+                  surfaces%var_av(:,n_out) = 0.0_wp
+
+               ENDIF
 !
 !--            Add further variables:
@@ -3706,4 +3765,40 @@
                                            surf_lsm_v(3)%uvw_abs,              &
                                            surf_usm_v(3)%uvw_abs, n_out )
+                                           
+            CASE ( 'waste_heat' )
+               CALL surface_data_output_sum_up( surf_def_h(0)%waste_heat,      &
+                                           surf_def_h(1)%waste_heat,           &
+                                           surf_lsm_h%waste_heat,              &
+                                           surf_usm_h%waste_heat,              &
+                                           surf_def_v(0)%waste_heat,           &
+                                           surf_lsm_v(0)%waste_heat,           &
+                                           surf_usm_v(0)%waste_heat,           &
+                                           surf_def_v(1)%waste_heat,           &
+                                           surf_lsm_v(1)%waste_heat,           &
+                                           surf_usm_v(1)%waste_heat,           &
+                                           surf_def_v(2)%waste_heat,           &
+                                           surf_lsm_v(2)%waste_heat,           &
+                                           surf_usm_v(2)%waste_heat,           &
+                                           surf_def_v(3)%waste_heat,           &
+                                           surf_lsm_v(3)%waste_heat,           &
+                                           surf_usm_v(3)%waste_heat, n_out )
+                                           
+            CASE ( 'im_hf' )
+               CALL surface_data_output_sum_up( surf_def_h(0)%iwghf_eb,        &
+                                           surf_def_h(1)%iwghf_eb,             &
+                                           surf_lsm_h%iwghf_eb,                &
+                                           surf_usm_h%iwghf_eb,                &
+                                           surf_def_v(0)%iwghf_eb,             &
+                                           surf_lsm_v(0)%iwghf_eb,             &
+                                           surf_usm_v(0)%iwghf_eb,             &
+                                           surf_def_v(1)%iwghf_eb,             &
+                                           surf_lsm_v(1)%iwghf_eb,             &
+                                           surf_usm_v(1)%iwghf_eb,             &
+                                           surf_def_v(2)%iwghf_eb,             &
+                                           surf_lsm_v(2)%iwghf_eb,             &
+                                           surf_usm_v(2)%iwghf_eb,             &
+                                           surf_def_v(3)%iwghf_eb,             &
+                                           surf_lsm_v(3)%iwghf_eb,             &
+                                           surf_usm_v(3)%iwghf_eb, n_out )
 
          END SELECT
@@ -4161,6 +4256,6 @@
 
        USE control_parameters,                                                 &
-           ONLY:  averaging_interval, dt_data_output, initializing_actions,    &
-                  message_string
+           ONLY:  averaging_interval, dt_data_output, indoor_model,            &
+                  initializing_actions, message_string
 
        USE pegrid,                                                             &
@@ -4293,4 +4388,14 @@
             CASE ( 'r_a', 'r_canopy', 'r_soil', 'r_s' )
                unit = 's/m'
+               
+            CASE ( 'waste_heat', 'im_hf' )
+               IF ( .NOT. indoor_model )  THEN
+                  message_string = TRIM( trimvar ) //                          &
+                             ' requires the indoor model'
+               CALL message( 'surface_data_output_check_parameters',           &
+                             'PA0588', 1, 2, 0, 6, 0 )
+               ENDIF
+            
+               unit = 'W/m2'
 
             CASE DEFAULT
