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:
Michele Guerini Rocco 2023-09-18 17:27:36 +02:00
parent f5a983f926
commit 61605d3478
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -65,9 +65,8 @@ contains
dens = 0
ddens = 0
! Outside the tail end both density and its
! derivatives are identically zero
if (psin >= tail%end .or. psin < 0) return
! Bail out when ψ is not available
if (psin < 0) return
if (iprof == 0) then
! Use the analytical model
@ -81,6 +80,10 @@ contains
else
! 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
! Use the interpolating spline when in range