*
* $Id$
*
* $Log$
* Revision 1.1  1996/04/01 15:03:26  mclareni
* Initial revision
*
*
#include "gen/pilot.h"
      SUBROUTINE FEASMV (N,NFREE,IFREE,X,PFREE,XLOW,XHI,TOL,STEPMX,INEW,
     1IDNEW)
      INTEGER N, NFREE, INEW, IDNEW
      INTEGER IFREE(NFREE)
      DOUBLE PRECISION TOL, STEPMX
      DOUBLE PRECISION X(N), PFREE(NFREE), XLOW(N), XHI(N)
      INTEGER I, IDIR, II
      DOUBLE PRECISION STEP
C*NS  DOUBLE PRECISION DABS
      STEPMX=1.0D+30
      DO 30 I=1,NFREE
      II=IFREE(I)
      IF(ABS(PFREE(I)).LT.TOL) GOTO 30
      IF(PFREE(I).GT.0.0D+0) GOTO 10
      STEP=(XLOW(II)-X(II))/PFREE(I)
      IDIR=1
      GOTO 20
 10   STEP=(XHI(II)-X(II))/PFREE(I)
      IDIR=-1
 20   IF(STEP.GE.STEPMX) GOTO 30
      STEPMX=STEP
      INEW=II
      IDNEW=IDIR
 30   CONTINUE
      RETURN
      END
