diff --git a/Src/atom_all.f90 b/Src/atom_all.f90 index ccfd04c..b362433 100644 --- a/Src/atom_all.f90 +++ b/Src/atom_all.f90 @@ -1,12 +1,15 @@ !> Calls the whole atomic pseudo-potential test plot chain !> !> \author Jose Luis Martins -!> \version 6.0.6 -!> \date 21 October 2021 +!> \version 6.0.8 +!> \date 21 October 2021. 25 May 2022. !> \copyright GNU Public License v2 program atom_all + +! Initializes lkb. 25 May 2022. JLM + implicit none integer, parameter :: REAL64 = selected_real_kind(12) @@ -279,6 +282,8 @@ program atom_all call atom_psd_print_info(iowrite, ioae, fileae, nameat) + lkb = .TRUE. + if(lint) then write(6,*)' Enter distance (in a.u.) at which the' @@ -287,8 +292,6 @@ program atom_all write(6,*) write(6,*) - lkb = .TRUE. - else call atom_p_tbl_psd_tm2(nameat, rc_tab, status) diff --git a/Src/lib_atom/atom_atm_vpseudo.f90 b/Src/lib_atom/atom_atm_vpseudo.f90 index c7767fd..fa8a0bc 100644 --- a/Src/lib_atom/atom_atm_vpseudo.f90 +++ b/Src/lib_atom/atom_atm_vpseudo.f90 @@ -3,7 +3,7 @@ !> !> \author Sverre Froyen, Norm Troullier, Jose Luis Martins !> \version 6.0.8 -!> \date 22 June 2021, 18 May 2022. +!> \date 22 June 2021, 25 May 2022. !> \copyright GNU Public License v2 subroutine atom_atm_vpseudo(ispp, icorr, ifcore, & @@ -29,6 +29,7 @@ subroutine atom_atm_vpseudo(ispp, icorr, ifcore, & ! remove Coulomb and rsh, zsh, 6 August 2021. JLM ! vionic, cdd, 10 September 2021. JLM ! psdtitle, 18 May 2022. JLM +! initialize np. 25 May 2022. JLM implicit none @@ -106,6 +107,12 @@ subroutine atom_atm_vpseudo(ispp, icorr, ifcore, & allocate(np(0:mxdl,-1:1)) + do j = -1,1 + do i = 0,mxdl + np(i,j) = 0 + enddo + enddo + do i = 1,6 iray(i) = ' ' enddo diff --git a/Src/lib_kb/atom_kb_sub.f90 b/Src/lib_kb/atom_kb_sub.f90 index 5eb4b98..e4a72f2 100644 --- a/Src/lib_kb/atom_kb_sub.f90 +++ b/Src/lib_kb/atom_kb_sub.f90 @@ -2,7 +2,7 @@ !> !> \author Norm Troullier, J.L.Martins !> \version 6.0.8 -!> \date November 90, May 2012, July 2021, 19 May 2022. +!> \date November 90, May 2012, July 2021, 25 May 2022. !> \copyright GNU Public License v2 subroutine atom_kb_sub(llocal, nql, delql, nqbas, delqbas, & @@ -31,6 +31,7 @@ subroutine atom_kb_sub(llocal, nql, delql, nqbas, delqbas, & ! ev for scattering basis functions. 19 October 2021. JLM ! printing. 21 October 2021. JLM ! psdtitle. 19 May 2022. JLM +! dated. 25 May 2022. JLM implicit none @@ -81,7 +82,7 @@ subroutine atom_kb_sub(llocal, nql, delql, nqbas, delqbas, & ! general variables - character(len=10) :: dated ! date of calculation + character(len=9) :: dated ! date of calculation character(len=5) :: version ! program version (should be the same as in atomic program) character(len=30) :: filekb ! name of default tape for writing pseudopotential in KB format diff --git a/Src/lib_kb/atom_kb_test_scf.f90 b/Src/lib_kb/atom_kb_test_scf.f90 index 510b7fe..f18e710 100644 --- a/Src/lib_kb/atom_kb_test_scf.f90 +++ b/Src/lib_kb/atom_kb_test_scf.f90 @@ -2,7 +2,7 @@ !> !> \author Norm Troullier, Jose Luis Martins !> \version 6.0.8 -!> \date 22 June 2021, 13 August 2021. 19 May 2022. +!> \date 22 June 2021, 13 August 2021. 25 May 2022. !> \copyright GNU Public License v2 subroutine atom_kb_test_scf(etotal, & @@ -16,6 +16,7 @@ subroutine atom_kb_test_scf(etotal, & ! number of iterations. 21 October 2021. JLM ! vhxc_orb in dsolv1. 28 October 2021. JLM ! psdtitle, 19 May 2022. JLM +! initialize itype. 25 May 2022. JLM implicit none @@ -326,6 +327,7 @@ subroutine atom_kb_test_scf(etotal, & ! Find the total energy. jlm + itype = 4 call atom_atm_etotal(itype, nameat, norb, & no, lo, iso, zo, etot, ev, ek, ep, & iowrite, mxdorb) diff --git a/Src/lib_num/ft_charge.f90 b/Src/lib_num/ft_charge.f90 index b1a8605..34f6d31 100644 --- a/Src/lib_num/ft_charge.f90 +++ b/Src/lib_num/ft_charge.f90 @@ -2,12 +2,15 @@ !> Four point formula. 4 pi r^2 in the input function !> !> \author Sverre Froyen, Norm Troullier, JL Martins -!> \version 6.013 -!> \date 80s, April 2012 +!> \version 6.0.8 +!> \date 80s, April 2012. 25 May 2022. !> \copyright GNU Public License v2 subroutine ft_charge(nr, nql, r, drdi, qp, fin, fout) + +! correct initialization of w and y. 25 May 2022. JLM + implicit none integer, parameter :: REAL64 = selected_real_kind(12) @@ -17,7 +20,7 @@ subroutine ft_charge(nr, nql, r, drdi, qp, fin, fout) integer, intent(in) :: nr !< number of points in the radial grid integer, intent(in) :: nql !< number of points for the local Fourier grid - real(REAL64), intent(in) :: r(0:nr) !< radial grid points r(i) = a*(exp(b*i)-1), i=1,...,nr + real(REAL64), intent(in) :: r(0:nr) !< radial grid points r(i) = a*(exp(b*i)-1), i=1,...,nr real(REAL64), intent(in) :: drdi(0:nr) !< d r(i) / d i real(REAL64), intent(in) :: qp(0:nql) !< fourier grid points @@ -34,7 +37,7 @@ subroutine ft_charge(nr, nql, r, drdi, qp, fin, fout) ! parameters real(REAL64), parameter :: ZERO = 0.0_REAL64 - + ! counters integer :: j, k @@ -46,6 +49,10 @@ subroutine ft_charge(nr, nql, r, drdi, qp, fin, fout) w(j) = drdi(j)*fin(j)/r(j) enddo w(0) = ZERO + do j = nr+1,nr+4 + w(j) = ZERO + y(j) = ZERO + enddo do k = 1,nql fout(k) = ZERO diff --git a/Src/lib_plot/atom_plot_kb_input.f90 b/Src/lib_plot/atom_plot_kb_input.f90 index c6fea32..37d3aed 100644 --- a/Src/lib_plot/atom_plot_kb_input.f90 +++ b/Src/lib_plot/atom_plot_kb_input.f90 @@ -3,7 +3,7 @@ !> !> \author Peter Schuster, Manuel Maria Alemany, Jose Luis Martins !> \version 6.0.8 -!> \date 4 September 2021, 21 October 2021. 19 May 2022. +!> \date 4 September 2021, 21 October 2021. 25 May 2022. !> \copyright GNU Public License v2 subroutine atom_plot_kb_input (iowrite, ioplot, & @@ -19,6 +19,7 @@ subroutine atom_plot_kb_input (iowrite, ioplot, & ! kinetic, 9 October 2021. JLM ! printing. New interface. 21 October 2021. JLM ! deallocate, 19 May 2022. JLM +! initialized px,py. 25 May 2022. JLM implicit none @@ -82,13 +83,21 @@ subroutine atom_plot_kb_input (iowrite, ioplot, & ! constants + real(REAL64), parameter :: ZERO = 0.0_REAL64 character(len=1), parameter :: IL(7) = (/'s','p','d','f','g','h','i'/) ! counters - integer :: i + integer :: i, j + do j = 1,nump + do i = 1,nmax + px(i,j) = ZERO + py(i,j) = ZERO + enddo + enddo + allocate(absc(nmax),ord(nmax)) iw = 0 diff --git a/Src/lib_psd/atom_psd_unscreen.f90 b/Src/lib_psd/atom_psd_unscreen.f90 index 1a8ff8d..f26d178 100644 --- a/Src/lib_psd/atom_psd_unscreen.f90 +++ b/Src/lib_psd/atom_psd_unscreen.f90 @@ -1,8 +1,8 @@ !> unscreens the pseudopotential !> !> \author Norm Troullier, Jose Luis Martins -!> \version 6.013 -!> \date 1980s and 1990s, 30 June 2021 +!> \version 6.0.8 +!> \date 1980s and 1990s, 30 June 2021, 25 May 2022. !> \copyright GNU Public License v2 @@ -16,6 +16,7 @@ subroutine atom_psd_unscreen(ifcore, icorr, ispp, nr, r, drdi, & ! pseudopotential generation subroutines were broken in several subroutines ! and converted to f90. ! Modified (cleaning) 8 July 2021. JLM +! Initializes vpsd. 25 May 2022. JLM !mmga modifications from early Sverre code by Manuel Maria Gonzalez Alemany !njtj modifications from early Sverre code by Norm Troullier @@ -100,9 +101,19 @@ subroutine atom_psd_unscreen(ifcore, icorr, ispp, nr, r, drdi, & ! counters - integer :: i, j + integer :: i, j, l +! initializes vpsd + + do i =-1,1 + do l = 0,lc + do j = 1,mxdnr + vpsd(j,l,i) = ZERO + enddo + enddo + enddo + ! Reset the n quantum numbers to include all valence orbitals. ! Compute the ratio between the valence charge present and the ! valence charge of a neutral atom. diff --git a/Src/plot_ln_show.f90 b/Src/plot_ln_show.f90 index ac86de8..1f76b3e 100644 --- a/Src/plot_ln_show.f90 +++ b/Src/plot_ln_show.f90 @@ -1,12 +1,15 @@ !> Swows the comparison of log derivatives of all-electron and pseudo potentials. !> !> \author Jose Luis Martins -!> \version 6.0.3 -!> \date September 2021 +!> \version 6.0.8 +!> \date September 2021. 25 May 2022. !> \copyright GNU Public License v2 program plot_ln_show + +! Initializes lkb. 25 May 2022. JLM + implicit none integer, parameter :: REAL64 = selected_real_kind(12) @@ -49,6 +52,7 @@ program plot_ln_show integer :: l + lkb = .TRUE. lint = .TRUE. ! lint = .FALSE.