      SUBROUTINE COMPF(NUMPAR,NUMVAR,VALVAR,SUMERR,DIFFS)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      INCLUDE 'SIZES/NOLIST'
      DIMENSION DIFFS(*), VALVAR(*)
      COMMON /GEOVAR/ NVAR, LOC(2,MAXPAR), XPARAM(MAXPAR)
***************************************************************************
*
*  THESE COMMON BLOCKS HOLD THE ADDRESSES OF THE PARAMETERS TO
*        BE OPTIMISED.
*
      COMMON /LOCVAR/ LOCVAR(2,100)
      DIMENSION GRAD(100), COORD(3,NUMATM)
      TIME1=SECOND()
      SUMERR=0.D0      
          CALL COMPFG(VALVAR,.TRUE.,ESCF,.TRUE.,DIFFS,.TRUE.)
                  SUMERR=DOT(DIFFS,DIFFS,NUMVAR)
C#      WRITE(6,'('' SSQ=  '',F9.3)')SUMERR
C#      WRITE(6,'(6F12.4)')(DIFFS(I),I=1,NVAR)
      RETURN
      END
