	subroutine accum(th,deriv)

	include '/u1/gcf/e350/crystal/cb/hotsun'

	dimension deriv(1)

	idata=idata+1
	zerocr=zerocr+th**2
	func(idata)=th
	if(npar.le.0) return
	ipos=0
c
	do 1 i=1,npar
	a=deriv(i)
	i1=i-1
	first(i)=first(i)+a*th
	if(i1.le.0) go to 3
c
	do 2 j=1,i1
 2	secpck(j+ipos)=secpck(j+ipos)+deriv(j)*a
c
 3	ipos=ipos+i
	secpck(ipos)=secpck(ipos)+a*a
 1	continue
	return
	end
