Skip to content

Commit

Permalink
Merge pull request #702 from galacticusorg/fixConcentrationMeanSchnei…
Browse files Browse the repository at this point in the history
…der2015

fix: Correctly compute the mean concentration when using the `schneider2015` class
  • Loading branch information
abensonca authored Sep 17, 2024
2 parents 3f3d9a2 + 764d2d0 commit 61a6ae9
Showing 1 changed file with 42 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@
class (cosmologicalMassVarianceClass ), pointer :: referenceCosmologicalMassVariance => null(), cosmologicalMassVariance_ => null()
type (rootFinder ) :: finder
double precision :: massFractionFormation
contains
contains
!![
<methods>
<method method="concentrationCompute" description="Compute the concentration for the given {\normalfont \ttfamily node}"/>
</methods>
!!]
final :: schneider2015Destructor
procedure :: concentration => schneider2015Concentration
procedure :: concentrationMean => schneider2015ConcentrationMean
procedure :: concentrationCompute => schneider2015ConcentrationCompute
procedure :: densityContrastDefinition => schneider2015DensityContrastDefinition
procedure :: darkMatterProfileDMODefinition => schneider2015DarkMatterProfileDefinition
end type darkMatterProfileConcentrationSchneider2015
Expand Down Expand Up @@ -179,7 +186,33 @@ subroutine schneider2015Destructor(self)
return
end subroutine schneider2015Destructor

double precision function schneider2015Concentration(self,node)
double precision function schneider2015Concentration(self,node) result(concentration)
!!{
Return the concentration of the dark matter halo profile of {\normalfont \ttfamily node} using the algorithm of
\cite{schneider_structure_2015}.
!!}
implicit none
class(darkMatterProfileConcentrationSchneider2015), intent(inout), target :: self
type (treeNode ), intent(inout), target :: node

concentration=self%concentrationCompute(node,mean=.false.)
return
end function schneider2015Concentration

double precision function schneider2015ConcentrationMean(self,node) result(concentration)
!!{
Return the mean concentration of the dark matter halo profile of {\normalfont \ttfamily node} using the algorithm of
\cite{schneider_structure_2015}.
!!}
implicit none
class(darkMatterProfileConcentrationSchneider2015), intent(inout) :: self
type (treeNode ), intent(inout), target :: node

concentration=self%concentrationCompute(node,mean=.true.)
return
end function schneider2015ConcentrationMean

double precision function schneider2015ConcentrationCompute(self,node,mean) result(concentration)
!!{
Return the concentration of the dark matter halo profile of {\normalfont \ttfamily node} using the algorithm of
\cite{schneider_structure_2015}.
Expand All @@ -190,6 +223,7 @@ double precision function schneider2015Concentration(self,node)
implicit none
class (darkMatterProfileConcentrationSchneider2015), intent(inout), target :: self
type (treeNode ), intent(inout), target :: node
logical , intent(in ) :: mean
class (nodeComponentBasic ) , pointer :: basic
integer :: status
double precision :: mass , &
Expand Down Expand Up @@ -240,10 +274,14 @@ double precision function schneider2015Concentration(self,node)
end if
! Compute the concentration of a node of this mass in the reference model.
call basic%massSet(massReference)
schneider2015Concentration=self%referenceConcentration%concentration(node)
if (mean) then
concentration=self%referenceConcentration%concentrationMean(node)
else
concentration=self%referenceConcentration%concentration (node)
end if
call basic%massSet(mass )
return
end function schneider2015Concentration
end function schneider2015ConcentrationCompute

double precision function schneider2015ReferenceCollapseMassRoot(massReference)
!!{
Expand Down

0 comments on commit 61a6ae9

Please sign in to comment.