Index: palm/trunk/SOURCE/data_output_ptseries.f90
===================================================================
--- palm/trunk/SOURCE/data_output_ptseries.f90	(revision 824)
+++ palm/trunk/SOURCE/data_output_ptseries.f90	(revision 825)
@@ -4,5 +4,5 @@
 ! Current revisions:
 ! -----------------
-! mean particle radius added as output quantity.
+! mean/minimum/maximum particle radius added as output quantity.
 ! particle attributes speed_x|y|z_sgs renamed rvar1|2|3.
 !
@@ -35,4 +35,5 @@
 !------------------------------------------------------------------------------!
 
+    USE cloud_parameters
     USE control_parameters
     USE cpulog
@@ -48,6 +49,5 @@
     INTEGER ::  i, inum, j, n
 
-    REAL, DIMENSION(0:number_of_particle_groups,30) ::  pts_value, pts_value_l
-
+    REAL, DIMENSION(:,:), ALLOCATABLE ::  pts_value, pts_value_l
 
 
@@ -70,5 +70,9 @@
     ENDIF
 
+    ALLOCATE( pts_value(0:number_of_particle_groups,dopts_num), &
+              pts_value_l(0:number_of_particle_groups,dopts_num) )
+
     pts_value_l = 0.0
+    pts_value_l(:,16) = 9999999.9    ! for calculation of minimum radius
 
 !
@@ -88,7 +92,9 @@
        pts_value_l(0,7)  = pts_value_l(0,7) + particles(n)%speed_y     ! mean v
        pts_value_l(0,8)  = pts_value_l(0,8) + particles(n)%speed_z     ! mean w
-       pts_value_l(0,9)  = pts_value_l(0,9) + particles(n)%rvar1     ! mean sgsu
-       pts_value_l(0,10) = pts_value_l(0,10) + particles(n)%rvar2    ! mean sgsv
-       pts_value_l(0,11) = pts_value_l(0,11) + particles(n)%rvar3    ! mean sgsw
+       IF ( .NOT. curvature_solution_effects )  THEN
+          pts_value_l(0,9)  = pts_value_l(0,9) + particles(n)%rvar1  ! mean sgsu
+          pts_value_l(0,10) = pts_value_l(0,10) + particles(n)%rvar2 ! mean sgsv
+          pts_value_l(0,11) = pts_value_l(0,11) + particles(n)%rvar3 ! mean sgsw
+       ENDIF
        IF ( particles(n)%speed_z > 0.0 )  THEN
           pts_value_l(0,12) = pts_value_l(0,12) + 1.0  ! # of upward moving prts
@@ -99,7 +105,9 @@
                                             particles(n)%speed_z ! mean w down
        ENDIF
-       pts_value_l(0,15) = pts_value_l(0,15) + particles(n)%radius
-       pts_value_l(0,16) = number_of_particles
-       pts_value_l(0,17) = number_of_particles
+       pts_value_l(0,15) = pts_value_l(0,15) + particles(n)%radius ! mean rad
+       pts_value_l(0,16) = MIN( pts_value_l(0,16), particles(n)%radius ) ! minrad
+       pts_value_l(0,17) = MAX( pts_value_l(0,17), particles(n)%radius ) ! maxrad
+       pts_value_l(0,18) = number_of_particles
+       pts_value_l(0,19) = number_of_particles
 
 !
@@ -119,7 +127,9 @@
           pts_value_l(j,7)  = pts_value_l(j,7)  + particles(n)%speed_y
           pts_value_l(j,8)  = pts_value_l(j,8)  + particles(n)%speed_z
-          pts_value_l(j,9)  = pts_value_l(j,9)  + particles(n)%rvar1
-          pts_value_l(j,10) = pts_value_l(j,10) + particles(n)%rvar2
-          pts_value_l(j,11) = pts_value_l(j,11) + particles(n)%rvar3
+          IF ( .NOT. curvature_solution_effects )  THEN
+             pts_value_l(j,9)  = pts_value_l(j,9)  + particles(n)%rvar1
+             pts_value_l(j,10) = pts_value_l(j,10) + particles(n)%rvar2
+             pts_value_l(j,11) = pts_value_l(j,11) + particles(n)%rvar3
+          ENDIF
           IF ( particles(n)%speed_z > 0.0 )  THEN
              pts_value_l(j,12) = pts_value_l(j,12) + 1.0
@@ -129,6 +139,8 @@
           ENDIF
           pts_value_l(j,15) = pts_value_l(j,15) + particles(n)%radius
-          pts_value_l(j,16) = pts_value_l(j,16) + 1.0
-          pts_value_l(j,17) = pts_value_l(j,17) + 1.0
+          pts_value_l(j,16) = MIN( pts_value(j,16), particles(n)%radius )
+          pts_value_l(j,17) = MAX( pts_value(j,17), particles(n)%radius )
+          pts_value_l(j,18) = pts_value_l(j,18) + 1.0
+          pts_value_l(j,19) = pts_value_l(j,19) + 1.0
 
        ENDIF
@@ -146,15 +158,21 @@
     IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     CALL MPI_ALLREDUCE( pts_value_l(0,16), pts_value(0,16), inum, MPI_REAL, &
+                        MPI_MIN, comm2d, ierr )
+    IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+    CALL MPI_ALLREDUCE( pts_value_l(0,17), pts_value(0,17), inum, MPI_REAL, &
                         MPI_MAX, comm2d, ierr )
     IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
-    CALL MPI_ALLREDUCE( pts_value_l(0,17), pts_value(0,17), inum, MPI_REAL, &
+    CALL MPI_ALLREDUCE( pts_value_l(0,18), pts_value(0,18), inum, MPI_REAL, &
+                        MPI_MAX, comm2d, ierr )
+    IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+    CALL MPI_ALLREDUCE( pts_value_l(0,19), pts_value(0,19), inum, MPI_REAL, &
                         MPI_MIN, comm2d, ierr )
 #else
-    pts_value(:,1:17) = pts_value_l(:,1:17)
+    pts_value(:,1:19) = pts_value_l(:,1:19)
 #endif
 
 !
-!-- Normalize the above calculated quantities with the total number of
-!-- particles
+!-- Normalize the above calculated quantities (except min/max values) with the
+!-- total number of particles
     IF ( number_of_particle_groups > 1 )  THEN
        inum = number_of_particle_groups
@@ -186,22 +204,24 @@
     DO  n = 1, number_of_particles
 
-       pts_value_l(0,18) = pts_value_l(0,18) + ( particles(n)%x - &
+       pts_value_l(0,20) = pts_value_l(0,20) + ( particles(n)%x - &
                            particles(n)%origin_x - pts_value(0,2) )**2 ! x*2
-       pts_value_l(0,19) = pts_value_l(0,19) + ( particles(n)%y - &
+       pts_value_l(0,21) = pts_value_l(0,21) + ( particles(n)%y - &
                            particles(n)%origin_y - pts_value(0,3) )**2 ! y*2
-       pts_value_l(0,20) = pts_value_l(0,20) + ( particles(n)%z - &
+       pts_value_l(0,22) = pts_value_l(0,22) + ( particles(n)%z - &
                            particles(n)%origin_z - pts_value(0,4) )**2 ! z*2
-       pts_value_l(0,21) = pts_value_l(0,21) + ( particles(n)%speed_x - &
-                                               pts_value(0,6) )**2     ! u*2
-       pts_value_l(0,22) = pts_value_l(0,22) + ( particles(n)%speed_y - &
-                                               pts_value(0,7) )**2     ! v*2
-       pts_value_l(0,23) = pts_value_l(0,23) + ( particles(n)%speed_z - &
-                                               pts_value(0,8) )**2     ! w*2
-       pts_value_l(0,24) = pts_value_l(0,24) + ( particles(n)%rvar1 - &
-                                               pts_value(0,9) )**2     ! u"2
-       pts_value_l(0,25) = pts_value_l(0,25) + ( particles(n)%rvar2 - &
-                                               pts_value(0,10) )**2    ! v"2
-       pts_value_l(0,26) = pts_value_l(0,26) + ( particles(n)%rvar3 - &
-                                               pts_value(0,11) )**2    ! w"2
+       pts_value_l(0,23) = pts_value_l(0,23) + ( particles(n)%speed_x - &
+                                                pts_value(0,6) )**2   ! u*2
+       pts_value_l(0,24) = pts_value_l(0,24) + ( particles(n)%speed_y - &
+                                                 pts_value(0,7) )**2   ! v*2
+       pts_value_l(0,25) = pts_value_l(0,25) + ( particles(n)%speed_z - &
+                                                 pts_value(0,8) )**2   ! w*2
+       IF ( .NOT. curvature_solution_effects )  THEN
+          pts_value_l(0,26) = pts_value_l(0,26) + ( particles(n)%rvar1 - &
+                                                    pts_value(0,9) )**2   ! u"2
+          pts_value_l(0,27) = pts_value_l(0,27) + ( particles(n)%rvar2 - &
+                                                    pts_value(0,10) )**2  ! v"2
+          pts_value_l(0,28) = pts_value_l(0,28) + ( particles(n)%rvar3 - &
+                                                    pts_value(0,11) )**2  ! w"2
+       ENDIF
 !
 !--    Repeat the same for the respective particle group
@@ -209,31 +229,33 @@
           j = particles(n)%group
 
-          pts_value_l(j,18) = pts_value_l(j,18) + ( particles(n)%x - &
+          pts_value_l(j,20) = pts_value_l(j,20) + ( particles(n)%x - &
                               particles(n)%origin_x - pts_value(j,2) )**2
-          pts_value_l(j,19) = pts_value_l(j,19) + ( particles(n)%y - &
+          pts_value_l(j,21) = pts_value_l(j,21) + ( particles(n)%y - &
                               particles(n)%origin_y - pts_value(j,3) )**2
-          pts_value_l(j,20) = pts_value_l(j,20) + ( particles(n)%z - &
+          pts_value_l(j,22) = pts_value_l(j,22) + ( particles(n)%z - &
                               particles(n)%origin_z - pts_value(j,4) )**2
-          pts_value_l(j,21) = pts_value_l(j,21) + ( particles(n)%speed_x - &
-                                                  pts_value(j,6) )**2
-          pts_value_l(j,22) = pts_value_l(j,22) + ( particles(n)%speed_y - &
-                                                  pts_value(j,7) )**2
-          pts_value_l(j,23) = pts_value_l(j,23) + ( particles(n)%speed_z - &
-                                                  pts_value(j,8) )**2
-          pts_value_l(j,24) = pts_value_l(j,24) + ( particles(n)%rvar1 -   &
-                                                  pts_value(j,9) )**2
-          pts_value_l(j,25) = pts_value_l(j,25) + ( particles(n)%rvar2 -   &
-                                                  pts_value(j,10) )**2
-          pts_value_l(j,26) = pts_value_l(j,26) + ( particles(n)%rvar3 -   &
-                                                  pts_value(j,11) )**2
+          pts_value_l(j,23) = pts_value_l(j,23) + ( particles(n)%speed_x - &
+                                                    pts_value(j,6) )**2
+          pts_value_l(j,24) = pts_value_l(j,24) + ( particles(n)%speed_y - &
+                                                    pts_value(j,7) )**2
+          pts_value_l(j,25) = pts_value_l(j,25) + ( particles(n)%speed_z - &
+                                                    pts_value(j,8) )**2
+          IF ( .NOT. curvature_solution_effects )  THEN
+             pts_value_l(j,26) = pts_value_l(j,26) + ( particles(n)%rvar1 - &
+                                                       pts_value(j,9) )**2
+             pts_value_l(j,27) = pts_value_l(j,27) + ( particles(n)%rvar2 - &
+                                                       pts_value(j,10) )**2
+             pts_value_l(j,28) = pts_value_l(j,28) + ( particles(n)%rvar3 - &
+                                                       pts_value(j,11) )**2
+          ENDIF
        ENDIF
 
     ENDDO
 
-    pts_value_l(0,27) = ( number_of_particles - pts_value(0,1) / numprocs )**2
+    pts_value_l(0,29) = ( number_of_particles - pts_value(0,1) / numprocs )**2
                                                  ! variance of particle numbers
     IF ( number_of_particle_groups > 1 )  THEN
        DO  j = 1, number_of_particle_groups
-          pts_value_l(j,27) = ( pts_value_l(j,1) - &
+          pts_value_l(j,29) = ( pts_value_l(j,1) - &
                                 pts_value(j,1) / numprocs )**2
        ENDDO
@@ -246,8 +268,8 @@
 
     IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
-    CALL MPI_ALLREDUCE( pts_value_l(0,18), pts_value(0,18), inum*10, MPI_REAL, &
+    CALL MPI_ALLREDUCE( pts_value_l(0,20), pts_value(0,20), inum*10, MPI_REAL, &
                         MPI_SUM, comm2d, ierr )
 #else
-    pts_value(:,18:27) = pts_value_l(:,18:27)
+    pts_value(:,20:29) = pts_value_l(:,20:29)
 #endif
 
@@ -264,7 +286,7 @@
 
        IF ( pts_value(j,1) > 0.0 )  THEN
-          pts_value(j,18:26) = pts_value(j,18:26) / pts_value(j,1)
-       ENDIF
-       pts_value(j,27) = pts_value(j,27) / numprocs
+          pts_value(j,20:28) = pts_value(j,20:28) / pts_value(j,1)
+       ENDIF
+       pts_value(j,29) = pts_value(j,29) / numprocs
 
     ENDDO
@@ -286,4 +308,6 @@
 #endif
 
+    DEALLOCATE( pts_value, pts_value_l )
+
     CALL cpu_log( log_point(36), 'data_output_ptseries','stop', 'nobarrier' )
 
