Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nelements | |||
integer, | intent(in), | DIMENSION(:) | :: | bins | ||
integer, | intent(in) | :: | nbins | |||
integer, | intent(out), | DIMENSION(1:nbins) | :: | bin_counts |
PURE SUBROUTINE count_bins(nelements, bins, nbins, bin_counts) INTEGER, INTENT(IN) :: nelements INTEGER, DIMENSION(:), INTENT(IN) :: bins INTEGER, INTENT(IN) :: nbins INTEGER, DIMENSION(1:nbins), INTENT(OUT) :: bin_counts INTEGER :: bin, i, i0, i1 ! PURE: DBCSR_ASSERT(nelements .EQ. SIZE(bins)) bin_counts(:) = 0 i0 = LBOUND(bins, 1) i1 = i0 + nelements - 1 DO i = i0, i1 bin = bins(i) bin_counts(bin) = bin_counts(bin) + 1 END DO END SUBROUTINE count_bins