      SUBROUTINE MCONNECT(FILL,XVAL,YVAL,PTS,DELTA)
C
C ROUTINE TO CONNECT ADJACENT ARRAY POINTS WITH INDEPENDENT DELTAS
C LESS THAN <DELTA> WHILE REMOVING FILL VALUES.
C
      INTEGER*4 PTS
      REAL*4 X(2),Y(2),XVAL(1),YVAL(1)
C
C FILL  FILL DATA VALUE
C XVAL  INDEPENDENT AXIS ARRAY
C YVAL  DEPENDENT AXIS ARRAY
C PTS   NUMBER OF ELEMENTS IN PARALLEL ARRAYS XVAL & VAL
C DELTA MAXIMUM GAP BETWEEN TWO ADJACENT POINTS TO BE CONNECTED 
C
C      WRITE(6,*)
C      WRITE(6,*) '***ENTER PLOTTING SUBROUTINE***'
      IPT = 0
      N = PTS - 1
      DO 150 I=1,N
       IF ( YVAL(I).NE.FILL .AND. YVAL(I+1).NE.FILL .AND.
     .      (XVAL(I+1) - XVAL(I)).LT.DELTA ) THEN
        X(1) = XVAL(I)
        X(2) = XVAL(I+1)
        Y(1) = YVAL(I)
        Y(2) = YVAL(I+1)
        CALL MGOCONNECT(X,Y,2)
        IPT = IPT + 1
       ELSE IF ( YVAL(I).NE.FILL ) THEN
        CALL MGORELOCATE(XVAL(I),YVAL(I))
        CALL MGOPOINT(10,3)
        IPT = IPT + 1
        IF ( I.EQ.N.AND.YVAL(I+1).NE.FILL ) THEN
         CALL MGORELOCATE(XVAL(I+1),YVAL(I+1))
         CALL MGOPOINT(10,3)
         IPT = IPT + 1
        END IF
       END IF
  150 CONTINUE
C      WRITE(6,*) 'NUMBER OF INTERVALS/POINTS : ',IPT
C      WRITE(6,*) '***EXIT PLOTTING SUBROUTINE***'
C
      RETURN
      END
