C
C *** SPEC DATA 1 + DATA 2 ***
C
      PROGRAM MWVADD
C
      PARAMETER(MOM=1025)
      IMPLICIT REAL*8(A-H,O-Z)
      CHARACTER FNAME*30
      COMPLEX*16 FOUR1(MOM),FOUR2(MOM)
C
C *** HEAD ***
C
      WRITE(*,1000)MOM
 1000 FORMAT(/' From MWVADD (main): FOUR1 + FOUR2'
     *  /' MOM =',I5)  
C
      WRITE(*,*)
      WRITE(*,1100)
      READ(*,*)IWS
 1100 FORMAT(/' Enter Weak(=0) or Strong(=1) Data   : ',\)
C
C *** INPUT OF DATA 1 ***
C
      WRITE(*,*)
   10 WRITE(*,1200)
      READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 10
 1200 FORMAT(/' Enter spec file name of data 1: ',\)
C      
      OPEN(8,FILE=FNAME)
        READ(8,1300)DOM1,NOM1
        NOM1=NOM1+1
        READ(8,1310)
        IF(IWS.EQ.1)THEN
          DO 100 K=2,NOM1,5
            READ(8,1320)(FOUR1(K+J),J=0,4)
  100     CONTINUE
        ELSE
          DO 120 K=2,NOM1,5
            READ(8,1330)(FOUR1(K+J),J=0,4)
  120     CONTINUE
        END IF
      CLOSE(8)
C
 1300 FORMAT(F15.8,I15)
 1310 FORMAT(///)
 1320 FORMAT(10F8.2)
 1330 FORMAT(10F8.5)
C
C *** INPUT OF DATA 2 ***
C
      WRITE(*,*)
   20 WRITE(*,2200)
      READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 20
 2200 FORMAT(/' Enter spec file name of data 2: ',\)
C      
      OPEN(8,FILE=FNAME)
        READ(8,2300)DOM2,NOM2
        NOM2=NOM2+1
        READ(8,2310)
        IF(IWS.EQ.1)THEN
          DO 200 K=2,NOM2,5
            READ(8,2320)(FOUR2(K+J),J=0,4)
  200     CONTINUE
        ELSE
          DO 220 K=2,NOM2,5
            READ(8,2330)(FOUR2(K+J),J=0,4)
  220     CONTINUE
        END IF
      CLOSE(8)
C
 2300 FORMAT(F15.8,I15)
 2310 FORMAT(///)
 2320 FORMAT(10F8.2)
 2330 FORMAT(10F8.5)
C
C *** CHECK ***
C
      IF(DABS(DOM1-DOM2).GT.(DOM1/10000.D0))THEN
        WRITE(*,*)
        WRITE(*,*)' DOM1.NE.DOM2 !!!!!'
        WRITE(*,*)' DOM1,DOM2 =',DOM1,DOM2
        STOP
      END IF
C
      IF(NOM1.NE.NOM2)THEN
        WRITE(*,*)
        WRITE(*,*)' NOM1.NE.NOM2 !!!!!'
        WRITE(*,*)' NOM1,NOM2 =',NOM1,NOM2
        STOP
      END IF
C
C *** INPUT OF DATA 2 ***
C
      WRITE(*,*)
   30 WRITE(*,3200)
      READ(*,'(A)')FNAME
      IF(FNAME(1:1).EQ.' ')GOTO 30
 3200 FORMAT(/' Enter spec file name (data 1 + data 2): ',\)
C      
      OPEN(8,FILE=FNAME)
        WRITE(8,3300)DOM1,NOM1-1
        WRITE(8,3310)
        IF(IWS.EQ.1)THEN
          DO 300 K=2,NOM1,5
            WRITE(8,3320)((FOUR1(K+J)+FOUR2(K+J)),J=0,4)
  300     CONTINUE
        ELSE
          DO 320 K=2,NOM1,5
            WRITE(8,3330)((FOUR1(K+J)+FOUR2(K+J)),J=0,4)
  320     CONTINUE
        END IF
      CLOSE(8)
C
 3300 FORMAT(F15.8,I15)
 3310 FORMAT(///)
 3320 FORMAT(10F8.2)
 3330 FORMAT(10F8.5)
C
      RETURN
      END
