*     H02CCF Example Program Text
*     Mark 20 Revised. NAG Copyright 2001.
*     .. Parameters ..
      INTEGER          NIN, NOUT, LINTVR
      PARAMETER        (NIN=5,NOUT=6,LINTVR=1)
      INTEGER          NMAX, NCMAX
      PARAMETER        (NMAX=10,NCMAX=10)
      INTEGER          LDA, LDH
      PARAMETER        (LDA=NCMAX,LDH=NMAX)
      INTEGER          LIWORK, LWORK, MDEPTH
      PARAMETER        (LIWORK=1000,LWORK=10000,MDEPTH=30)
*     .. Local Scalars ..
      DOUBLE PRECISION OBJ
      INTEGER          I, IFAIL, INFORM, J, N, NCLIN, STRTGY
*     .. Local Arrays ..
      DOUBLE PRECISION A(LDA,NMAX), AX(NCMAX), BL(NMAX+NCMAX),
     +                 BU(NMAX+NCMAX), CLAMDA(NMAX+NCMAX), CVEC(NMAX),
     +                 H(LDH,NMAX), WORK(LWORK), X(NMAX+NCMAX)
      INTEGER          INTVAR(LINTVR), ISTATE(NMAX+NCMAX), IWORK(LIWORK)
*     .. External Subroutines ..
      EXTERNAL         E04NFU, H02CBF, H02CBU, H02CCF, H02CDF, X04ABF
*     .. Executable Statements ..
      WRITE (NOUT,*) 'H02CCF Example Program Results'
*     Skip heading in data file
      READ (NIN,*)
      READ (NIN,*) N, NCLIN
      IF (N.LE.NMAX .AND. NCLIN.LE.NCMAX) THEN
*
*        Read CVEC, A, BL, BU, X and H from data file
*
         READ (NIN,*) (CVEC(I),I=1,N)
         READ (NIN,*) ((A(I,J),J=1,N),I=1,NCLIN)
         READ (NIN,*) (BL(I),I=1,N+NCLIN)
         READ (NIN,*) (BU(I),I=1,N+NCLIN)
         READ (NIN,*) (X(I),I=1,N)
         READ (NIN,*) ((H(I,J),J=1,N),I=1,N)
*
*        Set four options using H02CDF
*
         CALL H02CDF(' Print Level = 1 ')
*
         CALL H02CDF(' Check Frequency = 10 ')
*
         CALL H02CDF(' Crash Tolerance = 0.05 ')
*
         CALL H02CDF(' Infinite Bound Size = 1.0D+25 ')
*
*        Set the unit number for advisory messages to NOUT
*
         CALL X04ABF(1,NOUT)
*
*        Read the options file for the remaining options
*
         CALL H02CCF(NIN,INFORM)
*
         IF (INFORM.NE.0) THEN
            WRITE (NOUT,99998) 'H02CCF terminated with INFORM = ',
     +        INFORM
            STOP
         END IF
*
         STRTGY = 2
         INTVAR(1) = 4
*
         CALL H02CDF('Nolist')
         CALL H02CDF('Print Level = 0')
*
*        Solve the problem
*
         IFAIL = 1
*
         CALL H02CBF(N,NCLIN,A,LDA,BL,BU,CVEC,H,LDH,E04NFU,INTVAR,
     +               LINTVR,MDEPTH,ISTATE,X,OBJ,AX,CLAMDA,STRTGY,IWORK,
     +               LIWORK,WORK,LWORK,H02CBU,IFAIL)
*
*        Print out the best integer solution found
*
         WRITE (NOUT,99999) OBJ, (I,X(I),I=1,N)
*
      END IF
*
      STOP
*
99999 FORMAT (//' Optimal Integer Value is = ',D20.8,/' Components ar',
     +       'e ',/(' x(',I3,') = ',F15.8))
99998 FORMAT (A,I3)
      END
