Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 3699)
+++ palm/trunk/SOURCE/Makefile	(revision 3700)
@@ -690,5 +690,4 @@
 	user_data_output_dvrp.f90 \
 	user_data_output_mask.f90 \
-	user_define_netcdf_grid.f90 \
 	user_dvrp_coltab.f90 \
 	user_flight.f90\
@@ -1352,5 +1351,6 @@
 	spectra_mod.o \
 	turbulence_closure_mod.o \
-	urban_surface_mod.o
+	urban_surface_mod.o \
+	user_module.o
 nesting_offl_mod.o: \
 	cpulog_mod.o \
@@ -1752,8 +1752,4 @@
 	modules.o \
 	user_module.o
-user_define_netcdf_grid.o: \
-	mod_kinds.o \
-	modules.o \
-	user_module.o
 user_dvrp_coltab.o: \
 	mod_kinds.o \
@@ -1782,7 +1778,5 @@
 	mod_kinds.o \
 	modules.o \
-	netcdf_interface_mod.o \
-	surface_mod.o \
-	user_module.o
+	surface_mod.o
 user_init_plant_canopy.o: \
 	mod_kinds.o \
@@ -1816,5 +1810,4 @@
 	mod_kinds.o \
 	modules.o \
-	netcdf_interface_mod.o \
 	surface_mod.o
 user_spectra.o: \
Index: palm/trunk/SOURCE/bulk_cloud_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 3699)
+++ palm/trunk/SOURCE/bulk_cloud_model_mod.f90	(revision 3700)
@@ -881,5 +881,5 @@
 !> Initialization of the bulk cloud module
 !------------------------------------------------------------------------------!
-    SUBROUTINE bcm_init !( dots_label, dots_unit, dots_num, dots_max )
+    SUBROUTINE bcm_init
 
        IMPLICIT NONE
@@ -888,9 +888,4 @@
        INTEGER(iwp) ::  j !<
        INTEGER(iwp) ::  k !<
-
-!        INTEGER(iwp) ::  dots_num
-!        INTEGER(iwp) ::  dots_max
-!        CHARACTER (LEN=13), DIMENSION(dots_max) :: dots_unit
-!        CHARACTER (LEN=13), DIMENSION(dots_max) :: dots_label
 
        CALL location_message( 'initializing bulk cloud module', .FALSE. )
Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 3699)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 3700)
@@ -780,4 +780,5 @@
     USE module_interface,                                                      &
         ONLY:  module_interface_check_parameters,                              &
+               module_interface_check_data_output_ts,                          &
                module_interface_check_data_output_pr,                          &
                module_interface_check_data_output
@@ -790,5 +791,6 @@
         ONLY:  dopr_unit, do2d_unit, do3d_unit, netcdf_data_format,            &
                netcdf_data_format_string, dots_unit, heatflux_output_unit,     &
-               waterflux_output_unit, momentumflux_output_unit
+               waterflux_output_unit, momentumflux_output_unit,                &
+               dots_max, dots_num, dots_label
 
     USE particle_attributes
@@ -1253,4 +1255,17 @@
     dots_unit(21)    = waterflux_output_unit
     dots_unit(19:20) = momentumflux_output_unit
+
+!
+!-- Add other module specific timeseries
+    CALL module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+
+!
+!-- Check if maximum number of allowed timeseries is exceeded
+    IF ( dots_num > dots_max )  THEN
+       WRITE( message_string, * ) 'number of time series quantities exceeds',  &
+                                  ' its maximum of dots_max = ', dots_max,     &
+                                  '&Please increase dots_max in modules.f90.'
+       CALL message( 'init_3d_model', 'PA0194', 1, 2, 0, 6, 0 )    
+    ENDIF
 
 !
Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3699)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3700)
@@ -2642,8 +2642,4 @@
     INTEGER(iwp) ::  m    !<
     INTEGER(iwp) ::  lpr  !< running index chem spcs
-
-    !    REAL(wp),                                                                                      &
-    !    DIMENSION(dots_num_palm+1:dots_max) ::                                                         &
-    !          ts_value_l   !< 
 
     IF ( mode == 'profiles' )  THEN
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 3699)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 3700)
@@ -617,5 +617,5 @@
 
     USE netcdf_interface,                                                      &
-        ONLY:  dots_max, dots_num, dots_unit, dots_label
+        ONLY:  dots_max
 
     USE netcdf_data_input_mod,                                                 &
@@ -734,6 +734,6 @@
               sums_l(nzb:nzt+1,pr_palm+max_pr_user+max_pr_cs,0:threads_per_task-1),      &
               sums_l_l(nzb:nzt+1,0:statistic_regions,0:threads_per_task-1),    &
-              sums_wsts_bc_l(nzb:nzt+1,0:statistic_regions),                   &
-              ts_value(dots_max,0:statistic_regions) )
+              sums_wsts_bc_l(nzb:nzt+1,0:statistic_regions) )
+    ALLOCATE( ts_value(dots_max,0:statistic_regions) )
     ALLOCATE( ptdf_x(nxlg:nxrg), ptdf_y(nysg:nyng) )
 
@@ -2041,15 +2041,4 @@
     rmask(:,nxlg:nxl-1,:) = 0.0_wp;  rmask(:,nxr+1:nxrg,:) = 0.0_wp
     rmask(nysg:nys-1,:,:) = 0.0_wp;  rmask(nyn+1:nyng,:,:) = 0.0_wp
-
-!
-!-- Temporary solution to add LSM and radiation time series to the default
-!-- output
-    IF ( land_surface  .OR.  radiation )  THEN
-       IF ( TRIM( radiation_scheme ) == 'rrtmg' )  THEN
-          dots_num = dots_num + 15
-       ELSE
-          dots_num = dots_num + 11
-       ENDIF
-    ENDIF
 !
 !-- To do: New concept for these non-topography grid points!
@@ -2382,12 +2371,4 @@
        ENDDO
     ENDIF
-!
-!-- Check if maximum number of allowed timeseries is exceeded
-    IF ( dots_num > dots_max )  THEN
-       WRITE( message_string, * ) 'number of time series quantities exceeds',  &
-                                  ' its maximum of dots_max = ', dots_max,     &
-                                  '&Please increase dots_max in modules.f90.'
-       CALL message( 'init_3d_model', 'PA0194', 1, 2, 0, 6, 0 )    
-    ENDIF
 
 !
Index: palm/trunk/SOURCE/module_interface.f90
===================================================================
--- palm/trunk/SOURCE/module_interface.f90	(revision 3699)
+++ palm/trunk/SOURCE/module_interface.f90	(revision 3700)
@@ -216,4 +216,5 @@
               radiation_parin,                                                 &
               radiation_check_parameters,                                      &
+              radiation_check_data_output_ts,                                  &
               radiation_check_data_output_pr,                                  &
               radiation_check_data_output,                                     &
@@ -271,4 +272,5 @@
        ONLY:  user_parin,                                                      &
               user_check_parameters,                                           &
+              user_check_data_output_ts,                                       &
               user_check_data_output_pr,                                       &
               user_check_data_output,                                          &
@@ -307,4 +309,5 @@
       module_interface_parin,                                                  &
       module_interface_check_parameters,                                       &
+      module_interface_check_data_output_ts,                                   &
       module_interface_check_data_output_pr,                                   &
       module_interface_check_data_output,                                      &
@@ -334,4 +337,8 @@
       MODULE PROCEDURE module_interface_check_parameters
    END INTERFACE module_interface_check_parameters
+
+   INTERFACE module_interface_check_data_output_ts
+      MODULE PROCEDURE module_interface_check_data_output_ts
+   END INTERFACE module_interface_check_data_output_ts
 
    INTERFACE module_interface_check_data_output_pr
@@ -481,4 +488,28 @@
 ! Description:
 ! ------------
+!> Check module-specific data output of timeseries
+!------------------------------------------------------------------------------!
+SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+
+
+   INTEGER(iwp),      INTENT(IN)    ::  dots_max !< variable output array index
+   INTEGER(iwp),      INTENT(INOUT)    ::  dots_num !< variable output array index
+   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label
+   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit
+
+
+   IF ( radiation )  THEN
+      CALL radiation_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+   ENDIF
+
+   CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+
+
+END SUBROUTINE module_interface_check_data_output_ts
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
 !> Check module-specific data output of profiles
 !------------------------------------------------------------------------------!
@@ -522,5 +553,5 @@
    IF ( unit == 'illegal' )  THEN
       unit = '' ! ToDo: Seems like a hack. Find a general soultion!
-      CALL user_check_data_output_pr( variable, var_count, unit )
+      CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit )
    ENDIF
 
Index: palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 3699)
+++ palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 3700)
@@ -673,4 +673,7 @@
         ONLY: lsm_define_netcdf_grid, nzb_soil, nzt_soil, nzs, zs
 
+    USE user,                                                                  &
+        ONLY:  user_define_netcdf_grid
+
     USE ocean_mod,                                                             &
         ONLY:  ocean_define_netcdf_grid
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3699)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3700)
@@ -1136,4 +1136,8 @@
     END INTERFACE radiation_check_data_output
 
+    INTERFACE radiation_check_data_output_ts
+       MODULE PROCEDURE radiation_check_data_output_ts
+    END INTERFACE radiation_check_data_output_ts
+
     INTERFACE radiation_check_data_output_pr
        MODULE PROCEDURE radiation_check_data_output_pr
@@ -1241,4 +1245,5 @@
 !-- Public functions / NEEDS SORTING
     PUBLIC radiation_check_data_output, radiation_check_data_output_pr,        &
+           radiation_check_data_output_ts,                                     &
            radiation_check_parameters, radiation_control,                      &
            radiation_header, radiation_init, radiation_parin,                  &
@@ -1448,4 +1453,32 @@
 
     END SUBROUTINE radiation_check_data_output
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Set module-specific timeseries units and labels
+!------------------------------------------------------------------------------!
+ SUBROUTINE radiation_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+
+
+   INTEGER(iwp),      INTENT(IN)     ::  dots_max
+   INTEGER(iwp),      INTENT(INOUT)  ::  dots_num
+   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_label
+   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_unit
+
+!
+!-- Temporary solution to add LSM and radiation time series to the default
+!-- output
+    IF ( land_surface  .OR.  radiation )  THEN
+       IF ( TRIM( radiation_scheme ) == 'rrtmg' )  THEN
+          dots_num = dots_num + 15
+       ELSE
+          dots_num = dots_num + 11
+       ENDIF
+    ENDIF
+
+
+ END SUBROUTINE radiation_check_data_output_ts
 
 !------------------------------------------------------------------------------!
Index: palm/trunk/SOURCE/user_define_netcdf_grid.f90
===================================================================
--- palm/trunk/SOURCE/user_define_netcdf_grid.f90	(revision 3699)
+++ 	(revision )
@@ -1,102 +1,0 @@
-!> @file user_define_netcdf_grid.f90
-!------------------------------------------------------------------------------!
-! This file is part of the PALM model system.
-!
-! PALM is free software: you can redistribute it and/or modify it under the
-! terms of the GNU General Public License as published by the Free Software
-! Foundation, either version 3 of the License, or (at your option) any later
-! version.
-!
-! PALM is distributed in the hope that it will be useful, but WITHOUT ANY
-! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-! A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-!
-! You should have received a copy of the GNU General Public License along with
-! PALM. If not, see <http://www.gnu.org/licenses/>.
-!
-! Copyright 1997-2019 Leibniz Universitaet Hannover
-!------------------------------------------------------------------------------!
-!
-! Current revisions:
-! -----------------
-! 
-! 
-! Former revisions:
-! -----------------
-! $Id$
-! Corrected "Former revisions" section
-! 
-! 2696 2017-12-14 17:12:51Z kanani
-! Change in file header (GPL part)
-!
-! 2271 2017-06-09 12:34:55Z sward
-! found = .TRUE. added to grid definition in examples to avoid warning message
-! 
-! 2101 2017-01-05 16:42:31Z suehring
-!
-! 2000 2016-08-20 18:09:15Z knoop
-! Forced header and separation lines into 80 columns
-! 
-! 1682 2015-10-07 23:56:08Z knoop
-! Code annotations made doxygen readable 
-!
-! 1320 2014-03-20 08:40:49Z raasch
-! comment fields (!:) to be used for variable explanations added to
-! all variable declaration statements 
-!
-! 1036 2012-10-22 13:43:42Z raasch
-! code put under GPL (PALM 3.9)
-!
-! 211 2008-11-11 04:46:24Z raasch
-! Former file user_interface.f90 split into one file per subroutine
-!
-! Description:
-! ------------
-!> Set the grids on which user-defined output quantities are defined.
-!> Allowed values for grid_x are "x" and "xu", for grid_y "y" and "yv", and
-!> for grid_z "zu" and "zw".
-!------------------------------------------------------------------------------!
- SUBROUTINE user_define_netcdf_grid( variable, found, grid_x, grid_y, grid_z )
- 
-
-    USE kinds
-    
-    USE user
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=*) ::  grid_x     !< 
-    CHARACTER (LEN=*) ::  grid_y     !< 
-    CHARACTER (LEN=*) ::  grid_z     !< 
-    CHARACTER (LEN=*) ::  variable   !< 
-
-    LOGICAL ::  found   !< 
-
-
-    SELECT CASE ( TRIM( variable ) )
-
-!
-!--    Uncomment and extend the following lines, if necessary
-!       CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' )
-!          found  = .TRUE.
-!          grid_x = 'xu'
-!          grid_y = 'y'
-!          grid_z = 'zu'
-
-!       CASE ( 'u*v*', 'u*v*_xy', 'u*v*_xz', 'u*v*_yz' )
-!          found  = .TRUE.
-!          grid_x = 'x'
-!          grid_y = 'y'
-!          grid_z = 'zu'
-
-       CASE DEFAULT
-          found  = .FALSE.
-          grid_x = 'none'
-          grid_y = 'none'
-          grid_z = 'none'
-
-    END SELECT
-
-
- END SUBROUTINE user_define_netcdf_grid
-
Index: palm/trunk/SOURCE/user_init_land_surface.f90
===================================================================
--- palm/trunk/SOURCE/user_init_land_surface.f90	(revision 3699)
+++ palm/trunk/SOURCE/user_init_land_surface.f90	(revision 3700)
@@ -58,20 +58,9 @@
  
 
-    USE control_parameters
-    
-    USE indices
-    
     USE kinds
-    
+
     USE land_surface_model_mod
 
-    USE netcdf_interface,                                                      &
-        ONLY: dots_label, dots_unit, dots_num
-    
-    USE pegrid
-
-    USE surface_mod    
-
-    USE user
+    USE surface_mod
 
     IMPLICIT NONE
Index: palm/trunk/SOURCE/user_module.f90
===================================================================
--- palm/trunk/SOURCE/user_module.f90	(revision 3699)
+++ palm/trunk/SOURCE/user_module.f90	(revision 3700)
@@ -86,7 +86,4 @@
     USE statistics
 
-    USE statistics,                                                            &
-        ONLY:  statistic_regions, region
-
     USE surface_mod
 
@@ -94,4 +91,5 @@
 
     INTEGER(iwp) ::  dots_num_palm   !< 
+    INTEGER(iwp) ::  dots_num_user = 0  !< 
     INTEGER(iwp) ::  user_idummy     !< 
     
@@ -117,4 +115,5 @@
        user_parin, &
        user_check_parameters, &
+       user_check_data_output_ts, &
        user_check_data_output_pr, &
        user_check_data_output, &
@@ -143,4 +142,8 @@
        MODULE PROCEDURE user_check_parameters
     END INTERFACE user_check_parameters
+
+    INTERFACE user_check_data_output_ts
+       MODULE PROCEDURE user_check_data_output_ts
+    END INTERFACE user_check_data_output_ts
 
     INTERFACE user_check_data_output_pr
@@ -322,4 +325,42 @@
 ! Description:
 ! ------------
+!> Set module-specific timeseries units and labels
+!------------------------------------------------------------------------------!
+ SUBROUTINE user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+
+
+   INTEGER(iwp),      INTENT(IN)     ::  dots_max
+   INTEGER(iwp),      INTENT(INOUT)  ::  dots_num
+   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_label
+   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_unit
+
+
+!-- Sample for user-defined time series
+!-- For each time series quantity you have to give a label and a unit,
+!-- which will be used for the NetCDF file. They must not contain more than
+!-- seven characters. The value of dots_num has to be increased by the
+!-- number of new time series quantities. Its old value has to be store in
+!-- dots_num_palm. See routine user_statistics on how to output calculate
+!-- and output these quantities.
+
+!    dots_num_palm = dots_num
+
+!    dots_num = dots_num + 1
+!    dots_num_user = dots_num_user + 1
+!    dots_label(dots_num) = 'abs_umx'
+!    dots_unit(dots_num)  = 'm/s'
+
+!    dots_num = dots_num + 1
+!    dots_num_user = dots_num_user + 1
+!    dots_label(dots_num) = 'abs_vmx'
+!    dots_unit(dots_num)  = 'm/s'
+
+
+ END SUBROUTINE user_check_data_output_ts
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
 !> Set the unit of user defined profile output quantities. For those variables
 !> not recognized by the user, the parameter unit is set to "illegal", which
@@ -327,9 +368,6 @@
 !> to a program abort.
 !------------------------------------------------------------------------------!
- SUBROUTINE user_check_data_output_pr( variable, var_count, unit )
-
-
-    USE netcdf_interface,                                                      &
-        ONLY:  dopr_unit
+ SUBROUTINE user_check_data_output_pr( variable, var_count, unit, dopr_unit )
+
 
     USE profil_parameter
@@ -338,4 +376,5 @@
     CHARACTER (LEN=*) ::  unit     !< 
     CHARACTER (LEN=*) ::  variable !< 
+    CHARACTER (LEN=*) ::  dopr_unit !< local value of dopr_unit
 
     INTEGER(iwp) ::  user_pr_index !< 
@@ -357,5 +396,6 @@
 !          user_pr_index = pr_palm + 1
 !          dopr_index(var_count)  = user_pr_index    ! quantities' user-profile-number
-!          dopr_unit(var_count)   = 'm2/s2'  ! quantity unit
+!          dopr_unit = 'm2/s2'  ! quantity unit
+!          unit = dopr_unit
 !          hom(:,2,user_pr_index,:)       = SPREAD( zu, 2, statistic_regions+1 )
 !                                            ! grid on which the quantity is
@@ -413,8 +453,4 @@
 
 
-    USE netcdf_interface,                                                      &
-        ONLY: dots_label, dots_unit, dots_num
-
-
     CHARACTER (LEN=20) :: field_char   !< 
 !
@@ -424,20 +460,54 @@
 !    ALLOCATE( ustvst(nzb:nzt+1,nysg:nyng,nxlg:nxrg) );  ustvst = 0.0_wp
 
-!-- Sample for user-defined time series
-!-- For each time series quantity you have to give a label and a unit,
-!-- which will be used for the NetCDF file. They must not contain more than
-!-- seven characters. The value of dots_num has to be increased by the
-!-- number of new time series quantities. Its old value has to be store in
-!-- dots_num_palm. See routine user_statistics on how to output calculate
-!-- and output these quantities.
-!    dots_label(dots_num+1) = 'abs_umx'
-!    dots_unit(dots_num+1)  = 'm/s'
-!    dots_label(dots_num+2) = 'abs_vmx'
-!    dots_unit(dots_num+2)  = 'm/s'
-!
-!    dots_num_palm = dots_num
-!    dots_num = dots_num + 2
 
  END SUBROUTINE user_init
+
+
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+!> Set the grids on which user-defined output quantities are defined.
+!> Allowed values for grid_x are "x" and "xu", for grid_y "y" and "yv", and
+!> for grid_z "zu" and "zw".
+!------------------------------------------------------------------------------!
+ SUBROUTINE user_define_netcdf_grid( variable, found, grid_x, grid_y, grid_z )
+
+
+    CHARACTER (LEN=*) ::  grid_x     !<
+    CHARACTER (LEN=*) ::  grid_y     !<
+    CHARACTER (LEN=*) ::  grid_z     !<
+    CHARACTER (LEN=*) ::  variable   !<
+
+    LOGICAL ::  found   !<
+
+
+    SELECT CASE ( TRIM( variable ) )
+
+!
+!--    Uncomment and extend the following lines, if necessary
+!       CASE ( 'u2', 'u2_xy', 'u2_xz', 'u2_yz' )
+!          found  = .TRUE.
+!          grid_x = 'xu'
+!          grid_y = 'y'
+!          grid_z = 'zu'
+
+!       CASE ( 'u*v*', 'u*v*_xy', 'u*v*_xz', 'u*v*_yz' )
+!          found  = .TRUE.
+!          grid_x = 'x'
+!          grid_y = 'y'
+!          grid_z = 'zu'
+
+       CASE DEFAULT
+          found  = .FALSE.
+          grid_x = 'none'
+          grid_y = 'none'
+          grid_z = 'none'
+
+    END SELECT
+
+
+ END SUBROUTINE user_define_netcdf_grid
+
+
 
 
@@ -913,10 +983,5 @@
 
 
-    USE netcdf_interface,                                                      &
-        ONLY:  dots_max
-
-
     CHARACTER (LEN=*) ::  mode   !< 
-
     INTEGER(iwp) ::  i    !< 
     INTEGER(iwp) ::  j    !< 
@@ -925,8 +990,5 @@
     INTEGER(iwp) ::  tn   !< 
 
-    REAL(wp),                                                                  &
-       DIMENSION(dots_num_palm+1:dots_max) ::                                  &
-          ts_value_l   !< 
-
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  ts_value_l   !<
 
     IF ( mode == 'profiles' )  THEN
@@ -962,4 +1024,6 @@
     ELSEIF ( mode == 'time_series' )  THEN
 
+
+!       ALLOCATE ( ts_value_l(dots_num_user) )
 !
 !--    Sample on how to add values for the user-defined time series quantities.
@@ -968,6 +1032,6 @@
 !--    velocities u and v.
 !       ts_value_l = 0.0_wp
-!       ts_value_l(dots_num_palm+1) = ABS( u_max )
-!       ts_value_l(dots_num_palm+2) = ABS( v_max )
+!       ts_value_l(1) = ABS( u_max )
+!       ts_value_l(2) = ABS( v_max )
 !
 !--     Collect / send values to PE0, because only PE0 outputs the time series.
@@ -981,10 +1045,10 @@
 !#if defined( __parallel )
 !       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
-!       CALL MPI_ALLREDUCE( ts_value_l(dots_num_palm+1),                         &
+!       CALL MPI_ALLREDUCE( ts_value_l(1),                         &
 !                           ts_value(dots_num_palm+1,sr),                        &
-!                           dots_max-dots_num_palm, MPI_REAL, MPI_SUM, comm2d,   &
+!                           dots_num_user, MPI_REAL, MPI_MAX, comm2d,   &
 !                           ierr )
 !#else
-!       ts_value(dots_num_palm+1:,sr) = ts_value_l
+!       ts_value(dots_num_palm+1:dots_num_palm+dots_num_user,sr) = ts_value_l
 !#endif
 
