TABLE OF CONTENTS


ABINIT/pspcor [ Functions ]

[ Top ] [ Functions ]

NAME

 pspcor

FUNCTION

 Compute ecore pseudoion-pseudoion correction energy from epsatm for
 different types of atoms in unit cell.

COPYRIGHT

 Copyright (C) 1998-2017 ABINIT group (DCA, XG, GMR)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .
 For the initials of contributors, see ~abinit/doc/developers/contributors.txt .

INPUTS

  natom=number of atoms in cell
  ntypat=number of types of atoms
  typat(natom)=integer label of 'typat' for each atom in cell
  epsatm(ntypat)=pseudoatom energy for each type of atom
  zion(ntypat)=valence charge on each type of atom in cell

OUTPUT

  ecore=resulting psion-psion energy in Hartrees

PARENTS

      pspini

CHILDREN

SOURCE

34 #if defined HAVE_CONFIG_H
35 #include "config.h"
36 #endif
37 
38 #include "abi_common.h"
39 
40 
41 subroutine pspcor(ecore,epsatm,natom,ntypat,typat,zion)
42 
43  use defs_basis
44  use m_profiling_abi
45 
46 !This section has been created automatically by the script Abilint (TD).
47 !Do not modify the following lines by hand.
48 #undef ABI_FUNC
49 #define ABI_FUNC 'pspcor'
50 !End of the abilint section
51 
52  implicit none
53 
54 !Arguments ------------------------------------
55 !scalars
56  integer,intent(in) :: natom,ntypat
57  real(dp),intent(out) :: ecore
58 !arrays
59  integer,intent(in) :: typat(natom)
60  real(dp),intent(in) :: epsatm(ntypat),zion(ntypat)
61 
62 !Local variables-------------------------------
63 !scalars
64  integer :: ia
65  real(dp) :: charge,esum
66 
67 ! *************************************************************************
68 
69  charge = 0.d0
70  esum = 0.d0
71  do ia=1,natom
72 !  compute pseudocharge:
73    charge=charge+zion(typat(ia))
74 !  add pseudocore energies together:
75    esum = esum + epsatm(typat(ia))
76  end do
77 
78  ecore=charge*esum
79 
80 end subroutine pspcor