Index: palm/trunk/SOURCE/lpm_init.f90
===================================================================
--- palm/trunk/SOURCE/lpm_init.f90	(revision 2181)
+++ palm/trunk/SOURCE/lpm_init.f90	(revision 2182)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! Added parameters for simplified particle initialization.
 ! 
 ! Former revisions:
@@ -170,4 +170,5 @@
                 max_number_of_particle_groups, maximum_number_of_particles,    &
                 min_nr_particle, mpi_particle_type,                            &
+                number_concentration, number_particles_per_gridbox,            &
                 number_of_particles,                                           &
                 number_of_particle_groups, number_of_sublayers,                &
@@ -230,4 +231,5 @@
 #endif
 
+    REAL(wp) ::  div                             !< 
     REAL(wp) ::  height_int                      !<
     REAL(wp) ::  height_p                        !<
@@ -292,4 +294,24 @@
     IF ( pdy(1) == 9999999.9_wp  .OR.  pdy(1) == 0.0_wp )  pdy(1) = dy
     IF ( pdz(1) == 9999999.9_wp  .OR.  pdz(1) == 0.0_wp )  pdz(1) = zu(2) - zu(1)
+
+!
+!-- If number_particles_per_gridbox is set, the parametres pdx, pdy and pdz are
+!-- calculated diagnostically. Therfore an isotropic distribution is prescribed.
+    IF ( number_particles_per_gridbox /= -1 .AND.   & 
+         number_particles_per_gridbox >= 1 )    THEN
+       pdx(1) = (( dx * dy * ( zu(2) - zu(1) ) ) /  & 
+             REAL(number_particles_per_gridbox))**0.3333333_wp
+!
+!--    Ensure a smooth value (two significant digits) of distance between 
+!--    particles (pdx, pdy, pdz).
+       div = 1000.0_wp
+       DO  WHILE ( pdx(1) < div )
+          div = div / 10.0_wp
+       ENDDO
+       pdx(1) = NINT( pdx(1) * 100.0_wp / div ) * div / 100.0_wp
+       pdy(1) = pdx(1)
+       pdz(1) = pdx(1)
+
+    ENDIF
 
     DO  j = 2, number_of_particle_groups
@@ -578,4 +600,11 @@
           local_count = prt_count   ! Start address of new particles
        ENDIF
+
+!
+!--    Calculate initial_weighting_factor diagnostically
+       IF ( number_concentration /= -1.0_wp .AND. number_concentration > 0.0_wp ) THEN
+          initial_weighting_factor =  number_concentration * 1.0E6_wp *             & 
+                                      pdx(1) * pdy(1) * pdz(1) 
+       END IF
 
        n = 0
@@ -662,4 +691,5 @@
 
                             local_count(kp,jp,ip) = local_count(kp,jp,ip) + 1
+
                             IF ( .NOT. first_stride )  THEN
                                IF ( ip < nxl  .OR.  jp < nys  .OR.  kp < nzb+1 )  THEN
@@ -714,9 +744,8 @@
                             alloc_factor / 100.0_wp ) ), min_nr_particle )
                          IF( alloc_size > SIZE( grid_particles(kp,jp,ip)%particles) )  THEN
-                           CALL realloc_particles_array(ip,jp,kp,alloc_size)
+                            CALL realloc_particles_array(ip,jp,kp,alloc_size)
                          ENDIF
                       ENDIF
                    ENDIF
-
                 ENDDO
              ENDDO
@@ -725,4 +754,6 @@
 
     ENDDO
+
+
 
     local_start = prt_count+1
@@ -740,6 +771,6 @@
              DO  n = local_start(kp,jp,ip), number_of_particles  !only new particles 
 
-                particles(n)%id1 = 10000 * grid_particles(kp,jp,ip)%id_counter + kp
-                particles(n)%id2 = 10000 * jp + ip
+                particles(n)%id1 = 10000_iwp * grid_particles(kp,jp,ip)%id_counter + kp
+                particles(n)%id2 = 10000_iwp * jp + ip
 
                 grid_particles(kp,jp,ip)%id_counter =                          &
Index: palm/trunk/SOURCE/mod_particle_attributes.f90
===================================================================
--- palm/trunk/SOURCE/mod_particle_attributes.f90	(revision 2181)
+++ palm/trunk/SOURCE/mod_particle_attributes.f90	(revision 2182)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! Added parameters for simplified particle initialization.
 ! 
 ! Former revisions:
@@ -93,4 +93,5 @@
                      number_of_particle_groups = 1,                            &
                      number_of_sublayers = 20,                                 &
+                     number_particles_per_gridbox = -1,                        &
                      offset_ocean_nzt = 0,                                     &
                      offset_ocean_nzt_m1 = 0, particles_per_point = 1,         &
@@ -125,4 +126,5 @@
                  end_time_prel = 9999999.9_wp,                                 &
                  initial_weighting_factor = 1.0_wp,                            &
+                 number_concentration     = -1.0_wp,                           &
                  particle_advection_start = 0.0_wp,                            &
                  sgs_wf_part, time_prel = 0.0_wp, time_sort_particles = 0.0_wp,&
Index: palm/trunk/SOURCE/package_parin.f90
===================================================================
--- palm/trunk/SOURCE/package_parin.f90	(revision 2181)
+++ palm/trunk/SOURCE/package_parin.f90	(revision 2182)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Added parameters for simplified particle initialization.
 ! 
 ! Former revisions:
@@ -165,5 +165,6 @@
                dt_write_particle_data, end_time_prel, initial_weighting_factor,&
                init_aerosol_probabilistic, min_nr_particle,                    &
-               monodisperse_aerosols, n1, n2, n3, number_of_particle_groups,   &
+               monodisperse_aerosols, n1, n2, n3, number_concentration,        & 
+               number_of_particle_groups, number_particles_per_gridbox,        &
                particles_per_point, particle_advection,                        &
                particle_advection_start,                                       &
@@ -207,5 +208,7 @@
                                   init_aerosol_probabilistic,                  &
                                   min_nr_particle, monodisperse_aerosols,      &
-                                  n1, n2, n3, number_of_particle_groups,       &
+                                  n1, n2, n3, number_concentration,            &
+                                  number_of_particle_groups,                   &
+                                  number_particles_per_gridbox,                &
                                   particles_per_point,                         &
                                   particle_advection_start,                    &
