700 integer,
intent(in) :: rmax
701 double complex,
intent(in) :: p10,p21,p20,m02,m12,m22
702 double precision :: q10,q21,q20
703 double complex :: mm02,mm12,mm22
704 double complex,
intent(out) :: Cuv(0:rmax/2,0:rmax,0:rmax)
705 double complex,
intent(out) :: C(0:rmax/2,0:rmax,0:rmax)
706 double precision,
optional,
intent(out) :: Cerr(0:rmax),Cerr2(0:rmax)
707 integer,
optional,
intent(in) :: id_in
708 double complex :: C2uv(0:rmax/2,0:rmax,0:rmax),C2(0:rmax/2,0:rmax,0:rmax)
709 double complex :: Ccoliuv(0:rmax,0:rmax,0:rmax),Ccoli(0:rmax,0:rmax,0:rmax)
710 double complex :: Cdduv(0:rmax,0:rmax,0:rmax)
711 double complex :: Cdd(0:rmax,0:rmax,0:rmax)
712 double precision :: Cerraux(0:rmax),Cerr2aux(0:rmax)
713 double complex :: elimcminf2
714 double complex args(6)
715 integer :: n0,rank,errflag,id
716 double precision :: accrelDD(0:rmax_DD),accabsDD(0:rmax_DD)
717 double precision :: accrel2DD(0:rmax_DD),accabs2DD(0:rmax_DD)
718 double precision :: Cacc(0:rmax),norm,norm_coli,norm_dd,Cacc2(0:rmax),Cdiff(0:rmax)
719 integer :: accflagDD,errflagDD,NDD,rankDD
720 logical :: mflag,eflag
723 if (3.gt.nmax_cll) then
724 call seterrflag_cll(-10)
725 call errout_cll(
'C_cll',
'Nmax_cll smaller 3',eflag,.true.)
726 write(nerrout_cll,*)
'Nmax_cll =',nmax_cll
727 write(nerrout_cll,*)
'Reinitialize COLLIER with Nmax_cll >= 3'
728 call propagateerrflag_cll
731 if (rmax.gt.rmax_cll) then
732 call seterrflag_cll(-10)
733 call errout_cll(
'C_cll',
'argument rmax larger than rmax_cll',eflag,.true.)
734 write(nerrout_cll,*)
'rmax =',rmax
735 write(nerrout_cll,*)
'rmax_cll =',rmax_cll
736 write(nerrout_cll,*)
'Reinitialize COLLIER with rmax_cll >= ',rmax
737 call propagateerrflag_cll
742 if (
present(id_in)) then
758 call setmasterfname_cll(
'C_cll')
759 call setmastern_cll(3)
760 call setmasterr_cll(rmax)
761 call setmasterargs_cll(6,args)
763 call settencache_cll(never_tenred_cll)
767 select case (mode_cll)
773 call calcc(ccoli,ccoliuv,p10,p21,p20,m02,m12,m22,rmax,id,cerraux,cerr2aux)
775 norm = abs(ccoli(0,0,0))
779 norm = max(norm,abs(ccoli(0,n1,n2)))
782 if (norm.eq.0d0) then
783 norm = max(abs(p10),abs(p21),abs(p20),abs(m02),abs(m12),abs(m22))
791 if (norm.ne.0d0) then
793 cacc2 = cerr2aux/norm
799 if (
present(cerr)) cerr = cerraux
800 if (
present(cerr2)) cerr2 = cerr2aux
802 if (mflag)
call propagateaccflag_cll(cacc,rmax)
804 c(0:rmax/2,0:rmax,0:rmax) = ccoli(0:rmax/2,0:rmax,0:rmax)
805 cuv(0:rmax/2,0:rmax,0:rmax) = ccoliuv(0:rmax/2,0:rmax,0:rmax)
815 q10 = dreal(getminf2dd_cll(p10))
816 q21 = dreal(getminf2dd_cll(p21))
817 q20 = dreal(getminf2dd_cll(p20))
818 mm02 = getminf2dd_cll(m02)
819 mm12 = getminf2dd_cll(m12)
820 mm22 = getminf2dd_cll(m22)
823 call c_dd(cdd,cdduv,q10,q21,q20,mm02,mm12,mm22,rank,id)
824 c(0:rank/2,0:rank,0:rank) = cdd(0:rank/2,0:rank,0:rank)
825 cuv(0:rank/2,0:rank,0:rank) = cdduv(0:rank/2,0:rank,0:rank)
827 call ddgetacc(accreldd,accabsdd,accrel2dd,accabs2dd,ndd,rankdd,accflagdd,errflagdd,id)
828 if(
present(cerr)) cerr(0:rmax) = accabsdd(0:rmax)
829 if(
present(cerr2)) cerr2(0:rmax) = accabs2dd(0:rmax)
835 norm = max(norm,abs(c(0,n1,n2)))
838 if (norm.eq.0d0) then
839 norm = max(abs(p10),abs(p21),abs(p20),abs(m02),abs(m12),abs(m22))
846 if (norm.ne.0d0) then
847 cacc = accabsdd(0:rmax)/norm
848 cacc2 = accabs2dd(0:rmax)/norm
853 if (mflag)
call propagateaccflag_cll(cacc,rmax)
863 call calcc(ccoli,ccoliuv,p10,p21,p20,m02,m12,m22,rmax,id,cerraux,cerr2aux)
865 c(0:rmax/2,0:rmax,0:rmax) = ccoli(0:rmax/2,0:rmax,0:rmax)
866 cuv(0:rmax/2,0:rmax,0:rmax) = ccoliuv(0:rmax/2,0:rmax,0:rmax)
874 q10 = dreal(getminf2dd_cll(p10))
875 q21 = dreal(getminf2dd_cll(p21))
876 q20 = dreal(getminf2dd_cll(p20))
877 mm02 = getminf2dd_cll(m02)
878 mm12 = getminf2dd_cll(m12)
879 mm22 = getminf2dd_cll(m22)
882 call c_dd(cdd,cdduv,q10,q21,q20,mm02,mm12,mm22,rank,id)
883 c2(0:rank/2,0:rank,0:rank) = cdd(0:rank/2,0:rank,0:rank)
884 c2uv(0:rank/2,0:rank,0:rank) = cdduv(0:rank/2,0:rank,0:rank)
886 call ddgetacc(accreldd,accabsdd,accrel2dd,accabs2dd,ndd,rankdd,accflagdd,errflagdd,id)
889 norm_coli = abs(c(0,0,0))
890 norm_dd = abs(c2(0,0,0))
894 norm_coli = max(norm_coli,abs(c(0,n1,n2)))
895 norm_dd = max(norm_dd,abs(c(0,n1,n2)))
898 if (norm_coli.eq.0d0) then
899 norm_coli = max(abs(p10),abs(p21),abs(p20),abs(m02),abs(m12),abs(m22))
900 if(norm_coli.ne.0d0) then
901 norm_coli=1d0/norm_coli
903 norm_coli=1d0/muir2_cll
906 if (norm_dd.eq.0d0) then
907 norm_dd = max(abs(p10),abs(p21),abs(p20),abs(m02),abs(m12),abs(m22))
908 if(norm_dd.ne.0d0) then
911 norm_dd=1d0/muir2_cll
914 norm = min(norm_coli,norm_dd)
916 call checkcoefsc_cll(c,c2,p10,p21,p20,m02,m12,m22,rmax,norm,cdiff)
919 if (cerraux(rmax).lt.accabsdd(rmax)) then
920 if (
present(cerr)) cerr = max(cerraux,cdiff)
921 if (
present(cerr2)) cerr2 = cerr2aux
922 cacc = max(cerraux/norm_coli,cdiff/norm)
923 cacc2 = cerr2aux/norm_coli
924 if (monitoring) pointscntc_coli = pointscntc_coli + 1
928 if (
present(cerr)) cerr = max(accabsdd(0:rmax),cdiff)
929 if (
present(cerr2)) cerr2 = accabs2dd(0:rmax)
930 cacc = max(accabsdd(0:rmax)/norm_dd,cdiff/norm)
931 cacc2 = accabs2dd(0:rmax)/norm_dd
932 if (monitoring) pointscntc_dd = pointscntc_dd + 1
935 if (mflag)
call propagateaccflag_cll(cacc,rmax)
939 if (mflag)
call propagateerrflag_cll
942 pointscntc_cll = pointscntc_cll + 1
944 if(maxval(cacc).gt.reqacc_cll) accpointscntc_cll = accpointscntc_cll + 1
946 if(maxval(cacc).gt.critacc_cll) then
947 critpointscntc_cll = critpointscntc_cll + 1
948 if ( critpointscntc_cll.le.noutcritpointsmax_cll(3) ) then
949 call critpointsout_cll(
'C_cll',0,maxval(cacc), critpointscntc_cll)
950 if( critpointscntc_cll.eq.noutcritpointsmax_cll(3)) then
951 write(ncpout_cll,*)
' Further output of Critical Points for C_cll suppressed '
973 if(maxval(cacc2).gt.reqacc_cll) accpointscntc2_cll = accpointscntc2_cll + 1
975 if(maxval(cacc2).gt.critacc_cll) then
976 critpointscntc2_cll = critpointscntc2_cll + 1
977 if ( critpointscntc2_cll.le.noutcritpointsmax_cll(3) ) then
978 call critpointsout2_cll(
'C_cll',0,maxval(cacc2), critpointscntc2_cll)
979 if( critpointscntc2_cll.eq.noutcritpointsmax_cll(3)) then
980 write(ncpout2_cll,*)
' Further output of Critical Points for C_cll suppressed '