diff --git a/src/equilibrium.f90 b/src/equilibrium.f90 index 9d74a73..d3506c2 100644 --- a/src/equilibrium.f90 +++ b/src/equilibrium.f90 @@ -1195,7 +1195,13 @@ contains case (EQ_EQDSK_FULL, EQ_EQDSK_PARTIAL) ! Numerical data - fq = q_spline%eval(psin) + if (psin < 1) then + fq = q_spline%eval(psin) + else + ! q is undefined or infinite + fq = 0 + end if + end select end function fq