      SUBROUTINE VADD(VECI1, VECI2, VECO, NVEC)
C
C***********************************************************************
C
C   NAME- VADD
C
C   LANGUAGE- VS FORTRAN   TYPE- SUBROUTINE  COMPUTER- NAS9000
C
C   VERSION- 1.0     DATE- 07/13/89   PROGRAMMER- S.SWEETLAND (SMSRC)
C   VERSION- 3.0     DATE- 06/04/96   PROGRAMMER- TIM GARDNER (HSTX)
C
C   FUNCTION- ADDS EACH ELEMENT OF VECTOR VECI1 TO THE CORRESPONDING
C             ELEMENT OF VECTOR VECI2, AND PLACES THE RESULT IN THE
C             CORRESPONDING ELEMENT OF OUTPUT VECTOR VECO.
C             NOTE:  THE OUTPUT VECTOR CAN BE THE SAME AS ONE OF THE
C             INPUT VECTORS.
C
C   VERSION 3.0- DOCUMENTATION AND SYNTAX CHANGES FOR ATOVS BASELINE
C                ON THE CRAY.
C   VERSION- 4.0    DATE- 02/27/03   PROGRAMMER- Rickey Rollins (CSC)
C        Replace R4SPV equivalence test with ISR4SPV function
C
C   CALLING SEQUENCE PARAMETERS-
C
C   NAME   TYPE  I/O    DESCRIPTION
C
C   VECI1  REAL  I      REAL VECTOR OF DIMENSION NVEC - ADDEND
C   VECI2  REAL  I      REAL VECTOR OF DIMENSION NVEC - AUGEND
C   VECO   REAL  O      REAL VECTOR OF DIMENSION NVEC - SUM
C   NVEC   INT   I      NUMBER OF ELEMENTS IN VECI1/VECI2/VECO
C   J      I*4   I      CONTER
C
C***********************************************************************
C
      INTEGER NVEC, J
      REAL VECI1(NVEC), VECI2(NVEC), VECO(NVEC)
      LOGICAL   ISR4SPV
C
      INCLUDE 'SPVAL'
C
      DO 10 J = 1,NVEC
        IF (.NOT. ISR4SPV(VECI1(J)) .AND. .NOT. ISR4SPV(VECI2(J))) THEN
             VECO(J) = VECI1(J) + VECI2(J)
        ELSE
             VECO(J)  = R4SPV
        ENDIF
   10 CONTINUE
C
      RETURN
      END
