111
|
1 ! { dg-do compile }
|
|
2 ! { dg-options "-std=gnu -fno-tree-scev-cprop -Ofast" }
|
|
3
|
|
4 subroutine CalcCgr(C,rmax,ordgr_max)
|
|
5 integer, intent(in) :: rmax,ordgr_max
|
|
6 double complex :: Zadj(2,2), Zadj2(2,2)
|
|
7 double complex, intent(out) :: C(0:rmax,0:rmax,0:rmax)
|
|
8 double complex, allocatable :: Cexpgr(:,:,:,:)
|
|
9 double complex :: Caux
|
|
10 integer :: rmaxB,rmaxExp,r,n0,n1,n2,k,l,i,j,m,n,nn
|
|
11
|
|
12 rmaxB = 2*rmax
|
|
13 rmaxExp = rmaxB
|
|
14 allocate(Cexpgr(0:rmaxExp/2,0:rmaxExp,0:rmaxExp,0:ordgr_max))
|
|
15
|
|
16 rloop: do r=0,rmaxExp/2
|
|
17 do n0=r,1,-1
|
|
18 do nn=r-n0,0,-1
|
|
19 do i=1,2
|
|
20 Caux = Caux - Zadj(i,l)
|
|
21 end do
|
|
22 Cexpgr(n0,0,0,0) = Caux/(2*(nn+1))
|
|
23 end do
|
|
24 end do
|
|
25 do n1=0,r
|
|
26 n2 = r-n1
|
|
27 if (r.le.rmax) then
|
|
28 C(0,n1,n2) = Cexpgr(0,n1,n2,0)
|
|
29 end if
|
|
30 end do
|
|
31 end do rloop
|
|
32 end subroutine CalcCgr
|