      SUBROUTINE GROUP(NGROUP,IGROUP)
      DIMENSION IGROUP(*)
      LOGICAL ERROR
      CHARACTER LINE*80
      NGROUP = 0
      CALL UPROMP ( 'Input list of atoms to move: ' )
      READ ( *, '(A)' ) LINE
  10  CALL LCLEAN( LINE, LINE, .TRUE.)
      IF ( LINE(:1) .EQ. '-' ) THEN
         CALL UPROMP ( 'GROUP: More> ' )
         READ ( *, '(A)' ) LINE
         GOTO 10
      ELSEIF ( LINE(:1) .NE. ' ') THEN
         NGROUP = NGROUP + 1
         IGROUP( NGROUP) = READA( LINE, 1, ERROR)
         IF (ERROR) THEN
            NGROUP = NGROUP - 1
            IF ( NGROUP .LT. 0) NGROUP = 0
            RETURN
         ENDIF
         LINE = LINE( INDEX( LINE, ' ')+1: )
         GOTO 10
      ENDIF
      RETURN
      END
