! Subroutine for computing the 1 norm of
! a vector
! Dummy variable declarations.
! NOTE: When passing vectors to a subroutine, use
! a dummy variable to size the vector in the subrouine.
! In this case, we are using the n varaible as the size of
! Do not use NMAX to size the vector.
INTEGER,INTENT(IN) :: n
REAL(kind=dp),INTENT(IN) :: x(n)
REAL(kind=dp),INTENT(OUT) :: outnorm
! Local variable declarations
INTEGER :: i
! Main loop to compute the 1 norm
outnorm = 0
DO i = 1,n
outnorm = outnorm + ABS(x(i))
END SUBROUTINE norm1