Skip to content

Commit

Permalink
fix: Avoid retabulation of delta_crit(t) during merger tree building
Browse files Browse the repository at this point in the history
If delta_crit(t) gets retabulated during merger tree construction it can lead to branch mis-ordering which leads to an infinite loop. A temporary fix is to force delta_crit(t) to be pre-tabulated to the earliest time at which it will be needed. This fix extends that pre-tabulation to slightly earlier times still to avoid any retabulation being triggered by small oversteps of the earliest time.
  • Loading branch information
abensonca committed Aug 2, 2021
1 parent 1218d96 commit d61db4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/merger_trees.construct.builder.Cole2000.F90
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ subroutine cole2000Build(self,tree)
! critical overdensity classes which rely on tabulation and which have to retabulate themselves should ensure that they simply
! expand their range without changing any of the previous computed values (as we do for expansion factor vs. time in the
! cosmology function class).
deltaCriticalEarliest=+self%criticalOverdensity_ %value (time=self%timeEarliest,mass=basic%mass(),node=node) &
& *self%cosmologicalMassVariance_%rootVariance(time=self%timeNow ,mass=basic%mass() ) &
& /self%cosmologicalMassVariance_%rootVariance(time=self%timeEarliest,mass=basic%mass() )
deltaCriticalEarliest=+self%criticalOverdensity_ %value (time=self%timeEarliest/2.0d0,mass=basic%mass(),node=node) &
& *self%cosmologicalMassVariance_%rootVariance(time=self%timeNow ,mass=basic%mass() ) &
& /self%cosmologicalMassVariance_%rootVariance(time=self%timeEarliest/2.0d0,mass=basic%mass() )
! Convert time for base node to critical overdensity (which we use as a time coordinate in this class).
baseNodeTime = basic%time ()
rootVarianceGrowthFactor=+self%cosmologicalMassVariance_%rootVariance(time= baseNodeTime ,mass=basic%mass() ) &
Expand Down

0 comments on commit d61db4b

Please sign in to comment.