Table of Contents


xvp, xvm - direct access binary format for N-body data




xvp is a format-compatible Balcells extension to the xvm format in use by Quinn to store fixed size N-body data using FORTRAN direct access I/O.

In the original xmv (Quinn) version (3-dimensional) positions, velocities, and masses were stored, including a header, which describes the size of the upcoming data.

In the xvp Balcells-extension the masses are stored in the header (assuming the masses come in up to 13 groups) and the column which used to store the masses now contain the potentials.

Since this extension is annotated in the header, the xvp format is upward compatible with the xvm format.


The format consist of one header block, followed by many data blocks. Each block (excluding the VMS case) has a size of 7*128*NOBYTES bytes, with all atomic data being floating point numbers with NOBYTES bytes per number (being 4 or 8).


The header consists of 128 real numbers, with the following conventions (new upward compatible ones may be added in the future):
     header(1)=number of particles in this (and all subsequent) snapshot(s)
     header(2)=iteration number
     header(4)=total energy
     header(5)=total angular momentum
     header(6)=total mass
     header(8)=G (Newton’s constant)
     header(9)=epsilon (the gravitational softening length)
     header(18)=1 if a satellite is present , 0 if not.     | ???
     header(19)=ndim (only 3 is supported)
     header(20)=1 if two-galaxies model, 0 otherwise
     header(21)=ngal1+1      | gal2 comes after gal1
     header(23)=r0 galaxy 1 (half mass radius)
     header(24)=rmax galaxy 1 (initial rmax)
     header(25,26,27)= am(x,y,z) galaxy 1
     header(29)=r0 galaxy 2 (half mass radius)
     header(30)=rmax galaxy 2 (initial rmax)
     header(31,32,33)= am(x,y,z) galaxy 2
     header(100) = 1         file contains xvp, not xvm, 0 otherwise
     header(101) = nmasses   number of body mass groups
     header(102) = n1        bodies 1:n1 have mass m1
     header(103) = m1        the body mass m1
     header(104) = n2        bodies n1+1:n2 have mass m2
     header(105) = m2
     header(106) = n3
     header(107) = m3        etc.    max 13 mass groups
     header(126) = n13
     header(127) = m13
     header(128)    | currently unused 
     header(129)    | remainder unused 
     header(896)     | last header element
Note that formally up to 7*128 are available, but the last 6*128 are currently not in use.


The data consist of records of 128 particles each, with positions, velocities and an auxiliary (masses or potentials, as determined from the header)
    data(1,2,3)     positions (NDIM=3 assumed here)
    data(4,5,6)     velocities
    data(7)         auxilliary (mass/potential)
    data(8,9,10)    positions
    ... etc.


xvp multi-snapshot files must contain snapshots of equal size, so you cannot concatenate files of different particle size.

The header has no record of NOBYTES (4 or 8) or a version number (sic).

VMS may not be supported in NEMO.

See Also

nora(l) , snapshot(5NEMO)


Peter Quinn, Marc Balcells, Peter Teuben


~/src/nbody/io/xvpsnap.c    sample conversion code
~/usr/balcells/nora/{xvpread.f,xvpwrite.f}    sample I/O routines

Update History

25-may-94    documentation written        PJT

Table of Contents