	subroutine cmpinv(secinv)
c     complete inversion of  matrix secpck started in lllpck
c
c     set secinv as inverse of secpck using fact that lllpck contains
c     matrix l (lower triangular) where	secpck=	l*l-transpose
c     all matrices use imsl symmetric storage method
c
	include '/u1/gcf/e350/crystal/cb/hotsun'
c
	dimension	secinv(1)
c
c     first calculate lpr=l**-1	overwriting l in lllpck
c     remember that diagonal elements  of l have already been inverted in
c     lllpck
	if(npar.le.0) return
	if(npar.gt.1) go to 4
	secinv(1)=lllpck(1)*lllpck(1)
	return
c
4	jpos=2
	do 1 i=2,npar
	i1=i-1
	b=lllpck(jpos+i1)
	kpos=1
	do 2 j=1,i1
	lllpck(jpos)=-b*vdot2(i-j,lllpck(jpos),1,lllpck(kpos),j)
	jpos=jpos+1
2	kpos=kpos+j+1
1	jpos=jpos+1
c
c     calculate	ainv= lpr-transpose * lpr
	jpos=1
	do 5 i=1,npar
	nsum=npar-i+1
	kpos=jpos+i-1
	do 6 j=1,i
	secinv(jpos)=vdot3(nsum,lllpck(jpos),i,lllpck(kpos),i)
6	jpos=jpos+1
5	continue
	return
c
	end
