      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
