Index: palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 4298)
+++ palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 4331)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Calculation of diagnostic-only 2-m potential temperature moved to 
+! diagnostic_output_quantities.
+! 
+! 4298 2019-11-21 15:59:16Z suehring
 ! Calculation of 2-m temperature adjusted to the case the 2-m level is above 
 ! the first grid point.
@@ -108,5 +112,5 @@
                constant_waterflux, coupling_mode,                              &
                debug_output_timestep,                                          &
-               do_output_at_2m, humidity,                                      &
+               humidity,                                                       &
                ibc_e_b, ibc_pt_b, indoor_model,                                &
                land_surface, large_scale_forcing, lsf_surf, message_string,    &
@@ -162,5 +166,9 @@
     PRIVATE
 
-    PUBLIC init_surface_layer_fluxes, phi_m, surface_layer_fluxes
+    PUBLIC init_surface_layer_fluxes,                                          &
+           phi_m,                                                              &
+           psi_h,                                                              &
+           psi_m,                                                              &
+           surface_layer_fluxes
 
     INTERFACE init_surface_layer_fluxes
@@ -171,4 +179,12 @@
        MODULE PROCEDURE phi_m
     END INTERFACE phi_m
+
+    INTERFACE psi_h
+       MODULE PROCEDURE psi_h
+    END INTERFACE psi_h
+
+    INTERFACE psi_m
+       MODULE PROCEDURE psi_m
+    END INTERFACE psi_m
 
     INTERFACE surface_layer_fluxes
@@ -259,7 +275,4 @@
           CALL calc_scaling_parameters
           CALL calc_surface_fluxes
-          IF ( do_output_at_2m )  THEN
-             CALL calc_pt_near_surface ( '2m' )
-          ENDIF
        ENDIF
 !
@@ -272,7 +285,4 @@
           CALL calc_scaling_parameters
           CALL calc_surface_fluxes
-          IF ( do_output_at_2m )  THEN
-             CALL calc_pt_near_surface ( '2m' )
-          ENDIF
        ENDIF
 !
@@ -285,7 +295,4 @@
           CALL calc_scaling_parameters
           CALL calc_surface_fluxes
-          IF ( do_output_at_2m )  THEN
-             CALL calc_pt_near_surface ( '2m' )
-          ENDIF
 !
 !--       Calculate 10cm temperature, required in indoor model
@@ -1863,5 +1870,4 @@
        INTEGER(iwp)                    :: j      !< grid index y-dimension 
        INTEGER(iwp)                    :: k      !< grid index z-dimension
-       INTEGER(iwp)                    :: kk     !< running index along the z-dimension
        INTEGER(iwp)                    :: m      !< running index for surface elements
 
@@ -1882,49 +1888,7 @@
                                      - psi_h( 0.1_wp / surf%ol(m) )            &
                                      + psi_h( surf%z0h(m) / surf%ol(m) ) )
-                                    
-             ENDDO
-
-!
-!--       2-m temperature. Note, this is only calculated for output reasons at
-!--       horizontal upward-facing surfaces. 
-          CASE ( '2m' )
-      
-             DO  m = 1, surf%ns
-
-                i = surf%i(m)
-                j = surf%j(m)
-                k = surf%k(m)
-!
-!--             If 2-m level is below the first grid level, MOST is 
-!--             used for calculation of 2-m temperature.
-                IF ( surf%z_mo(m) > 2.0_wp )  THEN
-                   surf%pt_2m(m) = surf%pt_surface(m) + surf%ts(m) / kappa     &
-                                   * ( LOG( 2.0_wp /  surf%z0h(m) )            &
-                                     - psi_h( 2.0_wp / surf%ol(m) )            &
-                                     + psi_h( surf%z0h(m) / surf%ol(m) ) )
-!
-!--             If 2-m level is above the first grid level, 2-m temperature
-!--             is linearly interpolated between the two nearest vertical grid
-!--             levels. Note, since 2-m temperature is only computed for
-!--             horizontal upward-facing surfaces, only a vertical 
-!--             interpolation is necessary. 
-                ELSE
-!
-!--                zw(k-1) defines the height of the surface. 
-                   kk = k
-                   DO WHILE ( zu(kk) - zw(k-1) < 2.0_wp  .AND.  kk <= nzt )
-                      kk = kk + 1 
-                   ENDDO               
-!
-!--                kk defines the index of the first grid level >= 2m. 
-                   surf%pt_2m(m) = pt(kk-1,j,i) +                              &
-                                 ( zw(k-1) + 2.0_wp - zu(kk-1)     ) *         &
-                                 ( pt(kk,j,i)       - pt(kk-1,j,i) ) /         &
-                                 ( zu(kk)           - zu(kk-1)     )
-                ENDIF
-
-             ENDDO
-          
-       
+
+             ENDDO
+
        END SELECT
 
