      subroutine p_ts_zlnj(nq,nrpt,zlna,alna,a2lna,xm2lna,
     &          zlnj,alnj,a2lnj,xm2lnj) ! bernd berg, apr 11 2004.  
c potts model, jackknife time series partition function fractions.
      include '../../libs/fortran/implicit.sta'
      dimension zlna(nrpt),alna(nrpt),a2lna(nrpt),xm2lna(nrpt),
     &  zlnj(0:nrpt),alnj(0:nrpt),a2lnj(0:nrpt),xm2lnj(0:nrpt)
c
      nqm1=nq-1
      zlnj(0)=zlna(1)
      alnj(0)=alna(1)
      a2lnj(0)=a2lna(1)
      xm2lnj(0)=xm2lna(1)
      do irpt=2,nrpt
        zlnj(0)=addln(zlnj(0),zlna(irpt))
        alnj(0)=addln(alnj(0),alna(irpt))
        a2lnj(0)=addln(a2lnj(0),a2lna(irpt))
        xm2lnj(0)=addln(xm2lnj(0),xm2lna(irpt))
      end do
c
      do irpt=1,nrpt
        isgn=-1
        call addln2(zlnj(0),zlna(irpt),zlnj(irpt),isgn)
        if(isgn.ne.1) stop "p_ts_zlnj: zlnj negativ."
        isgn=-1
        call addln2(alnj(0),alna(irpt),alnj(irpt),isgn)
        if(isgn.ne.1) stop "p_ts_zlnj: alnj negativ."
        isgn=-1
        call addln2(a2lnj(0),a2lna(irpt),a2lnj(irpt),isgn)
        if(isgn.ne.1) stop "p_ts_zlnj: a2lnj negativ."
        do iq=0,nqm1
          isgn=-1
          call addln2(xm2lnj(0),xm2lna(irpt),xm2lnj(irpt),isgn)
          if(isgn.ne.1) stop "p_ts_zlnj: xm2lnj negativ."
        end do
      end do
c
      return
      end
