1 | ! declarations of global variables |
2 | module nbodyvars |
3 | real, dimension ( : , : ), allocatable :: X, V, M |
4 | integer NB ! number of particles |
5 | real G |
6 | end module |
7 | ! allocate arrays |
8 | subroutine setup ( ) |
9 | use nbodyvars |
10 | open (10, file=fnm, status="OLD") |
11 | read (10, *) NB |
12 | allocate (X (3, NB)) |
13 | allocate (V (3, NB)) |
14 | . . . |
15 | end subroutine |