Different Nbody codes: ------------------------------------------------------------- nbody0.f90 This is the shortest code for leapfrog integration. It has less than 40 lines. And it works. Note use of f90 constructs: vectors and intrinsic function SUM This code is simple, but it does not have all options of other codes. nbody1.f + initial.f Constant-step leapfrog integration and initial conditions. This is f77 code. Both codes - initial and nbody1 - should be linked with nbodyaux.f. For example, in order to compile nbody1, give the following command ifort -O3 nbody1.f nbodyaux.f -o nbody1.exe Configuration file is nbody1.h You need to have a subdirectory DATA. All the data files should be placed there. nbody2.f90 + initial2.f90 + nbody2aux.f90 Variable-step leapfrog f90 code. It is parallelized with OpenMP Parameters are set in module nbody2aux.f90 Four parameters define accuracy of integration: dtstep -- large integration time-step. Every large step can be split into smaller number of steps up to 2**(iMultiple). iMultiple -- if zero, then only a constant step dt is used for all particles -- if positive number, it defines the maximum number of particle species. Each specie has the same time-step. Time-steps can change only by factor two from on specie to another. At the beginning of a large step the code decides to which specie each particle belongs to. This decision is made based on (a) particle acceleration and (b) particle speed. Each condition brings in a free parameter aStep -- particle displacement dx should be less than aStep Alph -- the rate of change of velocities dV per time-step should be less than dV < Alph*V Other parameters: eps -- force softening dPrintTime-- frequency of writing snapshots, estimates of energies, and other analysis of the data RunTime -- Duration of simulation makefile -- rules of compilation: make initial2 <= complile and link initial conditions make nbody2 <= compile and link the main code make clean <= remove executables and object files all data files are read and written to subdirectory DATA