      SUBROUTINE DBLSC(INDIC,QQQ,DEVT)
C----------------------------------------------------------------------
C-
C-   Purpose and Methods :
C-
C-   Inputs  :
C-   Outputs :
C-   Controls:
C-
C-   Created  31-JAN-1995   MIRKO BOEZIO
C-
C----------------------------------------------------------------------
      IMPLICIT NONE

      INCLUDE 'INTEST.TXT'

      INTEGER J,K,L,M,INDIC,NGIR,ISTOP
      INTEGER LK,LVMIN,DBLS
      REAL A,B,VAR
      REAL QQQ,DAT,DAD,RR,DD
      REAL POS,ANGOL,DBLSQ
      REAL DEVT
      REAL RIL(NCHA/2)
      REAL YY(2),XX(2)
      REAL DBNCL(4)
      REAL DBCLUS(4,NCHA)
      REAL DIST
C
      REAL CX,CY, PIANO(NPLAV)
      REAL BAR(2,NPLAV),SHIFT
      INTEGER ITL, LPIANO
      INTEGER II 
      INTEGER IBAR(2,NPLAV)
C
      COMMON / SHIFT / SHIFT
      SAVE / SHIFT /
C
      COMMON / ANGOLO / BAR, IBAR
      SAVE / ANGOLO /
C
      COMMON / WHERE / CX, CY, PIANO
      SAVE / WHERE /
C
      COMMON /SDOUBLE/ POS,ANGOL,DBLSQ,DBLS
      SAVE / SDOUBLE /
C
C     Begin!
C     
      LPIANO = NPLA / 2
C     
      DO K = 1,NCHA/2
         RIL(K) = 1000.
      ENDDO
C     
      DO J = 1,4
         DO K = 1,NCHA
            DBCLUS(J,K) = CLUS4(1,J,K)
         ENDDO
         DBNCL(J) = NCL4(1,J)
      ENDDO
C     
      QQQ = 0.
      INDIC = 0
      NGIR = 0
      M = 1
C     
      DO 5 J = 1,2
C     
         IF (J.EQ.1) ITL = (LPIANO-6 + 1) / 2
         IF (J.EQ.2) ITL = (LPIANO + LPIANO-6 + 1) / 2
         
         DAD = BAR(M,ITL) 
C     
         NGIR = NCL4(M,J)
         IF (NGIR.EQ.0) GO TO 5
         DO L = 1,NGIR
            RR = ABS(DAD - CLUS4(M,J,L))
            DD = CLUS4(M,J,L)
            IF (RR.LE.10) THEN
               DBNCL(J) = DBNCL(J) - 1
               DBCLUS(J,L) = 0.
               DBCLUS(J,L+NCHA/2) = 0.
            ENDIF
         ENDDO
C     
 5    CONTINUE
C     
      DO J = 1,2
C     
         IF (J.EQ.1) ITL = (LPIANO-6 + 1) / 2
         IF (J.EQ.2) ITL = (LPIANO + LPIANO-6 + 1) / 2
C     
C     CHE COS'E' QUESTO DIST?
C
         II = MOD((ITL-1),2)
         DIST = II * 8.09 + INT((ITL-1)/2) * (8.09 + 10.09)
         IF (M.EQ.1) DIST = -DIST - 0.68 - 5.81
C
         DAT = DIST * ANGOL
C     
         DAD = POS + DAT
C     
         NGIR = NCL4(M,J)
C     
         IF (NGIR.GE.1) THEN
            DO L = 1,NGIR
               RIL(L) = ABS(DAD - DBCLUS(J,L))
               RR = RIL(L)
               IF (RIL(L).LE.15.AND.DBCLUS(J,L).NE.0) THEN
                  QQQ = QQQ + DBCLUS(J,L+NCHA/2)
               ENDIF
            ENDDO
            LK = LVMIN(RIL,NCHA/2)
            IF (RIL(LK).LE.10.AND.DBCLUS(J,LK).NE.0) THEN
               YY(J) = DBCLUS(J,LK)
            ENDIF
c 7       ENDIF
        ENDIF
      ENDDO
C     
      CALL LFIT(XX,YY,2,0,A,B,VAR)
      DEVT = ANGOL - A
C     
      DO K = 1,NCHA/2
         RIL(K) = 1000.
      ENDDO
C     
      ISTOP = 0
C     
      IF (QQQ.GT.30.AND.ISTOP.EQ.0) INDIC = 1
C     
c  999 RETURN
      RETURN
      END
