      SUBROUTINE BANGLE(I,J,K,ANGLE, COIN)
C?      INCLUDE 'SIZES.CMN/NOLIST'
C      CALCULATES THE ANGLE BETWEEN ATOMS I,J,K
      IMPLICIT REAL (A-H,O-Z)
C?      DIMENSION COIN( 3, NUMATM)
      DIMENSION COIN( 3, * )
      CHARACTER*80 DUMMY
C
      PI = 2.0D0 * ASIN(1.0D0)
      CONV = PI / 180.0D0
      D2IJ = ( COIN(1,I)- COIN(1,J))**2 +
     .       ( COIN(2,I)- COIN(2,J))**2 +
     .       ( COIN(3,I)- COIN(3,J))**2
      D2JK = ( COIN(1,J)- COIN(1,K))**2 +
     .       ( COIN(2,J)- COIN(2,K))**2 +
     .       ( COIN(3,J)- COIN(3,K))**2
      D2IK = ( COIN(1,I)- COIN(1,K))**2 +
     .       ( COIN(2,I)- COIN(2,K))**2 +
     .       ( COIN(3,I)- COIN(3,K))**2
      XY = SQRT(D2IJ*D2JK)
      IF ( XY .LT. 1.0D-2) THEN
         WRITE ( DUMMY, '(''BANGLE: ATOMS '', 3I5,
     .                    '' HAVE ZERO SPACING.'' )' ) I, J, K
         CALL DEBUGR( DUMMY )
         CALL DEBUGR('%DRAW-F-BADDATA, ignore subsequent values.')
      ELSE
         TEMP = 0.5D0 * (D2IJ+D2JK-D2IK) / XY
      ENDIF
      IF (TEMP .GT. 1.0D0) TEMP=1.0D0
      IF (TEMP .LT. -1.0D0) TEMP=-1.0D0
      ANGLE = ACOS( TEMP ) / CONV
      RETURN
      END
