10 type(tester_t) :: test
12 double precision,
parameter :: dt = 0.2
13 double precision,
parameter :: gamma = atan(1.d0)*4
14 double precision,
parameter :: v0 = 0.03
15 integer,
parameter :: l = 8
16 integer,
parameter :: b = 4
17 integer,
parameter :: N=8*l**(b+1)
20 integer :: i, j, i_block
24 double precision :: x(3)
25 double precision :: y(4)
26 double precision :: z(2, 5)
28 double precision :: comp(l)
30 call test%init(tolerance64=1d-8)
33 call acf2%init(l, b, dim=
size(x))
34 call acf3%init(l, b, n=
size(y))
35 call acf4%init(l, b, dim=
size(z, dim=1), n=
size(z, dim=2))
42 do j = 1,
size(z, dim=2)
43 z(1, j) = cos(gamma*i)
53 comp = [ ((i*dt*v0*l**(i_block-1))**2, i=0, l-1) ]
54 call test%assert_close(acf1%correlation(1,1,:,i_block) / acf1%count(i_block), comp)
59 call test%assert_close(acf2%correlation(1,1,:,i_block) / acf2%count(i_block), comp)
61 call test%assert_close(acf2%correlation(2,1,:,i_block) / acf2%count(i_block), comp)
63 call test%assert_close(acf2%correlation(3,1,:,i_block) / acf2%count(i_block), comp)
68 call test%assert_close(acf2%correlation(1,1,:,i_block) / acf2%count(i_block), comp)
70 call test%assert_close(acf2%correlation(2,1,:,i_block) / acf2%count(i_block), comp)
72 call test%assert_close(acf2%correlation(3,1,:,i_block) / acf2%count(i_block), comp)
77 call test%assert_close(acf3%correlation(1,1,:,i_block) / acf3%count(i_block), comp)
79 call test%assert_close(acf3%correlation(1,2,:,i_block) / acf3%count(i_block), comp)
81 call test%assert_close(acf3%correlation(1,3,:,i_block) / acf3%count(i_block), comp)
83 call test%assert_close(acf3%correlation(1,4,:,i_block) / acf3%count(i_block), comp)
88 comp = [ ((-1)**(modulo(i+2, 2)), i=0, l-1) ]
92 call test%assert_close(acf4%correlation(1,1,:,i_block) / acf4%count(i_block), comp)
93 write(15,*) acf4%correlation(1,1,:,i_block) / acf4%count(i_block)
subroutine, public correlate_block_dot(s, c, idx, l, n, dim)
Correlation routine for dot product.
program test_correlator_0
subroutine, public correlate_block_distsq(s, c, idx, l, n, dim)
Correlation routine for squared distance.