Index: palm/trunk/SOURCE/data_output_dvrp.f90
===================================================================
--- palm/trunk/SOURCE/data_output_dvrp.f90	(revision 262)
+++ palm/trunk/SOURCE/data_output_dvrp.f90	(revision 264)
@@ -32,5 +32,6 @@
 ! Current revisions:
 ! -----------------
-! Clipping of dvr-output implemented,
+! Clipping of dvr-output implemented, using a default colourtable for
+! particles,
 ! output of messages replaced by message handling routine.
 ! TEST: different colours for isosurfaces
@@ -168,16 +169,14 @@
 !--       number of particles and tails to be plotted; otherwise, all
 !--       particles/tails are plotted. dvrp_mask is used to mark the partikles.
-!          IF ( .NOT. use_particle_tails )  THEN
-             ALLOCATE( dvrp_mask(number_of_particles) )
-!          ELSE
-!             ALLOCATE( dvrp_mask(number_of_tails*maximum_number_of_tailpoints) )
-!          ENDIF
-          dvrp_mask = .TRUE.
+          ALLOCATE( dvrp_mask(number_of_particles) )
+
           IF ( dvrp_total_overlap )  THEN
-             dvrp_nop = number_of_particles
-             dvrp_not = number_of_tails
+             dvrp_mask = .TRUE.
+             dvrp_nop  = number_of_particles
+             dvrp_not  = number_of_tails
           ELSE
-             dvrp_nop = 0
-             dvrp_not = 0
+             dvrp_mask = .FALSE.
+             dvrp_nop  = 0
+             dvrp_not  = 0
              IF ( dvrp_overlap )  THEN
                 IF ( .NOT. use_particle_tails )  THEN
@@ -188,6 +187,5 @@
                            jp >= nys_dvrp  .AND.  jp <= nyn_dvrp )  THEN
                          dvrp_nop = dvrp_nop + 1
-                      ELSE
-                         dvrp_mask(n) = .FALSE.
+                         dvrp_mask(n) = .TRUE.
                       ENDIF
                    ENDDO
@@ -202,6 +200,5 @@
                               jp >= nys_dvrp  .AND.  jp <= nyn_dvrp )  THEN
                             dvrp_not = dvrp_not + 1
-                         ELSE
-                            dvrp_mask(n) = .FALSE.
+                            dvrp_mask(n) = .TRUE.
                          ENDIF
                       ENDIF
@@ -243,4 +240,5 @@
              i = 0
              k = 0
+
              DO  n = 1, number_of_particles
                 nn = particles(n)%tail_id
@@ -275,7 +273,9 @@
              CALL user_dvrp_coltab( 'particles', 'none' )
 
-             CALL DVRP_COLORTABLE_HLS( m-1, 0, interval_values_dvrp,     &
-                                       interval_h_dvrp, interval_l_dvrp, &
-                                       interval_s_dvrp, interval_a_dvrp )
+             CALL DVRP_COLORTABLE_HLS( m-1, 0, interval_values_dvrp_prt, &
+                                       interval_h_dvrp_prt,              &
+                                       interval_l_dvrp_prt,              &
+                                       interval_s_dvrp_prt,              &
+                                       interval_a_dvrp_prt )
 
              IF ( .NOT. use_particle_tails )  THEN
@@ -452,7 +452,20 @@
              END SELECT
 
+          ELSE
+!
+!--          No overlap of clipping domain with the current subdomain
+             DO  i = nxl_dvrp, nxr_dvrp+1
+                DO  j = nys_dvrp, nyn_dvrp+1
+                   DO  k = nzb, nz_do3d
+                      local_pf(i,j,k) = 0.0
+                   ENDDO
+                ENDDO
+             ENDDO
+
           ENDIF
 
           IF ( mode_dvrp(m)(1:10) == 'isosurface' )  THEN
+             WRITE(9,*) '#8'
+             CALL local_flush( 9 )
 !
 !--          DVRP-Calls for plotting isosurfaces:
@@ -477,4 +490,6 @@
                 CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t )
              ENDIF
+             WRITE(9,*) '#8.1'
+             CALL local_flush( 9 )
 
 !
@@ -482,13 +497,21 @@
              CALL DVRP_DATA( m-1, local_pf, 1, nx_dvrp, ny_dvrp, nz_dvrp, &
                              cyclic_dvrp, cyclic_dvrp, cyclic_dvrp )
+             WRITE(9,*) '#8.2'
+             CALL local_flush( 9 )
 
              c_size_x = vc_size_x;  c_size_y = vc_size_y;  c_size_z = vc_size_z
              CALL DVRP_CLUSTER_SIZE( m-1, c_size_x, c_size_y, c_size_z )
+             WRITE(9,*) '#8.3'
+             CALL local_flush( 9 )
 
              c_mode   = vc_mode 
              CALL DVRP_CLUSTERING_MODE( m-1, c_mode )
+             WRITE(9,*) '#8.4'
+             CALL local_flush( 9 )
 
              gradient_normals = vc_gradient_normals
              CALL DVRP_GRADIENTNORMALS( m-1, gradient_normals )
+             WRITE(9,*) '#8.5'
+             CALL local_flush( 9 )
 !
 !--          A seperate procedure for setting vc_alpha will be in the next
@@ -496,4 +519,6 @@
              tmp_c_alpha = vc_alpha 
              CALL DVRP_THRESHOLD( -(m-1)-1, tmp_c_alpha )
+             WRITE(9,*) '#8.6'
+             CALL local_flush( 9 )
 
              IF ( dvrp_overlap )  THEN
@@ -502,11 +527,25 @@
                 tmp_th = 1.0   ! nothing is plotted because array values are 0
              ENDIF
+             WRITE(9,*) '#8.7'
+             CALL local_flush( 9 )
 
              CALL DVRP_THRESHOLD( m-1, tmp_th )
+             WRITE(9,*) '#8.8'
+             WRITE(9,*) 'nxl_dvrp=',nxl_dvrp, ' nxl=',nxl
+             WRITE(9,*) 'nxr_dvrp=',nxr_dvrp, ' nxr=',nxr
+             WRITE(9,*) 'nys_dvrp=',nys_dvrp, ' nys=',nys
+             WRITE(9,*) 'nyn_dvrp=',nyn_dvrp, ' nyn=',nyn
+             CALL local_flush( 9 )
              CALL DVRP_VISUALIZE( m-1, 21, dvrp_filecount )
+             WRITE(9,*) '#8.9'
+             CALL local_flush( 9 )
 
              CALL cpu_log( log_point_s(26), 'dvrp_isosurface', 'stop' )
+                      WRITE(9,*) '#9'
+                      CALL local_flush( 9 )
 
           ELSEIF ( mode_dvrp(m)(1:6) == 'slicer' )  THEN
+                      WRITE(9,*) '#10'
+                      CALL local_flush( 9 )
 !
 !--          DVRP-Calls for plotting slicers:
@@ -547,4 +586,6 @@
 
              CALL cpu_log( log_point_s(27), 'dvrp_slicer', 'stop' )
+                      WRITE(9,*) '#11'
+                      CALL local_flush( 9 )
 
           ENDIF
@@ -552,4 +593,6 @@
           DEALLOCATE( local_pf )
 
+                      WRITE(9,*) '#12'
+                      CALL local_flush( 9 )
        ELSEIF ( mode_dvrp(m)(1:9) == 'pathlines' ) THEN
 
@@ -588,4 +631,6 @@
 
     ENDDO
+                      WRITE(9,*) '#13'
+                      CALL local_flush( 9 )
 
     dvrp_filecount = dvrp_filecount + 1
