fix density calculation in analytical mode
In the analytical mode the density does not have a tail, so tail%end is not initialised. The density is exactly zero at ψ≥1.
This commit is contained in:
parent
f5a983f926
commit
61605d3478
@ -65,9 +65,8 @@ contains
|
|||||||
dens = 0
|
dens = 0
|
||||||
ddens = 0
|
ddens = 0
|
||||||
|
|
||||||
! Outside the tail end both density and its
|
! Bail out when ψ is not available
|
||||||
! derivatives are identically zero
|
if (psin < 0) return
|
||||||
if (psin >= tail%end .or. psin < 0) return
|
|
||||||
|
|
||||||
if (iprof == 0) then
|
if (iprof == 0) then
|
||||||
! Use the analytical model
|
! Use the analytical model
|
||||||
@ -81,6 +80,10 @@ contains
|
|||||||
else
|
else
|
||||||
! Use the numerical data
|
! Use the numerical data
|
||||||
|
|
||||||
|
! Past the tail end both density and its
|
||||||
|
! derivatives are identically zero
|
||||||
|
if (psin >= tail%end) return
|
||||||
|
|
||||||
if (psin < tail%start) then
|
if (psin < tail%start) then
|
||||||
! Use the interpolating spline when in range
|
! Use the interpolating spline when in range
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user