!
!-----------------------------------------------------------------------
      subroutine summary(kvect,nks,ecut,lattice)
!-----------------------------------------------------------------------
!
!    This routine writes on output all the informations obtained from the
!    input file and from the setup routine, before starting the 
!    self-consistent calculation.
!
     use constants, only : DP, alat
     use structure, only : omega, atoms, nats, ntyp, at, bg
     use reciprocal_lattice, only: gcutm, ngm, nr1, nr2, nr3
     use pw_types, only : k_point

     implicit none
!
!     declaration of the local variables
!
      integer  ::  &
             nks,  &       ! number of k-points
             i,    &       ! counter on the celldm elements
             ipol, &       ! counter on polarizations
             apol, &       ! counter on direct or reciprocal lattice vectors
             na,   &       ! counter on atoms
             isym, &       ! counter on symmetries
             ik,   &       ! counter on k points  
             ib,   &       ! counter on beta functions
             nt,   &       ! counter on types
             l             ! counter on angular momenta
      character    :: &
             ps*5,    &    ! name of pseudo type
             lattice*(*)

      type(k_point) :: kvect(nks)
      real(DP)    :: ecut
!
!     we start with a general description of the run
!
      write (6, 100) lattice, alat, omega, nats, ntyp,   &
                     ecut, 4.d0*ecut
100   format (/,5x,                                    &
          'bravais-lattice           =          ',a3,/,5x,      &
          'lattice parameter (a_0)   = ',f12.4,'  a.u.',/,5x, &
          'unit-cell volume          = ',f12.4,' (a.u.)^3',/,5x, &
          'number of atoms/cell      = ',i12,/,5x,   &
          'number of atomic types    = ',i12,/,5x,   &
          'kinetic-energy cutoff     = ',f12.4,'  Ry',/,5x, &
          'charge density cutoff     = ',f12.4,'  Ry',/,5x)


      write(6,'(5x,''crystal axes: (cart. coord. in units of a_0)'')')
      write(6,'(3(15x,''a('',i1,'') = ('',3f8.4,'' )  '',/ ) )') & 
                ( apol, (at(ipol,apol), ipol=1,3), apol=1,3) 
      write(6,'(5x,   ''reciprocal axes: (cart. coord. in units 2 pi/a_0)'')')
      write(6,'(3(15x,''b('',i1,'') = ('',3f8.4,'' )  '',/ ) )') &
           (apol,(bg(ipol,apol), ipol=1,3), apol=1,3)
!
!    description of the atoms inside the unit cell
!
      write(6,'(/,3x,''Carthesian axes'')')
      write(6, '(/,5x,''site n.     atom         positions (a_0 units)'')')
      write(6, '(7x,'' tau('',i2,'') = ('',3f11.7,''  )'')')  &
                    (na, ( atoms(na)%tau(ipol),ipol=1,3),na=1,nats )

      nks = size(kvect(:))
      write(6,'(/5x,''number of k points='',i5)') nks

      write(6,'(23x,''carth. coord. in units 2pi/a_0'')')
      do ik=1,nks
         write(6,'(8x,''k('',i4,'') = ('',3f12.7,''), wk ='',f12.7)')  &
            ik, (kvect(ik)%k(ipol),ipol=1,3), kvect(ik)%wk
      enddo
      write (6, 2000) gcutm,ngm,nr1,nr2,nr3
2000  format(/5x,'G cutoff =',f10.4,' (',i7,' G-vectors)',&
     '     FFT grid: (',i3, ',',i3,',',i3,')')

      return
      end
