*
* $Id$
*
* $Log$
* Revision 1.1  1996/04/01 15:03:26  mclareni
* Initial revision
*
*
#include "gen/pilot.h"
      SUBROUTINE MULCHK (N,NACTV,IACTV,IIMIN,TOL,X,XHI,FTRUE,DELTA,XTEMP
     1,GACTV,NEGMUL,IBDEL,IBTRUE)
      INTEGER N, NACTV, IIMIN, IBDEL, IBTRUE
      INTEGER IACTV(NACTV)
      LOGICAL NEGMUL
      DOUBLE PRECISION FTRUE, DELTA, TOL
      DOUBLE PRECISION X(N), XHI(N), XTEMP(N), GACTV(NACTV)
      INTEGER I
      DOUBLE PRECISION SIG, XLTEST, XMULOW
      CALL GRDCMP(N,NACTV,IACTV,X,FTRUE,DELTA,XHI,XTEMP,GACTV)
      IF(IIMIN.EQ.1) GOTO 20
      DO 10 I=1,NACTV
      GACTV(I)=-GACTV(I)
 10   CONTINUE
 20   NEGMUL=.FALSE.
      IBDEL=0
      IBTRUE=0
      XMULOW=0.0D+0
      DO 30 I=1,NACTV
      SIG=1.0D+0
      IF(IACTV(I).LT.0) SIG=-1.0D+0
      XLTEST=GACTV(I)*SIG
      IF(XLTEST.GE.(-TOL)) GOTO 30
      NEGMUL=.TRUE.
      IF(XLTEST.GE.XMULOW) GOTO 30
      XMULOW=XLTEST
      IBDEL=I
      IBTRUE=IACTV(I)
 30   CONTINUE
      RETURN
      END
