also small negative values cause problems

Logic differs from the original formulation now
This commit is contained in:
Martin Diehl 2019-09-22 14:17:17 -07:00
parent 6b5b0fae22
commit 171a93ca30
1 changed files with 2 additions and 2 deletions

View File

@ -462,8 +462,8 @@ pure function qu2ro(qu) result(ro)
real(pReal) :: s
real(pReal), parameter :: thr = 1.0e-8_pReal
if (qu(1) < thr) then
ro = [qu(2), qu(3), qu(4), IEEE_value(ro(4),IEEE_positive_inf)]
if (abs(qu(1)) < thr) then
ro = [qu(2), qu(3), qu(4), IEEE_value(1.0_pReal,IEEE_positive_inf)]
else
s = norm2(qu(2:4))
if (s < thr) then