      SUBROUTINE SUBG(X,A,YFIT,DYDA,MFTO) ! Bernd Berg Jul 5 2008.
C USER PROVIDED SUBROUTINE FOR THE FIT FUNCTION FOR LGT MASS:
C Y=A1*EXP(A2*t)+A1*EXP(A2*(ntime-t)).
      include '../../Libs/Fortran/implicit.sta'
      include '../../Libs/Fortran/constants.par'
      include '../../Libs/Fortran_par/lat.par' ! Transfers MT.
      DIMENSION A(MFTO),DYDA(MFTO)
      cfile="unused"
      XTIME=ONE*MT
      YFIT=A(1)*(EXP(-A(2)*X)+EXP(-A(2)*(XTIME-X)))
      DYDA(1)=EXP(-A(2)*X)+EXP(-A(2)*(XTIME-X))
      DYDA(2)=A(1)*(-X*EXP(-A(2)*X)-(XTIME-X)*EXP(-A(2)*(XTIME-X)))
      RETURN
      END
