C   29/10/82 501081659  MEMBER NAME  DIFFLB   (JADESR)      FORTRAN
      SUBROUTINE DIFFLB
      DATA NWR /0 /
      DATA NRD /0 /
      DATA NRR /0 /
C
    1 READ (10,END=100) IRD, IED
      NRD=NRD+1
      READ (20,END=100) IRR, IER
      NRR=NRR+1
      IF (IRD.GT.IRR .OR. IED.GT.IER) GOTO 20
      IF (IRD.EQ.IRR .AND. IED.EQ.IER) GOTO 1
    2 WRITE (30) IRD, IED
      NWR=NWR+1
C
      IF (NWR.LE.100) PRINT 50, IRD, IED, IRR, IER
   50 FORMAT('  IRD, IED, IRR, IER=',4I10)
C
      READ (10,END=100) IRD, IED
      NRD=NRD+1
      IF (IRD.GT.IRR .OR. IED.GT.IER) GOTO 20
      IF (IRD.EQ.IRR .AND. IED.EQ.IER) GOTO 1
      GOTO 2
C
  100 CONTINUE
      PRINT 101, NRD, NRR, NWR
  101 FORMAT(/'   NRD, NRR, NWR=',3I10)
      RETURN
C
   20 CONTINUE
      READ (20,END=100) IRR, IER
      NRR=NRR+1
      GOTO 1
C
      END
