Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(histogram), | intent(inout) | :: | h | |||
real(kind=8), | intent(in) | :: | xmin | |||
real(kind=8), | intent(in) | :: | xmax |
subroutine histogram_set_range_uniform(h,xmin,xmax) type(histogram),intent(inout) :: h real(8),intent(in) :: xmin,xmax integer :: i,n real(8) :: f1,f2 if(xmin>=xmax)then print*,"histogram%range: xmin must be less than xmax:",xmin,xmax stop endif n=h%n do i=0,n f1= real(n-i,8)/real(n,8) f2= real(i,8)/real(n,8) h%range(i) = f1*xmin + f2*xmax enddo h%bin=0.d0 end subroutine histogram_set_range_uniform