NORM2(3f)

DESCRIPTION
Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along dimension DIM.

STANDARD
Fortran 2008 and later

CLASS
Transformational function

SYNTAX

RESULT = NORM2(ARRAY[, DIM])

ARGUMENTS

ARRAY Shall be an array of type REAL DIM (Optional) shall be a scalar of type INTEGER with a value in the range from 1 to n, where n equals the rank of ARRAY.

RETURN VALUE
The result is of the same type as ARRAY.

If DIM is absent, a scalar with the square root of the sum of all elements in ARRAY squared is returned. Otherwise, an array of rank n-1, where n equals the rank of ARRAY, and a shape similar to that of ARRAY with dimension DIM dropped is returned.

EXAMPLE
          PROGRAM test_sum
            REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
            print *, NORM2(x) ! = sqrt(55.) ~ 7.416
          END PROGRAM

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).