1
C----------------------------------------------
3
C Routine to add zincrement to a bin in a histogram
5
subroutine hfill(id,x,y,zincrement)
7
C id = integer associated with the histogram
8
C x = x value to locate bin (real)
9
C y = y value to locate bin (real) [ignored for 1-dim histo]
10
C zincrement = value to be added to bin specified by (x,y)
13
data nhist/0/,pointer(1)/1/
16
if (id number(i) .eq. id) go to 10
18
print*,' id number ',id,' does not belong to a current histogram'
23
ixoff = (x-data(k+1))/(data(k+2)-data(k+1))*data(k)+1
24
if (ixoff .le. 0 .or. ixoff .gt. nx) return
25
if (single dim(i)) then
26
data(k+2+ixoff)=data(k+2+ixoff)+zincrement
27
error(k+2+ixoff)=error(k+2+ixoff)+zincrement**2
28
npoints(k+2+ixoff)=npoints(k+2+ixoff)+1.
31
iyoff = (y-data(k+4))/(data(k+5)-data(k+4))*data(k+3)+1
32
if (iyoff .le. 0 .or. iyoff .gt. ny) return
33
ioff = nx*(iyoff-1)+ixoff
34
data(k+5+ioff)=data(k+5+ioff)+zincrement