      SUBROUTINE DFNCLR(IPT, FILPA)

C     * MAR 11/2004 - M.BERKLEY (MODIFIED for CCCMA)

C
C     * NB: PATTERN CHARACTERISTICS ARE DESCRIBED BY THE ARRAYS FILPAT,
C     *     FILTYP, FILANG AND FILSPC.
C     *     These arrays are defined in FILLPAT_BLOCKDATA

      PARAMETER(MCRA=300000,MSRA=300000)

      INTEGER         NPAT,IPT,FILPA
      REAL            DXF, DYF, DXU, DYU, CHRATIO
      REAL            LMARGN, RMARGN, BMARGN, TMARGN, PMARGN

      COMMON /FILLPATTERNS/ FILPAT, FILTYP, FILANG, FILSPC
      INTEGER         FILPAT(0:420), FILTYP(0:420)
      REAL            FILANG(0:420), FILSPC(0:420)

      REAL            XCRA(4),YCRA(4),ISRA(MCRA),FSRA(MCRA)
      COMMON /FILLCO/ LAN, LSP, LPA, LCH, LDP(8, 8)
C
C           * NOW FILL THE BOX
C
      DO J=1,8
         DO I=1,8
            LDP(I,J)=1
         ENDDO
      ENDDO
C
      IF (FILTYP(IPT) .GT. 0) THEN
         CALL GSCLIP(1)
           CALL SETPAT(FILPAT(IPT))
           CALL SFSETP(LDP)
        CALL SFSETI('DO - DOT FILL', 1)
        CALL SFSETR('AN', FILANG(IPT))
        CALL SFSETR('SP', FILSPC(IPT))
C        IF(FILPAT(IPT).GT.17..AND.FILPAT(IPT).LT.28) THEN
C           CALL SFSETI('TY',-1)
C           CALL SFSETI('CH',-1)
C           write(6,*) 'IN ',IPT,FILTYP(IPT)
C        ELSEIF(FILPAT(IPT).LT.18.OR.FILPAT(IPT).GE.28) THEN
C           CALL SETPAT(FILPAT(IPT))
C           CALL SFSETP(LDP)
           CALL SFSETI('TY', 1)
C           IF(FILTYP(IPT).LT.6) THEN
C              CALL SFSETI('CH',-FILTYP(IPT))
C           ELSE
              CALL SFSETI('CH',-FILTYP(IPT))              
C           ENDIF
C           write(6,*) 'LDP ', IPT, LDP
C        ENDIF
      ELSE
        CALL SFSETI('DO - NO DOT FILL', 0)
        CALL SFSETR('AN', FILANG(IPT))
        CALL SFSETR('SP', FILSPC(IPT))
        CALL SFSETI('TY', FILTYP(IPT))
      ENDIF
C
      FILPA = FILPAT(IPT)
C
      RETURN
      END
