check for NaN in math_QuaternionInSST

This commit is contained in:
Franz Roters 2012-05-11 07:37:32 +00:00
parent babf2647fb
commit f8f9c089d6
1 changed files with 16 additions and 12 deletions

View File

@ -1804,18 +1804,22 @@ pure function math_QuaternionInSST(Q, symmetryType)
real(pReal), dimension(3) :: Rodrig ! Rodrigues vector of Q real(pReal), dimension(3) :: Rodrig ! Rodrigues vector of Q
Rodrig = math_QuaternionToRodrig(Q) Rodrig = math_QuaternionToRodrig(Q)
select case (symmetryType) if (any(Rodrig/=Rodrig)) then
case (1_pInt) math_QuaternionInSST = .false.
math_QuaternionInSST = Rodrig(1) > Rodrig(2) .and. & else
Rodrig(2) > Rodrig(3) .and. & select case (symmetryType)
Rodrig(3) > 0.0_pReal case (1_pInt)
case (2_pInt) math_QuaternionInSST = Rodrig(1) > Rodrig(2) .and. &
math_QuaternionInSST = Rodrig(1) > sqrt(3.0_pReal)*Rodrig(2) .and. & Rodrig(2) > Rodrig(3) .and. &
Rodrig(2) > 0.0_pReal .and. & Rodrig(3) > 0.0_pReal
Rodrig(3) > 0.0_pReal case (2_pInt)
case default math_QuaternionInSST = Rodrig(1) > sqrt(3.0_pReal)*Rodrig(2) .and. &
math_QuaternionInSST = .true. Rodrig(2) > 0.0_pReal .and. &
end select Rodrig(3) > 0.0_pReal
case default
math_QuaternionInSST = .true.
end select
endif
end function math_QuaternionInSST end function math_QuaternionInSST