Common Bug 9

	SUBROUTINE cal(diff)
$$IMPLICIT
$$INCLUDE 'C$INC:BCS.INC'
$$INCLUDE 'YBOS$LIBRARY:ERRCOD.INC'
	REAL diff	! difference between first and last
	INTEGER n	! size of TAU data
	INTEGER m	! size of vector
	INTEGER ind, index	! bank and data index of TAUS
	INTEGER blocat	! YBOS named bank finder
	INTEGER wbank	! YBOS work bank creator
	INTEGER wdrop	! YBOS work bank dropper
	INTEGER windex	! work bank index
	INTEGER offset	! offset halfway into work bank
	INTEGER status	! error return status
	INTEGER i,j	! DO loop indices
C.................................
	diff = 0.
	status = blocat(iw, 'TAUS', 1, ind, index)
	IF(status .NE. yesucc) RETURN
	n = iw(index)	! size of data
	m = n/12	! number of elements
	status = wbank(iw, windex, m)
	IF(status .NE. yesucc) RETURN

	DO 1 i = 1, m
	 DO 2 j = 1, 12
	  iw(windex+i) = iw(windex+i) + iw(index+12*(i-1)+j)
2	 CONTINUE
1	CONTINUE
	diff = iw(windex+m) - iw(windex)

	status = wdrop(iw, windex, 1)
	RETURN
	END

This routine has a bug.

Why?

BACK to YBOS , Bug 10