Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 4662)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 4664)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Add additional debug messages around MPI-AlltoAllv calls
+!
+! 4662 2020-09-02 13:40:38Z pavelkrc
 ! Bugfix of LAD in CSF generation in legacy raytracing
 !
@@ -58,5 +61,5 @@
 ! - Bugfix: rtm_svf_, rtm_dif_ outputs
 ! - Bugfix: correct average transparency for MRT factors
-! 
+!
 ! 4587 2020-07-06 08:53:45Z pavelkrc
 ! RTM version 3.1 (see also previous commits):
@@ -64,31 +67,31 @@
 ! - plant canopy box count minimized
 ! - multiple enhancements and bugfixes
-! 
+!
 ! 4584 2020-06-29 13:16:14Z pavelkrc
 ! Consider only boxes with LAD>0 as plant canopy (credit: S. Schubert)
-! 
+!
 ! 4576 2020-06-24 17:58:55Z pavelkrc
 ! Allow the use of rotation_angle in RTM
-! 
+!
 ! 4574 2020-06-24 16:33:32Z pavelkrc
 ! - Restructure code in radiation_check_data_output
 ! - Move calculation of MPI global array offsets to a subroutine
-! 
+!
 ! 4571 2020-06-24 08:59:06Z sebschub
 ! Bugfix in vertical lad_s coordinate
-! 
+!
 ! 4558 2020-06-10 16:27:30Z moh.hefny
 ! Bugfix: - reset RTM output average values after each averaging timestep to zero
 !         - correct calculation of rtm_rad_net_av
-! 
+!
 ! 4555 2020-06-05 21:52:00Z moh.hefny
 ! Bugfix in averaging PC and MRT related quantities
-! 
+!
 ! 4552 2020-06-02 20:33:29Z moh.hefny
 ! Bugfix in IF statement in the emissivity coupling parameter for radiation-RTM
-! 
+!
 ! 4535 2020-05-15 12:07:23Z raasch
 ! bugfix for restart data format query
-! 
+!
 ! 4531 2020-05-13 09:52:22Z moh.hefny
 ! Bugfix in gather flux pabs_pc_lwdif in non_parallel case
@@ -101,17 +104,17 @@
 !      is calculated within its original line and not at the end.
 ! - minor formatting and comments changes
-! 
+!
 ! 4517 2020-05-03 14:29:30Z raasch
 ! added restart with MPI-IO for reading local arrays
-! 
+!
 ! 4495 2020-04-13 20:11:20Z raasch
 ! restart data handling with MPI-IO added
-! 
+!
 ! 4493 2020-04-10 09:49:43Z pavelkrc
 ! Avoid unstable direct normal radiation near horizon
-! 
+!
 ! 4481 2020-03-31 18:55:54Z maronga
 ! use statement for exchange horiz added
-! 
+!
 ! 4452 2020-03-10 20:15:32Z suehring
 ! Bugfix in calc_albedo
@@ -5947,5 +5950,5 @@
 
 !--  First pass of radiation interaction:
-!--   1) direct and diffuse irradiance 
+!--   1) direct and diffuse irradiance
 !--   2) thermal emissions
 
@@ -6526,5 +6529,5 @@
 !--     emiss1
         pabs_surf_lwdifl = pabs_surf_lwdifl +                               &
-                           emiss_surf(i) * facearea(d) * surfinlwdif(i) 
+                           emiss_surf(i) * facearea(d) * surfinlwdif(i)
      ENDDO
 
@@ -6610,5 +6613,5 @@
 
 !-    (3) temperature
-!-     effective horizontal area to account for the effect of vertical 
+!-     effective horizontal area to account for the effect of vertical
 !-     surfaces, Eq. * in Krc et al. 2020
       area_norm = pinlw / rad_lw_in_diff(nyn,nxl)
@@ -8347,5 +8350,5 @@
 
 !--         exchange csf fields between processors
-            IF ( debug_output )  CALL debug_message( 'Exchange csf fields between processors', 'info' )
+            IF ( debug_output )  CALL debug_message( 'Exchange CSF fields between processors', 'start' )
             udim = max(npcsfl,1)
             ALLOCATE( pcsflt_l(ndcsf*udim) )
@@ -8360,4 +8363,5 @@
                 FLUSH(9)
             ENDIF
+            IF ( debug_output )  CALL debug_message( 'Exchange CSF fields: finished first part', 'info' )
 
             CALL MPI_AlltoAllv(kcsflt_l, kdcsf*icsflt, kdcsf*dcsflt, MPI_INTEGER, &
@@ -8368,4 +8372,5 @@
                 FLUSH(9)
             ENDIF
+            IF ( debug_output )  CALL debug_message( 'Exchange CSF fields between processors', 'end' )
 
 #else
@@ -10035,5 +10040,5 @@
     INTEGER(iwp) ::  k !<
     INTEGER(iwp) ::  l, m !< index of current surface element
-    
+
     INTEGER(iwp)                                       :: ids, idsint, isurf
     CHARACTER(LEN=varnamelength)                       :: var
