pwdft  0.1
PW-DFT code for education
pp Module Reference

Functions/Subroutines

subroutine read_pp ()
 

Function/Subroutine Documentation

◆ read_pp()

subroutine pp::read_pp

Definition at line 30 of file pp.F90.

30  !
31  use atm_spec, only : spec, ntyp, nelec, atm, nat
32  use kohn_sham, only : nbnd
33  !
34  integer :: ityp, fi=10, iat
35  integer :: pspd, pspcode, pspxc, lmax, lloc, r2well, &
36  & rchrg, fchrg, qchrg, nproj(5), extension_switch, &
37  & ir, jr
38  character(256) :: ctmp
39  !
40  do ityp = 1, ntyp
41  !
42  write(*,*) " Reading ", trim(spec(ityp)%ps_file), &
43  & " for pseudopotential of ", trim(spec(ityp)%elem)
44  !
45  open(fi, file = trim(spec(ityp)%ps_file))
46  !
47  read(fi,*) ctmp
48  !
49  read(fi,*) spec(ityp)%zatom, spec(ityp)%zion, pspd
50  write(*,*) " Zatom : ", spec(ityp)%zatom
51  write(*,*) " Zion : ", spec(ityp)%Zion
52  write(*,*) " Gen. Date : ", pspd
53  !
54  read(fi,*) pspcode, pspxc, lmax, lloc, spec(ityp)%mmax, r2well
55  write(*,*) " PSP code : ", pspcode
56  write(*,*) " XC id : ", pspxc
57  write(*,*) " Max. L : ", lmax
58  write(*,*) " Localized L : ", lloc
59  write(*,*) " Radial grid : ", spec(ityp)%mmax
60  !
61  read(fi,*) rchrg, fchrg, qchrg
62  write(*,*) " R-charge : ", rchrg
63  write(*,*) " F-charge : ", fchrg
64  write(*,*) " Q-charge : ", qchrg
65  !
66  read(fi,*) nproj(1:5)
67  read(fi,*) extension_switch
68  read(fi,*) ir
69  !
70  allocate(spec(ityp)%psr(spec(ityp)%mmax), &
71  & spec(ityp)%psV(spec(ityp)%mmax) )
72  !
73  do ir = 1, spec(ityp)%mmax
74  read(fi,*) jr, spec(ityp)%psr(ir), &
75  & spec(ityp)%psV(ir)
76  end do
77  !
78  close(fi)
79  !
80  end do
81  !
82  nelec = 0.0d0
83  do iat = 1, nat
84  nelec = nelec + spec(atm(iat)%ityp)%Zion
85  end do
86  write(*,*) " Number of electrons : ", nelec
87  if(nbnd == 0) nbnd = nint(nelec)
88  write(*,*) " Number of bands : ", nbnd
89  !

References atm_spec::atm, atm_spec::nat, kohn_sham::nbnd, atm_spec::nelec, atm_spec::ntyp, and atm_spec::spec.

Referenced by pwdft().

Here is the caller graph for this function:
atm_spec::spec
type(spec_t), dimension(:), allocatable, save spec
(ntyp) Species
Definition: atm_spec.F90:57
atm_spec::ntyp
integer, save ntyp
Number of species (elements)
Definition: atm_spec.F90:47
atm_spec::atm
type(atm_t), dimension(:), allocatable, save atm
(nat) Atom
Definition: atm_spec.F90:55
atm_spec::nat
integer, save nat
Number of atoms.
Definition: atm_spec.F90:47
atm_spec
Definition: atm_spec.F90:23
kohn_sham
Definition: kohn_sham.F90:23