      SUBROUTINE CONTDF(PB)

C     * MAY 13/2004 - F.MAJAESS (ENSURE "ITYPE" CHECK IS DONE AS INTEGER)
C     * MAR 11/2004 - M.BERKLEY (MODIFIED for CCCMA)

      IMPLICIT NONE

C CONTour level DeFinition routine.
C This routine is called before shading.
      LOGICAL PB

      INTEGER I
C
      CHARACTER*4 ATYPE, CSPPL, CGGPL
      INTEGER*4 ITYPE, ISPPL, IGGPL
C ITYPE is used by all plotting programs.
      COMMON /CCCPLOT/ ITYPE

C For passing colour index array into colour FILL routines through
C Common Block.
      INTEGER NIPAT, NPAT, MAXPAT, MAXCLRS
      REAL TOL
      PARAMETER (TOL = 1D-3)
      PARAMETER(NIPAT = 28)
      INTEGER IPAT(NIPAT)
      REAL ZLEV(NIPAT)
      COMMON /FILLCB/ IPAT, ZLEV, NPAT, MAXPAT, MAXCLRS
      EQUIVALENCE (CSPPL,ISPPL)
      EQUIVALENCE (CGGPL,IGGPL)

      CSPPL='SPPL'
      CGGPL='GGPL'

C     IF (ITYPE .EQ. 'SPPL') THEN
      IF (ITYPE .EQ. ISPPL) THEN
        CALL CPSETR('VPL', .1)
        CALL CPSETR('VPR', .9)
        CALL CPSETR('VPB', .1)
        CALL CPSETR('VPT', .9)
        CALL CPSETI('SET - DO-SET-CALL FLAG', 1)
C     ELSE IF (ITYPE .NE. 'GGPL') THEN
      ELSE IF (ITYPE .NE. IGGPL) THEN
        CALL CPSETI('SET - DO-SET-CALL FLAG', 0)
      END IF
      CALL CPSETI('CLS - CONTOUR LEVEL SELECTION FLAG', 0)
      CALL CPSETI('NCL - NUMBER OF CONTOUR LEVELS', NPAT)
      DO 10 I = 1, NPAT
         CALL CPSETI('PAI - PARAMETER ARRAY INDEX', I)
         CALL CPSETR('CLV - CONTOUR LEVEL VALUES', ZLEV(I))
         CALL CPSETI('CLU - CONTOUR LEVEL USE FLAGS', 1)
         IF(.NOT.PB.AND.ZLEV(I).LT.0D0) THEN
            CALL CPSETC('CLD',"$$$$''")
         ENDIF
 10   CONTINUE

      RETURN
      END
