Skip to content

Commit

Permalink
fix: Correct loop index variable
Browse files Browse the repository at this point in the history
Also fix some minor formatting and spelling issues.
  • Loading branch information
abensonca committed Sep 28, 2023
1 parent f7c2102 commit daa09bc
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions source/nodes.property_extractor.tidally_truncated_NFW_fit.F90
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,17 @@ function tidallyTruncatedNFWFitExtract(self,node,time,instance)
double precision , allocatable , dimension(:) :: radii , fractionDensity
type (multiDMinimizer ), allocatable :: minimizer_
double precision , dimension(1) :: locationMinimum
double precision , parameter :: fractionRadiusScale =0.1d0, fractionMaximum=0.10d0, &
& radiusMaximumFractionDensityVirialMinimum=0.1d0, fractionStep =0.1d0 , &
& radiusMaximumScaleVirialMaximum =1.0d1
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 , n , &
& radiusMaxiumCountRadii
integer :: countRadii , i , &
& iteration , radiusMaximumCountRadii
logical :: converged
double precision :: radiusOuter , massTotal , &
& radiusMinimum , radiusMaximum , &
& radiusScale , radiusVirial , &
& radiusMaximumFractionDensityVirial , step
double precision :: radiusOuter , massTotal , &
& radiusMinimum , radiusMaximum , &
& radiusScale , radiusVirial , &
& radiusMaximumFractionDensityVirial , factorStepRadius
!$GLC attributes unused :: instance

allocate(tidallyTruncatedNFWFitExtract(3))
Expand All @@ -195,13 +194,12 @@ function tidallyTruncatedNFWFitExtract(self,node,time,instance)
! Choose radii for fitting.
radiusMaximum=radiusVirial
if (radiusOuter > radiusVirial) then
radiusMaxiumCountRadii=int(log10(radiusMaximumScaleVirialMaximum)*dble(radiusMaximumCountRadiiPerDecade)+1.0d0)
step =log10(radiusMaximumScaleVirialMaximum)/dble(radiusMaxiumCountRadii)
do n=1,radiusMaxiumCountRadii
radiusMaximum =10**(log10(radiusVirial)+step*dble(i))
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
Expand Down

0 comments on commit daa09bc

Please sign in to comment.