← Back to team overview

team-galacticus team mailing list archive

[Bug 745815] Re: Merger tree walk (with satellites) skips a node

 

The problem seems to be with the code that descends through satellite
and child progenitors in the merger tree. It's supposed to descend
through satellites first, then through children. Other routines make use
of this fact so that when they climb back up the tree, if they are
climbing from a satellite they know to check for unprocessed children in
the parent, but if climbing up from a child they assume that all
satellites and children of the parent are already processed.

The descent code currently looks as follows:

    ! Descend through satellites and children.
     do while (associated(progenitorNode%satelliteNode).or.associated(progenitorNode%childNode))
        ! Descend through any satellite nodes.
        do while (associated(progenitorNode%satelliteNode))
           progenitorNode => progenitorNode%satelliteNode
        end do
        ! Descend through any child nodes.
        do while (associated(progenitorNode%childNode))
           progenitorNode => progenitorNode%childNode
        end do
     end do

This is incorrect as it will descend through multiple levels of children
(possibly skipping some satellites on those levels) if the node it
begins from has no satellite. When the tree is traced back up those
satellites then get missed because they are assumed to have been already
processed.

A correct version works as follows:

    ! Descend through satellites and children.
    do while (associated(progenitorNode%satelliteNode).or.associated(progenitorNode%childNode))
       if (associated(progenitorNode%satelliteNode)) then
          progenitorNode => progenitorNode%satelliteNode
       else
          progenitorNode => progenitorNode%childNode
       end if
    end do

In this case, we check for possible satellite then child descent routes
at each level before proceeding to the next. With this change the test
case passes.

-- 
You received this bug notification because you are a member of Team
Galacticus, which is subscribed to trunk.
https://bugs.launchpad.net/bugs/745815

Title:
  Merger tree walk (with satellites) skips a node

Status in Galacticus: A Semi-Analytic Model of Galaxy Formation:
  Confirmed
Status in Galacticus trunk series:
  Confirmed

Bug description:
  When outputting a merger tree (and so presumably in other cases also)
  the merger tree walk can sometimes skip over a node. This is
  problematic since: a) the node will not be output and b) it can fail
  to be updated (e.g. in cases where histories are extended to the next
  output time at each output).



References