! declarations of global variables |
module nbodyvars |
real, dimension ( : , : ), allocatable :: X, V, M |
integer NB ! number of particles |
real G |
end module |
! allocate arrays |
subroutine setup ( ) |
use nbodyvars |
open (10, file=fnm, status="OLD") |
read (10, *) NB |
allocate (X (3, NB)) |
allocate (V (3, NB)) |
. . . |
end subroutine |