From 171a93ca30723ed1693dc802de8df5efbd39f32f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 22 Sep 2019 14:17:17 -0700 Subject: [PATCH] also small negative values cause problems Logic differs from the original formulation now --- src/rotations.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rotations.f90 b/src/rotations.f90 index bbbd51ee5..6c7e23038 100644 --- a/src/rotations.f90 +++ b/src/rotations.f90 @@ -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