module constants
  implicit none

! This file contains the definition of frequently used numerical and
! physical constants 

  integer,  parameter :: dp       = kind(1.0d0) ! The kind of double-precision
                                                ! fortran variables

  real(dp), parameter :: zero     = 0.0_dp,               &
                         one      = 1.0_dp,               &
                         two      = 2.0_dp,               &
                         three    = 3.0_dp,               &
                         four     = 4.0_dp,               &
                         half     = one/two,              &
                         third    = one/three,            &
                         sq2      = 1.41421356237309_dp,  &  ! sqrt(2)
                         sq3      = 1.73205080756888_dp,  &  ! sqrt(3)
                         pi       = 3.14159265358979_dp,  & 
                         tpi      = two*pi,               &
                         fpi      = four*pi,              &
                         e2       = two,                  &  ! e^2 in Ry au
                         degspin  = two,                  &  ! spin degeneracy
                         ry_to_ev = 13.6058_dp,           &  ! Ry->eV conv
                         aa_to_au = one / 0.529177_dp,    &  ! Angs -> au
                         eps      = 1.0d-8                   ! a (not too)
                                                             ! small number
  real(dp), parameter :: ELECTRONMASS_SI  = 9.10938215E-31_DP, &  ! electron mass [Kg]
                         AMU_SI           = 1.660538782E-27_DP,&  ! Atomic Mass Unit [Kg]
                         AMU_RY           = AMU_SI / ELECTRONMASS_SI / TWO ! mass conv to Ry au

  ! system-specific constants

  real(dp)        :: alat,    & ! lattice parameter and unit length (a.u.)
                     tpiba,   & ! wave-number unit: 2 pi / alat 
                     tpiba2     ! (2 pi /a alat)^2

end module constants 
