Compute orthogonal rotation matrix.
Compute matrix so that
Compute
is computed last to allow for the possibility that
sig
may be in the same location as a
or b
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp) | :: | a | ||||
real(kind=wp) | :: | b | ||||
real(kind=wp), | intent(out) | :: | c | |||
real(kind=wp), | intent(out) | :: | s | |||
real(kind=wp) | :: | sig |
subroutine g1(a,b,c,s,sig) implicit none real(wp) :: a real(wp) :: b real(wp) :: sig real(wp),intent(out) :: c real(wp),intent(out) :: s real(wp) :: xr, yr if ( abs(a)>abs(b) ) then xr = b/a yr = sqrt(one+xr**2) c = sign(one/yr,a) s = c*xr sig = abs(a)*yr else if ( abs(b)>zero ) then xr = a/b yr = sqrt(one+xr**2) s = sign(one/yr,b) c = s*xr sig = abs(b)*yr else sig = zero c = zero s = one end if end if end subroutine g1