      SUBROUTINE MOLVAL(C,P,NOCC,RHFUHF)
      implicit double precision (A-H,O-Z)
      include 'SIZES'
      include 'MOP6FILE'
      dimension C(NORBS,NORBS), P(*)
      common /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM),NMIDLE(NUMATM),
     1                NLAST(NUMATM), NORBS, NELECS,NALPHA,NBETA,
     2                NCLOSE,NOPEN,NDUMY,FRACT
      dimension VAL(MAXORB)
      do 40 I=1,NOCC
         SUM=0.D0
         do 30 JJ=1,NUMAT
            JL=NFIRST(JJ)
            JU=NLAST(JJ)
            do 30 J=JL,JU
               do 30 KK=1,NUMAT
                  if (KK.EQ.JJ) go to 20
                  KL=NFIRST(KK)
                  KU=NLAST(KK)
                  do 10 K=KL,KU
                     L1=MAX(J,K)
                     L2=J+K-L1
                     L=(L1*(L1-1))/2+L2
                     SUM=SUM+C(J,I)*C(K,I)*P(L)
   10             continue
   20             continue
   30    continue
         VAL(I)=SUM*RHFUHF
   40 continue
      write(MIOB,'(10F8.4)') (VAL(I),I=1,NOCC)
      end
