      SUBROUTINE UPDATS( NEWSYM, IVALUE)
* THIS ROUTINE UPDATES THE ATOMIC SYMBOL, VANRAD, AND ATMRAD TABLES
      IMPLICIT REAL (A-H,O-Z)
      REAL VANRAD, ATMRAD
      CHARACTER NEWSYM*(*)
      CHARACTER*6 ATSYMB
      CHARACTER*3 FTYPE
      CHARACTER*80 LINE, CLINE, KEYWRD,KOMENT,TITLE, COMAND
      COMMON /ATSYMB/ ATSYMB( 200)
      COMMON /COLORS/ ICOLAT( 200)
      COMMON /FINFO/ DELTAH,RC,GRAD,RCGRAD,VIP,DIPOLE, ICHARG
      COMMON /FINFOC/ FTYPE
      COMMON /VANRAD/ VANRAD( 200)
      COMMON /ATMRAD/ ATMRAD( 200)
      LOGICAL ERROR

      CLINE = NEWSYM
      K = LLENG( CLINE )
      CALL DEBUGR( 'Your input file has a symbol I do not recognize')
      CALL UPROMP( 'Enter correct symbol or RETURN '//
     .             'to accept this one: '// CLINE(1:K) )
      READ ( *, '(A)',END=199,ERR=199) COMAND
      CALL LCLEAN( COMAND, COMAND , .TRUE.)
      IF ( COMAND(1:1) .EQ. ' ') COMAND = CLINE(1:K)
      DO 80 IZ=1,200
         IF ( ATSYMB(IZ)(1:2) .EQ. '  ') GOTO 81
   80 CONTINUE
      CALL DEBUGR( 'UPDATS: No room for new symbol.')
      GOTO 82
   81 ATSYMB(IZ) = COMAND(1:INDEX(COMAND,' ')-1)
      IVALUE = IZ
      CALL DEBUGR( 'UPDATS: Atomic symbols updated.')
*
      CALL UPROMP( 'What ATOMIC RADIUS for the new symbol? ')
      READ( *, '(A)', END=199, ERR=199) COMAND
      CALL LCLEAN( COMAND, COMAND, .TRUE.)
      RADIUS = READA( COMAND, 1, ERROR)
      IF ( RADIUS.LT.0.0 .OR. ERROR) THEN
         ATMRAD( IVALUE) = DEFALT
      ELSE
         ATMRAD( IVALUE) = RADIUS
      ENDIF
*
      DEFALT = ATMRAD( IVALUE)
      WRITE ( COMAND, 
     .    '('' What COVALENT BONDING RADIUS for the new symbol ['',
     .     F8.4,''] ?'')') DEFALT
      CALL UPROMP( COMAND( 1: 62) )
      READ( *, '(A)', END=199, ERR=199) COMAND
      CALL LCLEAN( COMAND, COMAND, .TRUE.)
      RADIUS = READA( COMAND, 1, ERROR)
      IF ( RADIUS.LT.0.0 .OR. ERROR) THEN
         VANRAD( IVALUE) = DEFALT
      ELSE
         VANRAD( IVALUE) = RADIUS
      ENDIF
*
      CALL DEBUGR( ' What COLOR should I use in drawing ? ')
      READ ( *, '(A)', END=199, ERR=199) COMAND
      CALL LCLEAN( COMAND, COMAND, .TRUE.)
      ICOLAT( IVALUE) = READA( COMAND, 1, ERROR)
      IF ( ICOLAT( IVALUE) .LT. 0 .OR. ERROR) ICOLAT( IVALUE) = 1
*
      RETURN

   82 CALL UPROMP( 'Shall I assign a generic symbol? ')
      READ( *, '(A)', END=199, ERR=199) COMAND
      CALL LCLEAN( COMAND, COMAND, .TRUE.)
      IF ( COMAND( 1: 1) .EQ. 'Y' ) THEN
         IVALUE = 200
         RETURN
      ENDIF
      CALL UPROMP( 'Should I QUIT now? ')
      READ( *, '(A)', END=199, ERR=199) COMAND
      CALL LCLEAN( COMAND, COMAND, .TRUE.)
      IF ( COMAND( 1: 1) .NE. 'N' ) THEN
         RETURN
      ENDIF
C?      CALL QUIT
      STOP ' '
 199  CALL DEBUGR( 'Error with USER input.' )
      IVALUE = 200
      RETURN
      END
