Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
!***********************************************************************
!
!
SUBROUTINE init_pos
!
!
!***********************************************************************
!
!
! Subroutine to apply correction factor to make the leap-frog
! algorithm self-starting (Hernquist and Katz, Ap. J. Suppl.,
! in press [1988]).
!
!
!=======================================================================
USE fly_h
implicit none
! Declaration of local variables.
! -------------------------------
REAL(KIND=8) :: dt2,a_dot
INTEGER :: p,k
!
!=======================================================================
! Loop over all spatial coordinates for all bodies.
! -------------------------------------------------
dt2=dtime**2
ap=f_ap/tnow
a_dot = om_sum+Omega_l*(tnow**three_o_alpha)
bp = 1./(alpha2*(hubble*hubble)*a_dot*(tnow**2.))
DO p=1,nb_res_loc(me+1)
DO k=1,ndim
pos(k,p) = pos(k,p) + vel(k,p)*dtime2 + &
& (-2.0*ap*vel(k,p)+bp*acc(k,p))*dt2/8.0
ENDDO
ENDDO
RETURN
END