Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3882)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3885)
@@ -28,4 +28,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3882 2019-04-10 11:08:06Z suehring
 ! Avoid different type kinds
 ! Move definition of building-surface properties from declaration block
@@ -458,5 +462,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  coupling_start_time, topography, dt_3d, humidity, indoor_model, &
+        ONLY:  coupling_start_time, topography,                                &
+               debug_output, debug_string,                                     &
+               dt_3d, humidity, indoor_model,                                  &
                intermediate_timestep_count, initializing_actions,              &
                intermediate_timestep_count_max, simulated_time, end_time,      &
@@ -976,5 +982,5 @@
         INTEGER(iwp) ::  l
 
-        CALL location_message( 'initializing and allocating urban surfaces', .FALSE. )
+        IF ( debug_output )  CALL debug_message( 'usm_init_arrays', 'start' )
 
 !
@@ -1383,5 +1389,5 @@
         ENDDO
 
-        CALL location_message( 'finished', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'usm_init_arrays', 'end' )
         
     END SUBROUTINE usm_init_arrays
@@ -3474,5 +3480,5 @@
         INTEGER(iwp) ::  k, l, m            !< running indices
         
-        CALL location_message( '    initialization of wall surface model', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'usm_init_material_model', 'start' )
 
 !
@@ -3660,7 +3666,5 @@
 
         
-        CALL location_message( '    wall structures filed out', .TRUE. )
-
-        CALL location_message( '    initialization of wall surface model finished', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'usm_init_material_model', 'end' )
 
     END SUBROUTINE usm_init_material_model
@@ -3728,5 +3732,5 @@
         REAL(wp)     ::  z_agl                        !< height above ground
 
-        CALL location_message( 'initializing urban surface model', .FALSE. )
+        IF ( debug_output )  CALL debug_message( 'usm_init', 'start' )
 
         CALL cpu_log( log_point_s(78), 'usm_init', 'start' )
@@ -5191,5 +5195,5 @@
         CALL cpu_log( log_point_s(78), 'usm_init', 'stop' )
 
-        CALL location_message( 'finished', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'usm_init', 'end' )
 
     END SUBROUTINE usm_init
@@ -5217,4 +5221,10 @@
 
         LOGICAL      :: spinup  !< if true, no calculation of window temperatures
+
+
+        IF ( debug_output )  THEN
+           WRITE( debug_string, * ) 'usm_material_heat_model | spinup: ', spinup
+           CALL debug_message( debug_string, 'start' )
+        ENDIF
 
         !$OMP PARALLEL PRIVATE (m, i, j, k, kw, wtend, wintend, win_absorp, wall_mod)
@@ -5590,4 +5600,9 @@
         !$OMP END PARALLEL
 
+        IF ( debug_output )  THEN
+           WRITE( debug_string, * ) 'usm_material_heat_model | spinup: ', spinup
+           CALL debug_message( debug_string, 'end' )
+        ENDIF
+
     END SUBROUTINE usm_material_heat_model
 
@@ -5619,4 +5634,6 @@
         LOGICAL :: conserve_water_content = .true.
 
+
+        IF ( debug_output )  CALL debug_message( 'usm_green_heat_model', 'start' )
 
         drho_l_lv = 1.0_wp / (rho_l * l_v)
@@ -5949,4 +5966,6 @@
         ENDDO
 
+        IF ( debug_output )  CALL debug_message( 'usm_green_heat_model', 'end' )
+
     END SUBROUTINE usm_green_heat_model
 
@@ -6939,4 +6958,6 @@
         REAL(wp)                                              :: wealbedo3, wethick3, snalbedo3, snthick3
 
+
+        IF ( debug_output )  CALL debug_message( 'usm_read_urban_surface_types', 'start' )
 !
 !--     If building_pars or building_type are already read from static input 
@@ -7452,9 +7473,5 @@
         ENDDO
 
-        
-        WRITE(9,*) 'Urban surfaces read'
-        FLUSH(9)
-        
-        CALL location_message( '    types and parameters of urban surfaces read', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'usm_read_urban_surface_types', 'end' )
    
     END SUBROUTINE usm_read_urban_surface_types
@@ -7513,4 +7530,6 @@
 
 
+        IF ( debug_output )  CALL debug_message( 'usm_read_wall_temperature', 'start' )
+
         DO  ii = 0, io_blocks-1
             IF ( ii == io_group )  THEN
@@ -7567,5 +7586,5 @@
         ENDDO
 
-        CALL location_message( '    wall layer temperatures read', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'usm_read_wall_temperature', 'end' )
 
     END SUBROUTINE usm_read_wall_temperature
@@ -7638,4 +7657,9 @@
                      q_s             !< saturation specific humidity
 
+
+        IF ( debug_output )  THEN
+           WRITE( debug_string, * ) 'usm_surface_energy_balance | spinup: ', spinup
+           CALL debug_message( debug_string, 'start' )
+        ENDIF
 !
 !--     Index offset of surface element point with respect to adjoining 
@@ -8639,5 +8663,10 @@
 ! 
 !        END SUBROUTINE calc_q_surface_usm
-        
+
+        IF ( debug_output )  THEN
+           WRITE( debug_string, * ) 'usm_surface_energy_balance | spinup: ', spinup
+           CALL debug_message( debug_string, 'end' )
+        ENDIF
+
      END SUBROUTINE usm_surface_energy_balance
  
