The merger trees are built using the Friends of Friends (b=0.2) groups output by L-Gadget2 and the subgroups identified by SubFind. In the description below 'subhalo' means a set of particles grouped together by SubFind, which looks for gravitationally bound local density maxima. A 'halo' is a collection of subhalos grouped together in the following way:
Initially subhalos are grouped into halos by looking at the FoF groups - a halo just consists of all the subhalos belonging to one FoF group. Particles in the FoF group which do not belong to any subhalo are discarded. Note that SubFind identifies the background mass distribution of the halo as a subhalo, so each halo will normally contain one large subhalo (with most of the mass of the halo) and a set of smaller "satellite" subhalos.
The Friends of Friends algorithm often links together objects which should probably be treated as separate halos as far as the merger trees are concerned. So under certain conditions a subgroup may be split from its parent halo and considered to be a halo in its own right. This is done if 1) the subhalo is outside twice the half mass radius of the parent halo or 2) the subhalo has retained 75% of the mass it had at the last output time where it was an independant halo. This second condition is based on the assumption that a halo which has fallen into a more massive halo will rapidly be stripped of its outer layers, whereas a halo which has been artificially linked to another halo will retain its mass. When a subhalo is split off, any less massive subhalos within twice its half mass radius are also split off and become part of the new halo.
One side effect of this splitting algorithm is that the halos used in the construction of the merger trees are NOT just Friends of Friends groups. The number of halos after splitting is slightly greater than the number of Friends of Friends groups.
One merger tree is generated for each halo which exists at the final output time of the Millennium simulation (snapshot number 063). The merger tree contains information about all of the progenitors of the halo at all earlier snapshots, including a list of the subhalos in each progenitor halo and the final halo. The diagram below shows part of a possible merger tree - only the last four output times are shown:
The final halo is shown at the top with time increasing up the page. Halo mergers occur between snapshots 60-61 and 61-62, although the smaller halo in each case survives as a subhalo in the descendant halo. Between snapshots 62 and 63 one of these subhalos ceases to be identifiable as a separate object - it merges onto the main subhalo (ie the background mass distribution) of its parent halo. The other subhalo survives until the final output. Note that a halo may contain subhalos which cannot be traced back to a progenitor halo. The merger trees contain information about ALL the subhalos identified in each halo.
The descendant of a subhalo is found by following the most bound 10% of its mass or the 10 most bound particles, whichever is the greater mass. The descendant is the subhalo which contains the largest number of these particles. The descendant subhalo will usually be at the next output time, but this is not always the case. If a subhalo cannot be identified as a separate object in the next snapshot it may be possible to locate it at a later time. The merger tree building code attempts to match these subhalos to 'orphan' subhalos at any of the next five output times. Orphan subhalos are subhalos with no progenitors in the previous snapshot.
The descendant of a halo is the halo which contains the descendant of the most massive subhalo in the halo.
/data/rw1/jch/trees/treedir_063/splittrees_063.*There are 512 (Fortran unformatted) files. Each tree file starts with a header which can be read in with something like
READ(1) ntrees, ifirstsnap, ilastsnap ! All INTEGER*4The number of merger trees in this file is given by ntrees. ifirstsnap and ilastsnap give the indices of the first and last snapshots used in the construction of the merger trees - the final halos exist at snapshot ilastsnap and progenitors may exist at snapshots between isnapfirst and isnaplast. The redshifts of the snapshots are stored in the redshift array.
READ(1) redshift(ifirstsnap:ilastsnap) ! A REAL*4 array
READ(1) ifirst, ilast, nhalo, nsubhalo ! All INTEGER*4where the types of the data arrays are
READ(1) nhalostep(ifirst:ilast) ! An INTEGER*4 array
READ(1) id,np,idesc,halodecstep,nsphalo,firstsub
READ(1) subid,subnp,subidesc,subdecstep,pos,vel,veldisp,vmax,spin,mostboundid,rhalf
INTEGER*4, DIMENSION(nhalo) :: id, np, idesc, halodecstep, nsphalo, firstsub(in practice these arrays will need to be dynamically allocated as each tree is read)
INTEGER*4, DIMENSION(nsubhalo) :: subid,subnp,subidesc,subdecstep
REAL*4, DIMENSION(3,nsubhalo) :: pos, vel, spin
REAL*4, DIMENSION(nsubhalo) :: veldisp, vmax, rhalf
INTEGER*8, DIMENSION(nsubhalo) :: mostboundid
DO isub = firstsub(ihalo),firstsub(ihalo)+nsphalo(ihalo)-1,1Halos and subhalos are stored in order of the snapshot they exist at, earliest first. Halos and subhalo which exist in the same snapshot are stored consecutively so the nhalostep array can be used to find all the halos in the tree at a given snapshot. To loop over all halos at snapshot isnap and write out their IDs and masses for example:
WRITE(*,*)subnp(isub),pos(1,isub),pos(2,isub),pos(3,isub)
END DO
istart = SUM(nhalostep(ifirst:isnap - 1)) + 1To locate the descendant of a halo ihalo it is neccesary to find the halo jhalo at snapshot halodecstep(ihalo) such that idesc(ihalo) = id(jhalo). Subhalo descendants may be found in the same way.
ifinish = istart + nhalostep(isnap) - 1
DO ihalo = istart, ifinish, 1
WRITE(*,*)id(ihalo),np(ihalo)
END DO