! RS6000 SP: Practical MPI programming
PROGRAM randomwalk 
  PARAMETER (n = 10000) 
  INTEGER itotal(0:9)
  REAL seed 
  pi = 3.1415926 
  DO i = 0, 9
     itotal(i) = 0 
  END DO

  ! Uwaga: zalezy od kompilatora
  ! tutaj: gfortran
  iseed = 5
  CALL srand(iseed) 
  DO i = 1, n
     x = 0.0 
     y = 0.0 
     DO istep = 1, 10
        angle = 2.0 * pi * rand()
        x = x + cos(angle) 
        y = y + sin(angle)
     END DO
     itemp = sqrt(x*x + y*y) 
     itotal(itemp) = itotal(itemp) + 1
  END DO
PRINT *,"total =",itotal 
END PROGRAM randomwalk
