histogram_allocate Function

function histogram_allocate(n) result(h)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Return Value type(histogram)


Calls

proc~~histogram_allocate~~CallsGraph proc~histogram_allocate histogram_allocate bin bin proc~histogram_allocate->bin

Source Code

function histogram_allocate(n) result(h)
  integer,intent(in) :: n
  type(histogram)    :: h
  if(n<=0)then
     print*,"histogram length must be positive integer. n=",n
     stop
  endif
  allocate(h%range(0:n));h%range=0.d0
  allocate(h%bin(0:n))    ;h%bin=0.d0
  h%n=n
end function histogram_allocate