*
* $Id$
*
* $Log$
* Revision 1.1  1996/04/01 15:03:26  mclareni
* Initial revision
*
*
#include "gen/pilot.h"
      SUBROUTINE ADDBND (N,NFREE,IFREE,NACTV,IACTV,INEW,IDNEW,NADIM,AHES
     1S,XTEMP,GFREE,GNORM)
      INTEGER N, NFREE, NACTV, INEW, IDNEW, NADIM
      INTEGER IFREE(N), IACTV(N)
      DOUBLE PRECISION GNORM
      DOUBLE PRECISION AHESS(NADIM, N), XTEMP(N), GFREE(N)
      INTEGER I, INPOS, NFRM1
      DOUBLE PRECISION RNEW
      CALL DELETE(NFREE,IFREE,INEW,INPOS)
      IF(INPOS.EQ.0) RETURN
      NACTV=NACTV+1
      IACTV(NACTV)=IDNEW*INEW
      RNEW=GNORM*GNORM-GFREE(INPOS)**2
      IF(RNEW.LT.0.0D+0) RNEW=0.0D+0
      GNORM=SQRT(RNEW)
      CALL SHRNK(NFREE,NADIM,AHESS,INPOS,XTEMP)
      IF(INPOS.EQ.NFREE) GOTO 20
      NFRM1=NFREE-1
      DO 10 I=INPOS,NFRM1
      GFREE(I)=GFREE(I+1)
 10   CONTINUE
 20   NFREE=NFREE-1
      RETURN
      END
