      DOUBLE PRECISION FUNCTION WNRM2 (N, XR, XI, INCX)
      IMPLICIT NONE
C
C NORM2(X)
C
      INTEGER N, INCX
      DOUBLE PRECISION XR(*), XI(*)
C
      INTEGER I, IX
      DOUBLE PRECISION S
C
      DOUBLE PRECISION PYTHAG
C
C
      S = 0.0D0
      IF (N.LE.0) GO TO 20
      IX = 1
      DO 10 I = 1, N
         S = PYTHAG (S, XR(IX))
         S = PYTHAG (S, XI(IX))
         IX = IX+INCX
10    CONTINUE
C
20    CONTINUE
      WNRM2 = S
C
      RETURN
      END
