How do I change this algorithm to incorporate multiple particles in the random walk rather than just one particle?
<p>What do I do to add multiple particles to the program below? It is just a simple random walk in 3 dimensions.</p>

<pre><code>program RW3D

    implicit none

    integer :: x, y, z, i
    real :: P

    x = 0
    y = 0
    z = 0

    do i = 1, 100
       call random_number (p)

        write (1,*) i, x, y, z

        if (p .lt. 1.0/6) then
            x = x - 1
         else if (p .gt. 1.0/6 .lt. 2.0/6) then
            y = y - 1
         else if (p .lt. 3.0/6) then
            z = z - 1
         else if (p .lt. 4.0/6) then
            x = x + 1
         else if (p .lt. 5.0/6) then
            y = y + 1
         else
            z = z + 1
        end if

    end do

end program RW3D
</code></pre>