P-vector to spherical polar coordinates.
Status: vector/matrix support routine.
If P is null, zero THETA, PHI and R are returned.
At either pole, zero THETA is returned.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(3) | :: | p | p-vector |
|
real(kind=wp), | intent(out) | :: | theta | longitude angle (radians) |
||
real(kind=wp), | intent(out) | :: | phi | latitude angle (radians) |
||
real(kind=wp), | intent(out) | :: | r | radial distance |
subroutine P2S ( p, theta, phi, r )
implicit none
real(wp),dimension(3),intent(in) :: p !! p-vector
real(wp),intent(out) :: theta !! longitude angle (radians)
real(wp),intent(out) :: phi !! latitude angle (radians)
real(wp),intent(out) :: r !! radial distance
call C2S ( p, theta, phi )
call PM ( p, r )
end subroutine P2S