Index: palm/trunk/DOC/tec/technical_documentation.html
===================================================================
--- palm/trunk/DOC/tec/technical_documentation.html	(revision 228)
+++ palm/trunk/DOC/tec/technical_documentation.html	(revision 229)
@@ -12,5 +12,5 @@
 <br><table nosave="" cellpadding="0" cellspacing="0"> <caption>&nbsp; <br> </caption><tbody>
 </tbody><tbody> </tbody> <tbody> <tr nosave=""> <td nosave=""><b>Current
-model version:</b></td> <td><span style="font-weight: bold;">3.6</span></td> </tr>
+model version:</b></td> <td><span style="font-weight: bold;">3.6 (rev 228)</span></td> </tr>
 <tr nosave=""> <td nosave=""><b>Last
 change of this document</b>:&nbsp;</td> <td nosave=""><b>$Id$</b></td> </tr>
@@ -2434,5 +2434,5 @@
 init_3d_model, init_dvrp, local_stop, plant_canopy_model, poismg,
 prandtl_fluxes, pres, read_3d_binary, user_interface, wall_fluxes,
-write_3d_binary<br></td></tr><tr><td style="vertical-align: top;">02/02/09</td><td style="vertical-align: top;">SR</td><td style="vertical-align: top;">3.6</td><td style="vertical-align: top;">N</td><td style="vertical-align: top;">This
+write_3d_binary<br></td></tr><tr><td style="vertical-align: top;">02/02/09</td><td style="vertical-align: top;">SR</td><td style="vertical-align: top;">3.6<br>(r228)</td><td style="vertical-align: top;">N</td><td style="vertical-align: top;">This
 release contains further additions, changes, and bugfixes for the
 SGI-ICE system, as well as important changes like the splitting of the
Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 228)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 229)
@@ -10,2 +10,7 @@
 ------
 
+Bugfix: several tail counters are initialized, particle_tail_coordinates is
+only written to file if its third index is > 0, arrays for tails are allocated
+with a minimum size of 10 tails if there is no tail initially (init_particles,
+advec_particles)
+ 
Index: palm/trunk/SOURCE/advec_particles.f90
===================================================================
--- palm/trunk/SOURCE/advec_particles.f90	(revision 228)
+++ palm/trunk/SOURCE/advec_particles.f90	(revision 229)
@@ -4,4 +4,6 @@
 ! Actual revisions:
 ! -----------------
+! Bugfix: several tail counters are initialized, particle_tail_coordinates is
+! only written to file if its third index is > 0
 ! TEST: PRINT statements on unit 9 (commented out)
 !
@@ -159,5 +161,7 @@
        WRITE ( 85 )  maximum_number_of_tailpoints, maximum_number_of_tails, &
                      number_of_tails
-       WRITE ( 85 )  particle_tail_coordinates
+       IF ( maximum_number_of_tails > 0 )  THEN
+          WRITE ( 85 )  particle_tail_coordinates
+       ENDIF
        CALL close_file( 85 )
 
@@ -823,8 +827,12 @@
        trrp_count_recv   = 0
        trsp_count_recv   = 0
+       trlpt_count_recv  = 0
+       trnpt_count_recv  = 0
+       trrpt_count_recv  = 0
+       trspt_count_recv  = 0
        IF ( use_particle_tails )  THEN
           tail_mask     = .TRUE.
-          deleted_tails = 0
        ENDIF
+       deleted_tails = 0
 
 
Index: palm/trunk/SOURCE/init_particles.f90
===================================================================
--- palm/trunk/SOURCE/init_particles.f90	(revision 228)
+++ palm/trunk/SOURCE/init_particles.f90	(revision 229)
@@ -4,5 +4,6 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix: arrays for tails are allocated with a minimum size of 10 tails if
+! there is no tail initially
 !
 ! Former revisions:
@@ -457,4 +458,9 @@
           ENDDO
           maximum_number_of_tails = factor * INT( value )
+!
+!--       Create a minimum number of tails in case that there is no tail
+!--       initially (otherwise, index errors will occur when adressing the
+!--       arrays below)
+          IF ( maximum_number_of_tails == 0 )  maximum_number_of_tails = 10
 
           ALLOCATE( particle_tail_coordinates(maximum_number_of_tailpoints,5, &
