*
* $Id$
*
* $Log$
* Revision 1.1  1996/04/01 15:03:24  mclareni
* Initial revision
*
*
#include "gen/pilot.h"
      SUBROUTINE NOCUT (N,XLOW,XUP,Z,IDSCNT,IDSCRM,PARTN,NFCNT)
      INTEGER N, IDSCNT, IDSCRM, NFCNT
      DOUBLE PRECISION PARTN
      DOUBLE PRECISION XLOW(N), XUP(N), Z(N)
      INTEGER I, MOD
CMM   DOUBLE PRECISION DABS, DEVMAX, DFUN, XSAVE, YMID, YLOW, YUP, YDIF
      DOUBLE PRECISION       DEVMAX, DFUN, XSAVE, YMID, YLOW, YUP, YDIF
      DEVMAX=0.0D+0
      DO 10 I=1,N
      Z(I)=0.5D+0*(XLOW(I)+XUP(I))
 10   CONTINUE
      YMID=DFUN(N,Z)
      DO 30 I=1,N
      XSAVE=Z(I)
      Z(I)=XLOW(I)
      YLOW=DFUN(N,Z)
      Z(I)=XUP(I)
      YUP=DFUN(N,Z)
      YDIF=ABS(YMID-0.5D+0*(YLOW+YUP))
      IF(YDIF.LT.DEVMAX) GOTO 20
      DEVMAX=YDIF
      PARTN=XSAVE
      IDSCRM=I
 20   Z(I)=XSAVE
 30   CONTINUE
      NFCNT=NFCNT+2*N+1
      IF(DEVMAX.NE.0.0D+0) GOTO 40
      IDSCRM=MOD(IDSCNT,N)+1
      PARTN=Z(IDSCRM)
      IDSCNT=IDSCNT+1
      RETURN
 40   IDSCNT=0
      RETURN
      END
