Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 1317)
+++ palm/trunk/SOURCE/Makefile	(revision 1318)
@@ -20,5 +20,6 @@
 # Current revisions:
 # ------------------
-# 
+# +cpulog, dependencies for cpulog added
+# -cpu_log, cpu_statistics
 #
 # Former revisions:
@@ -142,6 +143,5 @@
 	calc_radiation.f90 calc_spectra.f90 check_for_restart.f90 \
 	check_open.f90 check_parameters.f90 close_file.f90 compute_vpt.f90 \
-	coriolis.f90 cpu_log.f90 cpu_statistics.f90 cuda_fft_interfaces.f90 \
-	data_log.f90 \
+	coriolis.f90 cpulog.f90 cuda_fft_interfaces.f90 data_log.f90 \
 	data_output_dvrp.f90 data_output_mask.f90 data_output_profiles.f90 \
 	data_output_ptseries.f90 data_output_spectra.f90 \
@@ -221,6 +221,5 @@
 
 
-advec_particles.o: modules.o
-advec_s_bc.o: modules.o
+advec_s_bc.o: modules.o cpulog.o
 advec_s_pw.o: modules.o
 advec_s_up.o: modules.o
@@ -232,5 +231,5 @@
 advec_w_pw.o: modules.o
 advec_w_up.o: modules.o
-average_3d_data.o: modules.o
+average_3d_data.o: modules.o cpulog.o
 boundary_conds.o: modules.o
 buoyancy.o: modules.o
@@ -238,5 +237,5 @@
 calc_precipitation.o: modules.o
 calc_radiation.o: modules.o
-calc_spectra.o: modules.o fft_xy.o
+calc_spectra.o: modules.o cpulog.o fft_xy.o
 check_for_restart.o: modules.o
 check_open.o: modules.o
@@ -245,16 +244,16 @@
 compute_vpt.o: modules.o
 coriolis.o: modules.o
-cpu_log.o: modules.o
+cpulog.o: modules.o
 cpu_statistics.o: modules.o
 cuda_fft_interfaces.o: cuda_fft_interfaces.f90 modules.o
 data_log.o: modules.o
-data_output_dvrp.o: modules.o
-data_output_mask.o: modules.o
-data_output_profiles.o: modules.o
-data_output_ptseries.o: modules.o
-data_output_spectra.o: modules.o
-data_output_tseries.o: modules.o
-data_output_2d.o: modules.o
-data_output_3d.o: modules.o
+data_output_dvrp.o: modules.o cpulog.o
+data_output_mask.o: modules.o cpulog.o
+data_output_profiles.o: modules.o cpulog.o
+data_output_ptseries.o: modules.o cpulog.o
+data_output_spectra.o: modules.o cpulog.o
+data_output_tseries.o: modules.o cpulog.o
+data_output_2d.o: modules.o cpulog.o
+data_output_3d.o: modules.o cpulog.o
 diffusion_e.o: modules.o
 diffusion_s.o: modules.o
@@ -263,17 +262,17 @@
 diffusion_w.o: modules.o wall_fluxes.o
 diffusivities.o: modules.o
-disturb_field.o: modules.o random_function.o
+disturb_field.o: modules.o cpulog.o random_function.o
 disturb_heatflux.o: modules.o
 eqn_state_seawater.o: modules.o
-exchange_horiz.o: modules.o
-exchange_horiz_2d.o: modules.o
+exchange_horiz.o: modules.o cpulog.o
+exchange_horiz_2d.o: modules.o cpulog.o
 fft_xy.o: cuda_fft_interfaces.o modules.o singleton.o temperton_fft.o
-flow_statistics.o: modules.o
+flow_statistics.o: modules.o cpulog.o
 global_min_max.o: modules.o
-header.o: modules.o subsidence.o
+header.o: modules.o cpulog.o subsidence.o
 impact_of_latent_heat.o: modules.o
-inflow_turbulence.o: modules.o
+inflow_turbulence.o: modules.o cpulog.o
 init_1d_model.o: modules.o
-init_3d_model.o: modules.o random_function.o advec_ws.o ls_forcing.o
+init_3d_model.o: modules.o cpulog.o random_function.o advec_ws.o ls_forcing.o
 init_advec.o: modules.o
 init_cloud_physics.o: modules.o
@@ -290,15 +289,15 @@
 local_getenv.o: modules.o
 local_stop.o: modules.o
-local_tremain.o: modules.o
-local_tremain_ini.o: modules.o
-lpm.o: modules.o
+local_tremain.o: modules.o cpulog.o
+local_tremain_ini.o: modules.o cpulog.o
+lpm.o: modules.o cpulog.o
 lpm_advec.o: modules.o
-lpm_boundary_conds.o: modules.o
-lpm_calc_liquid_water_content.o: modules.o
-lpm_collision_kernels.o: modules.o user_module.o
-lpm_data_output_particles.o: modules.o
-lpm_droplet_collision.o: modules.o lpm_collision_kernels.o
-lpm_droplet_condensation.o: modules.o lpm_collision_kernels.o
-lpm_exchange_horiz.o: modules.o
+lpm_boundary_conds.o: modules.o cpulog.o
+lpm_calc_liquid_water_content.o: modules.o cpulog.o
+lpm_collision_kernels.o: modules.o cpulog.o user_module.o
+lpm_data_output_particles.o: modules.o cpulog.o
+lpm_droplet_collision.o: modules.o cpulog.o lpm_collision_kernels.o
+lpm_droplet_condensation.o: modules.o cpulog.o lpm_collision_kernels.o
+lpm_exchange_horiz.o: modules.o cpulog.o
 lpm_extend_particle_array.o: modules.o
 lpm_extend_tails.o: modules.o
@@ -309,50 +308,50 @@
 lpm_read_restart_file.o: modules.o
 lpm_release_set.o: modules.o random_function.o
-lpm_set_attributes.o: modules.o
-lpm_sort_arrays.o: modules.o
+lpm_set_attributes.o: modules.o cpulog.o
+lpm_sort_arrays.o: modules.o cpulog.o
 lpm_write_exchange_statistics.o: modules.o
 lpm_write_restart_file.o: modules.o
-ls_forcing.o: modules.o
+ls_forcing.o: modules.o cpulog.o
 message.o: modules.o
 microphysics.o: modules.o
 modules.o: modules.f90
 netcdf.o: modules.o
-nudging.o: modules.o buoyancy.o
+nudging.o: modules.o buoyancy.o cpulog.o
 package_parin.o: modules.o
-palm.o: modules.o ls_forcing.o nudging.o
-parin.o: modules.o
+palm.o: modules.o cpulog.o ls_forcing.o nudging.o
+parin.o: modules.o cpulog.o
 plant_canopy_model.o: modules.o
-poisfft.o: modules.o fft_xy.o tridia_solver.o
-poismg.o: modules.o
+poisfft.o: modules.o cpulog.o fft_xy.o tridia_solver.o
+poismg.o: modules.o cpulog.o
 prandtl_fluxes.o: modules.o
-pres.o: modules.o poisfft.o
-print_1d.o: modules.o
+pres.o: modules.o cpulog.o poisfft.o
+print_1d.o: modules.o cpulog.o
 production_e.o: modules.o wall_fluxes.o
 prognostic_equations.o: modules.o advec_s_pw.o advec_s_up.o advec_u_pw.o \
 	advec_u_up.o advec_v_pw.o advec_v_up.o advec_w_pw.o advec_w_up.o  \
-        advec_ws.o buoyancy.o calc_precipitation.o calc_radiation.o coriolis.o \
-	diffusion_e.o diffusion_s.o diffusion_u.o diffusion_v.o diffusion_w.o \
+   advec_ws.o buoyancy.o calc_precipitation.o calc_radiation.o coriolis.o \
+	cpulog.o diffusion_e.o diffusion_s.o diffusion_u.o diffusion_v.o diffusion_w.o \
 	eqn_state_seawater.o impact_of_latent_heat.o microphysics.o \
         nudging.o plant_canopy_model.o production_e.o subsidence.o user_actions.o
 random_gauss.o: random_function.o
-read_3d_binary.o: modules.o random_function.o
+read_3d_binary.o: modules.o cpulog.o random_function.o
 read_var_list.o: modules.o
-run_control.o: modules.o
+run_control.o: modules.o cpulog.o
 set_slicer_attributes_dvrp.o: modules.o
 singleton.o: singleton.f90
 sor.o: modules.o
 subsidence.o: modules.o
-sum_up_3d_data.o: modules.o
-surface_coupler.o: modules.o
-swap_timelevel.o: modules.o
+sum_up_3d_data.o: modules.o cpulog.o
+surface_coupler.o: modules.o cpulog.o
+swap_timelevel.o: modules.o cpulog.o
 temperton_fft.o: modules.o
-time_integration.o: modules.o advec_ws.o buoyancy.o interaction_droplets_ptq.o \
+time_integration.o: modules.o advec_ws.o buoyancy.o cpulog.o interaction_droplets_ptq.o \
 	ls_forcing.o production_e.o prognostic_equations.o user_actions.o
-timestep.o: modules.o
+timestep.o: modules.o cpulog.o
 timestep_scheme_steering.o: modules.o
-transpose.o: modules.o
+transpose.o: modules.o cpulog.o
 tridia_solver.o: modules.o
 user_3d_data_averaging.o: modules.o user_module.o
-user_actions.o: modules.o user_module.o
+user_actions.o: modules.o cpulog.o user_module.o
 user_additional_routines.o: modules.o user_module.o
 user_check_data_output.o: modules.o user_module.o
@@ -380,5 +379,5 @@
 user_statistics.o: modules.o user_module.o
 wall_fluxes.o: modules.o
-write_3d_binary.o: modules.o random_function.o
+write_3d_binary.o: modules.o cpulog.o random_function.o
 write_compressed.o: modules.o
 write_var_list.o: modules.o
Index: palm/trunk/SOURCE/advec_s_bc.f90
===================================================================
--- palm/trunk/SOURCE/advec_s_bc.f90	(revision 1317)
+++ palm/trunk/SOURCE/advec_s_bc.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -80,5 +80,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
     USE statistics
Index: palm/trunk/SOURCE/average_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/average_3d_data.f90	(revision 1317)
+++ palm/trunk/SOURCE/average_3d_data.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -70,5 +71,4 @@
     USE cpulog
     USE indices
-    USE interfaces
 
     IMPLICIT NONE
@@ -360,5 +360,5 @@
     average_count_3d = 0.0
 
-    CALL cpu_log (log_point(35),'average_3d_data','stop','nobarrier')
+    CALL cpu_log( log_point(35), 'average_3d_data', 'stop' )
 
 
Index: palm/trunk/SOURCE/calc_spectra.f90
===================================================================
--- palm/trunk/SOURCE/calc_spectra.f90	(revision 1317)
+++ palm/trunk/SOURCE/calc_spectra.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -83,5 +83,4 @@
     USE fft_xy
     USE indices
-    USE interfaces
     USE pegrid
     USE spectrum
Index: palm/trunk/SOURCE/cpu_log.f90
===================================================================
--- palm/trunk/SOURCE/cpu_log.f90	(revision 1317)
+++ 	(revision )
@@ -1,143 +1,0 @@
- SUBROUTINE cpu_log( log_event, place, modus, barrierwait )
-
-!--------------------------------------------------------------------------------!
-! This file is part of PALM.
-!
-! 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-2014 Leibniz Universitaet Hannover
-!--------------------------------------------------------------------------------!
-!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 1036 2012-10-22 13:43:42Z raasch
-! code put under GPL (PALM 3.9)
-!
-! 274 2009-03-26 15:11:21Z heinze
-! Output of messages replaced by message handling routine.
-! Type of count and count_rate changed to default INTEGER on NEC machines
-!
-! 225 2009-01-26 14:44:20Z raasch
-! Type of count and count_rate changed to INTEGER(8)
-!
-! 82 2007-04-16 15:40:52Z raasch
-! Preprocessor strings for different linux clusters changed to "lc",
-! preprocessor directives for old systems removed
-!
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.24  2006/06/02 15:12:17  raasch
-! cpp-directives extended for lctit
-!
-! Revision 1.1  1997/07/24 11:12:29  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Cpu-time measurements for any program part whatever.
-!------------------------------------------------------------------------------!
-
-    USE control_parameters
-    USE cpulog
-    USE pegrid
-
-    IMPLICIT NONE
-
-    CHARACTER (LEN=*)           ::  modus, place
-    CHARACTER (LEN=*), OPTIONAL ::  barrierwait
-    LOGICAL, SAVE               ::  first = .TRUE.
-    REAL                        ::  mtime = 0.0, mtimevec = 0.0
-    TYPE(logpoint)              ::  log_event
-
-#if defined( __lc ) || defined( __decalpha )
-    INTEGER(8)                  ::  count, count_rate
-#elif defined( __nec )
-    INTEGER                     ::  count, count_rate
-#elif defined( __ibm )
-    INTEGER(8)                  ::  IRTC
-#endif
-
-
-!
-!-- Initialize and check, respectively, point of measurement
-    IF ( log_event%place == ' ' )  THEN
-       log_event%place = place
-    ELSEIF ( log_event%place /= place )  THEN
-       WRITE( message_string, * ) 'wrong argument & expected: ', &
-                         TRIM(log_event%place), '  given: ',  TRIM( place )
-       CALL message( 'cpu_log', 'PA0174', 1, 2, 0, 6, 0 )
-    ENDIF
-
-!
-!-- Take current time
-#if defined( __lc ) || defined( __decalpha ) || defined( __nec )
-    CALL SYSTEM_CLOCK( count, count_rate )
-    mtime = REAL( count ) / REAL( count_rate )
-#elif defined( __ibm )
-    mtime = IRTC( ) * 1E-9
-#else
-    message_string = 'no time measurement defined on this host'
-    CALL message( 'cpu_log', 'PA0175', 1, 2, 0, 6, 0 )
-#endif
-
-!
-!-- Start, stop or pause measurement
-    IF ( modus == 'start'  .OR.  modus == 'continue' )  THEN
-       log_event%mtime    = mtime
-       log_event%mtimevec = mtimevec
-    ELSEIF ( modus == 'pause' )  THEN
-       IF ( ( mtime - log_event%mtime ) < 0.0  .AND.  first )  THEN
-          WRITE( message_string, * ) 'negative time interval occured',         &
-                      ' &PE',myid,' L=PAUSE "',TRIM(log_event%place),'" new=', &
-                      mtime,' last=',log_event%mtime
-          CALL message( 'cpu_log', 'PA0176', 0, 1, -1, 6, 0 )
-          first = .FALSE.
-       ENDIF
-       log_event%isum     = log_event%isum + mtime - log_event%mtime
-       log_event%ivect    = log_event%ivect  + mtimevec - log_event%mtimevec
-    ELSEIF ( modus == 'stop' )  THEN
-       IF ( ( mtime - log_event%mtime + log_event%isum ) < 0.0  .AND. &
-            first )  THEN
-          WRITE( message_string, * ) 'negative time interval occured',        &
-                      ' &PE',myid,' L=STOP "',TRIM(log_event%place),'" new=', &
-                      mtime,' last=',log_event%mtime,' isum=',log_event%isum
-          CALL message( 'cpu_log', 'PA0177', 0, 1, -1, 6, 0 )
-          first = .FALSE.
-       ENDIF
-       log_event%mtime    = mtime    - log_event%mtime    + log_event%isum
-       log_event%mtimevec = mtimevec - log_event%mtimevec + log_event%ivect
-       log_event%sum      = log_event%sum  + log_event%mtime
-       IF ( log_event%sum < 0.0  .AND.  first )  THEN
-          WRITE( message_string, * ) 'negative time interval occured',        &
-                      ' &PE',myid,' L=STOP "',TRIM(log_event%place),'" sum=', &
-                                      log_event%sum,' mtime=',log_event%mtime
-          CALL message( 'cpu_log', 'PA0178', 0, 1, -1, 6, 0 )
-          first = .FALSE.
-       ENDIF
-       log_event%vector   = log_event%vector + log_event%mtimevec
-       log_event%counts   = log_event%counts + 1
-       log_event%isum     = 0.0
-       log_event%ivect    = 0.0
-    ELSE
-       message_string = 'unknown modus of time measurement: ' // TRIM( modus )
-       CALL message( 'cpu_log', 'PA0179', 0, 1, -1, 6, 0 )
-    ENDIF
-
-
- END SUBROUTINE cpu_log
Index: palm/trunk/SOURCE/cpu_statistics.f90
===================================================================
--- palm/trunk/SOURCE/cpu_statistics.f90	(revision 1317)
+++ 	(revision )
@@ -1,355 +1,0 @@
- SUBROUTINE cpu_statistics
-
-!--------------------------------------------------------------------------------!
-! This file is part of PALM.
-!
-! 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-2014 Leibniz Universitaet Hannover
-!--------------------------------------------------------------------------------!
-!
-! Current revisions:
-! -----------------
-! 
-!
-! Former revisions:
-! -----------------
-! $Id$
-!
-! 1111 2013-03-08 23:54:10Z raasch
-! output of grid point numbers and average CPU time per grid point and timestep
-!
-! 1092 2013-02-02 11:24:22Z raasch
-! unused variables removed
-!
-! 1036 2012-10-22 13:43:42Z raasch
-! code put under GPL (PALM 3.9)
-!
-! 1015 2012-09-27 09:23:24Z raasch
-! output of accelerator board information
-!
-! 683 2011-02-09 14:25:15Z raasch
-! output of handling of ghostpoint exchange
-!
-! 622 2010-12-10 08:08:13Z raasch
-! output of handling of collective operations
-!
-! 222 2009-01-12 16:04:16Z letzel
-! Bugfix for nonparallel execution
-!
-! 197 2008-09-16 15:29:03Z raasch
-! Format adjustments in order to allow CPU# > 999,
-! data are collected from PE0 in an ordered sequence which seems to avoid
-! hanging of processes on SGI-ICE
-!
-! 82 2007-04-16 15:40:52Z raasch
-! Preprocessor directives for old systems removed
-!
-! RCS Log replace by Id keyword, revision history cleaned up
-!
-! Revision 1.13  2006/04/26 12:10:51  raasch
-! Output of number of threads per task, max = min in case of 1 PE
-!
-! Revision 1.1  1997/07/24 11:11:11  raasch
-! Initial revision
-!
-!
-! Description:
-! ------------
-! Analysis and output of the cpu-times measured. All PE results are collected
-! on PE0 in order to calculate the mean cpu-time over all PEs and other
-! statistics. The output is sorted according to the amount of cpu-time consumed
-! and output on PE0.
-!------------------------------------------------------------------------------!
-
-    USE control_parameters
-    USE cpulog
-    USE indices,  ONLY: nx, ny, nz
-    USE pegrid
-
-    IMPLICIT NONE
-
-    INTEGER    ::  i, ii(1), iii, sender
-    REAL       ::  average_cputime
-    REAL, SAVE ::  norm = 1.0
-    REAL, DIMENSION(:),   ALLOCATABLE ::  pe_max, pe_min, pe_rms, sum
-    REAL, DIMENSION(:,:), ALLOCATABLE ::  pe_log_points
-
-
-!
-!-- Compute cpu-times in seconds
-    log_point%mtime  = log_point%mtime  / norm
-    log_point%sum    = log_point%sum    / norm
-    log_point%vector = log_point%vector / norm
-    WHERE ( log_point%counts /= 0 )
-       log_point%mean = log_point%sum / log_point%counts
-    END WHERE
-
-
-!
-!-- Collect cpu-times from all PEs and calculate statistics
-    IF ( myid == 0 )  THEN
-!
-!--    Allocate and initialize temporary arrays needed for statistics
-       ALLOCATE( pe_max( SIZE( log_point ) ), pe_min( SIZE( log_point ) ), &
-                 pe_rms( SIZE( log_point ) ),                              &
-                 pe_log_points( SIZE( log_point ), 0:numprocs-1 ) )
-       pe_min = log_point%sum
-       pe_max = log_point%sum    ! need to be set in case of 1 PE
-       pe_rms = 0.0
-
-#if defined( __parallel )
-!
-!--    Receive data from all PEs
-       DO  i = 1, numprocs-1
-          CALL MPI_RECV( pe_max(1), SIZE( log_point ), MPI_REAL, &
-                         i, i, comm2d, status, ierr )
-          sender = status(MPI_SOURCE)
-          pe_log_points(:,sender) = pe_max
-       ENDDO
-       pe_log_points(:,0) = log_point%sum   ! Results from PE0
-!
-!--    Calculate mean of all PEs, store it on log_point%sum
-!--    and find minimum and maximum
-       DO  iii = 1, SIZE( log_point )
-          DO  i = 1, numprocs-1
-             log_point(iii)%sum = log_point(iii)%sum + pe_log_points(iii,i)
-             pe_min(iii) = MIN( pe_min(iii), pe_log_points(iii,i) )
-             pe_max(iii) = MAX( pe_max(iii), pe_log_points(iii,i) )
-          ENDDO
-          log_point(iii)%sum = log_point(iii)%sum / numprocs
-!
-!--       Calculate rms
-          DO  i = 0, numprocs-1
-             pe_rms(iii) = pe_rms(iii) + ( &
-                                 pe_log_points(iii,i) - log_point(iii)%sum &
-                                         )**2
-          ENDDO
-          pe_rms(iii) = SQRT( pe_rms(iii) / numprocs )
-       ENDDO
-    ELSE
-!
-!--    Send data to PE0 (pe_max is used as temporary storage to send
-!--    the data in order to avoid sending the data type log)
-       ALLOCATE( pe_max( SIZE( log_point ) ) )
-       pe_max = log_point%sum
-       CALL MPI_SEND( pe_max(1), SIZE( log_point ), MPI_REAL, 0, myid, comm2d, &
-                      ierr )
-#endif
-
-    ENDIF
-
-!
-!-- Write cpu-times
-    IF ( myid == 0 )  THEN
-!
-!--    Re-store sums
-       ALLOCATE( sum( SIZE( log_point ) ) )
-       WHERE ( log_point%counts /= 0 )
-          sum = log_point%sum
-       ELSEWHERE
-          sum = -1.0
-       ENDWHERE
-
-!
-!--    Get total time in order to calculate CPU-time per gridpoint and timestep
-       IF ( nr_timesteps_this_run /= 0 )  THEN
-          average_cputime = log_point(1)%sum / REAL( (nx+1) * (ny+1) * nz ) / &
-                            REAL( nr_timesteps_this_run ) * 1E6  ! in micro-sec
-       ELSE
-          average_cputime = -1.0
-       ENDIF
-
-!
-!--    Write cpu-times sorted by size
-       CALL check_open( 18 )
-#if defined( __parallel )
-       WRITE ( 18, 100 )  TRIM( run_description_header ),                          &
-                          numprocs * threads_per_task, pdims(1), pdims(2),         &
-                          threads_per_task, nx+1, ny+1, nz, nr_timesteps_this_run, &
-                          average_cputime
-                          
-       IF ( num_acc_per_node /= 0 )  WRITE ( 18, 108 )  num_acc_per_node
-       WRITE ( 18, 110 )
-#else
-       WRITE ( 18, 100 )  TRIM( run_description_header ),                          &
-                          numprocs * threads_per_task, 1, 1,                       &
-                          threads_per_task, nx+1, ny+1, nz, nr_timesteps_this_run, &
-                          average_cputime
-
-       IF ( num_acc_per_node /= 0 )  WRITE ( 18, 109 )  num_acc_per_node
-       WRITE ( 18, 110 )
-#endif
-       DO
-          ii = MAXLOC( sum )
-          i = ii(1)
-          IF ( sum(i) /= -1.0 )  THEN
-             WRITE ( 18, 102 ) &
-	        log_point(i)%place, log_point(i)%sum,                &
-                log_point(i)%sum / log_point(1)%sum * 100.0,         &
-                log_point(i)%counts, pe_min(i), pe_max(i), pe_rms(i)
-             sum(i) = -1.0
-          ELSE
-             EXIT 
-          ENDIF
-       ENDDO
-    ENDIF
-
-
-!
-!-- The same procedure again for the individual measurements.
-!
-!-- Compute cpu-times in seconds
-    log_point_s%mtime  = log_point_s%mtime  / norm
-    log_point_s%sum    = log_point_s%sum    / norm
-    log_point_s%vector = log_point_s%vector / norm
-    WHERE ( log_point_s%counts /= 0 )
-       log_point_s%mean = log_point_s%sum / log_point_s%counts
-    END WHERE
-
-!
-!-- Collect cpu-times from all PEs and calculate statistics
-#if defined( __parallel )
-!
-!-- Set barrier in order to avoid that PE0 receives log_point_s-data
-!-- while still busy with receiving log_point-data (see above)
-    CALL MPI_BARRIER( comm2d, ierr )    
-#endif
-    IF ( myid == 0 )  THEN
-!
-!--    Initialize temporary arrays needed for statistics
-       pe_min = log_point_s%sum
-       pe_max = log_point_s%sum    ! need to be set in case of 1 PE
-       pe_rms = 0.0
-
-#if defined( __parallel )
-!
-!--    Receive data from all PEs
-       DO  i = 1, numprocs-1
-          CALL MPI_RECV( pe_max(1), SIZE( log_point ), MPI_REAL, &
-                         MPI_ANY_SOURCE, MPI_ANY_TAG, comm2d, status, ierr )
-          sender = status(MPI_SOURCE)
-          pe_log_points(:,sender) = pe_max
-       ENDDO
-       pe_log_points(:,0) = log_point_s%sum   ! Results from PE0
-!
-!--    Calculate mean of all PEs, store it on log_point_s%sum
-!--    and find minimum and maximum
-       DO  iii = 1, SIZE( log_point )
-          DO  i = 1, numprocs-1
-             log_point_s(iii)%sum = log_point_s(iii)%sum + pe_log_points(iii,i)
-             pe_min(iii) = MIN( pe_min(iii), pe_log_points(iii,i) )
-             pe_max(iii) = MAX( pe_max(iii), pe_log_points(iii,i) )
-          ENDDO
-          log_point_s(iii)%sum = log_point_s(iii)%sum / numprocs
-!
-!--       Calculate rms
-          DO  i = 0, numprocs-1
-             pe_rms(iii) = pe_rms(iii) + ( &
-                                 pe_log_points(iii,i) - log_point_s(iii)%sum &
-                                         )**2
-          ENDDO
-          pe_rms(iii) = SQRT( pe_rms(iii) / numprocs )
-       ENDDO
-    ELSE
-!
-!--    Send data to PE0 (pe_max is used as temporary storage to send
-!--    the data in order to avoid sending the data type log)
-       pe_max = log_point_s%sum
-       CALL MPI_SEND( pe_max(1), SIZE( log_point ), MPI_REAL, 0, 0, comm2d, &
-                      ierr )
-#endif
-
-    ENDIF
-
-!
-!-- Write cpu-times
-    IF ( myid == 0 )  THEN
-!
-!--    Re-store sums
-       WHERE ( log_point_s%counts /= 0 )
-          sum = log_point_s%sum
-       ELSEWHERE
-          sum = -1.0
-       ENDWHERE
-
-!
-!--    Write cpu-times sorted by size
-       WRITE ( 18, 101 )
-       DO
-          ii = MAXLOC( sum )
-          i = ii(1)
-          IF ( sum(i) /= -1.0 )  THEN
-             WRITE ( 18, 102 ) &
-                log_point_s(i)%place, log_point_s(i)%sum, &
-                log_point_s(i)%sum / log_point(1)%sum * 100.0, &
-                log_point_s(i)%counts, pe_min(i), pe_max(i), pe_rms(i)
-             sum(i) = -1.0
-          ELSE
-             EXIT 
-          ENDIF
-       ENDDO
-
-!
-!--    Output of handling of MPI operations
-       IF ( collective_wait )  THEN
-          WRITE ( 18, 103 )
-       ELSE
-          WRITE ( 18, 104 )
-       ENDIF
-       IF ( synchronous_exchange )  THEN
-          WRITE ( 18, 105 )
-       ELSE
-          WRITE ( 18, 106 )
-       ENDIF
-
-!
-!--    Empty lines in order to create a gap to the results of the model 
-!--    continuation runs
-       WRITE ( 18, 107 )
-
-!
-!--    Unit 18 is not needed anymore
-       CALL close_file( 18 )
-
-    ENDIF
-
-
-100 FORMAT (A/11('-')//'CPU measures for ',I5,' PEs (',I5,'(x) * ',I5,'(y', &
-            &') tasks *',I5,' threads):'//                                  &
-            'gridpoints (x/y/z): ',20X,I5,' * ',I5,' * ',I5/                &
-            'nr of timesteps: ',22X,I6/                                     &
-            'cpu time per grid point and timestep: ',5X,F8.5,' * 10**-6 s')
-
-101 FORMAT (/'special measures:'/ &
-            &'-----------------------------------------------------------', &
-            &'--------------------')
-
-102 FORMAT (A20,2X,F9.3,2X,F7.2,1X,I7,3(1X,F9.3))
-103 FORMAT (/'Barriers are set in front of collective operations')
-104 FORMAT (/'No barriers are set in front of collective operations')
-105 FORMAT (/'Exchange of ghostpoints via MPI_SENDRCV')
-106 FORMAT (/'Exchange of ghostpoints via MPI_ISEND/MPI_IRECV')
-107 FORMAT (//)
-108 FORMAT ('Accelerator boards per node: ',14X,I2)
-109 FORMAT ('Accelerator boards: ',23X,I2)
-110 FORMAT ('----------------------------------------------------------',   &
-            &'------------'//&
-            &'place:                        mean        counts      min  ', &
-            &'     max       rms'/ &
-            &'                           sec.      %                sec. ', &
-            &'     sec.      sec.'/  &
-            &'-----------------------------------------------------------', &
-            &'-------------------')
-
- END SUBROUTINE cpu_statistics
-
Index: palm/trunk/SOURCE/cpulog.f90
===================================================================
--- palm/trunk/SOURCE/cpulog.f90	(revision 1318)
+++ palm/trunk/SOURCE/cpulog.f90	(revision 1318)
@@ -0,0 +1,494 @@
+ MODULE cpulog
+
+!--------------------------------------------------------------------------------!
+! This file is part of PALM.
+!
+! 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-2014 Leibniz Universitaet Hannover
+!--------------------------------------------------------------------------------!
+!
+! Current revisions:
+! -----------------
+! former files/routines cpu_log and cpu_statistics combined to one module,
+! which also includes the former data module cpulog from the modules-file
+!
+! Former revisions:
+! -----------------
+! $Id$
+!
+! 1036 2012-10-22 13:43:42Z raasch
+! code put under GPL (PALM 3.9)
+!
+! 274 2009-03-26 15:11:21Z heinze
+! Output of messages replaced by message handling routine.
+! Type of count and count_rate changed to default INTEGER on NEC machines
+!
+! 225 2009-01-26 14:44:20Z raasch
+! Type of count and count_rate changed to INTEGER(8)
+!
+! 82 2007-04-16 15:40:52Z raasch
+! Preprocessor strings for different linux clusters changed to "lc",
+! preprocessor directives for old systems removed
+!
+! RCS Log replace by Id keyword, revision history cleaned up
+!
+! Revision 1.24  2006/06/02 15:12:17  raasch
+! cpp-directives extended for lctit
+!
+! Revision 1.1  1997/07/24 11:12:29  raasch
+! Initial revision
+!
+!
+! Description:
+! ------------
+! Cpu-time measurements for any program part whatever.
+!------------------------------------------------------------------------------!
+
+    USE control_parameters
+    USE indices,  ONLY: nx, ny, nz
+    USE pegrid
+
+    IMPLICIT NONE
+
+    PRIVATE
+    PUBLIC   cpu_log, cpu_log_barrierwait, cpu_log_nowait, cpu_statistics, &
+             initial_wallclock_time, log_point, log_point_s
+
+    INTERFACE cpu_log
+       MODULE PROCEDURE cpu_log
+    END INTERFACE cpu_log
+
+    INTERFACE cpu_statistics
+       MODULE PROCEDURE cpu_statistics
+    END INTERFACE cpu_statistics
+
+    INTEGER, PARAMETER ::  cpu_log_continue = 0, cpu_log_pause = 1, &
+                           cpu_log_start = 2, cpu_log_stop = 3
+
+    LOGICAL            ::  cpu_log_barrierwait = .FALSE.
+    LOGICAL, PARAMETER ::  cpu_log_nowait = .FALSE.
+
+    REAL ::  initial_wallclock_time
+
+    TYPE logpoint
+       REAL               ::  isum, ivect, mean, mtime, mtimevec, sum, vector
+       INTEGER            ::  counts
+       CHARACTER (LEN=20) ::  place
+    END TYPE logpoint
+
+    TYPE(logpoint), DIMENSION(100) ::  log_point = logpoint( 0.0, 0.0, 0.0,   &
+                                       0.0, 0.0, 0.0, 0.0, 0, ' ' ),          &
+                                       log_point_s = logpoint( 0.0, 0.0, 0.0, &
+                                       0.0, 0.0, 0.0, 0.0, 0, ' ' )
+
+    SAVE
+
+ CONTAINS
+
+    SUBROUTINE cpu_log( log_event, place, modus, barrierwait )
+
+       IMPLICIT NONE
+
+       CHARACTER (LEN=*)           ::  modus, place
+       LOGICAL                     ::  wait_allowed
+       LOGICAL, OPTIONAL           ::  barrierwait
+       LOGICAL, SAVE               ::  first = .TRUE.
+       REAL                        ::  mtime = 0.0, mtimevec = 0.0
+       TYPE(logpoint)              ::  log_event
+
+#if defined( __lc ) || defined( __decalpha )
+       INTEGER(8)                  ::  count, count_rate
+#elif defined( __nec )
+       INTEGER                     ::  count, count_rate
+#elif defined( __ibm )
+       INTEGER(8)                  ::  IRTC
+#endif
+
+
+!
+!--    Initialize and check, respectively, point of measurement
+       IF ( log_event%place == ' ' )  THEN
+          log_event%place = place
+       ELSEIF ( log_event%place /= place )  THEN
+          WRITE( message_string, * ) 'wrong argument & expected: ', &
+                            TRIM(log_event%place), '  given: ',  TRIM( place )
+          CALL message( 'cpu_log', 'PA0174', 1, 2, 0, 6, 0 )
+       ENDIF
+
+!
+!--    Determine, if barriers are allowed to set
+       IF ( PRESENT( barrierwait ) )  THEN
+          wait_allowed = barrierwait
+       ELSE
+          wait_allowed = .TRUE.
+       ENDIF
+
+!
+!--    MPI barrier, if requested, in order to avoid measuring wait times
+!--    caused by MPI routines waiting for other MPI routines of other
+!--    PEs that have not yet finished
+#if defined( __parallel )
+       IF ( cpu_log_barrierwait  .AND.  wait_allowed  .AND.  &
+            ( modus == 'start'  .OR.  modus == 'continue' ) )  THEN
+          CALL MPI_BARRIER( comm2d, ierr )
+       ENDIF
+#endif
+
+!
+!--    Take current time
+#if defined( __lc ) || defined( __decalpha ) || defined( __nec )
+       CALL SYSTEM_CLOCK( count, count_rate )
+       mtime = REAL( count ) / REAL( count_rate )
+#elif defined( __ibm )
+       mtime = IRTC( ) * 1E-9
+#else
+       message_string = 'no time measurement defined on this host'
+       CALL message( 'cpu_log', 'PA0175', 1, 2, 0, 6, 0 )
+#endif
+
+!
+!--    Start, stop or pause measurement
+       IF ( modus == 'start'  .OR.  modus == 'continue' )  THEN
+          log_event%mtime    = mtime
+          log_event%mtimevec = mtimevec
+       ELSEIF ( modus == 'pause' )  THEN
+          IF ( ( mtime - log_event%mtime ) < 0.0  .AND.  first )  THEN
+             WRITE( message_string, * ) 'negative time interval occured',         &
+                         ' &PE',myid,' L=PAUSE "',TRIM(log_event%place),'" new=', &
+                         mtime,' last=',log_event%mtime
+             CALL message( 'cpu_log', 'PA0176', 0, 1, -1, 6, 0 )
+             first = .FALSE.
+          ENDIF
+          log_event%isum     = log_event%isum + mtime - log_event%mtime
+          log_event%ivect    = log_event%ivect  + mtimevec - log_event%mtimevec
+       ELSEIF ( modus == 'stop' )  THEN
+          IF ( ( mtime - log_event%mtime + log_event%isum ) < 0.0  .AND. &
+               first )  THEN
+             WRITE( message_string, * ) 'negative time interval occured',        &
+                         ' &PE',myid,' L=STOP "',TRIM(log_event%place),'" new=', &
+                         mtime,' last=',log_event%mtime,' isum=',log_event%isum
+             CALL message( 'cpu_log', 'PA0177', 0, 1, -1, 6, 0 )
+             first = .FALSE.
+          ENDIF
+          log_event%mtime    = mtime    - log_event%mtime    + log_event%isum
+          log_event%mtimevec = mtimevec - log_event%mtimevec + log_event%ivect
+          log_event%sum      = log_event%sum  + log_event%mtime
+          IF ( log_event%sum < 0.0  .AND.  first )  THEN
+             WRITE( message_string, * ) 'negative time interval occured',        &
+                         ' &PE',myid,' L=STOP "',TRIM(log_event%place),'" sum=', &
+                                         log_event%sum,' mtime=',log_event%mtime
+             CALL message( 'cpu_log', 'PA0178', 0, 1, -1, 6, 0 )
+             first = .FALSE.
+          ENDIF
+          log_event%vector   = log_event%vector + log_event%mtimevec
+          log_event%counts   = log_event%counts + 1
+          log_event%isum     = 0.0
+          log_event%ivect    = 0.0
+       ELSE
+          message_string = 'unknown modus of time measurement: ' // TRIM( modus )
+          CALL message( 'cpu_log', 'PA0179', 0, 1, -1, 6, 0 )
+       ENDIF
+
+    END SUBROUTINE cpu_log
+
+
+    SUBROUTINE cpu_statistics
+!------------------------------------------------------------------------------!
+! Description:
+! ------------
+! Analysis and output of the cpu-times measured. All PE results are collected
+! on PE0 in order to calculate the mean cpu-time over all PEs and other
+! statistics. The output is sorted according to the amount of cpu-time consumed
+! and output on PE0.
+!------------------------------------------------------------------------------!
+
+       IMPLICIT NONE
+
+       INTEGER    ::  i, ii(1), iii, sender
+       REAL       ::  average_cputime
+       REAL, SAVE ::  norm = 1.0
+       REAL, DIMENSION(:),   ALLOCATABLE ::  pe_max, pe_min, pe_rms, sum
+       REAL, DIMENSION(:,:), ALLOCATABLE ::  pe_log_points
+
+
+!
+!--    Compute cpu-times in seconds
+       log_point%mtime  = log_point%mtime  / norm
+       log_point%sum    = log_point%sum    / norm
+       log_point%vector = log_point%vector / norm
+       WHERE ( log_point%counts /= 0 )
+          log_point%mean = log_point%sum / log_point%counts
+       END WHERE
+
+
+!
+!--    Collect cpu-times from all PEs and calculate statistics
+       IF ( myid == 0 )  THEN
+!
+!--       Allocate and initialize temporary arrays needed for statistics
+          ALLOCATE( pe_max( SIZE( log_point ) ), pe_min( SIZE( log_point ) ), &
+                    pe_rms( SIZE( log_point ) ),                              &
+                    pe_log_points( SIZE( log_point ), 0:numprocs-1 ) )
+          pe_min = log_point%sum
+          pe_max = log_point%sum    ! need to be set in case of 1 PE
+          pe_rms = 0.0
+
+#if defined( __parallel )
+!
+!--       Receive data from all PEs
+          DO  i = 1, numprocs-1
+             CALL MPI_RECV( pe_max(1), SIZE( log_point ), MPI_REAL, &
+                            i, i, comm2d, status, ierr )
+             sender = status(MPI_SOURCE)
+             pe_log_points(:,sender) = pe_max
+          ENDDO
+          pe_log_points(:,0) = log_point%sum   ! Results from PE0
+!
+!--       Calculate mean of all PEs, store it on log_point%sum
+!--       and find minimum and maximum
+          DO  iii = 1, SIZE( log_point )
+             DO  i = 1, numprocs-1
+                log_point(iii)%sum = log_point(iii)%sum + pe_log_points(iii,i)
+                pe_min(iii) = MIN( pe_min(iii), pe_log_points(iii,i) )
+                pe_max(iii) = MAX( pe_max(iii), pe_log_points(iii,i) )
+             ENDDO
+             log_point(iii)%sum = log_point(iii)%sum / numprocs
+!
+!--          Calculate rms
+             DO  i = 0, numprocs-1
+                pe_rms(iii) = pe_rms(iii) + ( &
+                                    pe_log_points(iii,i) - log_point(iii)%sum &
+                                            )**2
+             ENDDO
+             pe_rms(iii) = SQRT( pe_rms(iii) / numprocs )
+          ENDDO
+       ELSE
+!
+!--       Send data to PE0 (pe_max is used as temporary storage to send
+!--       the data in order to avoid sending the data type log)
+          ALLOCATE( pe_max( SIZE( log_point ) ) )
+          pe_max = log_point%sum
+          CALL MPI_SEND( pe_max(1), SIZE( log_point ), MPI_REAL, 0, myid, comm2d, &
+                         ierr )
+#endif
+
+       ENDIF
+
+!
+!--    Write cpu-times
+       IF ( myid == 0 )  THEN
+!
+!--       Re-store sums
+          ALLOCATE( sum( SIZE( log_point ) ) )
+          WHERE ( log_point%counts /= 0 )
+             sum = log_point%sum
+          ELSEWHERE
+             sum = -1.0
+          ENDWHERE
+
+!
+!--       Get total time in order to calculate CPU-time per gridpoint and timestep
+          IF ( nr_timesteps_this_run /= 0 )  THEN
+             average_cputime = log_point(1)%sum / REAL( (nx+1) * (ny+1) * nz ) / &
+                               REAL( nr_timesteps_this_run ) * 1E6  ! in micro-sec
+          ELSE
+             average_cputime = -1.0
+          ENDIF
+
+!
+!--       Write cpu-times sorted by size
+          CALL check_open( 18 )
+#if defined( __parallel )
+          WRITE ( 18, 100 )  TRIM( run_description_header ),                          &
+                             numprocs * threads_per_task, pdims(1), pdims(2),         &
+                             threads_per_task, nx+1, ny+1, nz, nr_timesteps_this_run, &
+                             average_cputime
+
+          IF ( num_acc_per_node /= 0 )  WRITE ( 18, 108 )  num_acc_per_node
+          WRITE ( 18, 110 )
+#else
+          WRITE ( 18, 100 )  TRIM( run_description_header ),                          &
+                             numprocs * threads_per_task, 1, 1,                       &
+                             threads_per_task, nx+1, ny+1, nz, nr_timesteps_this_run, &
+                             average_cputime
+
+          IF ( num_acc_per_node /= 0 )  WRITE ( 18, 109 )  num_acc_per_node
+          WRITE ( 18, 110 )
+#endif
+          DO
+             ii = MAXLOC( sum )
+             i = ii(1)
+             IF ( sum(i) /= -1.0 )  THEN
+                WRITE ( 18, 102 ) &
+              log_point(i)%place, log_point(i)%sum,                &
+                   log_point(i)%sum / log_point(1)%sum * 100.0,         &
+                   log_point(i)%counts, pe_min(i), pe_max(i), pe_rms(i)
+                sum(i) = -1.0
+             ELSE
+                EXIT
+             ENDIF
+          ENDDO
+       ENDIF
+
+
+!
+!--    The same procedure again for the individual measurements.
+!
+!--    Compute cpu-times in seconds
+       log_point_s%mtime  = log_point_s%mtime  / norm
+       log_point_s%sum    = log_point_s%sum    / norm
+       log_point_s%vector = log_point_s%vector / norm
+       WHERE ( log_point_s%counts /= 0 )
+          log_point_s%mean = log_point_s%sum / log_point_s%counts
+       END WHERE
+
+!
+!--    Collect cpu-times from all PEs and calculate statistics
+#if defined( __parallel )
+!
+!--    Set barrier in order to avoid that PE0 receives log_point_s-data
+!--    while still busy with receiving log_point-data (see above)
+       CALL MPI_BARRIER( comm2d, ierr )
+#endif
+       IF ( myid == 0 )  THEN
+!
+!--       Initialize temporary arrays needed for statistics
+          pe_min = log_point_s%sum
+          pe_max = log_point_s%sum    ! need to be set in case of 1 PE
+          pe_rms = 0.0
+
+#if defined( __parallel )
+!
+!--       Receive data from all PEs
+          DO  i = 1, numprocs-1
+             CALL MPI_RECV( pe_max(1), SIZE( log_point ), MPI_REAL, &
+                            MPI_ANY_SOURCE, MPI_ANY_TAG, comm2d, status, ierr )
+             sender = status(MPI_SOURCE)
+             pe_log_points(:,sender) = pe_max
+          ENDDO
+          pe_log_points(:,0) = log_point_s%sum   ! Results from PE0
+!
+!--       Calculate mean of all PEs, store it on log_point_s%sum
+!--       and find minimum and maximum
+          DO  iii = 1, SIZE( log_point )
+             DO  i = 1, numprocs-1
+                log_point_s(iii)%sum = log_point_s(iii)%sum + pe_log_points(iii,i)
+                pe_min(iii) = MIN( pe_min(iii), pe_log_points(iii,i) )
+                pe_max(iii) = MAX( pe_max(iii), pe_log_points(iii,i) )
+             ENDDO
+             log_point_s(iii)%sum = log_point_s(iii)%sum / numprocs
+!
+!--          Calculate rms
+             DO  i = 0, numprocs-1
+                pe_rms(iii) = pe_rms(iii) + ( &
+                                    pe_log_points(iii,i) - log_point_s(iii)%sum &
+                                            )**2
+             ENDDO
+             pe_rms(iii) = SQRT( pe_rms(iii) / numprocs )
+          ENDDO
+       ELSE
+!
+!--       Send data to PE0 (pe_max is used as temporary storage to send
+!--       the data in order to avoid sending the data type log)
+          pe_max = log_point_s%sum
+          CALL MPI_SEND( pe_max(1), SIZE( log_point ), MPI_REAL, 0, 0, comm2d, &
+                         ierr )
+#endif
+
+       ENDIF
+
+!
+!--    Write cpu-times
+       IF ( myid == 0 )  THEN
+!
+!--       Re-store sums
+          WHERE ( log_point_s%counts /= 0 )
+             sum = log_point_s%sum
+          ELSEWHERE
+             sum = -1.0
+          ENDWHERE
+
+!
+!--       Write cpu-times sorted by size
+          WRITE ( 18, 101 )
+          DO
+             ii = MAXLOC( sum )
+             i = ii(1)
+             IF ( sum(i) /= -1.0 )  THEN
+                WRITE ( 18, 102 ) &
+                   log_point_s(i)%place, log_point_s(i)%sum, &
+                   log_point_s(i)%sum / log_point(1)%sum * 100.0, &
+                   log_point_s(i)%counts, pe_min(i), pe_max(i), pe_rms(i)
+                sum(i) = -1.0
+             ELSE
+                EXIT
+             ENDIF
+          ENDDO
+
+!
+!--       Output of handling of MPI operations
+          IF ( collective_wait )  THEN
+             WRITE ( 18, 103 )
+          ELSE
+             WRITE ( 18, 104 )
+          ENDIF
+          IF ( cpu_log_barrierwait )  WRITE ( 18, 111 )
+          IF ( synchronous_exchange )  THEN
+             WRITE ( 18, 105 )
+          ELSE
+             WRITE ( 18, 106 )
+          ENDIF
+
+!
+!--       Empty lines in order to create a gap to the results of the model
+!--       continuation runs
+          WRITE ( 18, 107 )
+
+!
+!--       Unit 18 is not needed anymore
+          CALL close_file( 18 )
+
+       ENDIF
+
+
+   100 FORMAT (A/11('-')//'CPU measures for ',I5,' PEs (',I5,'(x) * ',I5,'(y', &
+               &') tasks *',I5,' threads):'//                                  &
+               'gridpoints (x/y/z): ',20X,I5,' * ',I5,' * ',I5/                &
+               'nr of timesteps: ',22X,I6/                                     &
+               'cpu time per grid point and timestep: ',5X,F8.5,' * 10**-6 s')
+
+   101 FORMAT (/'special measures:'/ &
+               &'-----------------------------------------------------------', &
+               &'--------------------')
+
+   102 FORMAT (A20,2X,F9.3,2X,F7.2,1X,I7,3(1X,F9.3))
+   103 FORMAT (/'Barriers are set in front of collective operations')
+   104 FORMAT (/'No barriers are set in front of collective operations')
+   105 FORMAT (/'Exchange of ghostpoints via MPI_SENDRCV')
+   106 FORMAT (/'Exchange of ghostpoints via MPI_ISEND/MPI_IRECV')
+   107 FORMAT (//)
+   108 FORMAT ('Accelerator boards per node: ',14X,I2)
+   109 FORMAT ('Accelerator boards: ',23X,I2)
+   110 FORMAT ('----------------------------------------------------------',   &
+               &'------------'//&
+               &'place:                        mean        counts      min  ', &
+               &'     max       rms'/ &
+               &'                           sec.      %                sec. ', &
+               &'     sec.      sec.'/  &
+               &'-----------------------------------------------------------', &
+               &'-------------------')
+   111 FORMAT (/'Barriers are set at beginning (start/continue) of measurements')
+
+    END SUBROUTINE cpu_statistics
+
+ END MODULE cpulog
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! barrier argument removed from cpu_log.
+! module interfaces removed
 !
 ! Former revisions:
@@ -143,5 +144,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE netcdf_control
     USE particle_attributes
@@ -1808,5 +1808,5 @@
     ENDIF
 
-    CALL cpu_log (log_point(3),'data_output_2d','stop','nobarrier')
+    CALL cpu_log( log_point(3), 'data_output_2d', 'stop' )
 
  END SUBROUTINE data_output_2d
Index: palm/trunk/SOURCE/data_output_3d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_3d.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_3d.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -126,5 +127,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE netcdf_control
     USE particle_attributes
@@ -634,5 +634,5 @@
 
 
-    CALL cpu_log (log_point(14),'data_output_3d','stop','nobarrier')
+    CALL cpu_log( log_point(14), 'data_output_3d', 'stop' )
 
 !
Index: palm/trunk/SOURCE/data_output_dvrp.f90
===================================================================
--- palm/trunk/SOURCE/data_output_dvrp.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_dvrp.f90	(revision 1318)
@@ -18,5 +18,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -109,5 +109,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE particle_attributes
     USE pegrid
Index: palm/trunk/SOURCE/data_output_mask.f90
===================================================================
--- palm/trunk/SOURCE/data_output_mask.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_mask.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -71,5 +72,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE netcdf
     USE netcdf_control
@@ -518,5 +518,5 @@
 
 
-    CALL cpu_log (log_point(49),'data_output_mask','stop','nobarrier')
+    CALL cpu_log( log_point(49), 'data_output_mask', 'stop' )
 #endif
 
Index: palm/trunk/SOURCE/data_output_profiles.f90
===================================================================
--- palm/trunk/SOURCE/data_output_profiles.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_profiles.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -71,5 +72,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE netcdf_control
     USE pegrid
@@ -310,5 +310,5 @@
     ENDIF
 
-    CALL cpu_log( log_point(15), 'data_output_profiles','stop', 'nobarrier' )
+    CALL cpu_log( log_point(15), 'data_output_profiles','stop' )
 
 !
Index: palm/trunk/SOURCE/data_output_ptseries.f90
===================================================================
--- palm/trunk/SOURCE/data_output_ptseries.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_ptseries.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -61,5 +62,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE netcdf_control
     USE particle_attributes
@@ -332,5 +332,5 @@
     DEALLOCATE( pts_value, pts_value_l )
 
-    CALL cpu_log( log_point(36), 'data_output_ptseries','stop', 'nobarrier' )
+    CALL cpu_log( log_point(36), 'data_output_ptseries', 'stop' )
 
  END SUBROUTINE data_output_ptseries
Index: palm/trunk/SOURCE/data_output_spectra.f90
===================================================================
--- palm/trunk/SOURCE/data_output_spectra.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_spectra.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -61,5 +61,4 @@
     USE control_parameters
     USE cpulog
-    USE interfaces
     USE netcdf_control
     USE pegrid
Index: palm/trunk/SOURCE/data_output_tseries.f90
===================================================================
--- palm/trunk/SOURCE/data_output_tseries.f90	(revision 1317)
+++ palm/trunk/SOURCE/data_output_tseries.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! barrier argument removed from cpu_log.
+! module interfaces removed
 !
 ! Former revisions:
@@ -58,5 +59,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE netcdf_control
     USE pegrid
@@ -118,5 +118,5 @@
 
 
-    CALL cpu_log( log_point(21), 'data_output_tseries','stop', 'nobarrier' )
+    CALL cpu_log( log_point(21), 'data_output_tseries', 'stop' )
 
 !
Index: palm/trunk/SOURCE/disturb_field.f90
===================================================================
--- palm/trunk/SOURCE/disturb_field.f90	(revision 1317)
+++ palm/trunk/SOURCE/disturb_field.f90	(revision 1318)
@@ -19,5 +19,6 @@
 !
 ! Current revisions:
-! -----------------
+! ------------------
+! module interfaces removed
 !
 ! Former revisions:
@@ -60,5 +61,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE random_function_mod
 
Index: palm/trunk/SOURCE/disturb_heatflux.f90
===================================================================
--- palm/trunk/SOURCE/disturb_heatflux.f90	(revision 1317)
+++ palm/trunk/SOURCE/disturb_heatflux.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -56,5 +56,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
 
     IMPLICIT NONE
Index: palm/trunk/SOURCE/exchange_horiz.f90
===================================================================
--- palm/trunk/SOURCE/exchange_horiz.f90	(revision 1317)
+++ palm/trunk/SOURCE/exchange_horiz.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -87,5 +87,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
 
Index: palm/trunk/SOURCE/exchange_horiz_2d.f90
===================================================================
--- palm/trunk/SOURCE/exchange_horiz_2d.f90	(revision 1317)
+++ palm/trunk/SOURCE/exchange_horiz_2d.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -68,5 +68,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
 
@@ -189,5 +188,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
 
Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 1317)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 1318)
@@ -21,5 +21,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -180,5 +180,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
     USE statistics
@@ -1353,5 +1352,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
     USE statistics
Index: palm/trunk/SOURCE/inflow_turbulence.f90
===================================================================
--- palm/trunk/SOURCE/inflow_turbulence.f90	(revision 1317)
+++ palm/trunk/SOURCE/inflow_turbulence.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -58,5 +58,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
 
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 1317)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 1318)
@@ -1,5 +1,2 @@
-#if defined( __ibmy_special )
-@PROCESS NOOPTimize
-#endif
  SUBROUTINE init_3d_model
 
@@ -23,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -270,5 +267,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE ls_forcing_mod
     USE model_1d
Index: palm/trunk/SOURCE/lpm.f90
===================================================================
--- palm/trunk/SOURCE/lpm.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -79,5 +79,4 @@
     USE control_parameters
     USE cpulog
-    USE interfaces
     USE particle_attributes
     USE pegrid
Index: palm/trunk/SOURCE/lpm_boundary_conds.f90
===================================================================
--- palm/trunk/SOURCE/lpm_boundary_conds.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_boundary_conds.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -63,5 +63,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE particle_attributes
     USE pegrid
Index: palm/trunk/SOURCE/lpm_calc_liquid_water_content.f90
===================================================================
--- palm/trunk/SOURCE/lpm_calc_liquid_water_content.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_calc_liquid_water_content.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -45,5 +45,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE particle_attributes
 
Index: palm/trunk/SOURCE/lpm_collision_kernels.f90
===================================================================
--- palm/trunk/SOURCE/lpm_collision_kernels.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_collision_kernels.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -264,5 +264,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE particle_attributes
 
Index: palm/trunk/SOURCE/lpm_data_output_particles.f90
===================================================================
--- palm/trunk/SOURCE/lpm_data_output_particles.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_data_output_particles.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -41,5 +41,4 @@
     USE control_parameters
     USE cpulog
-    USE interfaces
     USE netcdf_control
     USE particle_attributes
Index: palm/trunk/SOURCE/lpm_droplet_collision.f90
===================================================================
--- palm/trunk/SOURCE/lpm_droplet_collision.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_droplet_collision.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -71,5 +71,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE lpm_collision_kernels_mod
     USE particle_attributes
Index: palm/trunk/SOURCE/lpm_droplet_condensation.f90
===================================================================
--- palm/trunk/SOURCE/lpm_droplet_condensation.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_droplet_condensation.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -64,5 +64,4 @@
     USE cpulog
     USE grid_variables
-    USE interfaces
     USE lpm_collision_kernels_mod
     USE particle_attributes
Index: palm/trunk/SOURCE/lpm_exchange_horiz.f90
===================================================================
--- palm/trunk/SOURCE/lpm_exchange_horiz.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_exchange_horiz.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -46,5 +46,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE particle_attributes
     USE pegrid
Index: palm/trunk/SOURCE/lpm_set_attributes.f90
===================================================================
--- palm/trunk/SOURCE/lpm_set_attributes.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_set_attributes.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -53,5 +53,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE particle_attributes
     USE pegrid
Index: palm/trunk/SOURCE/lpm_sort_arrays.f90
===================================================================
--- palm/trunk/SOURCE/lpm_sort_arrays.f90	(revision 1317)
+++ palm/trunk/SOURCE/lpm_sort_arrays.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -43,5 +43,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE particle_attributes
 
Index: palm/trunk/SOURCE/ls_forcing.f90
===================================================================
--- palm/trunk/SOURCE/ls_forcing.f90	(revision 1317)
+++ palm/trunk/SOURCE/ls_forcing.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -60,5 +60,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
 
@@ -228,5 +227,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
 
@@ -287,5 +285,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
 
Index: palm/trunk/SOURCE/mod_kinds.f90
===================================================================
--- palm/trunk/SOURCE/mod_kinds.f90	(revision 1317)
+++ palm/trunk/SOURCE/mod_kinds.f90	(revision 1318)
@@ -49,10 +49,10 @@
 !-- Integer kinds
     INTEGER, PARAMETER ::  isp = SELECTED_INT_KIND(  9 )   ! single precision (32 bit)
-    INTEGER, PARAMETER ::  idp = SELECTED_INT_KIND( 14 )   ! double precision (32 bit)
+    INTEGER, PARAMETER ::  idp = SELECTED_INT_KIND( 14 )   ! double precision (64 bit)
 
 !
 !-- Set kinds to be used as defaults
     INTEGER, PARAMETER ::   wp =  dp          ! default real kind
-    INTEGER, PARAMETER ::  iwp = idp          ! default integer kind
+    INTEGER, PARAMETER ::  iwp = isp          ! default integer kind
 
     SAVE
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 1317)
+++ palm/trunk/SOURCE/modules.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! module cpulog moved to new separate module-file
+! interface for cpu_log removed
 ! Former revisions:
 ! -----------------
@@ -942,33 +943,4 @@
 
 
-
- MODULE cpulog
-
-!------------------------------------------------------------------------------!
-! Description:
-! ------------
-! Definition of variables for cpu-time measurements
-!------------------------------------------------------------------------------!
-
-    REAL ::  initial_wallclock_time
-
-    TYPE logpoint
-       REAL               ::  isum, ivect, mean, mtime, mtimevec, sum, vector
-       INTEGER            ::  counts
-       CHARACTER (LEN=20) ::  place
-    END TYPE logpoint
-
-    TYPE(logpoint), DIMENSION(100) ::  log_point = logpoint( 0.0, 0.0, 0.0,   &
-                                       0.0, 0.0, 0.0, 0.0, 0, ' ' ),          &
-                                       log_point_s = logpoint( 0.0, 0.0, 0.0, &
-                                       0.0, 0.0, 0.0, 0.0, 0, ' ' )
-
-    SAVE
-
- END MODULE cpulog
-
-
-
-
  MODULE dvrp_variables
 
@@ -1166,20 +1138,4 @@
 ! Interfaces for special subroutines which use optional parameters
 !------------------------------------------------------------------------------!
-
-    INTERFACE
-
-       SUBROUTINE cpu_log( log_event, place, modus, barrierwait )
-
-          USE cpulog
-
-          CHARACTER (LEN=*)           ::  modus, place
-          CHARACTER (LEN=*), OPTIONAL ::  barrierwait
-          TYPE(logpoint)              ::  log_event
-
-       END SUBROUTINE cpu_log
-
-    END INTERFACE
-
-
 
     INTERFACE
Index: palm/trunk/SOURCE/nudging.f90
===================================================================
--- palm/trunk/SOURCE/nudging.f90	(revision 1317)
+++ palm/trunk/SOURCE/nudging.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -63,5 +63,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
 
@@ -191,5 +190,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE statistics 
@@ -313,5 +311,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE statistics 
Index: palm/trunk/SOURCE/palm.f90
===================================================================
--- palm/trunk/SOURCE/palm.f90	(revision 1317)
+++ palm/trunk/SOURCE/palm.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -112,5 +112,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE ls_forcing_mod
     USE model_1d
Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 1317)
+++ palm/trunk/SOURCE/parin.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! +cpu_log_barrierwait in d3par
 !
 ! Former revisions:
@@ -212,4 +212,5 @@
     USE cloud_parameters
     USE control_parameters
+    USE cpulog
     USE dvrp_variables
     USE grid_variables
@@ -281,5 +282,5 @@
       
     NAMELIST /d3par/  averaging_interval, averaging_interval_pr, &
-             create_disturbances, &
+             cpu_log_barrierwait, create_disturbances, &
              cross_profiles, cross_ts_uymax, cross_ts_uymin, &
              data_output, data_output_format, data_output_masks, &
Index: palm/trunk/SOURCE/poisfft.f90
===================================================================
--- palm/trunk/SOURCE/poisfft.f90	(revision 1317)
+++ palm/trunk/SOURCE/poisfft.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -218,5 +218,4 @@
        USE control_parameters,  ONLY : fft_method, transpose_compute_overlap
        USE cpulog
-       USE interfaces
        USE pegrid
 
@@ -372,4 +371,5 @@
 !--       2d-domain-decomposition or no decomposition (1 PE run) with
 !--       overlapping transposition / fft
+!--       cputime logging must not use barriers, which would prevent overlapping
           ALLOCATE( f_out_y(0:ny,nxl_y:nxr_y,nzb_y:nzt_y), &
                     f_out_z(0:nx,nys_x:nyn_x,nzb_x:nzt_x) )
@@ -399,7 +399,7 @@
 
              IF ( kk == 1 )  THEN
-                CALL cpu_log( log_point_s(5), 'transpo forward', 'start' )
+                CALL cpu_log( log_point_s(5), 'transpo forward', 'start', cpu_log_nowait )
              ELSE
-                CALL cpu_log( log_point_s(5), 'transpo forward', 'continue' )
+                CALL cpu_log( log_point_s(5), 'transpo forward', 'continue', cpu_log_nowait )
              ENDIF
 
@@ -413,7 +413,7 @@
 
              IF ( kk == 1 )  THEN
-                CALL cpu_log( log_point_s(4), 'fft_x', 'start' )
+                CALL cpu_log( log_point_s(4), 'fft_x', 'start', cpu_log_nowait )
              ELSE
-                CALL cpu_log( log_point_s(4), 'fft_x', 'continue' )
+                CALL cpu_log( log_point_s(4), 'fft_x', 'continue', cpu_log_nowait )
              ENDIF
 
@@ -456,5 +456,5 @@
           DO  ii = 0, nblk
 
-             CALL cpu_log( log_point_s(5), 'transpo forward', 'continue' )
+             CALL cpu_log( log_point_s(5), 'transpo forward', 'continue', cpu_log_nowait )
 
              DO  inew = 0, nx-1
@@ -468,7 +468,7 @@
 
              IF ( ii == 1 )  THEN
-                CALL cpu_log( log_point_s(7), 'fft_y', 'start' )
+                CALL cpu_log( log_point_s(7), 'fft_y', 'start', cpu_log_nowait )
              ELSE
-                CALL cpu_log( log_point_s(7), 'fft_y', 'continue' )
+                CALL cpu_log( log_point_s(7), 'fft_y', 'continue', cpu_log_nowait )
              ENDIF
 
@@ -518,5 +518,5 @@
 !--          Forward Fourier Transformation
 !--          Transposition y --> z
-             CALL cpu_log( log_point_s(5), 'transpo forward', 'continue' )
+             CALL cpu_log( log_point_s(5), 'transpo forward', 'continue', cpu_log_nowait )
 
              DO  jnew = 0, ny-1
@@ -535,5 +535,5 @@
 !
 !--          Solve the tridiagonal equation system along z
-             CALL cpu_log( log_point_s(6), 'tridia', 'start' )
+             CALL cpu_log( log_point_s(6), 'tridia', 'start', cpu_log_nowait )
 
              n = isave(2) + jj
@@ -548,7 +548,7 @@
 !--          backward tranpose are in the same section
              IF ( jj == 0 )  THEN
-                CALL cpu_log( log_point_s(8), 'transpo invers', 'start' )
+                CALL cpu_log( log_point_s(8), 'transpo invers', 'start', cpu_log_nowait )
              ELSE
-                CALL cpu_log( log_point_s(8), 'transpo invers', 'continue' )
+                CALL cpu_log( log_point_s(8), 'transpo invers', 'continue', cpu_log_nowait )
              ENDIF
 
@@ -597,5 +597,5 @@
           DO  ii = 0, nblk
 
-             CALL cpu_log( log_point_s(7), 'fft_y', 'continue' )
+             CALL cpu_log( log_point_s(7), 'fft_y', 'continue', cpu_log_nowait )
 
              n = isave(2) + ii
@@ -613,5 +613,5 @@
              ENDIF
 
-             CALL cpu_log( log_point_s(8), 'transpo invers', 'continue' )
+             CALL cpu_log( log_point_s(8), 'transpo invers', 'continue', cpu_log_nowait )
 
              CALL transpose_yx( ar1(:,:,:), f_in )
@@ -659,5 +659,5 @@
           DO  kk = 1, nblk
 
-             CALL cpu_log( log_point_s(4), 'fft_x', 'continue' )
+             CALL cpu_log( log_point_s(4), 'fft_x', 'continue', cpu_log_nowait )
 
              n = isave(2) + kk - 1
@@ -670,5 +670,5 @@
              ENDIF
 
-             CALL cpu_log( log_point_s(8), 'transpo invers', 'continue' )
+             CALL cpu_log( log_point_s(8), 'transpo invers', 'continue', cpu_log_nowait )
 
              CALL transpose_xz( ar1(:,:,:), f_in )
@@ -723,5 +723,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE transpose_indices
@@ -841,5 +840,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE transpose_indices
@@ -963,5 +961,4 @@
        USE grid_variables
        USE indices
-       USE interfaces
        USE pegrid
        USE transpose_indices
@@ -1094,5 +1091,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE transpose_indices
@@ -1200,5 +1196,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE transpose_indices
@@ -1307,5 +1302,4 @@
        USE grid_variables
        USE indices
-       USE interfaces
        USE pegrid
        USE transpose_indices
Index: palm/trunk/SOURCE/poismg.f90
===================================================================
--- palm/trunk/SOURCE/poismg.f90	(revision 1317)
+++ palm/trunk/SOURCE/poismg.f90	(revision 1318)
@@ -23,5 +23,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -110,5 +110,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
 
@@ -616,5 +615,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
 
@@ -1029,5 +1027,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
 
@@ -1094,5 +1091,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
 
Index: palm/trunk/SOURCE/pres.f90
===================================================================
--- palm/trunk/SOURCE/pres.f90	(revision 1317)
+++ palm/trunk/SOURCE/pres.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -143,5 +143,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
     USE poisfft_mod
Index: palm/trunk/SOURCE/print_1d.f90
===================================================================
--- palm/trunk/SOURCE/print_1d.f90	(revision 1317)
+++ palm/trunk/SOURCE/print_1d.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -47,5 +48,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE statistics
@@ -136,5 +136,5 @@
     ENDIF
 
-    CALL cpu_log( log_point(18), 'print_1d','stop', 'nobarrier' )
+    CALL cpu_log( log_point(18), 'print_1d', 'stop' )
 
 !
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 1317)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -167,5 +167,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
     USE pointer_interfaces
Index: palm/trunk/SOURCE/read_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/read_3d_binary.f90	(revision 1317)
+++ palm/trunk/SOURCE/read_3d_binary.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -110,5 +110,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE particle_attributes
     USE pegrid
Index: palm/trunk/SOURCE/run_control.f90
===================================================================
--- palm/trunk/SOURCE/run_control.f90	(revision 1317)
+++ palm/trunk/SOURCE/run_control.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -61,5 +61,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE statistics
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 1317)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 1318)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! barrier argument removed from cpu_log,
+! module interfaces removed
 !
 ! Former revisions:
@@ -80,5 +81,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE particle_attributes
 
@@ -603,5 +603,5 @@
     ENDDO
 
-    CALL cpu_log (log_point(34),'sum_up_3d_data','stop','nobarrier')
+    CALL cpu_log( log_point(34), 'sum_up_3d_data', 'stop' )
 
 
Index: palm/trunk/SOURCE/surface_coupler.f90
===================================================================
--- palm/trunk/SOURCE/surface_coupler.f90	(revision 1317)
+++ palm/trunk/SOURCE/surface_coupler.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! module interfaces removed
 !
 ! Former revisions:
@@ -64,5 +64,4 @@
     USE grid_variables
     USE indices
-    USE interfaces
     USE pegrid
 
Index: palm/trunk/SOURCE/swap_timelevel.f90
===================================================================
--- palm/trunk/SOURCE/swap_timelevel.f90	(revision 1317)
+++ palm/trunk/SOURCE/swap_timelevel.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 ! 
 ! Former revisions:
@@ -75,5 +75,4 @@
     USE arrays_3d
     USE cpulog
-    USE interfaces
     USE control_parameters
 
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 1317)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -179,5 +179,4 @@
     USE indices
     USE interaction_droplets_ptq_mod
-    USE interfaces
     USE ls_forcing_mod
     USE particle_attributes
Index: palm/trunk/SOURCE/transpose.f90
===================================================================
--- palm/trunk/SOURCE/transpose.f90	(revision 1317)
+++ palm/trunk/SOURCE/transpose.f90	(revision 1318)
@@ -20,5 +20,7 @@
 ! Current revisions:
 ! -----------------
-!
+! cpu_log_nowait parameter added to cpu measurements of the transpositions
+! required for solving the Poisson equation (poisfft),
+! module interfaces removed
 !
 ! Former revisions:
@@ -125,5 +127,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -143,5 +144,5 @@
 !
 !--    Transpose array
-       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start' )
+       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start', cpu_log_nowait )
        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
        !$acc update host( f_inv )
@@ -247,5 +248,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -288,5 +288,5 @@
 !
 !--    Transpose array
-       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start' )
+       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start', cpu_log_nowait )
        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
        CALL MPI_ALLTOALL( work(nys_x,1,nzb_x,0), sendrecvcount_zx, MPI_REAL, &
@@ -370,5 +370,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -408,5 +407,5 @@
 !
 !--    Transpose array
-       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start' )
+       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start', cpu_log_nowait )
        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
        CALL MPI_ALLTOALL( work(1,nzb_y,nxl_y,0), sendrecvcount_xy, MPI_REAL, &
@@ -453,5 +452,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -558,5 +556,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -594,5 +591,5 @@
 !
 !--    Transpose array
-       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start' )
+       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start', cpu_log_nowait )
        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
        !$acc update host( f_inv )
@@ -679,5 +676,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -715,5 +711,5 @@
 !
 !--    Transpose array
-       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start' )
+       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start', cpu_log_nowait )
        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
        !$acc update host( f_inv )
@@ -800,5 +796,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
@@ -841,5 +836,5 @@
 !
 !--    Transpose array
-       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start' )
+       CALL cpu_log( log_point_s(32), 'mpi_alltoall', 'start', cpu_log_nowait )
        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
        CALL MPI_ALLTOALL( work(nxl_z,1,nys_z,0), sendrecvcount_yz, MPI_REAL, &
@@ -885,5 +880,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE pegrid
     USE transpose_indices
Index: palm/trunk/SOURCE/user_actions.f90
===================================================================
--- palm/trunk/SOURCE/user_actions.f90	(revision 1317)
+++ palm/trunk/SOURCE/user_actions.f90	(revision 1318)
@@ -19,5 +19,6 @@
 !
 ! Current revisions:
-! -----------------
+! ------------------
+! module interfaces removed
 !
 ! Former revisions:
@@ -64,5 +65,4 @@
        USE cpulog
        USE indices
-       USE interfaces
        USE pegrid
        USE user
Index: palm/trunk/SOURCE/write_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/write_3d_binary.f90	(revision 1317)
+++ palm/trunk/SOURCE/write_3d_binary.f90	(revision 1318)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! module interfaces removed
 !
 ! Former revisions:
@@ -100,5 +100,4 @@
     USE cpulog
     USE indices
-    USE interfaces
     USE particle_attributes
     USE pegrid
