function that calculates the Euclidean norm (L2 norm) of a vector , where where is the dimension of the real vector .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in), | dimension(:) | :: | a |
function norm_2_real(a) result(result) real(dp), dimension(:), intent(in) :: a real(dp) :: result result = sqrt(dot_product(a, a)) end function norm_2_real