      SUBROUTINE SUBG(X,A,YFIT,DYDA,NFIT)
C USER PROVIDED SUBROUTINE FOR THE POLYNOMIAL FIT FUNCTION 
C Y=A1+A2*X+A3*X**2+... (linear).
      include '../../ForLib/implicit.sta'
      include '../../ForLib/constants.par'
      DIMENSION A(NFIT),DYDA(NFIT)
      YFIT=ZERO
      DO IFIT=1,NFIT
        XN=X**(IFIT-1)
        YFIT=YFIT+A(IFIT)*XN
        DYDA(IFIT)=XN
      ENDDO
      RETURN
      END

