1214 integer,
intent(in) :: rmax
1215 double complex,
intent(in) :: p10,p21,p32,p30,p20,p31,m02,m12,m22,m32
1216 double precision :: q10,q21,q32,q30,q20,q31
1217 double complex :: mm02,mm12,mm22,mm32
1218 double complex,
intent(out) :: D(0:rmax/2,0:rmax,0:rmax,0:rmax)
1219 double complex,
intent(out) :: Duv(0:rmax/2,0:rmax,0:rmax,0:rmax)
1220 double precision,
optional,
intent(out) :: Derr(0:rmax),Derr2(0:rmax)
1221 integer,
optional,
intent(in) :: id_in
1222 double complex :: D2uv(0:rmax/2,0:rmax,0:rmax,0:rmax)
1223 double complex :: D2(0:rmax/2,0:rmax,0:rmax,0:rmax)
1224 double complex :: Dcoliuv(0:rmax,0:rmax,0:rmax,0:rmax)
1225 double complex :: Dcoli(0:rmax,0:rmax,0:rmax,0:rmax)
1226 double complex :: Ddduv(0:rmax,0:rmax,0:rmax,0:rmax)
1227 double complex :: Ddd(0:rmax,0:rmax,0:rmax,0:rmax)
1228 double precision :: Derraux(0:rmax),Derr2aux(0:rmax),Ddiff(0:rmax)
1229 double complex :: elimcminf2
1230 double complex :: args(10)
1231 integer :: n0,rank,errflag,id
1232 double precision :: accrelDD(0:rmax_DD),accabsDD(0:rmax_DD),Dacc(0:rmax),norm,norm_coli,norm_dd,Dacc2(0:rmax)
1233 double precision :: accrel2DD(0:rmax_DD),accabs2DD(0:rmax_DD)
1234 integer :: accflagDD,errflagDD,NDD,rankDD
1235 logical :: mflag,eflag
1236 integer :: r,n1,n2,n3
1238 if (4.gt.nmax_cll) then
1239 call seterrflag_cll(-10)
1240 call errout_cll(
'D_cll',
'Nmax_cll smaller 4',eflag,.true.)
1241 write(nerrout_cll,*)
'Nmax_cll =',nmax_cll
1242 write(nerrout_cll,*)
'Reinitialize COLLIER with Nmax_cll >= 4'
1243 call propagateerrflag_cll
1246 if (rmax.gt.rmax_cll) then
1247 call seterrflag_cll(-10)
1248 call errout_cll(
'D_cll',
'argument rmax larger than rmax_cll',eflag,.true.)
1249 write(nerrout_cll,*)
'rmax =',rmax
1250 write(nerrout_cll,*)
'rmax_cll =',rmax_cll
1251 write(nerrout_cll,*)
'Reinitialize COLLIER with rmax_cll >= ',rmax
1252 call propagateerrflag_cll
1257 if (
present(id_in)) then
1276 call setmasterfname_cll(
'D_cll')
1277 call setmastern_cll(4)
1278 call setmasterr_cll(rmax)
1279 call setmasterargs_cll(10,args)
1281 call settencache_cll(never_tenred_cll)
1285 select case (mode_cll)
1291 call calcd(dcoli,dcoliuv,p10,p21,p32,p30,p20,p31, &
1292 m02,m12,m22,m32,rmax,id,derraux,derr2aux)
1294 norm = abs(dcoli(0,0,0,0))
1299 norm = max(norm,abs(dcoli(0,n1,n2,n3)))
1303 if (norm.eq.0d0) then
1304 norm = max(abs(p10),abs(p21),abs(p32),abs(p30),abs(p20),abs(p31), &
1305 abs(m02),abs(m12),abs(m22),abs(m32))
1306 if(norm.ne.0d0) then
1309 norm=1d0/muir2_cll**2
1312 if (norm.ne.0d0) then
1314 dacc2 = derr2aux/norm
1320 if (
present(derr)) derr = derraux
1321 if (
present(derr2)) derr2 = derr2aux
1323 if (mflag)
call propagateaccflag_cll(dacc,rmax)
1325 d(0:rmax/2,0:rmax,0:rmax,0:rmax) = dcoli(0:rmax/2,0:rmax,0:rmax,0:rmax)
1326 duv(0:rmax/2,0:rmax,0:rmax,0:rmax) = dcoliuv(0:rmax/2,0:rmax,0:rmax,0:rmax)
1336 q10 = dreal(getminf2dd_cll(p10))
1337 q21 = dreal(getminf2dd_cll(p21))
1338 q32 = dreal(getminf2dd_cll(p32))
1339 q30 = dreal(getminf2dd_cll(p30))
1340 q20 = dreal(getminf2dd_cll(p20))
1341 q31 = dreal(getminf2dd_cll(p31))
1342 mm02 = getminf2dd_cll(m02)
1343 mm12 = getminf2dd_cll(m12)
1344 mm22 = getminf2dd_cll(m22)
1345 mm32 = getminf2dd_cll(m32)
1354 call d_dd(ddd,ddduv,q10,q21,q32,q30,q20,q31, &
1355 mm02,mm12,mm22,mm32,rank,id)
1356 d(0:rank/2,0:rank,0:rank,0:rank) = ddd(0:rank/2,0:rank,0:rank,0:rank)
1357 duv(0:rank/2,0:rank,0:rank,0:rank) = ddduv(0:rank/2,0:rank,0:rank,0:rank)
1359 call ddgetacc(accreldd,accabsdd,accrel2dd,accabs2dd,ndd,rankdd,accflagdd,errflagdd,id)
1360 if (
present(derr)) derr(0:rmax) = accabsdd(0:rmax)
1361 if (
present(derr2)) derr2(0:rmax) = accabs2dd(0:rmax)
1363 norm = abs(d(0,0,0,0))
1368 norm = max(norm,abs(d(0,n1,n2,n3)))
1372 if (norm.eq.0d0) then
1373 norm = max(abs(p10),abs(p21),abs(p32),abs(p30),abs(p20),abs(p31), &
1374 abs(m02),abs(m12),abs(m22),abs(m32))
1375 if(norm.ne.0d0) then
1378 norm=1d0/muir2_cll**2
1381 if (norm.ne.0d0) then
1382 dacc = accabsdd(0:rmax)/norm
1383 dacc2 = accabs2dd(0:rmax)/norm
1388 if (mflag)
call propagateaccflag_cll(dacc,rmax)
1398 call calcd(dcoli,dcoliuv,p10,p21,p32,p30,p20,p31, &
1399 m02,m12,m22,m32,rmax,id,derraux,derr2aux)
1401 d(0:rmax/2,0:rmax,0:rmax,0:rmax) = dcoli(0:rmax/2,0:rmax,0:rmax,0:rmax)
1402 duv(0:rmax/2,0:rmax,0:rmax,0:rmax) = dcoliuv(0:rmax/2,0:rmax,0:rmax,0:rmax)
1410 q10 = dreal(getminf2dd_cll(p10))
1411 q21 = dreal(getminf2dd_cll(p21))
1412 q32 = dreal(getminf2dd_cll(p32))
1413 q30 = dreal(getminf2dd_cll(p30))
1414 q20 = dreal(getminf2dd_cll(p20))
1415 q31 = dreal(getminf2dd_cll(p31))
1416 mm02 = getminf2dd_cll(m02)
1417 mm12 = getminf2dd_cll(m12)
1418 mm22 = getminf2dd_cll(m22)
1419 mm32 = getminf2dd_cll(m32)
1422 call d_dd(ddd,ddduv,q10,q21,q32,q30,q20,q31, &
1423 mm02,mm12,mm22,mm32,rank,id)
1425 d2(n0,0:rank,0:rank,0:rank) = ddd(n0,0:rank,0:rank,0:rank)
1426 d2uv(n0,0:rank,0:rank,0:rank) = ddduv(n0,0:rank,0:rank,0:rank)
1428 call ddgetacc(accreldd,accabsdd,accrel2dd,accabs2dd,ndd,rankdd,accflagdd,errflagdd,id)
1430 norm_coli = abs(d(0,0,0,0))
1431 norm_dd = abs(d2(0,0,0,0))
1436 norm_coli = max(norm_coli,abs(d(0,n1,n2,n3)))
1437 norm_dd = max(norm_dd,abs(d2(0,n1,n2,n3)))
1441 if (norm_coli.eq.0d0) then
1442 norm_coli = max(abs(p10),abs(p21),abs(p32),abs(p30),abs(p20),abs(p31), &
1443 abs(m02),abs(m12),abs(m22),abs(m32))
1444 if(norm_coli.ne.0d0) then
1445 norm_coli=1d0/norm_coli**2
1447 norm_coli=1d0/muir2_cll**2
1450 if (norm_dd.eq.0d0) then
1451 norm_dd = max(abs(p10),abs(p21),abs(p32),abs(p30),abs(p20),abs(p31), &
1452 abs(m02),abs(m12),abs(m22),abs(m32))
1453 if(norm_dd.ne.0d0) then
1454 norm_dd=1d0/norm_dd**2
1456 norm_dd=1d0/muir2_cll**2
1459 norm = min(norm_coli,norm_dd)
1462 call checkcoefsd_cll(d,d2,p10,p21,p32,p30,p20,p31, &
1463 m02,m12,m22,m32,rmax,norm,ddiff)
1466 if (derraux(rmax).lt.accabsdd(rmax)) then
1467 if (
present(derr)) derr = max(derraux,ddiff)
1468 if (
present(derr2)) derr2 = derr2aux
1469 if (norm.ne.0d0) then
1470 dacc = max(derraux/norm_coli,ddiff/norm)
1471 dacc2 = derr2aux/norm_coli
1476 if (monitoring) pointscntd_coli = pointscntd_coli + 1
1480 if (
present(derr)) derr = max(accabsdd(0:rmax),ddiff)
1481 if (
present(derr2)) derr2 = accabs2dd(0:rmax)
1482 if (norm.ne.0d0) then
1483 dacc = max(accabsdd(0:rmax)/norm_dd,ddiff/norm)
1484 dacc2 = accabs2dd(0:rmax)/norm_dd
1489 if (monitoring) pointscntd_dd = pointscntd_dd + 1
1492 if (mflag)
call propagateaccflag_cll(dacc,rmax)
1496 if (mflag)
call propagateerrflag_cll
1498 if (monitoring) then
1499 pointscntd_cll = pointscntd_cll + 1
1501 if(maxval(dacc).gt.reqacc_cll) accpointscntd_cll = accpointscntd_cll + 1
1503 if(maxval(dacc).gt.critacc_cll) then
1504 critpointscntd_cll = critpointscntd_cll + 1
1505 if ( critpointscntd_cll.le.noutcritpointsmax_cll(4) ) then
1506 call critpointsout_cll(
'D_cll',0,maxval(dacc), critpointscntd_cll)
1507 if( critpointscntd_cll.eq.noutcritpointsmax_cll(4)) then
1508 write(ncpout_cll,*)
' Further output of Critical Points for D_cll suppressed '
1516 if(maxval(dacc2).gt.reqacc_cll) accpointscntd2_cll = accpointscntd2_cll + 1
1518 if(maxval(dacc2).gt.critacc_cll) then
1519 critpointscntd2_cll = critpointscntd2_cll + 1
1520 if ( critpointscntd2_cll.le.noutcritpointsmax_cll(4) ) then
1521 call critpointsout2_cll(
'D_cll',0,maxval(dacc2), critpointscntd2_cll)
1522 if( critpointscntd2_cll.eq.noutcritpointsmax_cll(4)) then
1523 write(ncpout2_cll,*)
' Further output of Critical Points for D_cll suppressed '
1524 write(ncpout2_cll,*)