histogram_accumulate Subroutine

subroutine histogram_accumulate(h, x, w)

Arguments

Type IntentOptional Attributes Name
type(histogram), intent(inout) :: h
real(kind=8), intent(in) :: x
real(kind=8), intent(in) :: w

Calls

proc~~histogram_accumulate~~CallsGraph proc~histogram_accumulate histogram_accumulate bin bin proc~histogram_accumulate->bin find_index find_index proc~histogram_accumulate->find_index

Source Code

subroutine histogram_accumulate(h,x,w)
  type(histogram),intent(inout) :: h
  real(8),intent(in)            :: x,w
  integer                       :: i,index
  index=0
  call find_index(h%n,h%range,x,index)
  if(index>=h%n)then
     print*,"index lies outside valid range of 0 .. n - 1"
     stop
  endif
  h%bin(index)=h%bin(index)+w
end subroutine histogram_accumulate