      SUBROUTINE MADD(MATXI1,MATXI2,MATXO,MROW,NCOL)
C
C***********************************************************************
C
C   NAME- MADD
C
C   LANGUAGE- VS FORTRAN  TYPE- SUBROUTINE      COMPUTER- NAS 9000
C
C   VERSION- 1.0    DATE- 07/06/89   PROGRAMMER- G. RAJASHEKAR (SMSRC)
C   VERSION- 3.0    DATE- 06/04/96   PROGRAMMER- TIM GARDNER (HSTX)
C
C   FUNCTION - THIS SUBROUTINE WILL ADD TWO INPUT MATRICES OF SAME
C              SIZE AND PLACE THE RESULT IN THE OUTPUT MATRIX.  MISSING
C              VALUES ON INPUT PRODUCE MISSING VALUES ON OUTPUT.
C
C   VERSION 3.0- DOCUMENTATION AND SYNTAX CHANGES FOR ATOVS BASELINE
C                ON THE CRAY.
C
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     FUNCTION
C
C   MATXI1   REAL     I      INPUT REAL MATRIX OF DIMENSION MROW * NCOL
C   MATXI2   REAL     I      INPUT REAL MATRIX OF DIMENSION MROW * NCOL
C   MATXO    REAL     O      OUTPUT REAL MATRIX OF DIMENSION MROW * NCOL
C   MROW     INT      I      # OF ROWS IN THE INPUT & OUTPUT MATRICES
C   NCOL     INT      I      # OF COLS IN THE INPUT & OUTPUT MATRICES
C
      INTEGER MROW,NCOL
      REAL MATXI1(MROW,NCOL),MATXI2(MROW,NCOL),MATXO(MROW,NCOL)
C
C   LOCAL PARAMETERS-
C
C   NAME     TYPE    FUNCTION
C
C   I, J     INT     DO LOOP INDICES
C
      INTEGER I,J
      LOGICAL   ISR4SPV
C
      INCLUDE 'SPVAL'
C
C***********************************************************************
C
      DO 300 J = 1,NCOL
         DO 200 I = 1,MROW
            IF ((ISR4SPV(MATXI1(I,J))) .OR.
     +          (ISR4SPV(MATXI2(I,J)))) THEN
              MATXO(I,J) = R4SPV
            ELSE
              MATXO(I,J) = MATXI1(I,J) + MATXI2(I,J)
            ENDIF
  200    CONTINUE
  300 CONTINUE
C
      RETURN
      END
