Skip to content

Commit

Permalink
Merge pull request #483 from cgannonucm/tidally_truncated_improvement
Browse files Browse the repository at this point in the history
Improvements to the Radial Range that Subhalo Density Profiles are Tabulated when Fitting TNFW Profile
  • Loading branch information
abensonca authored Sep 28, 2023
2 parents 456ee65 + daa09bc commit 563a052
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions source/nodes.property_extractor.tidally_truncated_NFW_fit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,20 @@ function tidallyTruncatedNFWFitExtract(self,node,time,instance)
type (multiCounter ), intent(inout), optional :: instance
class (nodeComponentDarkMatterProfile ), pointer :: darkMatterProfile
class (nodeComponentSatellite ), pointer :: satellite
double precision , allocatable , dimension(:) :: radii , fractionDensity
double precision , allocatable , dimension(:) :: radii , fractionDensity
type (multiDMinimizer ), allocatable :: minimizer_
double precision , dimension(1) :: locationMinimum
double precision , parameter :: fractionRadiusOuter=0.95d0, fractionRadiusScale=0.1d0, &
& fractionMaximum =0.10d0, fractionStep =0.1d0
integer , parameter :: countRadiiPerDecade=10
integer :: countRadii , i , &
& iteration
double precision , parameter :: fractionRadiusScale =0.1d0, fractionMaximum =0.1d0, &
& radiusMaximumFractionDensityVirialMinimum=0.1d0, fractionStep =0.1d0, &
& radiusMaximumScaleVirialMaximum =1.0d1
integer , parameter :: radiusMaximumCountRadiiPerDecade =10 , countRadiiPerDecade=10
integer :: countRadii , i , &
& iteration , radiusMaximumCountRadii
logical :: converged
double precision :: radiusOuter , massTotal , &
& radiusMinimum , radiusMaximum , &
& radiusScale , radiusVirial
double precision :: radiusOuter , massTotal , &
& radiusMinimum , radiusMaximum , &
& radiusScale , radiusVirial , &
& radiusMaximumFractionDensityVirial , factorStepRadius
!$GLC attributes unused :: instance

allocate(tidallyTruncatedNFWFitExtract(3))
Expand All @@ -190,8 +192,18 @@ function tidallyTruncatedNFWFitExtract(self,node,time,instance)
radiusScale = darkMatterProfile %scale ( )
radiusVirial = self %darkMatterHaloScale_%radiusVirial (node )
! Choose radii for fitting.
radiusMaximum= fractionRadiusOuter*radiusOuter
radiusMinimum=min(fractionRadiusScale*radiusScale,fractionMaximum*radiusMaximum)
radiusMaximum=radiusVirial
if (radiusOuter > radiusVirial) then
radiusMaximumCountRadii=int(log10(radiusMaximumScaleVirialMaximum)*dble(radiusMaximumCountRadiiPerDecade)+1.0d0)
factorStepRadius = log10(radiusMaximumScaleVirialMaximum)/dble(radiusMaximumCountRadii )
do i=1,radiusMaximumCountRadii
radiusMaximum =10.0d0**(log10(radiusVirial)+factorStepRadius*dble(i))
radiusMaximumFractionDensityVirial=+self%darkMatterProfileDMO_%density(node,radiusMaximum) &
& /self%darkMatterProfileDMO_%density(node,radiusVirial )
if (radiusMaximumFractionDensityVirial < radiusMaximumFractionDensityVirialMinimum) exit
end do
end if
radiusMinimum=min(fractionRadiusScale*radiusScale,fractionMaximum*radiusMaximum,fractionMaximum*radiusOuter)
countRadii =int(log10(radiusMaximum/radiusMinimum)*dble(countRadiiPerDecade)+1.0d0)
radii =Make_Range(radiusMinimum,radiusMaximum,countRadii,rangeTypeLogarithmic)
! Tabulate the density ratio relative to an NFW profile.
Expand Down

1 comment on commit 563a052

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Milky Way model benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: 563a052 Previous: 456ee65 Ratio
Milky Way model - Likelihood - localGroupMassVelocityDispersionRelation 1.1512787904706 -logℒ 0.931769699117319 -logℒ 1.24
Milky Way model - Likelihood - localGroupStellarMassFunction 72.1724829562187 -logℒ 65.3346334051298 -logℒ 1.10

This comment was automatically generated by workflow using github-action-benchmark.

CC: @abensonca

Please sign in to comment.