Modulus of p-vector.
Status: vector/matrix support routine.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(3) | :: | p | p-vector |
|
real(kind=wp), | intent(out) | :: | r | modulus |
subroutine PM ( p, r )
implicit none
real(wp),dimension(3),intent(in) :: p !! p-vector
real(wp),intent(out) :: r !! modulus
integer :: i
real(wp) :: w, c
w = 0.0_wp
do i=1,3
c = p(i)
w = w + c*c
end do
r = sqrt(w)
end subroutine PM