Index: palm/trunk/SOURCE/data_output_dvrp.f90
===================================================================
--- palm/trunk/SOURCE/data_output_dvrp.f90	(revision 242)
+++ palm/trunk/SOURCE/data_output_dvrp.f90	(revision 246)
@@ -74,4 +74,5 @@
     USE cloud_parameters
     USE constants
+    USE control_parameters
     USE cpulog
     USE DVRP
@@ -83,5 +84,4 @@
     USE particle_attributes
     USE pegrid
-    USE control_parameters
 
     IMPLICIT NONE
@@ -165,5 +165,5 @@
 !--       If clipping is active and if this subdomain is clipped, find out the
 !--       number of particles and tails to be plotted; otherwise, all
-!--       particles/tails are plotted
+!--       particles/tails are plotted. dvrp_mask is used to mark the partikles.
           IF ( .NOT. use_particle_tails )  THEN
              ALLOCATE( dvrp_mask(number_of_particles) )
@@ -299,150 +299,157 @@
 !
 !--       Create an intermediate array, properly dimensioned for plot-output 
-          ALLOCATE( local_pf(nxl:nxr+1,nys:nyn+1,nzb:nz_do3d) )
+          ALLOCATE( local_pf(nxl_dvrp:nxr_dvrp+1,nys_dvrp:nyn_dvrp+1, &
+                             nzb:nz_do3d) )
 
 !
 !--       Move original array to intermediate array
-          SELECT CASE ( output_variable )
-
-             CASE ( 'u', 'u_xy', 'u_xz', 'u_yz' )
-                DO  i = nxl, nxr+1
-                   DO  j = nys, nyn+1
-                      DO  k = nzb, nz_do3d
-                         local_pf(i,j,k) = u(k,j,i)
-                      ENDDO
-                   ENDDO
-                ENDDO
-!
-!--             Replace mirrored values at lower surface by real surface values
-                IF ( output_variable == 'u_xz'  .OR. &
-                     output_variable == 'u_yz' )  THEN
-                   IF ( ibc_uv_b == 0 )  local_pf(:,:,nzb) = 0.0
-                ENDIF
-
-
-             CASE ( 'v', 'v_xy', 'v_xz', 'v_yz' )
-                DO  i = nxl, nxr+1
-                   DO  j = nys, nyn+1
-                      DO  k = nzb, nz_do3d
-                         local_pf(i,j,k) = v(k,j,i)
-                      ENDDO
-                   ENDDO
-                ENDDO
-!
-!--             Replace mirrored values at lower surface by real surface values
-                IF ( output_variable == 'v_xz'  .OR. &
-                     output_variable == 'v_yz' )  THEN
-                   IF ( ibc_uv_b == 0 )  local_pf(:,:,nzb) = 0.0
-                ENDIF
-
-             CASE ( 'w', 'w_xy', 'w_xz', 'w_yz' )
-                DO  i = nxl, nxr+1
-                   DO  j = nys, nyn+1
-                      DO  k = nzb, nz_do3d
-                         local_pf(i,j,k) = w(k,j,i)
-                      ENDDO
-                   ENDDO
-                ENDDO
+          IF ( dvrp_overlap )  THEN
+
+             SELECT CASE ( output_variable )
+
+                CASE ( 'u', 'u_xy', 'u_xz', 'u_yz' )
+                   DO  i = nxl_dvrp, nxr_dvrp+1
+                      DO  j = nys_dvrp, nyn_dvrp+1
+                         DO  k = nzb, nz_do3d
+                            local_pf(i,j,k) = u(k,j,i)
+                         ENDDO
+                      ENDDO
+                   ENDDO
+!
+!--                Replace mirrored values at lower surface by real surface
+!--                values
+                   IF ( output_variable == 'u_xz'  .OR. &
+                        output_variable == 'u_yz' )  THEN
+                      IF ( ibc_uv_b == 0 )  local_pf(:,:,nzb) = 0.0
+                   ENDIF
+
+
+                CASE ( 'v', 'v_xy', 'v_xz', 'v_yz' )
+                   DO  i = nxl_dvrp, nxr_dvrp+1
+                      DO  j = nys_dvrp, nyn_dvrp+1
+                         DO  k = nzb, nz_do3d
+                            local_pf(i,j,k) = v(k,j,i)
+                         ENDDO
+                      ENDDO
+                   ENDDO
+!
+!--                Replace mirrored values at lower surface by real surface
+!--                values
+                   IF ( output_variable == 'v_xz'  .OR. &
+                        output_variable == 'v_yz' )  THEN
+                      IF ( ibc_uv_b == 0 )  local_pf(:,:,nzb) = 0.0
+                   ENDIF
+
+                CASE ( 'w', 'w_xy', 'w_xz', 'w_yz' )
+                   DO  i = nxl_dvrp, nxr_dvrp+1
+                      DO  j = nys_dvrp, nyn_dvrp+1
+                         DO  k = nzb, nz_do3d
+                            local_pf(i,j,k) = w(k,j,i)
+                         ENDDO
+                      ENDDO
+                   ENDDO
 ! Averaging for Langmuir circulation
-!                DO  k = nzb, nz_do3d
-!                   DO  j = nys+1, nyn
-!                      DO  i = nxl, nxr+1
-!                         local_pf(i,j,k) = 0.25 * local_pf(i,j-1,k) + &
-!                                           0.50 * local_pf(i,j,k)   + &
-!                                           0.25 * local_pf(i,j+1,k)
+!                   DO  k = nzb, nz_do3d
+!                      DO  j = nys_dvrp+1, nyn_dvrp
+!                         DO  i = nxl_dvrp, nxr_dvrp+1
+!                            local_pf(i,j,k) = 0.25 * local_pf(i,j-1,k) + &
+!                                              0.50 * local_pf(i,j,k)   + &
+!                                              0.25 * local_pf(i,j+1,k)
+!                         ENDDO
 !                      ENDDO
 !                   ENDDO
-!                ENDDO
-
-             CASE ( 'p', 'p_xy', 'p_xz', 'p_yz' )
-                DO  i = nxl, nxr+1
-                   DO  j = nys, nyn+1
-                      DO  k = nzb, nz_do3d
-                         local_pf(i,j,k) = p(k,j,i)
-                      ENDDO
-                   ENDDO
-                ENDDO
-
-             CASE ( 'pt', 'pt_xy', 'pt_xz', 'pt_yz' )
-                IF ( .NOT. cloud_physics ) THEN
-                   DO  i = nxl, nxr+1
-                      DO  j = nys, nyn+1
+
+                CASE ( 'p', 'p_xy', 'p_xz', 'p_yz' )
+                   DO  i = nxl_dvrp, nxr_dvrp+1
+                      DO  j = nys_dvrp, nyn_dvrp+1
                          DO  k = nzb, nz_do3d
-                            local_pf(i,j,k) = pt(k,j,i)
-                         ENDDO
-                      ENDDO
-                   ENDDO
-                ELSE
-                   DO  i = nxl, nxr+1
-                      DO  j = nys, nyn+1
-                         DO  k = nzb, nz_do3d
-                            local_pf(i,j,k) = pt(k,j,i) + l_d_cp * pt_d_t(k) * &
-                                                          ql(k,j,i)
-                         ENDDO
-                      ENDDO
-                   ENDDO
-                ENDIF
-
-             CASE ( 'q', 'q_xy', 'q_xz', 'q_yz' )
-                IF ( humidity  .OR.  passive_scalar )  THEN
-                   DO  i = nxl, nxr+1
-                      DO  j = nys, nyn+1
-                         DO  k = nzb, nz_do3d
-                            local_pf(i,j,k) = q(k,j,i)
-                         ENDDO
-                      ENDDO
-                   ENDDO            
-                ELSE
-                   IF ( myid == 0 )  THEN
-                      PRINT*, '+++ data_output_dvrp: if humidity/passive_scalar = ', & 
-                              'FALSE output of ', output_variable,            &
-                              'is not provided' 
+                            local_pf(i,j,k) = p(k,j,i)
+                         ENDDO
+                      ENDDO
+                   ENDDO
+
+                CASE ( 'pt', 'pt_xy', 'pt_xz', 'pt_yz' )
+                   IF ( .NOT. cloud_physics ) THEN
+                      DO  i = nxl_dvrp, nxr_dvrp+1
+                         DO  j = nys_dvrp, nyn_dvrp+1
+                            DO  k = nzb, nz_do3d
+                               local_pf(i,j,k) = pt(k,j,i)
+                            ENDDO
+                         ENDDO
+                      ENDDO
+                   ELSE
+                      DO  i = nxl_dvrp, nxr_dvrp+1
+                         DO  j = nys_dvrp, nyn_dvrp+1
+                            DO  k = nzb, nz_do3d
+                               local_pf(i,j,k) = pt(k,j,i) + l_d_cp * &
+                                                 pt_d_t(k) * ql(k,j,i)
+                            ENDDO
+                         ENDDO
+                      ENDDO
                    ENDIF
-                ENDIF
+
+                CASE ( 'q', 'q_xy', 'q_xz', 'q_yz' )
+                   IF ( humidity  .OR.  passive_scalar )  THEN
+                      DO  i = nxl_dvrp, nxr_dvrp+1
+                         DO  j = nys_dvrp, nyn_dvrp+1
+                            DO  k = nzb, nz_do3d
+                               local_pf(i,j,k) = q(k,j,i)
+                            ENDDO
+                         ENDDO
+                      ENDDO            
+                   ELSE
+                      IF ( myid == 0 )  THEN
+                         PRINT*, '+++ data_output_dvrp: if humidity/passive_scalar = ', & 
+                                 'FALSE output of ', output_variable,            &
+                                 'is not provided' 
+                      ENDIF
+                   ENDIF
              
-             CASE ( 'ql', 'ql_xy', 'ql_xz', 'ql_yz' )
-                IF ( cloud_physics  .OR.  cloud_droplets )  THEN
-                   DO  i = nxl, nxr+1
-                      DO  j = nys, nyn+1
-                         DO  k = nzb, nz_do3d
-                            local_pf(i,j,k) = ql(k,j,i)
-                         ENDDO
-                      ENDDO
-                   ENDDO
-                ELSE
-                   IF ( myid == 0 ) THEN
-                      PRINT*, '+++ data_output_dvrp: if cloud_physics = FALSE ', & 
-                              'output of ', output_variable, 'is not provided' 
+                CASE ( 'ql', 'ql_xy', 'ql_xz', 'ql_yz' )
+                   IF ( cloud_physics  .OR.  cloud_droplets )  THEN
+                      DO  i = nxl_dvrp, nxr_dvrp+1
+                         DO  j = nys_dvrp, nyn_dvrp+1
+                            DO  k = nzb, nz_do3d
+                               local_pf(i,j,k) = ql(k,j,i)
+                            ENDDO
+                         ENDDO
+                      ENDDO
+                   ELSE
+                      IF ( myid == 0 ) THEN
+                         PRINT*, '+++ data_output_dvrp: if cloud_physics = FALSE ', & 
+                                 'output of ', output_variable, 'is not provided' 
+                      ENDIF
                    ENDIF
-                ENDIF
-
-             CASE ( 'u*_xy' )
-                DO  i = nxl, nxr+1
-                   DO  j = nys, nyn+1
-                      local_pf(i,j,nzb+1) = us(j,i)
-                   ENDDO
-                ENDDO
-                slicer_position = zu(nzb+1)
-
-             CASE ( 't*_xy' )
-                DO  i = nxl, nxr+1
-                   DO  j = nys, nyn+1
-                      local_pf(i,j,nzb+1) = ts(j,i)
-                   ENDDO
-                ENDDO
-                slicer_position = zu(nzb+1)
-
-
-             CASE DEFAULT
-!
-!--             The DEFAULT case is reached either if output_variable contains
-!--             unsupported variable or if the user has coded a special case in
-!--             the user interface. There, the subroutine user_data_output_dvrp 
-!--             checks which of these two conditions applies.
-                CALL user_data_output_dvrp( output_variable, local_pf )
-
-
-          END SELECT
-
+
+                CASE ( 'u*_xy' )
+                   DO  i = nxl_dvrp, nxr_dvrp+1
+                      DO  j = nys_dvrp, nyn_dvrp+1
+                         local_pf(i,j,nzb+1) = us(j,i)
+                      ENDDO
+                   ENDDO
+                   slicer_position = zu(nzb+1)
+
+                CASE ( 't*_xy' )
+                   DO  i = nxl_dvrp, nxr_dvrp+1
+                      DO  j = nys_dvrp, nyn_dvrp+1
+                         local_pf(i,j,nzb+1) = ts(j,i)
+                      ENDDO
+                   ENDDO
+                   slicer_position = zu(nzb+1)
+
+
+                CASE DEFAULT
+!
+!--                The DEFAULT case is reached either if output_variable
+!--                contains unsupported variable or if the user has coded a
+!--                special case in the user interface. There, the subroutine
+!--                user_data_output_dvrp checks which of these two conditions
+!--                applies.
+                   CALL user_data_output_dvrp( output_variable, local_pf )
+
+
+             END SELECT
+
+          ENDIF
 
           IF ( mode_dvrp(m)(1:10) == 'isosurface' )  THEN
@@ -489,5 +496,10 @@
              CALL DVRP_THRESHOLD( -(m-1)-1, tmp_c_alpha )
 
-             tmp_th = threshold(tv)
+             IF ( dvrp_overlap )  THEN
+                tmp_th = threshold(tv)
+             ELSE
+                tmp_th = 1.0   ! nothing is plotted because array values are 0
+             ENDIF
+
              CALL DVRP_THRESHOLD( m-1, tmp_th )
              CALL DVRP_VISUALIZE( m-1, 21, dvrp_filecount )
