2003-01-20 05:58:50 +08:00
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
! Copyright (C) 2001-2007 Quantum-Espresso group
|
2003-01-20 05:58:50 +08:00
|
|
|
! This file is distributed under the terms of the
|
|
|
|
! GNU General Public License. See the file `License'
|
|
|
|
! in the root directory of the present distribution,
|
|
|
|
! or http://www.gnu.org/copyleft/gpl.txt .
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!-----------------------------------------------------------------------
|
2007-10-03 00:54:13 +08:00
|
|
|
subroutine read_ncpp (iunps, np, upf)
|
2003-01-20 05:58:50 +08:00
|
|
|
!-----------------------------------------------------------------------
|
|
|
|
!
|
2004-01-23 23:08:03 +08:00
|
|
|
USE kinds, only: dp
|
2007-10-24 03:47:26 +08:00
|
|
|
USE parameters, ONLY: lmaxx
|
2005-11-04 19:47:42 +08:00
|
|
|
use funct, only: set_dft_from_name, dft_is_meta, dft_is_hybrid
|
2007-10-03 00:54:13 +08:00
|
|
|
USE pseudo_types
|
|
|
|
|
2003-01-20 05:58:50 +08:00
|
|
|
implicit none
|
2004-04-27 21:44:55 +08:00
|
|
|
!
|
2007-10-03 00:54:13 +08:00
|
|
|
TYPE (pseudo_upf) :: upf
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: iunps, np
|
2004-04-27 21:44:55 +08:00
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
real(DP) :: cc(2), alpc(2), aps(6,0:3), alps(3,0:3), &
|
|
|
|
a_nlcc, b_nlcc, alpha_nlcc
|
2005-08-28 22:09:42 +08:00
|
|
|
real(DP) :: x, vll
|
|
|
|
real(DP), allocatable:: vnl(:,:)
|
|
|
|
real(DP), parameter :: rcut = 10.d0, e2 = 2.d0
|
2009-07-08 18:29:32 +08:00
|
|
|
real(DP), external :: qe_erf
|
2007-10-16 23:07:42 +08:00
|
|
|
integer :: nlc, nnl, lmax, lloc
|
2003-02-08 00:04:36 +08:00
|
|
|
integer :: nb, ios, i, l, ir
|
2007-10-16 23:07:42 +08:00
|
|
|
logical :: bhstype, numeric
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2004-04-26 15:25:01 +08:00
|
|
|
!====================================================================
|
|
|
|
! read norm-conserving PPs
|
|
|
|
!
|
2008-01-15 19:26:08 +08:00
|
|
|
read (iunps, '(a)', end=300, err=300, iostat=ios) upf%dft
|
2007-10-03 00:54:13 +08:00
|
|
|
if (upf%dft(1:2) .eq.'**') upf%dft = 'PZ'
|
2007-10-16 23:07:42 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) upf%psd, upf%zp, lmax, nlc, &
|
|
|
|
nnl, upf%nlcc, lloc, bhstype
|
|
|
|
if (nlc > 2 .or. nnl > 3) &
|
2004-04-26 15:25:01 +08:00
|
|
|
call errore ('read_ncpp', 'Wrong nlc or nnl', np)
|
2007-10-16 23:07:42 +08:00
|
|
|
if (nlc*nnl < 0) call errore ('read_ncpp', 'nlc*nnl < 0 ? ', np)
|
2007-10-03 00:54:13 +08:00
|
|
|
if (upf%zp <= 0d0 .or. upf%zp > 100 ) &
|
2004-04-26 15:25:01 +08:00
|
|
|
call errore ('read_ncpp', 'Wrong zp ', np)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! In numeric pseudopotentials both nlc and nnl are zero.
|
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
numeric = (nlc <= 0) .and. (nnl <= 0)
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
if (lloc == -1000) lloc = lmax
|
|
|
|
if (lloc < 0 .or. lmax < 0 .or. &
|
|
|
|
.not.numeric .and. (lloc > min(lmax+1,lmaxx+1) .or. &
|
|
|
|
lmax > max(lmaxx,lloc)) .or. &
|
|
|
|
numeric .and. (lloc > lmax .or. lmax > lmaxx) ) &
|
2004-04-26 15:25:01 +08:00
|
|
|
call errore ('read_ncpp', 'wrong lmax and/or lloc', np)
|
2007-10-16 23:07:42 +08:00
|
|
|
if (.not.numeric ) then
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! read here pseudopotentials in analytic form
|
|
|
|
!
|
2004-04-26 15:25:01 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) &
|
2007-10-16 23:07:42 +08:00
|
|
|
(alpc(i), i=1,2), (cc(i), i=1,2)
|
|
|
|
if (abs (cc(1)+cc(2)-1.d0) > 1.0d-6) &
|
2004-01-19 18:57:53 +08:00
|
|
|
call errore ('read_ncpp', 'wrong pseudopotential coefficients', 1)
|
2007-10-16 23:07:42 +08:00
|
|
|
do l = 0, lmax
|
|
|
|
read (iunps, *, err=300, iostat=ios) (alps(i,l), i=1,3), &
|
|
|
|
(aps(i,l), i=1,6)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
2007-10-03 00:54:13 +08:00
|
|
|
if (upf%nlcc ) then
|
2004-04-26 15:25:01 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) &
|
2007-10-16 23:07:42 +08:00
|
|
|
a_nlcc, b_nlcc, alpha_nlcc
|
|
|
|
if (alpha_nlcc <= 0.d0) call errore('read_ncpp','alpha_nlcc=0',np)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
endif
|
2007-10-03 00:54:13 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) upf%zmesh, upf%xmin, upf%dx, &
|
|
|
|
upf%mesh, upf%nwfc
|
|
|
|
if ( upf%mesh <= 0) &
|
|
|
|
call errore ('read_ncpp', 'wrong nuymber of mesh points', np)
|
2007-10-24 03:47:26 +08:00
|
|
|
if ( upf%nwfc < 0 .or. &
|
2007-10-16 23:07:42 +08:00
|
|
|
(upf%nwfc < lmax .and. lloc == lmax) .or. &
|
|
|
|
(upf%nwfc < lmax+1 .and. lloc /= lmax) ) &
|
2004-04-26 15:25:01 +08:00
|
|
|
call errore ('read_ncpp', 'wrong no. of wfcts', np)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Here pseudopotentials in numeric form are read
|
|
|
|
!
|
2007-10-03 00:54:13 +08:00
|
|
|
ALLOCATE ( upf%chi(upf%mesh,upf%nwfc), upf%rho_atc(upf%mesh) )
|
2007-10-16 23:07:42 +08:00
|
|
|
upf%rho_atc(:) = 0.d0
|
2007-10-03 00:54:13 +08:00
|
|
|
ALLOCATE ( upf%lchi(upf%nwfc), upf%oc(upf%nwfc) )
|
2007-10-16 23:07:42 +08:00
|
|
|
allocate (vnl(upf%mesh, 0:lmax))
|
|
|
|
if (numeric ) then
|
|
|
|
do l = 0, lmax
|
2003-04-23 00:03:45 +08:00
|
|
|
read (iunps, '(a)', err=300, iostat=ios)
|
2007-10-03 00:54:13 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) (vnl(ir,l), ir=1,upf%mesh )
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
2007-10-03 00:54:13 +08:00
|
|
|
if ( upf%nlcc ) then
|
|
|
|
read (iunps, *, err=300, iostat=ios) (upf%rho_atc(ir), ir=1,upf%mesh)
|
2003-01-20 05:58:50 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
!
|
2004-04-26 15:25:01 +08:00
|
|
|
! Here pseudowavefunctions (in numeric form) are read
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2007-10-03 00:54:13 +08:00
|
|
|
do nb = 1, upf%nwfc
|
2003-04-23 00:03:45 +08:00
|
|
|
read (iunps, '(a)', err=300, iostat=ios)
|
2007-10-03 00:54:13 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) upf%lchi(nb), upf%oc(nb)
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! Test lchi and occupation numbers
|
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
if (nb <= lmax .and. upf%lchi(nb)+1 /= nb) &
|
2004-04-26 15:25:01 +08:00
|
|
|
call errore ('read_ncpp', 'order of wavefunctions', 1)
|
2007-10-03 00:54:13 +08:00
|
|
|
if (upf%lchi(nb) > lmaxx .or. upf%lchi(nb) < 0) &
|
2004-01-19 18:57:53 +08:00
|
|
|
call errore ('read_ncpp', 'wrong lchi', np)
|
2007-10-03 00:54:13 +08:00
|
|
|
if (upf%oc(nb) < 0.d0 .or. upf%oc(nb) > 2.d0*(2*upf%lchi(nb)+1)) &
|
2004-04-26 15:25:01 +08:00
|
|
|
call errore ('read_ncpp', 'wrong oc', np)
|
2007-10-03 00:54:13 +08:00
|
|
|
read (iunps, *, err=300, iostat=ios) ( upf%chi(ir,nb), ir=1,upf%mesh )
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
!
|
2004-04-26 15:25:01 +08:00
|
|
|
!====================================================================
|
|
|
|
! PP read: now setup
|
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
IF ( numeric ) THEN
|
2007-10-08 15:33:57 +08:00
|
|
|
upf%generated='Generated by old ld1 code (numerical format)'
|
|
|
|
ELSE
|
|
|
|
upf%generated='From published tables, or generated by old fitcar code (analytical format)'
|
|
|
|
END IF
|
2007-10-03 00:54:13 +08:00
|
|
|
call set_dft_from_name( upf%dft )
|
2005-07-14 03:35:50 +08:00
|
|
|
!
|
2005-08-09 15:34:23 +08:00
|
|
|
#if defined (EXX)
|
|
|
|
#else
|
2005-11-04 19:47:42 +08:00
|
|
|
IF ( dft_is_hybrid() ) &
|
2005-08-09 15:34:23 +08:00
|
|
|
CALL errore( 'read_ncpp ', 'HYBRID XC not implemented in PWscf', 1 )
|
|
|
|
#endif
|
2007-10-03 00:54:13 +08:00
|
|
|
!
|
|
|
|
! calculate the number of beta functions
|
|
|
|
!
|
|
|
|
upf%nbeta = 0
|
2007-10-16 23:07:42 +08:00
|
|
|
do l = 0, lmax
|
|
|
|
if (l /= lloc ) upf%nbeta = upf%nbeta + 1
|
2007-10-03 00:54:13 +08:00
|
|
|
enddo
|
|
|
|
ALLOCATE ( upf%lll(upf%nbeta) )
|
|
|
|
nb = 0
|
2007-10-16 23:07:42 +08:00
|
|
|
do l = 0, lmax
|
|
|
|
if (l /= lloc ) then
|
2007-10-03 00:54:13 +08:00
|
|
|
nb = nb + 1
|
|
|
|
upf%lll (nb) = l
|
|
|
|
end if
|
|
|
|
enddo
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
2003-01-20 05:58:50 +08:00
|
|
|
! compute the radial mesh
|
|
|
|
!
|
2007-10-03 00:54:13 +08:00
|
|
|
ALLOCATE ( upf%r(upf%mesh), upf%rab(upf%mesh) )
|
|
|
|
do ir = 1, upf%mesh
|
|
|
|
x = upf%xmin + DBLE (ir - 1) * upf%dx
|
|
|
|
upf%r(ir) = exp (x) / upf%zmesh
|
|
|
|
upf%rab(ir) = upf%dx * upf%r(ir)
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
2007-10-03 00:54:13 +08:00
|
|
|
do ir = 1, upf%mesh
|
|
|
|
if ( upf%r(ir) > rcut) then
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
upf%kkbeta = ir
|
2004-04-26 15:25:01 +08:00
|
|
|
go to 5
|
|
|
|
end if
|
|
|
|
end do
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
upf%kkbeta = upf%mesh
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
2006-03-14 18:59:14 +08:00
|
|
|
! ... force kkbeta to be odd for simpson integration (obsolete?)
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
5 upf%kkbeta = 2 * ( ( upf%kkbeta + 1 ) / 2) - 1
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
ALLOCATE ( upf%kbeta(upf%nbeta) )
|
|
|
|
upf%kbeta(:) = upf%kkbeta
|
2007-10-03 00:54:13 +08:00
|
|
|
ALLOCATE ( upf%vloc(upf%mesh) )
|
|
|
|
upf%vloc (:) = 0.d0
|
2007-10-16 23:07:42 +08:00
|
|
|
!
|
|
|
|
if (.not. numeric) then
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
|
|
|
! bring analytic potentials into numerical form
|
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
IF ( nlc == 2 .AND. nnl == 3 .AND. bhstype ) &
|
|
|
|
CALL bachel( alps(1,0), aps(1,0), 1, lmax )
|
2004-04-26 15:25:01 +08:00
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
do i = 1, nlc
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
do ir = 1, upf%kkbeta
|
2007-10-16 23:07:42 +08:00
|
|
|
upf%vloc (ir) = upf%vloc (ir) - upf%zp * e2 * cc (i) * &
|
2009-07-08 18:29:32 +08:00
|
|
|
qe_erf ( sqrt (alpc(i)) * upf%r(ir) ) / upf%r(ir)
|
2004-04-26 15:25:01 +08:00
|
|
|
end do
|
|
|
|
end do
|
2007-10-16 23:07:42 +08:00
|
|
|
do l = 0, lmax
|
2007-10-03 00:54:13 +08:00
|
|
|
vnl (:, l) = upf%vloc (1:upf%mesh)
|
2007-10-16 23:07:42 +08:00
|
|
|
do i = 1, nnl
|
|
|
|
vnl (:, l) = vnl (:, l) + e2 * (aps (i, l) + &
|
|
|
|
aps (i + 3, l) * upf%r (:) **2) * &
|
|
|
|
exp ( - upf%r(:) **2 * alps (i, l) )
|
2004-04-26 15:25:01 +08:00
|
|
|
enddo
|
|
|
|
enddo
|
2007-10-16 23:07:42 +08:00
|
|
|
if ( upf%nlcc ) then
|
|
|
|
upf%rho_atc(:) = ( a_nlcc + b_nlcc*upf%r(:)**2 ) * &
|
|
|
|
exp ( -upf%r(:)**2 * alpha_nlcc )
|
|
|
|
end if
|
|
|
|
!
|
2004-04-26 15:25:01 +08:00
|
|
|
end if
|
|
|
|
!
|
|
|
|
! assume l=lloc as local part and subtract from the other channels
|
|
|
|
!
|
2007-10-16 23:07:42 +08:00
|
|
|
if (lloc <= lmax ) &
|
|
|
|
upf%vloc (:) = vnl (:, lloc)
|
2004-04-26 15:25:01 +08:00
|
|
|
! lloc > lmax is allowed for PP in analytical form only
|
|
|
|
! it means that only the erf part is taken as local part
|
2007-10-16 23:07:42 +08:00
|
|
|
do l = 0, lmax
|
|
|
|
if (l /= lloc) vnl (:, l) = vnl(:, l) - upf%vloc(:)
|
2004-04-26 15:25:01 +08:00
|
|
|
enddo
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
|
|
|
! compute the atomic charges
|
|
|
|
!
|
2007-10-03 00:54:13 +08:00
|
|
|
ALLOCATE ( upf%rho_at (upf%mesh) )
|
|
|
|
upf%rho_at(:) = 0.d0
|
|
|
|
do nb = 1, upf%nwfc
|
|
|
|
if ( upf%oc(nb) > 0.d0) then
|
|
|
|
do ir = 1, upf%mesh
|
|
|
|
upf%rho_at(ir) = upf%rho_at(ir) + upf%oc(nb) * upf%chi(ir,nb)**2
|
2003-01-20 05:58:50 +08:00
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
enddo
|
2004-04-26 15:25:01 +08:00
|
|
|
!====================================================================
|
|
|
|
! convert to separable (KB) form
|
|
|
|
!
|
2007-10-03 00:54:13 +08:00
|
|
|
ALLOCATE ( upf%beta (upf%mesh, upf%nbeta) )
|
|
|
|
ALLOCATE ( upf%dion (upf%nbeta,upf%nbeta), upf%lll (upf%nbeta) )
|
|
|
|
upf%dion (:,:) = 0.d0
|
2004-04-26 15:25:01 +08:00
|
|
|
nb = 0
|
2007-10-16 23:07:42 +08:00
|
|
|
do l = 0, lmax
|
|
|
|
if (l /= lloc ) then
|
2004-04-26 15:25:01 +08:00
|
|
|
nb = nb + 1
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
! upf%beta is used here as work space
|
|
|
|
do ir = 1, upf%kkbeta
|
2007-10-03 00:54:13 +08:00
|
|
|
upf%beta (ir, nb) = upf%chi(ir, l+1) **2 * vnl(ir, l)
|
2004-04-26 15:25:01 +08:00
|
|
|
end do
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
call simpson (upf%kkbeta, upf%beta (1, nb), upf%rab, vll )
|
2007-10-03 00:54:13 +08:00
|
|
|
upf%dion (nb, nb) = 1.d0 / vll
|
|
|
|
! upf%beta stores projectors |beta(r)> = |V_nl(r)phi(r)>
|
The following pseudopotential-related variables in module uspp_param:
zp, psd, dion, betar, jjj, qqq, qfunc, qfcoef, vloc_at, rinner,
nbeta, kkbeta, nqf, nqlc, lll, tvanp
have been replaced by the corresponding variables in structure 'upf'.
There shouldn't be any side effects, but who knows. There is still a
copy of the above variables that will be removed sooner or later.
Basically : variable([i,j,k,..,]n) => upf(n)%variable [(i,j,k,..)]
Note that upf%qfunc has for the time being three indices instead of two,
and that upf%kkbeta is the analogous of kkbeta and not what it used to be.
The logic of this operation will be clearer when it will be completed
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4308 c92efa57-630b-4861-b058-cf58834340f0
2007-10-05 17:26:23 +08:00
|
|
|
do ir = 1, upf%kkbeta
|
2007-10-03 00:54:13 +08:00
|
|
|
upf%beta (ir, nb) = vnl (ir, l) * upf%chi (ir, l + 1)
|
2004-04-26 15:25:01 +08:00
|
|
|
enddo
|
2007-10-03 00:54:13 +08:00
|
|
|
upf%lll (nb) = l
|
2004-04-26 15:25:01 +08:00
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
deallocate (vnl)
|
2007-10-03 00:54:13 +08:00
|
|
|
!
|
|
|
|
! for compatibility with USPP
|
|
|
|
!
|
|
|
|
upf%nqf = 0
|
|
|
|
upf%nqlc= 0
|
|
|
|
upf%tvanp =.false.
|
2008-01-16 02:06:09 +08:00
|
|
|
upf%tpawp =.false.
|
2007-10-03 00:54:13 +08:00
|
|
|
upf%has_so=.false.
|
|
|
|
!
|
This is a quite complex check-in, but actually not very much is done. Changelog follows.
LP
UPF file format updated completely, UPFv2 introduced:
* ld1.x can still produce old format, with the switch upf_v1_format=.true. in inputp
this is disabled by default, but we can discuss if it should be the opposite.
* pw.x cp.x and all utilities should notice no difference
* some utilities in upftools still need to be updated, anyway conversion UPFv1 to UPFv2
is very easy, so this should be no big issue
* starting from now to produce an UPF file you need to fill the pseudo_upf derivedd type
and feed it to write_upf woutine in upf_module (Modules/upf.f90)
* extensive use of iotk
I have tried to make the new format as self contained as possible, e.g. there should be
minimal need for post-processing after the data is read, no more reconstruction of known
quantities, and no more odd syntax to save negligible quantity of space. Also the human
readable section is a bit richer, all the rest is more machine readable.
I hope this will not cause any throuble, and tried really hard to, all examples and all
tests works as fine as before and gives (what really looks like) the same results.
Other changes that I needed to make:
* radial grids are now allocatable, they management is a bit less of a hack too
* paw and uspp augmentation are stored in the same place
* paw print total all-electron energy if all atoms are paw, not very useful, but nice
* most of the pseudopotential-writing reading files have been renamed to some more
logical name, I spare you the list. E.g. read_oldpseudo -> read_pseudo_rrkj3
* paw_t derived type was only used in atomic, so I have put it there (as the pseudo_type
module take ages to recompile it was awkward to leave it there).
PAW tests inserted in test/ there are 6 of them, as a consequence I have also put 5 paw
pseudopotentials in the pseudo/ directory.
I will update the PAW scf examples soon, by deleting them (as running a pw with a PAW
pseudopotential requires no option at all). PAW generation examples should be updated.
A lot of small bugfixes here & there mostly uninitialized variables or unallocated
pointers used as subrotuine arguments.
git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4769 c92efa57-630b-4861-b058-cf58834340f0
2008-04-03 23:50:43 +08:00
|
|
|
! Set additional, not present, variables to dummy values
|
|
|
|
allocate(upf%els(upf%nwfc))
|
|
|
|
upf%els(:) = 'nX'
|
|
|
|
allocate(upf%els_beta(upf%nbeta))
|
|
|
|
upf%els_beta(:) = 'nX'
|
|
|
|
allocate(upf%rcut(upf%nbeta), upf%rcutus(upf%nbeta))
|
|
|
|
upf%rcut(:) = 0._dp
|
|
|
|
upf%rcutus(:) = 0._dp
|
|
|
|
!
|
2003-02-08 00:04:36 +08:00
|
|
|
return
|
2003-01-20 05:58:50 +08:00
|
|
|
|
2003-02-21 22:57:00 +08:00
|
|
|
300 call errore ('read_ncpp', 'pseudo file is empty or wrong', abs (np) )
|
2003-01-20 05:58:50 +08:00
|
|
|
end subroutine read_ncpp
|
|
|
|
|