      SUBROUTINE svdvar(v,ma,np,w,cvm,ncvm)
      INTEGER ma,ncvm,np,MMAX
      double precision cvm(ncvm,ncvm),v(np,np),w(np)
      PARAMETER (MMAX=20)
      INTEGER i,j,k
      double precision sumup,wti(MMAX)
      do 11 i=1,ma
        wti(i)=0.
        if(w(i).ne.0.) wti(i)=1./(w(i)*w(i))
11    continue
      do 14 i=1,ma
        do 13 j=1,i
          sumup=0.0d0
          do 12 k=1,ma
            sumup=sumup+v(i,k)*v(j,k)*wti(k)
12        continue
          cvm(i,j)=sumup
          cvm(j,i)=sumup
13      continue
14    continue
      return
      END
