39 integer,
dimension(:),
allocatable ::
rts
53 integer,
intent(in) :: Nm1,rmax
75 integer,
intent(in) :: rmax
78 if (
allocated(
rts))
deallocate(
rts)
79 allocate(
rts(-1:rmax+1))
83 rts(r) =
rts(r-1) + binomtable(r,r+3)
99 integer,
intent(in) :: rmax
100 integer :: r,mu0,mu1,mu2,mu3,cnt
109 do mu2=r-mu0-mu1,0,-1
137 integer,
intent(in) :: rmax
138 integer :: r,mu,nu,IndMu(0:3),i
148 indmu(i) = indmu(i)+1
154 indmu(i) = indmu(i)-1
172 integer,
intent(in) :: rmax
173 integer :: r,nsum,mu,nu,munu,IndMu(0:3),IndN(0:3)
175 if (rmax.le.1)
return
181 do nu=
rts(nsum-1)+1,
rts(nsum)
184 do munu=
rts(2*nsum-1)+1,
rts(2*nsum)
185 if (all(
lorindtab(:,munu).eq.2*indn))
then
194 do munu=
rts(r+2*nsum-1)+1,
rts(r+2*nsum)
196 if (all(
lorindtab(:,munu).eq.indmu+2*indn))
then
221 integer,
intent(in) :: rmax
222 integer :: mu, nu, IndMu(0:3), IndNu(0:3), CF, i, r
231 do nu=2,
rts((rmax-r)/2)
234 cf = (-1)**(indnu(1)+indnu(2)+indnu(3))
236 cf = cf*calcfactorial(indmu(i)+2*indnu(i)) &
237 /(2**indnu(i)*calcfactorial(indmu(i))*calcfactorial(indnu(i)))
262 integer,
intent(in) :: Nm1max, rmax
263 integer :: strmax, Nm1
265 strmax = binomtable(rmax,rmax+nm1max-1)
269 allocate(
indspiprod(0:1,nm1max,strmax,nm1max))
273 strmax = binomtable(rmax,rmax+nm1-1)
303 integer,
intent(in) :: nm1, r
304 integer,
dimension(:,:,:),
allocatable ::
indspiprod
305 integer :: str, i, j, inds(r), indsp1(r+1), pos, cnt
307 str = binomtable(r,r+nm1-1)
311 inds = indcombiseq(1:r,i,r,nm1)
318 if (inds(pos)>j)
then
320 else if (inds(pos).eq.j)
then
326 indsp1(1:pos-1) = inds(1:pos-1)
328 indsp1(pos+1:r+1) = inds(pos:r)
330 indspiprod(0,j,i) = calcposindcombiseq(nm1,r+1,indsp1)
380 integer,
intent(in) :: N, rmax
381 double complex,
intent(in) :: T1(0:rmax,0:rmax,0:rmax,0:rmax)
382 double complex,
intent(in) :: T2(0:rmax,0:rmax,0:rmax,0:rmax)
383 double complex,
intent(in) :: MomVec(0:3,N-1)
384 double complex,
intent(in) :: MomInv(BinomTable(2,N)), masses2(0:N-1)
385 double precision,
intent(in) :: norm(0:rmax)
386 double precision,
intent(out) :: Tdiff(0:rmax)
387 integer :: r,n0,n1,n2,n3,i,j,flag
388 double complex :: diffTN
389 double precision :: ratio
390 character(len=*),
parameter :: fmt1 =
"(A8,'(',i2,') = dcmplx(',d25.18,' , ',d25.18,' )')"
391 character(len=*),
parameter :: fmt2 = &
392 "(A6,' TNten(',i1,',',i1,',',i1,',',i1,') = (',d23.16,' , ',d23.16,' ), r=',i2)"
393 character(len=*),
parameter :: fmt3 = &
394 "(A7,'(',i1,',',i2,') = dcmplx(',d25.18,' , ',d25.18,' )')"
397 checkcntten_cll(n) = checkcntten_cll(n) + 1
402 if(diffcntten_cll(n).ge.maxcheck_cll(n)) flag=0
403 if(ncheckout_cll.eq.-1) flag=0
414 difftn = t1(n0,n1,n2,n3)-t2(n0,n1,n2,n3)
415 tdiff(r) = max(tdiff(r),abs(difftn)/norm(r))
416 if ((abs(difftn).gt.checkacc_cll*norm(r)) .and.(flag.eq.1))
then
417 write(ncheckout_cll,*)
'***************************************************************************'
418 write(ncheckout_cll,
'(A15,I2,A16,I10)')
'TNten with N =',n,
', difference NO.', diffcntten_cll(n)+1
419 write(ncheckout_cll,*)
'COLI and DD do not agree! checkacc =', checkacc_cll
420 write(ncheckout_cll,
'(A24,I2,A10,I2,A4,I2)')
'TNten integral with N =', n,
' and rank ', r,
' of ',rmax
421 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
422 write(ncheckout_cll,*)
'GLOBAL PARAMETERS:'
423 write(ncheckout_cll,*)
'mode ', mode_cll
424 write(ncheckout_cll,*)
'muUV2 ', muuv2_cll
425 write(ncheckout_cll,*)
'muIR2 ', muir2_cll
426 write(ncheckout_cll,*)
'deltaUV ', deltauv_cll
427 write(ncheckout_cll,*)
'deltaIR1 ', deltair1_cll
428 write(ncheckout_cll,*)
'deltaIR2 ', deltair2_cll
429 write(ncheckout_cll,*)
'nminf ', nminf_cll
431 write(ncheckout_cll,*)
'minf2 ', i, minf2_cll(i)
433 write(ncheckout_cll,*)
'dprec ', dprec_cll
434 write(ncheckout_cll,*)
'reqacc ', reqacc_cll
435 write(ncheckout_cll,*)
'critacc ', critacc_cll
436 write(ncheckout_cll,*)
'checkacc ', checkacc_cll
437 write(ncheckout_cll,*)
'ErrFlag ', errflag_cll
438 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
441 write(ncheckout_cll,fmt3)
'MomVec', j, i, momvec(j,i)
444 do i=1,binomtable(2,n)
445 write(ncheckout_cll,fmt1)
'MomInv ', i, mominv(i)
448 write(ncheckout_cll,fmt1)
'masses2', i, masses2(i)
450 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
451 write(ncheckout_cll,fmt2)
'COLI:',0,0,0,0,t1(0,0,0,0),0
452 write(ncheckout_cll,fmt2)
'DD :',0,0,0,0,t2(0,0,0,0),0
453 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(n0,n1,n2,n3),r
454 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(n0,n1,n2,n3),r
455 if(norm(r).ne.0d0)
then
456 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
457 ratio=abs(difftn)/norm(r)
459 write(ncheckout_cll,*)
'diff:', 1d50
463 elseif((flag.eq.2).and.(abs(difftn).gt.ratio*norm(r)))
then
464 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(n0,n1,n2,n3),r
465 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(n0,n1,n2,n3),r
466 if(norm(r).gt.1d-100)
then
467 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
468 ratio=abs(difftn)/norm(r)
470 write(ncheckout_cll,*)
'diff:', 1d50
473 elseif ((flag.eq.0).and.(abs(difftn).gt.checkacc_cll*norm(r)))
then
483 write(ncheckout_cll,*)
'*************************************************************************'
484 write(ncheckout_cll,*)
' end TNten '
485 write(ncheckout_cll,*)
486 diffcntten_cll(n) = diffcntten_cll(n) + 1
487 if(diffcntten_cll(n).eq.maxcheck_cll(n))
then
488 write(ncheckout_cll,
'((A),I4)')
' Further output for differences in TNten functions suppressed for N =', n
489 write(ncheckout_cll,*)
491 else if (flag.eq.3)
then
492 diffcntten_cll(n) = diffcntten_cll(n) + 1
508 integer,
intent(in) :: N, rmax
510 double complex,
intent(in) :: T1(RtS(rmax)), T2(RtS(rmax))
511 double complex,
intent(in) :: MomVec(0:3,N-1)
512 double complex,
intent(in) :: MomInv(BinomTable(2,N)), masses2(0:N-1)
513 double precision,
intent(in) :: norm(0:rmax)
514 double precision,
intent(out) :: Tdiff(0:rmax)
515 integer :: r,ind,i,j,flag,n0,n1,n2,n3
516 double complex :: diffTN
517 double precision :: ratio
518 character(len=*),
parameter :: fmt1 =
"(A8,'(',i2,') = dcmplx(',d25.18,' , ',d25.18,' )')"
519 character(len=*),
parameter :: fmt2 = &
520 "(A6,' TNten(',i1,',',i1,',',i1,',',i1,') = (',d23.16,' , ',d23.16,' ), r=',i2)"
521 character(len=*),
parameter :: fmt3 = &
522 "(A7,'(',i1,',',i2,') = dcmplx(',d25.18,' , ',d25.18,' )')"
524 checkcntten_cll(n) = checkcntten_cll(n) + 1
529 if(diffcntten_cll(n).ge.maxcheck_cll(n)) flag=0
530 if(ncheckout_cll.eq.-1) flag=0
536 do ind=rts(r-1)+1,rts(r)
543 difftn = t1(ind)-t2(ind)
544 tdiff(r) = max(tdiff(r),abs(difftn)/norm(r))
546 if ((abs(dreal(difftn)).gt.checkacc_cll*norm(r).or.abs(dimag(difftn)).gt.checkacc_cll*norm(r)) .and.(flag.eq.1))
then
547 write(ncheckout_cll,*)
'***************************************************************************'
548 write(ncheckout_cll,
'(A15,I2,A16,I10)')
'TNten with N =',n,
' difference NO.', diffcntten_cll(n)+1
549 write(ncheckout_cll,*)
'COLI and DD do not agree! checkacc =', checkacc_cll
550 write(ncheckout_cll,
'(A24,I2,A10,I2,A4,I2)')
'TNten integral with N =', n,
' and rank ', r,
' of ',rmax
551 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
552 write(ncheckout_cll,*)
'GLOBAL PARAMETERS:'
553 write(ncheckout_cll,*)
'mode ', mode_cll
554 write(ncheckout_cll,*)
'muUV2 ', muuv2_cll
555 write(ncheckout_cll,*)
'muIR2 ', muir2_cll
556 write(ncheckout_cll,*)
'deltaUV ', deltauv_cll
557 write(ncheckout_cll,*)
'deltaIR1 ', deltair1_cll
558 write(ncheckout_cll,*)
'deltaIR2 ', deltair2_cll
559 write(ncheckout_cll,*)
'nminf ', nminf_cll
561 write(ncheckout_cll,*)
'minf2 ', i, minf2_cll(i)
563 write(ncheckout_cll,*)
'dprec ', dprec_cll
564 write(ncheckout_cll,*)
'reqacc ', reqacc_cll
565 write(ncheckout_cll,*)
'critacc ', critacc_cll
566 write(ncheckout_cll,*)
'checkacc ', checkacc_cll
567 write(ncheckout_cll,*)
'ErrFlag ', errflag_cll
568 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
571 write(ncheckout_cll,fmt3)
'MomVec', j, i, momvec(j,i)
574 do i=1,binomtable(2,n)
575 write(ncheckout_cll,fmt1)
'MomInv ', i, mominv(i)
578 write(ncheckout_cll,fmt1)
'masses2', i, masses2(i)
580 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
581 write(ncheckout_cll,fmt2)
'COLI:',0,0,0,0,t1(1),0
582 write(ncheckout_cll,fmt2)
'DD :',0,0,0,0,t2(1),0
583 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(ind),r
584 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(ind),r
585 if(norm(r).ne.0d0)
then
586 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
587 ratio=abs(difftn)/norm(r)
589 write(ncheckout_cll,*)
'diff:', 1d50
593 elseif((flag.eq.2).and.(abs(difftn).gt.ratio*norm(r)))
then
594 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(ind),r
595 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(ind),r
596 if(norm(r).gt.1d-100)
then
597 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
598 ratio=abs(difftn)/norm(r)
600 write(ncheckout_cll,*)
'diff:', 1d50
603 elseif ((flag.eq.0).and.(abs(difftn).gt.checkacc_cll*norm(r)))
then
611 write(ncheckout_cll,*)
'*************************************************************************'
612 write(ncheckout_cll,*)
' end TNten '
613 write(ncheckout_cll,*)
614 diffcntten_cll(n) = diffcntten_cll(n) + 1
615 if(diffcntten_cll(n).eq.maxcheck_cll(n))
then
616 write(ncheckout_cll,*)
' Further output for differences in TNten functions suppressed for N =', n
617 write(ncheckout_cll,*)
619 else if (flag.eq.3)
then
620 diffcntten_cll(n) = diffcntten_cll(n) + 1
636 integer,
intent(in) :: rmax
637 double complex,
intent(in) :: T1(0:rmax,0:rmax,0:rmax,0:rmax)
638 double complex,
intent(in) :: T2(0:rmax,0:rmax,0:rmax,0:rmax)
639 double complex,
intent(in) :: masses2(0:0)
640 double precision,
intent(in) :: norm(0:rmax)
641 double precision,
intent(out) :: Tdiff(0:rmax)
642 integer :: r,n0,n1,n2,n3,i,j,flag
643 double complex :: diffTN
644 double precision :: ratio
645 character(len=*),
parameter :: fmt1 =
"(A8,'(',i2,') = dcmplx(',d25.18,',',d25.18,' )')"
646 character(len=*),
parameter :: fmt2 = &
647 "(A6,' TNten(',i1,',',i1,',',i1,',',i1,') = (',d23.16,' , ',d23.16,' ), r=',i2)"
648 character(len=*),
parameter :: fmt3 = &
649 "(A7,'(',i1,',',i2,') = dcmplx(',d25.18,' , ',d25.18,' )')"
651 checkcntten_cll(1) = checkcntten_cll(1) + 1
656 if(diffcntten_cll(1).ge.maxcheck_cll(1)) flag=0
657 if(ncheckout_cll.eq.-1) flag=0
668 difftn = t1(n0,n1,n2,n3)-t2(n0,n1,n2,n3)
669 tdiff(r) = max(tdiff(r),abs(difftn)/norm(r))
670 if ((abs(dreal(difftn)).gt.checkacc_cll*norm(r).or.abs(dimag(difftn)).gt.checkacc_cll*norm(r)) .and.(flag.eq.1))
then
671 write(ncheckout_cll,*)
'***************************************************************************'
672 write(ncheckout_cll,
'(A15,I2,A16,I10)')
'TNten with N =',1,
' difference NO.', diffcntten_cll(1)+1
673 write(ncheckout_cll,*)
'COLI and DD do not agree! checkacc =', checkacc_cll
674 write(ncheckout_cll,
'(A24,I2,A10,I2,A4,I2)')
'TNten integral with N =', 1,
' and rank ', r,
' of ',rmax
675 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
676 write(ncheckout_cll,*)
'GLOBAL PARAMETERS:'
677 write(ncheckout_cll,*)
'mode ', mode_cll
678 write(ncheckout_cll,*)
'muUV2 ', muuv2_cll
679 write(ncheckout_cll,*)
'muIR2 ', muir2_cll
680 write(ncheckout_cll,*)
'deltaUV ', deltauv_cll
681 write(ncheckout_cll,*)
'deltaIR1 ', deltair1_cll
682 write(ncheckout_cll,*)
'deltaIR2 ', deltair2_cll
683 write(ncheckout_cll,*)
'nminf ', nminf_cll
685 write(ncheckout_cll,*)
'minf2 ', i, minf2_cll(i)
687 write(ncheckout_cll,*)
'dprec ', dprec_cll
688 write(ncheckout_cll,*)
'reqacc ', reqacc_cll
689 write(ncheckout_cll,*)
'critacc ', critacc_cll
690 write(ncheckout_cll,*)
'checkacc ', checkacc_cll
691 write(ncheckout_cll,*)
'ErrFlag ', errflag_cll
692 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
693 write(ncheckout_cll,fmt1)
'masses2', 0, masses2(0)
694 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
695 write(ncheckout_cll,fmt2)
'COLI:',0,0,0,0,t1(0,0,0,0),0
696 write(ncheckout_cll,fmt2)
'DD :',0,0,0,0,t2(0,0,0,0),0
697 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(n0,n1,n2,n3),r
698 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(n0,n1,n2,n3),r
699 if(norm(r).ne.0d0)
then
700 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
701 ratio=abs(difftn)/norm(r)
703 write(ncheckout_cll,*)
'diff:', 1d50
707 elseif((flag.eq.2).and.(abs(difftn).gt.ratio*norm(r)))
then
708 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(n0,n1,n2,n3),r
709 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(n0,n1,n2,n3),r
710 if(norm(r).gt.1d-100)
then
711 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
712 ratio=abs(difftn)/norm(r)
714 write(ncheckout_cll,*)
'diff:', 1d50
717 elseif ((flag.eq.0).and.(abs(difftn).gt.checkacc_cll*norm(r)))
then
727 write(ncheckout_cll,*)
'*************************************************************************'
728 write(ncheckout_cll,*)
' end TNten '
729 write(ncheckout_cll,*)
730 diffcntten_cll(1) = diffcntten_cll(1) + 1
731 if(diffcntten_cll(1).eq.maxcheck_cll(1))
then
732 write(ncheckout_cll,*)
' Further output for differences in TNten functions suppressed for N =', 1
733 write(ncheckout_cll,*)
735 else if (flag.eq.3)
then
736 diffcntten_cll(1) = diffcntten_cll(1) + 1
752 integer,
intent(in) :: rmax
754 double complex,
intent(in) :: T1(RtS(rmax)), T2(RtS(rmax))
755 double complex,
intent(in) :: masses2(0:0)
756 double precision,
intent(in) :: norm(0:rmax)
757 double precision,
intent(out) :: Tdiff(0:rmax)
758 integer :: r,ind,i,j,flag,n0,n1,n2,n3
759 double complex :: diffTN
760 double precision :: ratio
761 character(len=*),
parameter :: fmt1 =
"(A8,'(',i2,') = dcmplx(',d25.18,',',d25.18,' )')"
762 character(len=*),
parameter :: fmt2 = &
763 "(A6,' TNten(',i1,',',i1,',',i1,',',i1,') = (',d23.16,' , ',d23.16,' ), r=',i2)"
764 character(len=*),
parameter :: fmt3 = &
765 "(A7,'(',i1,',',i2,') = dcmplx(',d25.18,' , ',d25.18,' )')"
767 checkcntten_cll(1) = checkcntten_cll(1) + 1
772 if(diffcntten_cll(1).ge.maxcheck_cll(1)) flag=0
773 if(ncheckout_cll.eq.-1) flag=0
779 do ind=rts(r-1)+1,rts(r)
785 difftn = t1(ind)-t2(ind)
786 tdiff(r) = max(tdiff(r),abs(difftn)/norm(r))
788 if ((abs(dreal(difftn)).gt.checkacc_cll*norm(r).or.abs(dimag(difftn)).gt.checkacc_cll*norm(r)) .and.(flag.eq.1))
then
789 write(ncheckout_cll,*)
'***************************************************************************'
790 write(ncheckout_cll,
'(A15,I2,A16,I10)')
'TNten with N =',1,
' difference NO.', diffcntten_cll(1)+1
791 write(ncheckout_cll,*)
'COLI and DD do not agree! checkacc =', checkacc_cll
792 write(ncheckout_cll,
'(A24,I2,A10,I2,A4,I2)')
'TNten integral with N =', 1,
' and rank ', r,
' of ',rmax
793 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
794 write(ncheckout_cll,*)
'GLOBAL PARAMETERS:'
795 write(ncheckout_cll,*)
'mode ', mode_cll
796 write(ncheckout_cll,*)
'muUV2 ', muuv2_cll
797 write(ncheckout_cll,*)
'muIR2 ', muir2_cll
798 write(ncheckout_cll,*)
'deltaUV ', deltauv_cll
799 write(ncheckout_cll,*)
'deltaIR1 ', deltair1_cll
800 write(ncheckout_cll,*)
'deltaIR2 ', deltair2_cll
801 write(ncheckout_cll,*)
'nminf ', nminf_cll
803 write(ncheckout_cll,*)
'minf2 ', i, minf2_cll(i)
805 write(ncheckout_cll,*)
'dprec ', dprec_cll
806 write(ncheckout_cll,*)
'reqacc ', reqacc_cll
807 write(ncheckout_cll,*)
'critacc ', critacc_cll
808 write(ncheckout_cll,*)
'checkacc ', checkacc_cll
809 write(ncheckout_cll,*)
'ErrFlag ', errflag_cll
810 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
811 write(ncheckout_cll,fmt1)
'masses2', 0, masses2(0)
812 write(ncheckout_cll,*)
'---------------------------------------------------------------------------'
813 write(ncheckout_cll,fmt2)
'COLI:',0,0,0,0,t1(1),0
814 write(ncheckout_cll,fmt2)
'DD :',0,0,0,0,t2(1),0
815 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(ind),r
816 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(ind),r
817 if(norm(r).ne.0d0)
then
818 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
819 ratio=abs(difftn)/norm(r)
821 write(ncheckout_cll,*)
'diff:', 1d50
825 elseif((flag.eq.2).and.(abs(difftn).gt.ratio*norm(r)))
then
826 write(ncheckout_cll,fmt2)
'COLI:',n0,n1,n2,n3,t1(ind),r
827 write(ncheckout_cll,fmt2)
'DD :',n0,n1,n2,n3,t2(ind),r
828 if(norm(r).gt.1d-100)
then
829 write(ncheckout_cll,*)
'diff:', abs(difftn)/norm(r)
830 ratio=abs(difftn)/norm(r)
832 write(ncheckout_cll,*)
'diff:', 1d50
835 elseif ((flag.eq.0).and.(abs(difftn).gt.checkacc_cll*norm(r)))
then
843 write(ncheckout_cll,*)
'*************************************************************************'
844 write(ncheckout_cll,*)
' end TNten '
845 write(ncheckout_cll,*)
846 diffcntten_cll(1) = diffcntten_cll(1) + 1
847 if(diffcntten_cll(1).eq.maxcheck_cll(1))
then
848 write(ncheckout_cll,*)
' Further output for differences in TNten functions suppressed for N =', 1
849 write(ncheckout_cll,*)
851 else if (flag.eq.3)
then
852 diffcntten_cll(1) = diffcntten_cll(1) + 1