14 integer,
parameter :: N = 3000
15 type(mt19937ar_t),
target :: mt
16 type(tester_t) :: test
18 type(threefry_rng_t) :: state(1)
20 double precision :: L(3), x(3)
22 call system_clock(count=clock)
23 call init_genrand(mt, int(clock, c_long))
25 call test% init(tolerance64=12*epsilon(1.d0))
27 call threefry_rng_init(state, int(clock, c_int64_t))
30 l = [ 1.d0, 20.d0, 5.d0 ]
31 call p% random_placement(l, state=state(1))
35 i = modulo(int(genrand_int31(mt)), n) + 1
36 x = [ genrand_real1(mt), genrand_real1(mt), genrand_real1(mt) ]
39 write(*,*)
'pos(:,i)', p% pos(:,i)
40 p% pos(:,i) = p% pos(:,i) + x
41 write(*,*)
'pos(:,i)', p% pos(:,i)
42 call test% assert_positive( sqrt(3.d0) - p% maximum_displacement() )
45 p% pos(:,i) = p% pos(:,i) - x
46 write(*,*)
'pos(:,i)', p% pos(:,i)
47 call test% assert_close( p% maximum_displacement(), 0.d0 )
program test_particle_system_0