Index: /palm/trunk/SOURCE/biometeorology_mod.f90
===================================================================
--- /palm/trunk/SOURCE/biometeorology_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/biometeorology_mod.f90	(revision 3885)
@@ -27,4 +27,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3753 2019-02-19 14:48:54Z dom_dwd_user
 ! - Added automatic setting of mrt_nlevels in case it was not part of 
 ! radiation_parameters namelist (or set to 0 accidentially).
@@ -150,5 +154,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  average_count_3d, biometeorology, dz, dz_stretch_factor,        &
+        ONLY:  average_count_3d, biometeorology,                               &
+               debug_output,                                                   &
+               dz, dz_stretch_factor,                                          &
                dz_stretch_level, humidity, initializing_actions, nz_do3d,      &
                surface_pressure
@@ -1209,5 +1215,5 @@
     REAL ( wp )  :: height  !< current height in meters
 
-    CALL location_message( 'initializing biometeorology module', .FALSE. )
+    IF ( debug_output )  CALL debug_message( 'bio_init', 'start' )
 !
 !-- Determine cell level corresponding to 1.1 m above ground level
@@ -1229,5 +1235,5 @@
     IF ( uv_exposure )  CALL netcdf_data_input_uvem
 
-    CALL location_message( 'finished', .TRUE. )
+    IF ( debug_output )  CALL debug_message( 'bio_init', 'end' )
 
  END SUBROUTINE bio_init
Index: /palm/trunk/SOURCE/bulk_cloud_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3874 2019-04-08 16:53:48Z knoop
 ! Implemented non_transport_physics module interfaces
 ! 
@@ -239,5 +243,6 @@
 
     USE control_parameters,                                                    &
-        ONLY:  dt_3d, dt_do2d_xy, intermediate_timestep_count,                 &
+        ONLY:  debug_output,                                                   &
+               dt_3d, dt_do2d_xy, intermediate_timestep_count,                 &
                intermediate_timestep_count_max, large_scale_forcing,           &
                lsf_surf, pt_surface, rho_surface, surface_pressure,            &
@@ -934,5 +939,5 @@
        INTEGER(iwp) ::  j !<
 
-       CALL location_message( 'initializing bulk cloud module', .FALSE. )
+       IF ( debug_output )  CALL debug_message( 'bcm_init', 'start' )
 
        IF ( bulk_cloud_model )  THEN
@@ -1015,9 +1020,9 @@
           dpirho_l = 1.0_wp / pirho_l
 
-          CALL location_message( 'finished', .TRUE. )
+          IF ( debug_output )  CALL debug_message( 'bcm_init', 'end' )
 
        ELSE
 
-          CALL location_message( 'skipped', .TRUE. )
+          IF ( debug_output )  CALL debug_message( 'bcm_init skipped', 'end' )
 
        ENDIF
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 3884)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3766 2019-02-26 16:23:41Z raasch
 ! trim added to avoid truncation compiler warnings
 ! 
@@ -859,5 +863,5 @@
 
 
-    CALL location_message( 'checking parameters', .FALSE. )
+    CALL location_message( 'checking parameters', 'start' )
 !
 !-- At first, check static and dynamic input for consistency
@@ -3851,5 +3855,5 @@
     ENDIF
 
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'checking parameters', 'finished' )
 
  CONTAINS
Index: /palm/trunk/SOURCE/chem_emissions_mod.f90
===================================================================
--- /palm/trunk/SOURCE/chem_emissions_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/chem_emissions_mod.f90	(revision 3885)
@@ -15,7 +15,7 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2018-2018 Leibniz Universitaet Hannover
-! Copyright 2018-2018 Freie Universitaet Berlin
-! Copyright 2018-2018 Karlsruhe Institute of Technology
+! Copyright 2018-2019 Leibniz Universitaet Hannover
+! Copyright 2018-2019 Freie Universitaet Berlin
+! Copyright 2018-2019 Karlsruhe Institute of Technology
 !--------------------------------------------------------------------------------!
 !
@@ -27,4 +27,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3831 2019-03-28 09:11:22Z forkel
 ! added nvar to USE chem_gasphase_mod (chem_modules will not include nvar anymore) 
 ! 
@@ -112,5 +116,6 @@
 
     USE control_parameters,                                                    &
-        ONLY:  end_time, message_string, initializing_actions,                 &
+        ONLY:  debug_output,                                                   &
+               end_time, message_string, initializing_actions,                 &
                intermediate_timestep_count, dt_3d
  
@@ -248,5 +253,5 @@
 
 
-    CALL location_message( 'Matching input emissions and model chemistry species', .FALSE. )
+    IF ( debug_output )  CALL debug_message( 'chem_emissions_match', 'start' )
 
     !
@@ -696,4 +701,6 @@
        END SELECT
 
+       IF ( debug_output )  CALL debug_message( 'chem_emissions_match', 'end' )
+
  END SUBROUTINE chem_emissions_match
 
@@ -728,5 +735,5 @@
 
 
-  CALL location_message( 'Starting initialization of emission arrays', .FALSE. )
+  IF ( debug_output )  CALL debug_message( 'chem_emissions_init', 'start' )
 
   !
@@ -802,4 +809,6 @@
 
   ENDIF    
+
+  IF ( debug_output )  CALL debug_message( 'chem_emissions_init', 'end' )
 
  END SUBROUTINE chem_emissions_init
Index: /palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3885)
@@ -15,7 +15,7 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2017-2018 Leibniz Universitaet Hannover
-! Copyright 2017-2018 Karlsruhe Institute of Technology
-! Copyright 2017-2018 Freie Universitaet Berlin
+! Copyright 2017-2019 Leibniz Universitaet Hannover
+! Copyright 2017-2019 Karlsruhe Institute of Technology
+! Copyright 2017-2019 Freie Universitaet Berlin
 !------------------------------------------------------------------------------!
 !
@@ -27,4 +27,8 @@
 ! -----------------
 ! $Id: chemistry_model_mod.f90 3784 2019-03-05 14:16:20Z banzhafs
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3784 2019-03-05 14:16:20Z banzhafs
 ! some formatting of the deposition code
 !
@@ -310,5 +314,7 @@
 
     USE control_parameters,                                                                        &
-         ONLY:  bc_lr_cyc, bc_ns_cyc, dt_3d, humidity, initializing_actions, message_string,       &
+         ONLY:  bc_lr_cyc, bc_ns_cyc,                                                              &
+                debug_output,                                                                      &
+                dt_3d, humidity, initializing_actions, message_string,                             &
          omega, tsc, intermediate_timestep_count, intermediate_timestep_count_max,                 &
          max_pr_user, timestep_scheme, use_prescribed_profile_data, ws_scheme_sca, air_chemistry
@@ -1755,4 +1761,7 @@
     INTEGER(iwp) ::  j !< running index y dimension
     INTEGER(iwp) ::  n !< running index for chemical species
+
+
+    IF ( debug_output )  CALL debug_message( 'chem_init', 'start' )
 !
 !-- Next statement is to avoid compiler warning about unused variables
@@ -1778,4 +1787,5 @@
     ENDIF
 
+    IF ( debug_output )  CALL debug_message( 'chem_init', 'end' )
 
  END SUBROUTINE chem_init
@@ -1882,5 +1892,4 @@
 !--    Initial profiles of the variables must be computed.
        IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
-         CALL location_message( 'initializing with 1D chemistry model profiles', .FALSE. )
 !
 !--       Transfer initial profiles to the arrays of the 3D model
@@ -1897,5 +1906,4 @@
        ELSEIF ( INDEX(initializing_actions, 'set_constant_profiles') /= 0 )    &
        THEN
-          CALL location_message( 'initializing with constant chemistry profiles', .FALSE. )
 
           DO  lsp = 1, nspec 
@@ -2287,5 +2295,4 @@
 !       write(text,*) 'gas_phase chemistry: solver_type = ',TRIM( solver_type )
 !kk    Has to be changed to right calling sequence
-!kk       CALL location_message( TRIM( text ), .FALSE. )
 !        IF(myid == 0)  THEN
 !           write(9,*) ' '
Index: /palm/trunk/SOURCE/cpulog_mod.f90
===================================================================
--- /palm/trunk/SOURCE/cpulog_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/cpulog_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! output format limited to a maximum line length of 80
 ! 
@@ -337,5 +341,5 @@
 
 
-       CALL location_message( 'calculating cpu statistics', .FALSE. )
+       CALL location_message( 'calculating cpu statistics', 'start' )
 
 !
@@ -580,5 +584,6 @@
        ENDIF
 
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'calculating cpu statistics', 'finished' )
+
 
    100 FORMAT (A/11('-')//'CPU measures for ',I5,' PEs (',I5,'(x) * ',I5,'(y', &
Index: /palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- /palm/trunk/SOURCE/data_output_2d.f90	(revision 3884)
+++ /palm/trunk/SOURCE/data_output_2d.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3766 2019-02-26 16:23:41Z raasch
 ! unused variables removed
 ! 
@@ -298,5 +302,7 @@
     USE control_parameters,                                                    &
         ONLY:  data_output_2d_on_each_pe,                                      &
-               data_output_xy, data_output_xz, data_output_yz, do2d,           &
+               data_output_xy, data_output_xz, data_output_yz,                 &
+               debug_output, debug_string,                                     &
+               do2d,                                                           &
                do2d_xy_last_time, do2d_xy_time_count,                          &
                do2d_xz_last_time, do2d_xz_time_count,                          &
@@ -394,4 +400,9 @@
     REAL(wp), DIMENSION(:,:,:), POINTER ::  to_be_resorted  !< points to array which shall be output
 
+
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'data_output_2d'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 !
 !-- Immediate return, if no output is requested (no respective sections
@@ -2264,3 +2275,8 @@
     CALL cpu_log( log_point(3), 'data_output_2d', 'stop' )
 
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'data_output_2d'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
+
  END SUBROUTINE data_output_2d
Index: /palm/trunk/SOURCE/data_output_3d.f90
===================================================================
--- /palm/trunk/SOURCE/data_output_3d.f90	(revision 3884)
+++ /palm/trunk/SOURCE/data_output_3d.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3814 2019-03-26 08:40:31Z pavelkrc
 ! unused variables removed
 ! 
@@ -258,5 +262,6 @@
 
     USE control_parameters,                                                    &
-        ONLY:  do3d, do3d_no, do3d_time_count, io_blocks, io_group,            &
+        ONLY:  debug_output, debug_string,                                     &
+               do3d, do3d_no, do3d_time_count, io_blocks, io_group,            &
                land_surface, message_string, ntdim_3d, nz_do3d, psolver,       &
                time_since_reference_point, urban_surface, varnamelength
@@ -335,4 +340,9 @@
 !-- Return, if nothing to output
     IF ( do3d_no(av) == 0 )  RETURN
+
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'data_output_3d'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 
     CALL cpu_log (log_point(14),'data_output_3d','start')
@@ -866,3 +876,8 @@
     CALL cpu_log( log_point(14), 'data_output_3d', 'stop' )
 
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'data_output_3d'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
+
  END SUBROUTINE data_output_3d
Index: /palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/indoor_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/indoor_model_mod.f90	(revision 3885)
@@ -15,6 +15,6 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2018-2018 Leibniz Universitaet Hannover
-! Copyright 2018-2018 Hochschule Offenburg
+! Copyright 2018-2019 Leibniz Universitaet Hannover
+! Copyright 2018-2019 Hochschule Offenburg
 !--------------------------------------------------------------------------------!
 !
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3786 2019-03-06 16:58:03Z raasch
 ! unused variables removed
 ! 
@@ -89,5 +93,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  initializing_actions
+        ONLY:  debug_output, initializing_actions
 
     USE kinds
@@ -432,5 +436,5 @@
                                                            !< on local subdomain
 
-    CALL location_message( 'initializing indoor model', .FALSE. )
+    IF ( debug_output )  CALL debug_message( 'im_init', 'start' )
 
 !
@@ -961,5 +965,5 @@
     ENDDO
 
-    CALL location_message( 'finished', .TRUE. )
+    IF ( debug_output )  CALL debug_message( 'im_init', 'end' )
 
  END SUBROUTINE im_init
Index: /palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- /palm/trunk/SOURCE/init_3d_model.f90	(revision 3884)
+++ /palm/trunk/SOURCE/init_3d_model.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3849 2019-04-01 16:35:16Z knoop
 ! Move initialization of rmask before initializing user_init_arrays
 ! 
@@ -723,5 +727,6 @@
     INTEGER(iwp) ::  nz_s_shift_l !< topography-top index on scalar-grid, used to vertically shift initial profiles
 
-    CALL location_message( 'allocating arrays', .FALSE. )
+    CALL location_message( 'init_3d_model', 'start' )
+    CALL location_message( 'allocating arrays', 'start' )
 !
 !-- Allocate arrays
@@ -1072,5 +1077,5 @@
     intermediate_timestep_count = 0  ! needed when simulated_time = 0.0
        
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'allocating arrays', 'finished' )
 
 !
@@ -1095,5 +1100,5 @@
 !--    Initialization with provided input data derived from larger-scale model
        IF ( INDEX( initializing_actions, 'inifor' ) /= 0 )  THEN
-          CALL location_message( 'initializing with INIFOR', .FALSE. )
+          CALL location_message( 'initializing with INIFOR', 'start' )
 !
 !--       Read initial 1D profiles or 3D data from NetCDF file, depending 
@@ -1247,10 +1252,10 @@
           IF( use_syn_turb_gen )  CALL stg_init
 
-          CALL location_message( 'finished', .TRUE. )
+          CALL location_message( 'initializing with INIFOR', 'finished' )
 !
 !--    Initialization via computed 1D-model profiles
        ELSEIF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 )  THEN
 
-          CALL location_message( 'initializing with 1D model profiles', .FALSE. )
+          CALL location_message( 'initializing with 1D model profiles', 'start' )
 !
 !--       Use solutions of the 1D model as initial profiles,
@@ -1317,10 +1322,10 @@
           IF( use_syn_turb_gen )  CALL stg_init
 
-          CALL location_message( 'finished', .TRUE. )
+          CALL location_message( 'initializing with 1D model profiles', 'finished' )
 
        ELSEIF ( INDEX(initializing_actions, 'set_constant_profiles') /= 0 )    &
        THEN
 
-          CALL location_message( 'initializing with constant profiles', .FALSE. )
+          CALL location_message( 'initializing with constant profiles', 'start' )
 
 !
@@ -1388,10 +1393,10 @@
           IF( use_syn_turb_gen )  CALL stg_init
           
-          CALL location_message( 'finished', .TRUE. )
+          CALL location_message( 'initializing with constant profiles', 'finished' )
 
        ELSEIF ( INDEX(initializing_actions, 'by_user') /= 0 )                  &
        THEN
 
-          CALL location_message( 'initializing by user', .FALSE. )
+          CALL location_message( 'initializing by user', 'start' )
 !
 !--       Pre-initialize surface variables, i.e. setting start- and end-indices
@@ -1403,10 +1408,9 @@
           CALL user_init_3d_model
 
-          CALL location_message( 'finished', .TRUE. )
-
-       ENDIF
-
-       CALL location_message( 'initializing statistics, boundary conditions, etc.', &
-                              .FALSE. )
+          CALL location_message( 'initializing by user', 'finished' )
+
+       ENDIF
+
+       CALL location_message( 'initializing statistics, boundary conditions, etc.', 'start' )
 
 !
@@ -1542,5 +1546,5 @@
        ENDIF       
 
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'initializing statistics, boundary conditions, etc.', 'finished' )
 
     ELSEIF ( TRIM( initializing_actions ) == 'read_restart_data'  .OR.         &
@@ -1548,6 +1552,5 @@
     THEN
 
-       CALL location_message( 'initializing in case of restart / cyclic_fill', &
-                              .FALSE. )
+       CALL location_message( 'initializing in case of restart / cyclic_fill', 'start' )
 !
 !--    Initialize surface elements and its attributes, e.g. heat- and 
@@ -1813,5 +1816,5 @@
             use_syn_turb_gen )  CALL stg_init
 
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'initializing in case of restart / cyclic_fill', 'finished' )
 
     ELSE
@@ -2181,8 +2184,8 @@
 !$ACC COPY(v(nzb:nzt+1,nysg:nyng,nxlg:nxrg))
 
-       CALL location_message( 'creating initial disturbances', .FALSE. )
+       CALL location_message( 'creating initial disturbances', 'start' )
        CALL disturb_field( 'u', tend, u )
        CALL disturb_field( 'v', tend, v )
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'creating initial disturbances', 'finished' )
 
 !$ACC DATA &
@@ -2201,9 +2204,9 @@
 !$ACC COPYIN(bc_h(1)%k(1:bc_h(1)%ns))
 
-       CALL location_message( 'calling pressure solver', .FALSE. )
+       CALL location_message( 'applying pressure solver', 'start' )
        n_sor = nsor_ini
        CALL pres
        n_sor = nsor
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'applying pressure solver', 'finished' )
 
 !$ACC END DATA
@@ -2418,5 +2421,5 @@
 
 
-    CALL location_message( 'leaving init_3d_model', .TRUE. )
+    CALL location_message( 'init_3d_model', 'finished' )
 
  END SUBROUTINE init_3d_model
Index: /palm/trunk/SOURCE/init_pegrid.f90
===================================================================
--- /palm/trunk/SOURCE/init_pegrid.f90	(revision 3884)
+++ /palm/trunk/SOURCE/init_pegrid.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3884 2019-04-10 13:31:55Z Giersch
 ! id_recycling is only calculated in case of tubulent inflow
 ! 
@@ -348,6 +352,5 @@
 #if defined( __parallel )
 
-    CALL location_message( 'creating virtual PE grids + MPI derived data types', &
-                           .FALSE. )
+    CALL location_message( 'creating virtual PE grids + MPI derived data types', 'start' )
 
 !
@@ -1394,5 +1397,5 @@
     ENDIF
 
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'creating virtual PE grids + MPI derived data types', 'finished' )
 
 #else
Index: /palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3881 2019-04-10 09:31:22Z suehring
 ! Bugfix in level 3 initialization of pavement albedo type and pavement 
 ! emissivity
@@ -544,5 +548,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  cloud_droplets, coupling_start_time, dt_3d,      &
+        ONLY:  cloud_droplets, coupling_start_time,                            &
+               debug_output, debug_string,                                     &
+               dt_3d,                                                          &
                end_time, humidity, intermediate_timestep_count,                &
                initializing_actions, intermediate_timestep_count_max,          &
@@ -1890,4 +1896,11 @@
     TYPE(surf_type), POINTER  ::  surf  !< surface-date type variable
 
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'lsm_energy_balance', horizontal, l
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
+
     IF ( horizontal )  THEN
        surf              => surf_lsm_h
@@ -2449,5 +2462,9 @@
     IF ( horizontal  .AND.  .NOT. constant_roughness )  CALL calc_z0_water_surface
     
-    
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'lsm_energy_balance', horizontal, l
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
+
     CONTAINS
 !------------------------------------------------------------------------------!
@@ -2632,5 +2649,5 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  pr_soil_init !< temporary array used for averaging soil profiles
 
-       CALL location_message( 'initializing land surface model', .FALSE. )
+       IF ( debug_output )  CALL debug_message( 'lsm_init', 'start' )
 !
 !--    If no cloud physics is used, rho_surface has not been calculated before
@@ -4942,5 +4959,5 @@
        ENDDO
 
-       CALL location_message( 'finished', .TRUE. )
+       IF ( debug_output )  CALL debug_message( 'lsm_init', 'end' )
 
     END SUBROUTINE lsm_init
@@ -5271,4 +5288,10 @@
        TYPE(surf_type), POINTER  ::  surf  !< surface-date type variable
 
+
+       IF ( debug_output )  THEN
+          WRITE( debug_string, * ) 'lsm_soil_model', horizontal, l, calc_soil_moisture
+          CALL debug_message( debug_string, 'start' )
+       ENDIF
+
        IF ( horizontal )  THEN
           surf           => surf_lsm_h
@@ -5566,4 +5589,10 @@
        ENDDO
        !$OMP END PARALLEL
+!
+!--    Debug location message
+       IF ( debug_output )  THEN
+          WRITE( debug_string, * ) 'lsm_soil_model', horizontal, l, calc_soil_moisture
+          CALL debug_message( debug_string, 'end' )
+       ENDIF
 
     END SUBROUTINE lsm_soil_model
Index: /palm/trunk/SOURCE/message.f90
===================================================================
--- /palm/trunk/SOURCE/message.f90	(revision 3884)
+++ /palm/trunk/SOURCE/message.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Minor formating changes
 ! 
@@ -199,5 +203,5 @@
 !
 !--       Output on stdout
-          WRITE( *, '(//A/)' )  TRIM( header_string )
+          WRITE( *, '(6X,A)' )  TRIM( header_string )
 !
 !--       Cut message string into pieces and output one piece per line.
@@ -210,9 +214,10 @@
              i = INDEX( message_string, '&' )
           ENDDO
-          WRITE( *, '(4X,A)' )  TRIM( message_string )
-          WRITE( *, '(4X,A)' )  ''
-          WRITE( *, '(4X,A)' )  TRIM( information_string_1 ) 
-          WRITE( *, '(4X,A)' )  TRIM( information_string_2 ) 
-          WRITE( *, '(4X,A)' )  ''
+          WRITE( *, '(10X,A)' )  ''
+          WRITE( *, '(10X,A)' )  TRIM( message_string )
+          WRITE( *, '(10X,A)' )  ''
+          WRITE( *, '(10X,A)' )  TRIM( information_string_1 ) 
+          WRITE( *, '(10X,A)' )  TRIM( information_string_2 ) 
+          WRITE( *, '(10X,A)' )  ''
 
        ELSE
@@ -261,26 +266,28 @@
 
 
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
 ! Description:
 ! ------------
 !> Prints out the given location on stdout
-!------------------------------------------------------------------------------!
+!--------------------------------------------------------------------------------------------------!
  
- SUBROUTINE location_message( location, advance )
-
-
-    USE, INTRINSIC ::  ISO_FORTRAN_ENV,                                        &
+ SUBROUTINE location_message( location, message_type )
+
+
+    USE, INTRINSIC ::  ISO_FORTRAN_ENV,                                                            &
         ONLY:  OUTPUT_UNIT
 
     USE pegrid
 
-    USE pmc_interface,                                                         &
+    USE pmc_interface,                                                                             &
         ONLY:  cpl_id
 
     IMPLICIT NONE
 
-    CHARACTER(LEN=*) ::  location !< text to be output on stdout
-    LOGICAL          ::  advance  !< switch for advancing/noadvancing I/O
-
+    CHARACTER(LEN=*)  ::  location      !< text to be output on stdout
+    CHARACTER(LEN=*)  ::  message_type  !< attribute marking 'start' or 'end' of routine
+    CHARACTER(LEN=11) ::  message_type_string = ' '  !< 
+    CHARACTER(LEN=10) ::  system_time   !< system clock time
+    CHARACTER(LEN=10) ::  time
 !
 !-- Output for nested runs only on the root domain
@@ -288,14 +295,71 @@
 
     IF ( myid == 0 )  THEN
-       IF ( advance )  THEN
-          WRITE ( OUTPUT_UNIT, '(6X,''--- '',A)' )  TRIM( location )
-       ELSE
-          WRITE ( OUTPUT_UNIT, '(6X,''... '',A)', ADVANCE='NO' )               &
-                TRIM( location )
-       ENDIF
+!
+!--    Get system time for debug info output (helpful to estimate the required computing time for
+!--    specific parts of code
+       CALL date_and_time( TIME=time )
+       system_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
+!
+!--    Write pre-string depending on message_type
+       IF ( TRIM( message_type ) == 'start' )     WRITE( message_type_string, * ) '-', TRIM( message_type ), '----'
+       IF ( TRIM( message_type ) == 'finished' )  WRITE( message_type_string, * ) '-', TRIM( message_type ), '-'
+!
+!--    Write and flush debug location or info message to file
+       WRITE( OUTPUT_UNIT, 200 )  TRIM( message_type_string ), TRIM( location ), TRIM( system_time )
        FLUSH( OUTPUT_UNIT )
+!
+!--    Message formats
+200    FORMAT ( 3X, A, '  ', A, '  | System time: ', A )
+
     ENDIF
 
  END SUBROUTINE location_message
+
+
+!--------------------------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Prints out the given debug information to unit 9 (DEBUG files in temporary directory)
+!> for each PE on each domain.
+!--------------------------------------------------------------------------------------------------!
+
+ SUBROUTINE debug_message( debug_string, message_type )
+
+
+    USE control_parameters,                                                                        &
+        ONLY:  current_timestep_number
+
+    IMPLICIT NONE
+
+
+    CHARACTER(LEN=*)   ::  debug_string        !< debug message to be output on unit 9
+    CHARACTER(LEN=*)   ::  message_type        !< 'start', 'end', 'info'
+    CHARACTER(LEN=10)  ::  message_type_string = ' '  !< 
+    CHARACTER(LEN=10)  ::  system_time         !< system clock time
+    CHARACTER(LEN=10)  ::  time
+
+    INTEGER, PARAMETER ::  debug_output_unit = 9
+
+!
+!-- Get system time for debug info output (helpful to estimate the required computing time for
+!-- specific parts of code
+    CALL date_and_time( TIME=time )
+    system_time = time(1:2)//':'//time(3:4)//':'//time(5:6)
+!
+!-- Write pre-string depending on message_type
+    IF ( TRIM( message_type ) == 'start' )  WRITE( message_type_string, * ) '-', TRIM( message_type ), '-'
+    IF ( TRIM( message_type ) == 'end' )    WRITE( message_type_string, * ) '-', TRIM( message_type ), '---'
+    IF ( TRIM( message_type ) == 'info' )   WRITE( message_type_string, * ) '-', TRIM( message_type ), '--'
+!
+!-- Write and flush debug location or info message to file
+    WRITE( debug_output_unit, 201 )    TRIM( system_time ), current_timestep_number, TRIM( message_type_string ), TRIM( debug_string )
+    FLUSH( debug_output_unit )
+
+!
+!-- Message formats
+201 FORMAT ( 'System time: ', A, ' | timestep: ', I6, ' | ', A, ' ', A )
+
+
+ END SUBROUTINE debug_message
 
 
Index: /palm/trunk/SOURCE/module_interface.f90
===================================================================
--- /palm/trunk/SOURCE/module_interface.f90	(revision 3884)
+++ /palm/trunk/SOURCE/module_interface.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3880 2019-04-08 21:43:02Z knoop
 ! Add a call for salsa_prognostic_equations
 ! 
@@ -790,4 +794,6 @@
 
 
+    CALL location_message( 'initializing module-specific arrays', 'start' )
+
     IF ( bulk_cloud_model    )  CALL bcm_init_arrays
     IF ( air_chemistry       )  CALL chem_init_arrays
@@ -801,4 +807,6 @@
     IF ( user_module_enabled )  CALL user_init_arrays
 
+    CALL location_message( 'initializing module-specific arrays', 'finished' )
+
 
  END SUBROUTINE module_interface_init_arrays
@@ -812,4 +820,6 @@
  SUBROUTINE module_interface_init
 
+
+    CALL location_message( 'initializing module features', 'start' )
 
     IF ( biometeorology      )  CALL bio_init
@@ -831,4 +841,6 @@
     IF ( user_module_enabled )  CALL user_init
 
+    CALL location_message( 'initializing module features', 'finished' )
+
 
  END SUBROUTINE module_interface_init
Index: /palm/trunk/SOURCE/modules.f90
===================================================================
--- /palm/trunk/SOURCE/modules.f90	(revision 3884)
+++ /palm/trunk/SOURCE/modules.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3871 2019-04-08 14:38:39Z knoop
 ! Initialized parameter region
 ! 
@@ -1146,4 +1150,5 @@
     CHARACTER (LEN=100)  ::  restart_string = ' '                         !< for storing strings in case of writing/reading restart data
     CHARACTER (LEN=210)  ::  run_description_header                       !< string containing diverse run informations as run identifier, coupling mode, host, ensemble number, run date and time
+    CHARACTER (LEN=1000) ::  debug_string = ' '                           !<.....
     CHARACTER (LEN=1000) ::  message_string = ' '                         !< dynamic string for error message output
 
@@ -1318,4 +1323,5 @@
     LOGICAL ::  data_output_during_spinup = .FALSE.              !< namelist parameter
     LOGICAL ::  data_output_2d_on_each_pe = .TRUE.               !< namelist parameter
+    LOGICAL ::  debug_output = .FALSE.                           !< namelist parameter
     LOGICAL ::  disturbance_created = .FALSE.                    !< flow disturbance imposed?
     LOGICAL ::  do2d_at_begin = .FALSE.                          !< namelist parameter
Index: /palm/trunk/SOURCE/multi_agent_system_mod.f90
===================================================================
--- /palm/trunk/SOURCE/multi_agent_system_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/multi_agent_system_mod.f90	(revision 3885)
@@ -15,5 +15,5 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2016 Leibniz Universitaet Hannover
+! Copyright 2016-2019 Leibniz Universitaet Hannover
 !------------------------------------------------------------------------------!
 !
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3876 2019-04-08 18:41:49Z knoop
 ! replaced nspec by nvar: only variable species should bconsidered, fixed species are not relevant 
 ! 
@@ -109,5 +113,10 @@
 
     USE control_parameters,                                                    &
-        ONLY:  biometeorology, dt_3d, dt_write_agent_data, message_string,     &
+        ONLY:  biometeorology,                                                 &
+               debug_output,                                                   &
+               debug_string,                                                   &
+               dt_3d,                                                          &
+               dt_write_agent_data,                                            &
+               message_string,                                                 &
                time_since_reference_point
 
@@ -387,4 +396,10 @@
     LOGICAL       ::  first_loop_stride   !< flag for first loop stride of agent sub-timesteps
     LOGICAL, SAVE ::  first_call = .TRUE. !< first call of mas flag for output
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'multi_agent_system'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 
     CALL cpu_log( log_point(9), 'mas', 'start' )
@@ -607,4 +622,10 @@
 
     CALL cpu_log( log_point(9), 'mas', 'stop' )
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'multi_agent_system'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
 
  END SUBROUTINE multi_agent_system
Index: /palm/trunk/SOURCE/nesting_offl_mod.f90
===================================================================
--- /palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 
 ! Do local data exchange for chemistry variables only when boundary data is  
 ! coming from dynamic file
@@ -68,5 +72,7 @@
     USE control_parameters,                                                    &
         ONLY:  air_chemistry, bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,  &
-               bc_dirichlet_s, dt_3d, dz, constant_diffusion, humidity,        &
+               bc_dirichlet_s, dt_3d, dz, constant_diffusion,                  &
+               debug_output, debug_string,                                     &
+               humidity,                                                       &
                message_string, nesting_offline, neutral, passive_scalar,       &
                rans_mode, rans_tke_e, time_since_reference_point, volume_flow
@@ -150,4 +156,10 @@
        REAL(wp), DIMENSION(1:3) ::  volume_flow_l   !< local volume flow
 
+!
+!--    Debug location message
+       IF ( debug_output )  THEN
+          WRITE( debug_string, * ) 'nesting_offl_mass_conservation'
+          CALL debug_message( debug_string, 'start' )
+       ENDIF
        
        CALL  cpu_log( log_point(58), 'offline nesting', 'start' )
@@ -226,4 +238,10 @@
        
        CALL  cpu_log( log_point(58), 'offline nesting', 'stop' )
+!
+!--    Debug location message
+       IF ( debug_output )  THEN
+          WRITE( debug_string, * ) 'nesting_offl_mass_conservation'
+          CALL debug_message( debug_string, 'end' )
+       ENDIF
 
     END SUBROUTINE nesting_offl_mass_conservation
@@ -258,4 +276,11 @@
        REAL(wp), DIMENSION(nzb:nzt+1) ::  v_ref_l  !< reference profile for v-component on subdomain
        
+!
+!--    Debug location message
+       IF ( debug_output )  THEN
+          WRITE( debug_string, * ) 'nesting_offl_bc'
+          CALL debug_message( debug_string, 'start' )
+       ENDIF
+
        CALL  cpu_log( log_point(58), 'offline nesting', 'start' )      
 !
@@ -782,4 +807,10 @@
     
        CALL  cpu_log( log_point(58), 'offline nesting', 'stop' )
+!
+!--    Debug location message
+       IF ( debug_output )  THEN
+          WRITE( debug_string, * ) 'nesting_offl_bc'
+          CALL debug_message( debug_string, 'end' )
+       ENDIF
 
     END SUBROUTINE nesting_offl_bc
Index: /palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3864 2019-04-05 09:01:56Z monakurppa
 ! get_variable_4d_to_3d_real modified to enable read in data of type
 ! data(t,y,x,n) one timestep at a time + some routines made public
@@ -1391,5 +1395,4 @@
 !--
        !> Start the processing of the data
-       CALL location_message( 'starting allocation of chemistry emissions arrays', .FALSE. )
 
        !> Parameterized mode of the emissions
Index: /palm/trunk/SOURCE/palm.f90
===================================================================
--- /palm/trunk/SOURCE/palm.f90	(revision 3884)
+++ /palm/trunk/SOURCE/palm.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3761 2019-02-25 15:31:42Z raasch
 ! unused variable removed
 ! 
@@ -573,5 +577,5 @@
        CALL cpu_log( log_point(22), 'wrd_local', 'start' )
 
-       CALL location_message( 'writing restart data', .FALSE. )
+       CALL location_message( 'writing restart data', 'start' )
 
        DO  i = 0, io_blocks-1
@@ -597,5 +601,5 @@
        ENDDO
 
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'writing restart data', 'finished' )
 
        CALL cpu_log( log_point(22), 'wrd_local', 'stop' )
Index: /palm/trunk/SOURCE/parin.f90
===================================================================
--- /palm/trunk/SOURCE/parin.f90	(revision 3884)
+++ /palm/trunk/SOURCE/parin.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3806 2019-03-21 12:45:50Z raasch
 ! additional check for lateral boundary conditions added
 ! 
@@ -690,5 +694,7 @@
              cpu_log_barrierwait, create_disturbances,                         &
              cross_profiles, data_output, data_output_masks,                   &
-             data_output_pr, data_output_2d_on_each_pe, disturbance_amplitude, &
+             data_output_pr, data_output_2d_on_each_pe,                        &
+             debug_output,                                                     &
+             disturbance_amplitude,                                            &
              disturbance_energy_limit, disturbance_level_b,                    &
              disturbance_level_t, do2d_at_begin, do3d_at_begin,                &
@@ -712,5 +718,7 @@
              cpu_log_barrierwait, create_disturbances,                         &
              cross_profiles, data_output, data_output_masks,                   &
-             data_output_pr, data_output_2d_on_each_pe, disturbance_amplitude, &
+             data_output_pr, data_output_2d_on_each_pe,                        &
+             debug_output,                                                     &
+             disturbance_amplitude,                                            &
              disturbance_energy_limit, disturbance_level_b,                    &
              disturbance_level_t, do2d_at_begin, do3d_at_begin,                &
@@ -739,5 +747,5 @@
 !-- First read values of environment variables (this NAMELIST file is
 !-- generated by palmrun)
-    CALL location_message( 'reading environment parameters from ENVPAR', .FALSE. )
+    CALL location_message( 'reading environment parameters from ENVPAR', 'start' )
 
     OPEN ( 90, FILE='ENVPAR', STATUS='OLD', FORM='FORMATTED', IOSTAT=ioerr )
@@ -762,5 +770,5 @@
     ENDIF
 
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'reading environment parameters from ENVPAR', 'finished' )
 !
 !-- Calculate the number of groups into which parallel I/O is split.
@@ -794,5 +802,5 @@
     io_group  = MOD( global_id+1, io_blocks )
     
-    CALL location_message( 'reading NAMELIST parameters from PARIN', .FALSE. )
+    CALL location_message( 'reading NAMELIST parameters from PARIN', 'start' )
 !
 !-- Data is read in parallel by groups of PEs
@@ -1098,5 +1106,5 @@
     ENDDO
 
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'reading NAMELIST parameters from PARIN', 'finished' )
 
  END SUBROUTINE parin
Index: /palm/trunk/SOURCE/plant_canopy_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/plant_canopy_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/plant_canopy_model_mod.f90	(revision 3885)
@@ -16,15 +16,19 @@
 !
 ! Copyright 1997-2019 Leibniz Universitaet Hannover
-! Copyright 2018 Institute of Computer Science of the
-!                Czech Academy of Sciences, Prague
+! Copyright 2017-2019 Institute of Computer Science of the
+!                     Czech Academy of Sciences, Prague
 !------------------------------------------------------------------------------!
 !
 ! Current revisions:
 ! ------------------
-!
+! 
 ! 
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3864 2019-04-05 09:01:56Z monakurppa
 ! unsed variables removed
 ! 
@@ -254,6 +258,6 @@
         ONLY:  c_p, degc_to_k, l_v, lv_d_cp, r_d, rd_d_rv
 
-    USE control_parameters,                                                   &
-        ONLY: humidity
+    USE control_parameters,                                                    &
+        ONLY: debug_output, humidity
 
     USE indices,                                                               &
@@ -913,5 +917,5 @@
        REAL(wp) ::  canopy_height   !< canopy height for lad-profile construction
 
-       CALL location_message( 'initializing plant canopy model', .FALSE. )
+       IF ( debug_output )  CALL debug_message( 'pcm_init', 'start' )
 !
 !--    Allocate one-dimensional arrays for the computation of the 
@@ -1221,5 +1225,5 @@
        ENDIF
 
-       CALL location_message( 'finished', .TRUE. )
+       IF ( debug_output )  CALL debug_message( 'pcm_init', 'end' )
 
 
Index: /palm/trunk/SOURCE/pmc_handle_communicator_mod.f90
===================================================================
--- /palm/trunk/SOURCE/pmc_handle_communicator_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/pmc_handle_communicator_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3819 2019-03-27 11:01:36Z hellstea
 ! Adjustable anterpolation buffer introduced on all nest boundaries, it is controlled
 ! by the new nesting_parameters parameter anterpolation_buffer_width.
@@ -524,5 +528,5 @@
 !
 !-- Output location message
-    CALL location_message( 'initialize communicators for nesting', .FALSE. )
+    CALL location_message( 'initialize communicators for nesting', 'start' )
 !
 !-- Assign the layout to the corresponding internally used variable m_couplers
@@ -563,4 +567,6 @@
     ENDIF
 
+    CALL location_message( 'initialize communicators for nesting', 'finished' )
+
  END SUBROUTINE read_coupling_layout
 
Index: /palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3883 2019-04-10 12:51:50Z hellstea
 ! Checks and error messages improved and extended. All the child index bounds in the
 ! parent-grid index space are made module variables. Function get_number_of_childs
@@ -405,5 +409,7 @@
                bc_dirichlet_s, child_domain,                                   &
                constant_diffusion, constant_flux_layer,                        &
-               coupling_char, dt_3d, dz, humidity, message_string,             &
+               coupling_char,                                                  &
+               debug_output, debug_string,                                     &
+               dt_3d, dz, humidity, message_string,                            &
                neutral, passive_scalar, rans_mode, rans_tke_e,                 &
                roughness_length, salsa, topography, volume_flow
@@ -790,5 +796,5 @@
 !-- Attention: myid has been set at the end of pmc_init_model in order to
 !-- guarantee that only PE0 of the root domain does the output.
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'initialize model nesting', 'finished' )
 !
 !-- Reset myid to its default value
@@ -800,4 +806,5 @@
 !-- world_comm is given a dummy value to avoid compiler warnings (INTENT(OUT)
 !-- should get an explicit value)
+!-- todo: why don't we print an error message instead of these settings?
     cpl_id     = 1
     nested_run = .FALSE.
@@ -817,5 +824,5 @@
     
 #if defined( __parallel )
-    CALL location_message( 'setup the nested model configuration', .FALSE. )
+    CALL location_message( 'setup the nested model configuration', 'start' )
     CALL cpu_log( log_point_s(79), 'pmci_model_config', 'start' )
 !
@@ -844,5 +851,5 @@
 
     CALL cpu_log( log_point_s(79), 'pmci_model_config', 'stop' )
-    CALL location_message( 'finished', .TRUE. )
+    CALL location_message( 'setup the nested model configuration', 'finished' )
 #endif
 
@@ -3050,8 +3057,17 @@
    REAL(wp) ::  dtg       !<  Global time step defined as the global minimum of dtl of all processes
 
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'pmci_synchronize'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
    
    dtl = dt_3d
    CALL MPI_ALLREDUCE( dtl, dtg, 1, MPI_REAL, MPI_MIN, MPI_COMM_WORLD, ierr )
    dt_3d  = dtg
+
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'pmci_synchronize'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
 
 #endif
@@ -3099,4 +3115,10 @@
     CHARACTER(LEN=*), INTENT(IN) ::  local_nesting_mode  !<  Nesting mode: 'one-way', 'two-way' or 'vertical'
 
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'pmci_datatrans'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 
     IF ( TRIM( local_nesting_mode ) == 'one-way' )  THEN
@@ -3133,4 +3155,10 @@
        ENDIF
 
+    ENDIF
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'pmci_datatrans'
+       CALL debug_message( debug_string, 'end' )
     ENDIF
 
@@ -4600,4 +4628,10 @@
     INTEGER(iwp) ::  n   !< Running index for number of chemical species
     
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'pmci_boundary_conds'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 !
 !-- Set Dirichlet boundary conditions for horizontal velocity components
@@ -4786,4 +4820,10 @@
        ENDIF
     ENDIF    
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'pmci_boundary_conds'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
 
  END SUBROUTINE pmci_boundary_conds
Index: /palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- /palm/trunk/SOURCE/prognostic_equations.f90	(revision 3884)
+++ /palm/trunk/SOURCE/prognostic_equations.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3881 2019-04-10 09:31:22Z suehring
 ! Bugfix in OpenMP directive
 ! 
@@ -395,4 +399,5 @@
     USE control_parameters,                                                    &
         ONLY:  air_chemistry, constant_diffusion,                              &
+               debug_output, debug_string,                                     &
                dp_external, dp_level_ind_b, dp_smooth_factor, dpdxy, dt_3d,    &
                humidity, intermediate_timestep_count,                          &
@@ -517,4 +522,9 @@
 
 
+
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'prognostic_equations_cache'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 !
 !-- Time measurement can only be performed for the whole set of equations
@@ -1115,4 +1125,8 @@
     CALL cpu_log( log_point(32), 'all progn.equations', 'stop' )
 
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'prognostic_equations_cache'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
 
  END SUBROUTINE prognostic_equations_cache
@@ -1138,4 +1152,9 @@
     REAL(wp)     ::  sbt  !<
 
+
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'prognostic_equations_vector'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 !
 !-- Run SALSA and aerosol dynamic processes. SALSA is run with a longer time 
@@ -1869,4 +1888,9 @@
     CALL module_interface_prognostic_equations()
 
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'prognostic_equations_vector'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
+
  END SUBROUTINE prognostic_equations_vector
 
Index: /palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3885)
@@ -15,7 +15,7 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2015-2018 Institute of Computer Science of the 
+! Copyright 2015-2019 Institute of Computer Science of the 
 !                     Czech Academy of Sciences, Prague
-! Copyright 2015-2018 Czech Technical University in Prague
+! Copyright 2015-2019 Czech Technical University in Prague
 ! Copyright 1997-2019 Leibniz Universitaet Hannover
 !------------------------------------------------------------------------------!
@@ -28,4 +28,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3881 2019-04-10 09:31:22Z suehring
 ! Output of albedo and emissivity moved from USM, bugfixes in initialization
 ! of albedo
@@ -612,5 +616,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  cloud_droplets, coupling_char, dz, dt_spinup, end_time,         &
+        ONLY:  cloud_droplets, coupling_char,                                  &
+               debug_output, debug_string,                                     &
+               dz, dt_spinup, end_time,                                        &
                humidity,                                                       &
                initializing_actions, io_blocks, io_group,                      &
@@ -1347,4 +1353,7 @@
 
 
+       IF ( debug_output )  CALL debug_message( 'radiation_control', 'start' )
+
+
        SELECT CASE ( TRIM( radiation_scheme ) )
 
@@ -1362,4 +1371,5 @@
        END SELECT
 
+       IF ( debug_output )  CALL debug_message( 'radiation_control', 'end' )
 
     END SUBROUTINE radiation_control
@@ -1835,4 +1845,6 @@
 #endif
 
+
+       IF ( debug_output )  CALL debug_message( 'radiation_init', 'start' )
 !
 !--    Activate radiation_interactions according to the existence of vertical surfaces and/or trees.
@@ -1858,9 +1870,4 @@
 !--    via sky-view factors. This must be done before radiation is initialized.
        IF ( radiation_interactions )  CALL radiation_interaction_init
-
-!
-!--    Initialize radiation model
-       CALL location_message( 'initializing radiation model', .FALSE. )
-
 !
 !--    Allocate array for storing the surface net radiation
@@ -2856,6 +2863,4 @@
        CALL init_date_and_time
 
-       CALL location_message( 'finished', .TRUE. )
-
 !
 !--    Find all discretized apparent solar positions for radiation interaction.
@@ -2867,14 +2872,10 @@
 !
 !--       Read sky-view factors and further required data from file
-          CALL location_message( '    Start reading SVF from file', .FALSE. )
           CALL radiation_read_svf()
-          CALL location_message( '    Reading SVF from file has finished', .TRUE. )
 
        ELSEIF ( radiation_interactions .AND. .NOT. read_svf)  THEN
 !
 !--       calculate SFV and CSF
-          CALL location_message( '    Start calculation of SVF', .FALSE. )
           CALL radiation_calc_svf()
-          CALL location_message( '    Calculation of SVF has finished', .TRUE. )
        ENDIF
 
@@ -2882,7 +2883,5 @@
 !
 !--       Write svf, csf svfsurf and csfsurf data to file
-          CALL location_message( '    Start writing SVF in file', .FALSE. )
           CALL radiation_write_svf()
-          CALL location_message( '    Writing SVF in file has finished', .TRUE. )
        ENDIF
 
@@ -2894,5 +2893,7 @@
        ENDIF
 
-       RETURN
+       IF ( debug_output )  CALL debug_message( 'radiation_init', 'end' )
+
+       RETURN !todo: remove, I don't see what we need this for here
 
     END SUBROUTINE radiation_init
@@ -5104,4 +5105,6 @@
 
 
+     IF ( debug_output )  CALL debug_message( 'radiation_interaction', 'start' )
+
      IF ( plant_canopy )  THEN
          pchf_prep(:) = r_d * exner(nz_urban_b:nz_urban_t)                                 &
@@ -5848,4 +5851,7 @@
            (emissivity_urb*sigma_sb * area_hor) )**0.25_wp
 
+     IF ( debug_output )  CALL debug_message( 'radiation_interaction', 'end' )
+
+
     CONTAINS
 
@@ -5978,5 +5984,4 @@
     END SUBROUTINE calc_diffusion_radiation
 
-
  END SUBROUTINE radiation_interaction
     
@@ -6143,5 +6148,6 @@
 !--    allocate urban surfaces grid
 !--    calc number of surfaces in local proc
-       CALL location_message( '    calculation of indices for surfaces', .TRUE. )
+       IF ( debug_output )  CALL debug_message( 'calculation of indices for surfaces', 'info' )
+
        nsurfl = 0
 !
@@ -6478,5 +6484,5 @@
 !--
 !--    allocation of the arrays for direct and diffusion radiation
-       CALL location_message( '    allocation of radiation arrays', .TRUE. )
+       IF ( debug_output )  CALL debug_message( 'allocation of radiation arrays', 'info' )
 !--    rad_sw_in, rad_lw_in are computed in radiation model,
 !--    splitting of direct and diffusion part is done
@@ -6577,9 +6583,8 @@
 !    
         INTEGER(iwp), DIMENSION(0:svfnorm_report_num) :: svfnorm_counts
-        CHARACTER(200)                                :: msg
+
 
 !--     calculation of the SVF
-        CALL location_message( '    calculation of SVF and CSF', .TRUE. )
-        CALL radiation_write_debug_log('Start calculation of SVF and CSF')
+        CALL location_message( 'calculating view factors for radiation interaction', 'start' )
 
 !--     initialize variables and temporary arrays for calculation of svf and csf
@@ -6921,6 +6926,8 @@
                      ENDIF
 
-                     WRITE (msg,'(A,3I12)') 'Grow asvf:',nsvfl,nsvfla,k
-                     CALL radiation_write_debug_log( msg )
+                     IF ( debug_output )  THEN
+                        WRITE( debug_string, '(A,3I12)' ) 'Grow asvf:', nsvfl, nsvfla, k
+                        CALL debug_message( debug_string, 'info' )
+                     ENDIF
                      
                      nsvfla = k
@@ -7004,6 +7011,8 @@
                      ENDIF
 
-                     WRITE(msg,'(A,3I12)') 'Grow asvf:',nsvfl,nsvfla,k
-                     CALL radiation_write_debug_log( msg )
+                     IF ( debug_output )  THEN
+                        WRITE( debug_string, '(A,3I12)' ) 'Grow asvf:', nsvfl, nsvfla, k
+                        CALL debug_message( debug_string, 'info' )
+                     ENDIF
                      
                      nsvfla = k
@@ -7172,6 +7181,8 @@
                     ENDIF
 
-                    WRITE (msg,'(A,3I12)') 'Grow amrtf:', nmrtf, nmrtfa, k
-                    CALL radiation_write_debug_log( msg )
+                    IF ( debug_output )  THEN
+                       WRITE( debug_string, '(A,3I12)' ) 'Grow amrtf:', nmrtf, nmrtfa, k
+                       CALL debug_message( debug_string, 'info' )
+                    ENDIF
 
                     nmrtfa = k
@@ -7224,13 +7235,6 @@
         ENDIF
 
-        CALL radiation_write_debug_log( 'End of calculation SVF' )
-        WRITE(msg, *) 'Raytracing skipped for maximum distance of ', &
-           max_raytracing_dist, ' m on ', ray_skip_maxdist, ' pairs.'
-        CALL radiation_write_debug_log( msg )
-        WRITE(msg, *) 'Raytracing skipped for minimum potential value of ', &
-           min_irrf_value , ' on ', ray_skip_minval, ' pairs.'
-        CALL radiation_write_debug_log( msg )
-
-        CALL location_message( '    waiting for completion of SVF and CSF calculation in all processes', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'waiting for completion of SVF and CSF calculation in all processes', 'info' )
+
 !--     deallocate temporary global arrays
         DEALLOCATE(nzterr)
@@ -7274,8 +7278,8 @@
         ENDIF
 
-        CALL location_message( '    calculation of the complete SVF array', .TRUE. )
+        IF ( debug_output )  CALL debug_message( 'calculation of the complete SVF array', 'info' )
 
         IF ( rad_angular_discretization )  THEN
-           CALL radiation_write_debug_log( 'Load svf from the structure array to plain arrays' )
+           IF ( debug_output )  CALL debug_message( 'Load svf from the structure array to plain arrays', 'info' )
            ALLOCATE( svf(ndsvf,nsvfl) )
            ALLOCATE( svfsurf(idsvf,nsvfl) )
@@ -7286,10 +7290,10 @@
            ENDDO
         ELSE
-           CALL radiation_write_debug_log( 'Start SVF sort' )
+           IF ( debug_output )  CALL debug_message( 'Start SVF sort', 'info' )
 !--        sort svf ( a version of quicksort )
            CALL quicksort_svf(asvf,1,nsvfl)
 
            !< load svf from the structure array to plain arrays
-           CALL radiation_write_debug_log( 'Load svf from the structure array to plain arrays' )
+           IF ( debug_output )  CALL debug_message( 'Load svf from the structure array to plain arrays', 'info' )
            ALLOCATE( svf(ndsvf,nsvfl) )
            ALLOCATE( svfsurf(idsvf,nsvfl) )
@@ -7346,6 +7350,5 @@
         IF ( plant_canopy )  THEN
 
-            CALL location_message( '    calculation of the complete CSF array', .TRUE. )
-            CALL radiation_write_debug_log( 'Calculation of the complete CSF array' )
+            IF ( debug_output )  CALL debug_message( 'Calculation of the complete CSF array', 'info' )
 !--         sort and merge csf for the last time, keeping the array size to minimum
             CALL merge_and_grow_csf(-1)
@@ -7419,6 +7422,8 @@
 !--         scatter and gather the number of elements to and from all processor
 !--         and calculate displacements
-            CALL radiation_write_debug_log( 'Scatter and gather the number of elements to and from all processor' )
+            IF ( debug_output )  CALL debug_message( 'Scatter and gather the number of elements to and from all processor', 'info' )
+
             CALL MPI_AlltoAll(icsflt,1,MPI_INTEGER,ipcsflt,1,MPI_INTEGER,comm2d, ierr)
+
             IF ( ierr /= 0 ) THEN
                 WRITE(9,*) 'Error MPI_AlltoAll1:', ierr, SIZE(icsflt), SIZE(ipcsflt)
@@ -7434,5 +7439,5 @@
 
 !--         exchange csf fields between processors
-            CALL radiation_write_debug_log( 'Exchange csf fields between processors' )
+            IF ( debug_output )  CALL debug_message( 'Exchange csf fields between processors', 'info' )
             udim = max(npcsfl,1)
             ALLOCATE( pcsflt_l(ndcsf*udim) )
@@ -7473,10 +7478,10 @@
 
 !--         sort csf ( a version of quicksort )
-            CALL radiation_write_debug_log( 'Sort csf' )
+            IF ( debug_output )  CALL debug_message( 'Sort csf', 'info' )
             CALL quicksort_csf2(kpcsflt, pcsflt, 1, npcsfl)
 
 !--         aggregate canopy sink factor records with identical box & source
 !--         againg across all values from all processors
-            CALL radiation_write_debug_log( 'Aggregate canopy sink factor records with identical box' )
+            IF ( debug_output )  CALL debug_message( 'Aggregate canopy sink factor records with identical box', 'info' )
 
             IF ( npcsfl > 0 )  THEN
@@ -7521,5 +7526,5 @@
             DEALLOCATE( pcsflt_l )
             DEALLOCATE( kpcsflt_l )
-            CALL radiation_write_debug_log( 'End of aggregate csf' )
+            IF ( debug_output )  CALL debug_message( 'End of aggregate csf', 'info' )
             
         ENDIF
@@ -7528,7 +7533,7 @@
         CALL MPI_BARRIER( comm2d, ierr )
 #endif
-        CALL radiation_write_debug_log( 'End of radiation_calc_svf (after mpi_barrier)' )
-
-        RETURN
+        CALL location_message( 'calculating view factors for radiation interaction', 'finished' )
+
+        RETURN  !todo: remove
         
 !        WRITE( message_string, * )  &
@@ -8440,5 +8445,8 @@
        INTEGER(iwp)                 :: nsurfl_from_file = 0
        INTEGER(iwp)                 :: nmrtbl_from_file = 0
-       
+
+
+       CALL location_message( 'reading view factors for radiation interaction', 'start' )
+
        DO  i = 0, io_blocks-1
           IF ( i == io_group )  THEN
@@ -8484,8 +8492,8 @@
                  CALL message( 'radiation_read_svf', 'PA0483', 1, 2, 0, 6, 0 )
              ELSE
-                 WRITE(message_string,*) '    Number of SVF, CSF, and nsurfl ',&
+                 WRITE(debug_string,*)   'Number of SVF, CSF, and nsurfl ',    &
                                          'to read', nsvfl, ncsfl,              &
                                          nsurfl_from_file
-                 CALL location_message( message_string, .TRUE. )
+                 IF ( debug_output )  CALL debug_message( debug_string, 'info' )
              ENDIF
              
@@ -8516,6 +8524,6 @@
                  CALL message( 'radiation_read_svf', 'PA0494', 1, 2, 0, 6, 0 )
              ELSE
-                 WRITE(message_string,*) '    Number of nmrtf to read ', nmrtf
-                 CALL location_message( message_string, .TRUE. )
+                 WRITE(debug_string,*) 'Number of nmrtf to read ', nmrtf
+                 IF ( debug_output )  CALL debug_message( debug_string, 'info' )
              ENDIF
               
@@ -8578,4 +8586,7 @@
        ENDDO
 
+       CALL location_message( 'reading view factors for radiation interaction', 'finished' )
+
+
     END SUBROUTINE radiation_read_svf
 
@@ -8592,4 +8603,7 @@
        
        INTEGER(iwp)        :: i
+
+
+       CALL location_message( 'writing view factors for radiation interaction', 'start' )
 
        DO  i = 0, io_blocks-1
@@ -8636,4 +8650,8 @@
 #endif
        ENDDO
+
+       CALL location_message( 'writing view factors for radiation interaction', 'finished' )
+
+
     END SUBROUTINE radiation_write_svf
 
@@ -8788,5 +8806,5 @@
         INTEGER(iwp)                            :: iread, iwrite
         TYPE(t_csf), DIMENSION(:), POINTER      :: acsfnew
-        CHARACTER(100)                          :: msg
+
 
         IF ( newsize == -1 )  THEN
@@ -8852,6 +8870,8 @@
         ncsfla = newsize
 
-        WRITE(msg,'(A,2I12)') 'Grow acsf2:',ncsfl,ncsfla
-        CALL radiation_write_debug_log( msg )
+        IF ( debug_output )  THEN
+           WRITE( debug_string, '(A,2I12)' ) 'Grow acsf2:', ncsfl, ncsfla
+           CALL debug_message( debug_string, 'info' )
+        ENDIF
 
     END SUBROUTINE merge_and_grow_csf
@@ -11490,21 +11510,4 @@
  END SUBROUTINE radiation_rrd_local
 
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-!> Subroutine writes debug information
-!------------------------------------------------------------------------------!
- SUBROUTINE radiation_write_debug_log ( message )
-    !> it writes debug log with time stamp
-    CHARACTER(*)  :: message
-    CHARACTER(15) :: dtc
-    CHARACTER(8)  :: date
-    CHARACTER(10) :: time
-    CHARACTER(5)  :: zone
-    CALL date_and_time(date, time, zone)
-    dtc = date(7:8)//','//time(1:2)//':'//time(3:4)//':'//time(5:10)
-    WRITE(9,'(2A)') dtc, TRIM(message)
-    FLUSH(9)
- END SUBROUTINE radiation_write_debug_log
 
  END MODULE radiation_model_mod
Index: /palm/trunk/SOURCE/salsa_mod.f90
===================================================================
--- /palm/trunk/SOURCE/salsa_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/salsa_mod.f90	(revision 3885)
@@ -15,5 +15,5 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2018-2018 University of Helsinki
+! Copyright 2018-2019 University of Helsinki
 ! Copyright 1997-2019 Leibniz Universitaet Hannover
 !--------------------------------------------------------------------------------!
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3876 2019-04-08 18:41:49Z knoop
 ! Introduced salsa_actions module interface
 ! 
@@ -1290,5 +1294,5 @@
     INTEGER(iwp) :: j   !<
 
-    CALL location_message( 'initializing salsa (sectional aerosol module )', .TRUE. )
+    IF ( debug_output )  CALL debug_message( 'salsa_init', 'start' )
 
     bin_low_limits = 0.0_wp
@@ -1439,5 +1443,5 @@
     ENDIF
 
-    CALL location_message( 'finished', .TRUE. )
+    IF ( debug_output )  CALL debug_message( 'salsa_init', 'end' )
 
  END SUBROUTINE salsa_init
@@ -8087,6 +8091,9 @@
 !
 !--          Subrange 2b:
+!--          todo: this information should go to HEADER/RUN_CONTROL, it doesn't belong to the job log,
+!--          and actually, aerosol_flux_mass_fracs_b is not used anywhere else except for this message,
+!--          hence, what do we need it for?
              IF ( SUM( aerosol_flux_mass_fracs_b ) > 0.0_wp )  THEN
-                CALL location_message( '   salsa_emission_setup: emissions are soluble!', .TRUE. )
+                CALL debug_message( '   salsa_emission_setup: emissions are soluble!', 'info' )
              ENDIF
 
@@ -8681,7 +8688,8 @@
 !
 !--    Subrange 2b:
-       IF ( .NOT. no_insoluble )  THEN
-          CALL location_message( '    salsa_mass_flux: All emissions are soluble!', .TRUE. )
-       ENDIF
+!--          todo: this information should go to HEADER/RUN_CONTROL, it doesn't belong to the job log
+!        IF ( .NOT. no_insoluble )  THEN
+!           CALL location_message( '    salsa_mass_flux: All emissions are soluble!', .TRUE. )
+!        ENDIF
 
     END SUBROUTINE set_mass_flux
@@ -8776,7 +8784,8 @@
           END SELECT
        ENDDO
-       IF ( SUM( emission_index_chem ) == 0 )  THEN
-          CALL location_message( '    salsa_gas_emission_setup: no gas emissions', .TRUE. )
-       ENDIF
+!--          todo: this information should go to HEADER/RUN_CONTROL, it doesn't belong to the job log
+!        IF ( SUM( emission_index_chem ) == 0 )  THEN
+!           CALL location_message( '    salsa_gas_emission_setup: no gas emissions', .TRUE. )
+!        ENDIF
 !
 !--    Inquire the fill value
Index: /palm/trunk/SOURCE/surface_layer_fluxes_mod.f90
===================================================================
--- /palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/surface_layer_fluxes_mod.f90	(revision 3885)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3881 2019-04-10 09:31:22Z suehring
 ! Assure that Obukhov length does not become zero
 ! 
@@ -273,5 +277,7 @@
         ONLY:  air_chemistry, cloud_droplets,                                  &
                constant_heatflux, constant_scalarflux,                         &
-               constant_waterflux, coupling_mode, do_output_at_2m, humidity,   &
+               constant_waterflux, coupling_mode,                              &
+               debug_output, debug_string,                                     &
+               do_output_at_2m, humidity,                                      &
                ibc_e_b, ibc_pt_b, indoor_model, initializing_actions,          &
                intermediate_timestep_count, intermediate_timestep_count_max,   &
@@ -356,4 +362,7 @@
 
        IMPLICIT NONE
+
+
+       IF ( debug_output )  CALL debug_message( 'surface_layer_fluxes', 'start' )
 
        surf_vertical = .FALSE. !< flag indicating vertically orientated surface elements
@@ -716,5 +725,6 @@
        ENDDO 
        mom_tke = .FALSE.
-  
+
+       IF ( debug_output )  CALL debug_message( 'surface_layer_fluxes', 'end' )
 
     END SUBROUTINE surface_layer_fluxes
@@ -733,5 +743,5 @@
 
 
-       CALL location_message( 'initializing surface layer', .FALSE. )
+       CALL location_message( 'initializing surface layer', 'start' )
 
 !
@@ -744,5 +754,5 @@
        ENDIF
 
-       CALL location_message( 'finished', .TRUE. )
+       CALL location_message( 'initializing surface layer', 'finished' )
 
     END SUBROUTINE init_surface_layer_fluxes
Index: /palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- /palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3885)
@@ -15,5 +15,5 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2017 Leibniz Universitaet Hannover
+! Copyright 2017-2019 Leibniz Universitaet Hannover
 !------------------------------------------------------------------------------!
 !
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 
 ! removed unused variables
 ! 
@@ -187,5 +191,9 @@
 
     USE control_parameters,                                                    &
-        ONLY:  initializing_actions, num_mean_inflow_profiles, message_string, &
+        ONLY:  debug_output,                                                   &
+               debug_string,                                                   &
+               initializing_actions,                                           &
+               message_string,                                                 &
+               num_mean_inflow_profiles,                                       &
                syn_turb_gen
 
@@ -1080,5 +1088,10 @@
     REAL(wp) :: volume_flow_l   !< local mass flux through lateral boundary
 
-
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'stg_main'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
 !
 !-- Calculate time step which is needed for filter functions
@@ -1422,5 +1435,10 @@
 !-- Finally, set time counter for calling STG to zero
     time_stg_call = 0.0_wp
-
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'stg_main'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
 
  END SUBROUTINE stg_main
@@ -1825,4 +1843,10 @@
 
 !
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'stg_adjust'
+       CALL debug_message( debug_string, 'start' )
+    ENDIF
+!
 !-- Compute mean boundary layer height according to Richardson-Bulk
 !-- criterion using the inflow profiles. Further velocity scale as well as
@@ -1856,5 +1880,10 @@
 !-- Reset time counter for controlling next adjustment to zero
     time_stg_adjust = 0.0_wp
-    
+!
+!-- Debug location message
+    IF ( debug_output )  THEN
+       WRITE( debug_string, * ) 'stg_adjust'
+       CALL debug_message( debug_string, 'end' )
+    ENDIF
     
  END SUBROUTINE stg_adjust 
Index: /palm/trunk/SOURCE/time_integration.f90
===================================================================
--- /palm/trunk/SOURCE/time_integration.f90	(revision 3884)
+++ /palm/trunk/SOURCE/time_integration.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3879 2019-04-08 20:25:23Z knoop
 ! Moved wtm_forces to module_interface_actions
 ! 
@@ -821,5 +825,5 @@
 #endif
 
-    CALL location_message( 'starting timestep-sequence', .TRUE. )
+    CALL location_message( 'atmosphere (and/or ocean) time-stepping', 'start' )
 
 !
@@ -1858,5 +1862,5 @@
 #endif
 
-    CALL location_message( 'finished time-stepping', .TRUE. )
+    CALL location_message( 'atmosphere (and/or ocean) time-stepping', 'finished' )
 
  END SUBROUTINE time_integration
Index: /palm/trunk/SOURCE/time_integration_spinup.f90
===================================================================
--- /palm/trunk/SOURCE/time_integration_spinup.f90	(revision 3884)
+++ /palm/trunk/SOURCE/time_integration_spinup.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3766 2019-02-26 16:23:41Z raasch
 ! unused variable removed
 ! 
@@ -257,5 +261,5 @@
     dt_3d   = dt_spinup
 
-    CALL location_message( 'starting spinup-sequence', .TRUE. )
+    CALL location_message( 'wall/soil spinup time-stepping', 'start' )
 !
 !-- Start of the time loop
@@ -573,5 +577,5 @@
 #endif
 
-    CALL location_message( 'finished spinup-sequence', .TRUE. )
+    CALL location_message( 'wall/soil spinup time-stepping', 'finished' )
 
 
Index: /palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3884)
+++ /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
  
Index: /palm/trunk/SOURCE/virtual_flight_mod.f90
===================================================================
--- /palm/trunk/SOURCE/virtual_flight_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/virtual_flight_mod.f90	(revision 3885)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! variables documented
 ! 
@@ -104,5 +108,5 @@
  
     USE control_parameters,                                                    &
-        ONLY:  fl_max, num_leg, num_var_fl, num_var_fl_user, virtual_flight
+        ONLY:  debug_output, fl_max, num_leg, num_var_fl, num_var_fl_user, virtual_flight
  
     USE kinds
@@ -332,4 +336,7 @@
 
        REAL(wp) ::  distance  !< distance between start and end position of a flight leg
+
+
+       IF ( debug_output )  CALL debug_message( 'flight_init', 'start' )
 !
 !--    Determine the number of flight legs
@@ -407,4 +414,6 @@
        sensor_l = 0.0_wp
        sensor   = 0.0_wp
+
+       IF ( debug_output )  CALL debug_message( 'flight_init', 'end' )
 
     END SUBROUTINE flight_init
Index: /palm/trunk/SOURCE/wind_turbine_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 3884)
+++ /palm/trunk/SOURCE/wind_turbine_model_mod.f90	(revision 3885)
@@ -15,5 +15,5 @@
 ! PALM. If not, see <http://www.gnu.org/licenses/>.
 !
-! Copyright 2009-2018 Carl von Ossietzky Universitaet Oldenburg
+! Copyright 2009-2019 Carl von Ossietzky Universitaet Oldenburg
 ! Copyright 1997-2019 Leibniz Universitaet Hannover
 !------------------------------------------------------------------------------!
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Changes related to global restructuring of location messages and introduction 
+! of additional debug messages
+! 
+! 3875 2019-04-08 17:35:12Z knoop
 ! Addaped wtm_tendency to fit the module actions interface
 ! 
@@ -197,5 +201,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  coupling_char, dt_3d, dz, message_string, simulated_time,       &
+        ONLY:  coupling_char,                                                  &
+               debug_output,                                                   &
+               dt_3d, dz, message_string, simulated_time,                      &
                wind_turbine, initializing_actions
 
@@ -984,5 +990,5 @@
        INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: index_nact       !< 
        
-       CALL location_message( 'initializing wind turbine model', .FALSE. )
+       IF ( debug_output )  CALL debug_message( 'wtm_init', 'start' )
        
        ALLOCATE( index_nacb(1:nturbines) )
@@ -1341,5 +1347,5 @@
        CALL wtm_read_blade_tables
 
-       CALL location_message( 'finished', .TRUE. )
+       IF ( debug_output )  CALL debug_message( 'wtm_init', 'end' )
  
     END SUBROUTINE wtm_init
