Loading [MathJax]/extensions/tex2jax.js
pwdft  0.1
PW-DFT code for education
All Classes Namespaces Files Functions Variables
pp.F90
Go to the documentation of this file.
1 !
2 ! Copyright (c) 2018 Mitsuaki Kawamura
3 !
4 ! Permission is hereby granted, free of charge, to any person obtaining a
5 ! copy of this software and associated documentation files (the
6 ! "Software"), to deal in the Software without restriction, including
7 ! without limitation the rights to use, copy, modify, merge, publish,
8 ! distribute, sublicense, and/or sell copies of the Software, and to
9 ! permit persons to whom the Software is furnished to do so, subject to
10 ! the following conditions:
11 !
12 ! The above copyright notice and this permission notice shall be included
13 ! in all copies or substantial portions of the Software.
14 !
15 ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 ! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 ! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 ! IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 ! CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 ! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 ! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 !
23 module pp
24  !
25  implicit none
26  !
27 contains
28  !
29  subroutine read_pp()
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  !
90  end subroutine read_pp
91  !
92 end module pp
atm_spec::spec
type(spec_t), dimension(:), allocatable, save spec
(ntyp) Species
Definition: atm_spec.F90:57
pp::read_pp
subroutine read_pp()
Definition: pp.F90:30
pp
Definition: pp.F90:23
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
kohn_sham::nbnd
integer, save nbnd
Number of bands.
Definition: kohn_sham.F90:29
atm_spec::nat
integer, save nat
Number of atoms.
Definition: atm_spec.F90:47
atm_spec::nelec
real(8), save nelec
Number of electrons per u.c.
Definition: atm_spec.F90:50
atm_spec
Definition: atm_spec.F90:23
kohn_sham
Definition: kohn_sham.F90:23