Index: palm/trunk/SOURCE/average_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/average_3d_data.f90	(revision 2741)
+++ palm/trunk/SOURCE/average_3d_data.f90	(revision 2742)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Enable output of surface temperature
+! 
+! 2735 2018-01-11 12:01:27Z suehring
 ! output of r_a moved from land-surface to consider also urban-type surfaces
 ! 
@@ -422,4 +425,12 @@
              CALL exchange_horiz_2d( ts_av, nbgp )
 
+         CASE ( 'tsurf*' )
+             DO  i = nxlg, nxrg
+                DO  j = nysg, nyng
+                   tsurf_av(j,i) = tsurf_av(j,i) / REAL( average_count_3d, KIND=wp )
+                ENDDO
+             ENDDO
+             CALL exchange_horiz_2d( tsurf_av, nbgp )
+
           CASE ( 'u' )
              DO  i = nxlg, nxrg
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 2741)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 2742)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Enable output of surface temperature
+! 
+! 2735 2018-01-11 12:01:27Z suehring
 ! output of r_a moved from land-surface to consider also urban-type surfaces
 ! 
@@ -3286,5 +3289,5 @@
 
           CASE ( 'lwp*', 'ol*', 'pra*', 'prr*', 'qsws*', 'r_a*', 'shf*',       &
-                 'ssws*', 't*', 'u*', 'z0*', 'z0h*', 'z0q*' )
+                 'ssws*', 't*', 'tsurf*', 'u*', 'z0*', 'z0h*', 'z0q*' )
              IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
                 message_string = 'illegal value for data_output: "' //         &
@@ -3321,6 +3324,6 @@
                 CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 )
              ENDIF
-             IF ( TRIM( var ) == 'r_a*'  .AND.  .NOT.  land_surface  .AND.     &
-                                                .NOT.  urban_surface )         &         
+             IF ( ( TRIM( var ) == 'r_a*' .OR.  TRIM( var ) == 'tsurf*' )      &
+                 .AND.  .NOT.  land_surface  .AND.  .NOT.  urban_surface )     &         
              THEN
                 message_string = 'output of "' // TRIM( var ) // '" requi' //  &
@@ -3344,4 +3347,5 @@
              IF ( TRIM( var ) == 'ssws*'  )  unit = 'kg/m2*s'
              IF ( TRIM( var ) == 't*'     )  unit = 'K'
+             IF ( TRIM( var ) == 'tsurf*' )  unit = 'K'  
              IF ( TRIM( var ) == 'u*'     )  unit = 'm/s'
              IF ( TRIM( var ) == 'z0*'    )  unit = 'm'
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 2741)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 2742)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Enable output of surface temperature
+! 
+! 2735 2018-01-11 12:01:27Z suehring
 ! output of r_a moved from land-surface to consider also urban-type surfaces
 ! 
@@ -978,4 +981,29 @@
                 resorted = .TRUE.
                 two_d = .TRUE.
+                level_z(nzb+1) = zu(nzb+1)
+
+             CASE ( 'tsurf*_xy' )        ! 2d-array
+                IF ( av == 0 )  THEN
+                   DO  m = 1, surf_lsm_h%ns
+                      i                   = surf_lsm_h%i(m)            
+                      j                   = surf_lsm_h%j(m)
+                      local_pf(i,j,nzb+1) = surf_lsm_h%pt_surface(m)
+                   ENDDO
+
+                   DO  m = 1, surf_usm_h%ns
+                      i   = surf_usm_h%i(m)            
+                      j   = surf_usm_h%j(m)
+                      local_pf(i,j,nzb+1) = surf_usm_h%pt_surface(m)
+                   ENDDO
+
+                ELSE
+                   DO  i = nxl, nxr
+                      DO  j = nys, nyn
+                         local_pf(i,j,nzb+1) = tsurf_av(j,i)
+                      ENDDO
+                   ENDDO
+                ENDIF
+                resorted       = .TRUE.
+                two_d          = .TRUE.
                 level_z(nzb+1) = zu(nzb+1)
 
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 2741)
+++ palm/trunk/SOURCE/modules.f90	(revision 2742)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! +tsurf_av
+! 
+! 2735 2018-01-11 12:01:27Z suehring
 ! +r_a_av
 ! 
@@ -890,4 +893,5 @@
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ssws_av                !< avg. surface scalar flux
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  shf_av                 !< avg. surface heat flux
+    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  tsurf_av               !< avg. surface temperature
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  ts_av                  !< avg. characteristic temperature scale
     REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  us_av                  !< avg. friction velocity
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 2741)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 2742)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Enable output of surface temperature
+! 
+! 2735 2018-01-11 12:01:27Z suehring
 ! output of r_a moved from land-surface to consider also urban-type surfaces
 ! 
@@ -162,5 +165,6 @@
                q_av, qc_av, ql_av, ql_c_av, ql_v_av, ql_vp_av, qr_av, qsws_av, &
                qv_av, r_a_av, rho_ocean_av, s_av, sa_av, shf_av, ssws_av,      &
-               ts_av, u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av, z0q_av
+               ts_av, tsurf_av, u_av, us_av, v_av, vpt_av, w_av, z0_av, z0h_av,&
+               z0q_av
 #if defined( __chem )
     USE chemistry_model_mod,                                                   &
@@ -409,4 +413,10 @@
                 ENDIF
                 ts_av = 0.0_wp
+
+             CASE ( 'tsurf*' )
+                IF ( .NOT. ALLOCATED( tsurf_av ) )  THEN
+                   ALLOCATE( tsurf_av(nysg:nyng,nxlg:nxrg) )
+                ENDIF
+                tsurf_av = 0.0_wp
 
              CASE ( 'u' )
@@ -854,4 +864,17 @@
              ENDDO
 
+          CASE ( 'tsurf*' )
+             DO  m = 1, surf_lsm_h%ns
+                i   = surf_lsm_h%i(m)            
+                j   = surf_lsm_h%j(m)
+                tsurf_av(j,i) = tsurf_av(j,i) + surf_lsm_h%pt_surface(m)
+             ENDDO
+
+             DO  m = 1, surf_usm_h%ns
+                i   = surf_usm_h%i(m)            
+                j   = surf_usm_h%j(m)
+                tsurf_av(j,i) = tsurf_av(j,i) + surf_usm_h%pt_surface(m)
+             ENDDO
+
           CASE ( 'u' )
              DO  i = nxlg, nxrg
