Sort_nodes is a small program. It does only modify the structure tree provided by AdaptaHOP.
Its input is the file filenode (.i.e. output of AdaptaHOP ).
This code detect for each node its most dense child. Then it defines this child as part of its host node. Thus we are able to sort the structure tree provided by AdaptaHOP, defining , for example, the most-dense sub-halo of a halo as its center.
Its output is the file filenodeout, and has the same format as the input filenode.