c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1995  by  Jay William Ponder  ##
c     ##              All Rights Reserved              ##
c     ###################################################
c
c     ################################################################
c     ##                                                            ##
c     ##  subroutine control  --  set information and output types  ##
c     ##                                                            ##
c     ################################################################
c
c
c     "control" gets initial values for parameters that determine
c     the output style and information level provided by TINKER
c
c
      subroutine control
      implicit none
      include 'sizes.i'
      include 'inform.i'
      include 'keys.i'
      include 'output.i'
      integer i,next
      character*20 keyword
      character*80 record
c
c
c     set default values for information and output variables
c
      verbose = .false.
      debug = .false.
      abort = .false.
      savecycle = .false.
      use_version = .true.
c
c     search keywords for various control parameters
c
      do i = 1, nkey
         next = 1
         record = keyline(i)
         call gettext (record,keyword,next)
         call upcase (keyword)
         if (keyword(1:8) .eq. 'VERBOSE ') then
            verbose = .true.
         else if (keyword(1:6) .eq. 'DEBUG ') then
            debug = .true.
            verbose = .true.
         else if (keyword(1:10) .eq. 'SAVECYCLE ') then
            savecycle = .true.
         else if (keyword(1:10) .eq. 'OVERWRITE ') then
            savecycle = .false.
         else if (keyword(1:10) .eq. 'NOVERSION ') then
            use_version = .false.
         end if
      end do
      return
      end
