      SUBROUTINE SUMM(SUM,ISUM,TERM1,ITERM1,TERM2,ITERM2,N)
C
      DOUBLE PRECISION SUM,TERM1,TERM2,TEMP1,TEMP2
      DOUBLE PRECISION FACTOR
C
      IF (TERM1.EQ.0.0D0) GO TO 30
      IF (TERM2.EQ.0.0D0) GO TO 40
      TEMP1 = TERM1
      TEMP2 = TERM2
      ISAVE = ITERM1
      IF(ITERM1 .EQ. ITERM2) GO TO 50
      MULT = IABS (ITERM1 - ITERM2)
CDVAX TEST TO PREVENT FLOATING PT OVFLOW IF EXPONENT DIFF TOO LARGE
      IF(MULT.GT.37 .AND. ITERM1.GT.ITERM2) GO TO 40
      IF(MULT.GT.37 .AND. ITERM2.GT.ITERM1) GO TO 30
      FACTOR = 10.0D0**MULT
      IF(ITERM1 .GT. ITERM2) GO TO 20
      TEMP1 = TERM1/FACTOR
      ISAVE = ITERM2
      GO TO 50
   20 TEMP2 = TERM2/FACTOR
      GO TO 50
   30 IF(N .NE. 1) GO TO 35
      SUM = TERM2
   31 ISUM = ITERM2
      GO TO 70
   35 SUM = -TERM2
      GO TO 31
   40 SUM = TERM1
      ISUM = ITERM1
      GO TO 70
   50 IF(N .NE. 1) GO TO 60
      SUM = TEMP1+TEMP2
      ISUM = ISAVE
      GO TO 70
   60 SUM = TEMP1-TEMP2
      ISUM = ISAVE
   70 IF (SUM.EQ.0.0D0) ISUM = 0
      RETURN
      END
