random_dist Subroutine

subroutine random_dist(dist_array, dist_size, nbins)

Arguments

TypeIntentOptionalAttributesName
integer, intent(out), DIMENSION(:), POINTER:: dist_array
integer, intent(in) :: dist_size
integer, intent(in) :: nbins

Contents

Source Code


Source Code

   SUBROUTINE random_dist(dist_array, dist_size, nbins)
      INTEGER, DIMENSION(:), INTENT(out), POINTER        :: dist_array
      INTEGER, INTENT(in)                                :: dist_size, nbins

      INTEGER                                            :: i

      ALLOCATE (dist_array(dist_size))
      DO i = 1, dist_size
         dist_array(i) = MODULO(nbins - i, nbins)
      END DO

   END SUBROUTINE random_dist