subroutine histogram_deallocate(h) type(histogram) :: h deallocate(h%range) deallocate(h%bin) h%n=0 end subroutine histogram_deallocate