Scripted HTML version of Foils prepared 12 November 1996
Foil 11 Pipeline Algorithm Grav -- Part I
From CPS615-End of N-Body Discussion and Beginning of Numerical Integration Delivered Lectures of CPS615 Basic Simulation Track for Computational Science -- 15 October 96. byGeoffrey C. Fox * Secs 84.9
function Grav(X,M)
C accepts positions of particles X and masses of particles M
C returns accelerations in Grav
integer, parameter :: N =number of particles
real, parameter :: G = gravitational constant
real, dimension (1:3, 1:N) :: X,M,Grav
real, dimension (1:3,1:N) :: A, Xc, Mc, Ac, D, R
integer k
! A is fixed accelerations - X and M are used for fixed positions and masses
A=0.0
Ac=0.0 ! circulating accelerations
Xc=X ! circulating positions
M=G*M ! precalculate mass * gravitational constant