Index: palm/trunk/SOURCE/lpm_collision_kernels_mod.f90
===================================================================
--- palm/trunk/SOURCE/lpm_collision_kernels_mod.f90	(revision 1857)
+++ palm/trunk/SOURCE/lpm_collision_kernels_mod.f90	(revision 1858)
@@ -19,5 +19,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Interpolation of collision kernels adjusted to more reasonable values.
+! Reformatting of the code. 
 ! 
 ! Former revisions:
@@ -27,5 +28,4 @@
 ! 1850 2016-04-08 13:29:27Z maronga
 ! Module renamed
-!
 ! 
 ! 1822 2016-04-07 07:49:42Z hoffmann
@@ -195,7 +195,7 @@
 !
 !--       Calculate the radius class bounds with logarithmic distances
-!--       in the interval [1.0E-6, 2.0E-4] m
+!--       in the interval [1.0E-6, 1000.0E-6] m
           rclass_lbound = LOG( 1.0E-6_wp )
-          rclass_ubound = LOG( 2.0E-4_wp )
+          rclass_ubound = LOG( 1000.0E-6_wp )
           radclass(1)   = EXP( rclass_lbound )
           DO  i = 2, radius_classes
@@ -206,7 +206,7 @@
 
 !
-!--       Set the class bounds for dissipation in interval [0.0, 0.1] m**2/s**3
+!--       Set the class bounds for dissipation in interval [0.0, 600.0] cm**2/s**3
           DO  i = 1, dissipation_classes
-             epsclass(i) = 0.1_wp * REAL( i, KIND=wp ) / dissipation_classes
+             epsclass(i) = 0.06_wp * REAL( i, KIND=wp ) / dissipation_classes
           ENDDO
 !
@@ -286,9 +286,4 @@
           DEALLOCATE( ec, ecf, epsclass, gck, hkernel, winf )
 
-       ELSEIF( collision_kernel == 'hall'  .OR.  collision_kernel == 'wang' ) &
-       THEN
-!
-!--       Initial settings for Hall- and Wang-Kernel
-!--       To be done: move here parts from turbsd, fallg, ecoll, etc.
        ENDIF
 
@@ -307,5 +302,5 @@
 
        USE particle_attributes,                                                &
-           ONLY:  prt_count, radius_classes, wang_kernel
+           ONLY:  number_of_particles, prt_count, radius_classes, wang_kernel
 
        IMPLICIT NONE
@@ -316,18 +311,17 @@
        INTEGER(iwp) ::  j1     !<
        INTEGER(iwp) ::  k1     !<
-       INTEGER(iwp) ::  pend   !<
-       INTEGER(iwp) ::  pstart !<
-
-
-       pstart = 1
-       pend   = prt_count(k1,j1,i1)
-       radius_classes = prt_count(k1,j1,i1)
-
-       ALLOCATE( ec(1:radius_classes,1:radius_classes), &
-                 radclass(1:radius_classes), winf(1:radius_classes) )
+
+
+       number_of_particles = prt_count(k1,j1,i1)
+       radius_classes      = number_of_particles   ! necessary to use the same
+                                                   ! subroutines as for 
+                                                   ! precalculated kernels
+
+       ALLOCATE( ec(1:number_of_particles,1:number_of_particles), &
+                 radclass(1:number_of_particles), winf(1:number_of_particles) )
 
 !
 !--    Store particle radii on the radclass array
-       radclass(1:radius_classes) = particles(pstart:pend)%radius
+       radclass(1:number_of_particles) = particles(1:number_of_particles)%radius
 
        IF ( wang_kernel )  THEN
@@ -341,6 +335,6 @@
 !
 !--       Call routines to calculate efficiencies for the Wang kernel
-          ALLOCATE( gck(1:radius_classes,1:radius_classes), &
-                    ecf(1:radius_classes,1:radius_classes) )
+          ALLOCATE( gck(1:number_of_particles,1:number_of_particles), &
+                    ecf(1:number_of_particles,1:number_of_particles) )
 
           CALL turbsd
@@ -348,7 +342,7 @@
           CALL effic
 
-          DO  j = 1, radius_classes
-             DO  i =  1, radius_classes
-                ckernel(pstart+i-1,pstart+j-1,1) = ec(i,j) * gck(i,j) * ecf(i,j)
+          DO  j = 1, number_of_particles
+             DO  i =  1, number_of_particles
+                ckernel(1+i-1,1+j-1,1) = ec(i,j) * gck(i,j) * ecf(i,j)
              ENDDO
           ENDDO
@@ -362,9 +356,8 @@
           CALL effic
 
-          DO  j = 1, radius_classes
-             DO  i =  1, radius_classes
-                ckernel(pstart+i-1,pstart+j-1,1) = pi *                       &
-                                          ( radclass(j) + radclass(i) )**2    &
-                                          * ec(i,j) * ABS( winf(j) - winf(i) )
+          DO  j = 1, number_of_particles
+             DO  i =  1, number_of_particles
+                ckernel(i,j,1) = pi * ( radclass(j) + radclass(i) )**2         &
+                                    * ec(i,j) * ABS( winf(j) - winf(i) )
              ENDDO
           ENDDO
