mirror of https://gitlab.com/QEF/q-e.git
option tbeta_smoothing similar to tq_smoothing added.
some cleanup a little semplification in the logics stemming from the fact that tpawp=.true. implies tvanp=.true. git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12622 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
parent
e39c689df4
commit
f69123d35d
|
@ -257,9 +257,10 @@ MODULE control_flags
|
|||
|
||||
!LOGICAL, PUBLIC :: real_space=.false. ! beta functions in real space
|
||||
!
|
||||
! ... Augmetation charge smoothing
|
||||
! ... Augmetation charge and beta smoothing
|
||||
!
|
||||
LOGICAL, PUBLIC :: tq_smoothing=.FALSE. ! if true the Q are smoothed
|
||||
LOGICAL, PUBLIC :: tbeta_smoothing=.FALSE. ! if true the betas are smoothed
|
||||
!
|
||||
! ... External Forces on Ions
|
||||
!
|
||||
|
|
|
@ -899,6 +899,9 @@ MODULE input_parameters
|
|||
LOGICAL :: tq_smoothing = .false.
|
||||
! US augmentation charge is smoothed before use
|
||||
|
||||
LOGICAL :: tbeta_smoothing = .false.
|
||||
! beta function are smoothed before use
|
||||
|
||||
LOGICAL :: occupation_constraints = .false.
|
||||
! If true perform CP dynamics with constrained occupations
|
||||
! to be used together with penalty functional ...
|
||||
|
@ -936,7 +939,7 @@ MODULE input_parameters
|
|||
diis_temp, diis_achmix, diis_g0chmix, diis_g1chmix, &
|
||||
diis_nchmix, diis_nrot, diis_rothr, diis_ethr, diis_chguess, &
|
||||
mixing_mode, mixing_beta, mixing_ndim, mixing_fixed_ns, &
|
||||
tqr, tq_smoothing, &
|
||||
tqr, tq_smoothing, tbeta_smoothing, &
|
||||
diago_cg_maxiter, diago_david_ndim, diagonalization, &
|
||||
startingpot, startingwfc , conv_thr, &
|
||||
adaptive_thr, conv_thr_init, conv_thr_multi, &
|
||||
|
|
|
@ -648,11 +648,11 @@ CONTAINS
|
|||
!
|
||||
!
|
||||
!------------------------------------------------------------------------
|
||||
SUBROUTINE qexml_write_control( pp_check_flag, lkpoint_dir, q_real_space, tq_smoothing, beta_real_space)
|
||||
SUBROUTINE qexml_write_control( pp_check_flag, lkpoint_dir, q_real_space, tq_smoothing, tbeta_smoothing, beta_real_space)
|
||||
!------------------------------------------------------------------------
|
||||
!
|
||||
IMPLICIT NONE
|
||||
LOGICAL, OPTIONAL, INTENT(IN) :: pp_check_flag, lkpoint_dir, q_real_space, tq_smoothing, beta_real_space
|
||||
LOGICAL, OPTIONAL, INTENT(IN) :: pp_check_flag, lkpoint_dir, q_real_space, tq_smoothing, tbeta_smoothing, beta_real_space
|
||||
|
||||
|
||||
CALL iotk_write_begin( ounit, "CONTROL" )
|
||||
|
@ -674,6 +674,9 @@ CONTAINS
|
|||
! This flag says if the Q are being smoothed
|
||||
IF ( PRESENT( tq_smoothing ) ) &
|
||||
CALL iotk_write_dat( ounit, "TQ_SMOOTHING", tq_smoothing )
|
||||
! This flag says if the beta are being smoothed
|
||||
IF ( PRESENT( tbeta_smoothing ) ) &
|
||||
CALL iotk_write_dat( ounit, "TBETA_SMOOTHING", tbeta_smoothing )
|
||||
!
|
||||
CALL iotk_write_end( ounit, "CONTROL" )
|
||||
!
|
||||
|
|
|
@ -242,7 +242,7 @@ MODULE qexsd_input
|
|||
END SUBROUTINE qexsd_init_basis
|
||||
!-------------------------------------------------------------------------------------------
|
||||
SUBROUTINE qexsd_init_electron_control( obj,diagonalization,mixing_mode,mixing_beta,&
|
||||
conv_thr, mixing_ndim, max_nstep, tqr, tq_smoothing, &
|
||||
conv_thr, mixing_ndim, max_nstep, tqr, tq_smoothing, tbeta_smoothing, &
|
||||
diago_thr_init, diago_full_acc, diago_cg_maxiter,&
|
||||
diago_david_ndim)
|
||||
!-------------------------------------------------------------------------------------------
|
||||
|
@ -254,15 +254,15 @@ MODULE qexsd_input
|
|||
REAL(DP),INTENT(IN) :: mixing_beta, conv_thr, diago_thr_init
|
||||
INTEGER,INTENT(IN) :: mixing_ndim,max_nstep,diago_cg_maxiter,&
|
||||
diago_david_ndim
|
||||
LOGICAL,INTENT(IN) :: diago_full_acc,tqr, tq_smoothing
|
||||
LOGICAL,INTENT(IN) :: diago_full_acc,tqr, tq_smoothing, tbeta_smoothing
|
||||
!
|
||||
CHARACTER(LEN=*),PARAMETER :: TAGNAME="electron_control"
|
||||
!
|
||||
CALL qes_init_electron_control(obj,TAGNAME,diagonalization=diagonalization,&
|
||||
mixing_mode=mixing_mode,mixing_beta=mixing_beta,&
|
||||
conv_thr=conv_thr,mixing_ndim=mixing_ndim,max_nstep=max_nstep,&
|
||||
real_space_q=tqr,tqr_smoothing=tq_smoothing,diago_thr_init=diago_thr_init,&
|
||||
diago_full_acc=diago_full_acc,diago_cg_maxiter=diago_cg_maxiter)
|
||||
real_space_q=tqr,tqr_smoothing=tq_smoothing,tbeta_smoothing=tbeta_smoothing, &
|
||||
diago_thr_init=diago_thr_init,diago_full_acc=diago_full_acc,diago_cg_maxiter=diago_cg_maxiter)
|
||||
!
|
||||
END SUBROUTINE qexsd_init_electron_control
|
||||
!
|
||||
|
|
|
@ -937,6 +937,7 @@ MODULE read_namelists_module
|
|||
CALL mp_bcast( mixing_ndim, ionode_id, intra_image_comm )
|
||||
CALL mp_bcast( tqr, ionode_id, intra_image_comm )
|
||||
CALL mp_bcast( tq_smoothing, ionode_id, intra_image_comm )
|
||||
CALL mp_bcast( tbeta_smoothing, ionode_id, intra_image_comm )
|
||||
CALL mp_bcast( diagonalization, ionode_id, intra_image_comm )
|
||||
CALL mp_bcast( diago_thr_init, ionode_id, intra_image_comm )
|
||||
CALL mp_bcast( diago_cg_maxiter, ionode_id, intra_image_comm )
|
||||
|
|
|
@ -705,6 +705,9 @@ CONTAINS
|
|||
CASE ( 'tq_smoothing' )
|
||||
CALL iotk_scan_dat_inside( xmlinputunit, tq_smoothing, ierr = ierr )
|
||||
!
|
||||
CASE ( 'tbeta_smoothing' )
|
||||
CALL iotk_scan_dat_inside( xmlinputunit, tbeta_smoothing, ierr = ierr )
|
||||
!
|
||||
CASE ( 'trust_radius_ini' )
|
||||
CALL iotk_scan_dat_inside( xmlinputunit, trust_radius_ini, ierr = ierr )
|
||||
!
|
||||
|
|
|
@ -221,7 +221,7 @@ MODULE xml_io_base
|
|||
!
|
||||
USE io_global, ONLY : ionode, ionode_id
|
||||
USE mp_images, ONLY : intra_image_comm
|
||||
USE control_flags, ONLY : lkpoint_dir, tqr, tq_smoothing
|
||||
USE control_flags, ONLY : lkpoint_dir, tqr, tq_smoothing, tbeta_smoothing
|
||||
!
|
||||
IMPLICIT NONE
|
||||
!
|
||||
|
@ -270,10 +270,14 @@ MODULE xml_io_base
|
|||
!
|
||||
IF ( .NOT. found ) tqr = .FALSE.
|
||||
!
|
||||
CALL iotk_scan_dat( iunpun, "TQ_SMOOTING", tq_smoothing, FOUND = found)
|
||||
CALL iotk_scan_dat( iunpun, "TQ_SMOOTHING", tq_smoothing, FOUND = found)
|
||||
!
|
||||
IF ( .NOT. found ) tq_smoothing = .FALSE.
|
||||
!
|
||||
CALL iotk_scan_dat( iunpun, "TBETA_SMOOTHING", tbeta_smoothing, FOUND = found)
|
||||
!
|
||||
IF ( .NOT. found ) tbeta_smoothing = .FALSE.
|
||||
!
|
||||
IF ( .NOT. back_compat ) THEN
|
||||
!
|
||||
CALL iotk_scan_end( iunpun, "CONTROL" )
|
||||
|
@ -292,6 +296,8 @@ MODULE xml_io_base
|
|||
!
|
||||
CALL mp_bcast( tq_smoothing, ionode_id, intra_image_comm )
|
||||
!
|
||||
CALL mp_bcast( tbeta_smoothing, ionode_id, intra_image_comm )
|
||||
!
|
||||
pp_check_file = lval
|
||||
!
|
||||
RETURN
|
||||
|
|
|
@ -109,6 +109,7 @@ init_ns.o \
|
|||
init_q_aeps.o \
|
||||
init_run.o \
|
||||
init_us_0.o \
|
||||
init_us_b0.o \
|
||||
init_us_1.o \
|
||||
init_us_2.o \
|
||||
init_at_1.o \
|
||||
|
|
|
@ -42,10 +42,7 @@ SUBROUTINE calc_btq(ql,qr_k,idbes)
|
|||
! only need to calculate for l=lmin,lmin+2 ...lmax-2,lmax
|
||||
DO l = ilmin,ilmax,2
|
||||
aux(:) = 0.0_DP
|
||||
IF (upf(np)%tvanp .or. upf(np)%tpawp) then
|
||||
aux(1:upf(np)%kkbeta) = &
|
||||
upf(np)%qfuncl(1:upf(np)%kkbeta,ijv,l)
|
||||
ENDIF
|
||||
aux(1:upf(np)%kkbeta) = upf(np)%qfuncl(1:upf(np)%kkbeta,ijv,l)
|
||||
IF (idbes == 1) THEN
|
||||
!
|
||||
CALL sph_dbes( upf(np)%kkbeta, rgrid(np)%r, ql, l, jl )
|
||||
|
|
|
@ -107,7 +107,7 @@ SUBROUTINE compute_el_dip(emaxpos, eopreg, edir, charge, e_dipole)
|
|||
!--------------------------
|
||||
|
||||
!
|
||||
! Case with edir = 3 (in the formula changes only tha rgument of saw, i for
|
||||
! Case with edir = 3 (in the formula changes only the argument of saw, i for
|
||||
! edir=1 and j for edir = 2)
|
||||
!
|
||||
! P_{ele} = \sum_{ijk} \rho_{r_{ijk}} Saw\left( \frac{k}{nr3} \right)
|
||||
|
|
|
@ -45,10 +45,7 @@ SUBROUTINE compute_qdipol(dpqq)
|
|||
if ( ( l >= abs(upf(nt)%lll(nb) - upf(nt)%lll(mb)) ) .and. &
|
||||
( l <= upf(nt)%lll(nb) + upf(nt)%lll(mb) ) .and. &
|
||||
(mod (l+upf(nt)%lll(nb)+upf(nt)%lll(mb), 2) == 0) ) then
|
||||
if (upf(nt)%tvanp .or. upf(nt)%tpawp) then
|
||||
qtot(1:upf(nt)%kkbeta,nb,mb) =&
|
||||
upf(nt)%qfuncl(1:upf(nt)%kkbeta,ijv,l)
|
||||
endif
|
||||
qtot(1:upf(nt)%kkbeta,nb,mb) = upf(nt)%qfuncl(1:upf(nt)%kkbeta,ijv,l)
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
|
|
@ -26,7 +26,7 @@ SUBROUTINE hinit0()
|
|||
USE gvecw, ONLY : gcutw
|
||||
USE realus, ONLY : generate_qpointlist,betapointlist,init_realspace_vars,real_space
|
||||
use ldaU, ONLY : lda_plus_U, U_projection
|
||||
USE control_flags,ONLY : tqr, tq_smoothing
|
||||
USE control_flags,ONLY : tqr, tq_smoothing, tbeta_smoothing
|
||||
USE io_global, ONLY : stdout
|
||||
!
|
||||
IMPLICIT NONE
|
||||
|
@ -40,6 +40,7 @@ SUBROUTINE hinit0()
|
|||
!
|
||||
! ... k-point independent parameters of non-local pseudopotentials
|
||||
!
|
||||
if (tbeta_smoothing) CALL init_us_b0()
|
||||
if (tq_smoothing) CALL init_us_0()
|
||||
CALL init_us_1()
|
||||
IF ( lda_plus_U .AND. ( U_projection == 'pseudo' ) ) CALL init_q_aeps()
|
||||
|
|
|
@ -37,7 +37,6 @@ subroutine init_us_0
|
|||
! here a few local variables
|
||||
!
|
||||
logical, parameter :: tprint=.false. ! whether the q_l(r) and its relatives are printed or not
|
||||
logical, parameter :: smoothing=.true. ! whether the q_l(r) are smoothed or not
|
||||
integer, parameter :: nn=16 ! smoothing parameter, order of the polynomial inverse gaussian approximant
|
||||
real(DP), parameter:: a=22.0 ! smoothing parameter, exponent of the gaussian decaying factor
|
||||
! a=0.d0 ; nn=0 would be no smoothing.
|
||||
|
@ -52,20 +51,12 @@ subroutine init_us_0
|
|||
! q-point grid for interpolation
|
||||
real(DP), allocatable :: ylmk0 (:)
|
||||
! the spherical harmonics
|
||||
integer :: n1, m0, m1, n, li, mi, vi, vj, ijs, is1, is2, lk, mk, vk, kh, lh, ijkb0
|
||||
integer, external :: sph_ind
|
||||
integer :: lnb, lmb
|
||||
complex(DP) :: qgm(1)
|
||||
real(DP) :: qmax
|
||||
!
|
||||
real(DP), allocatable :: xdata(:)
|
||||
real(DP) :: d1
|
||||
character(LEN=5) :: filename
|
||||
!
|
||||
! if no smoothing is desired just quit here
|
||||
!
|
||||
if (.not. smoothing) return
|
||||
!
|
||||
call start_clock ('init_us_0')
|
||||
!
|
||||
! Initialization of the variables
|
||||
|
|
|
@ -267,12 +267,9 @@ subroutine init_us_1
|
|||
( l <= upf(nt)%lll(nb) + upf(nt)%lll(mb) ) .and. &
|
||||
(mod (l+upf(nt)%lll(nb)+upf(nt)%lll(mb), 2) == 0) ) then
|
||||
ijv = mb * (mb-1) / 2 + nb
|
||||
paw : & ! in PAW and now in US as well q(r) is stored in an l-dependent array
|
||||
if (upf(nt)%tvanp .or. upf(nt)%tpawp) then
|
||||
qtot(1:upf(nt)%kkbeta,ijv) =&
|
||||
upf(nt)%qfuncl(1:upf(nt)%kkbeta,ijv,l)
|
||||
endif paw
|
||||
endif respect_sum_rule
|
||||
! in PAW and now in US as well q(r) is stored in an l-dependent array
|
||||
qtot(1:upf(nt)%kkbeta,ijv) = upf(nt)%qfuncl(1:upf(nt)%kkbeta,ijv,l)
|
||||
endif respect_sum_rule
|
||||
enddo ! mb
|
||||
enddo ! nb
|
||||
!
|
||||
|
|
|
@ -0,0 +1,219 @@
|
|||
|
||||
! Copyright (C) 2001-2007 Quantum ESPRESSO group
|
||||
! 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 .
|
||||
!
|
||||
!
|
||||
!----------------------------------------------------------------------
|
||||
subroutine init_us_b0
|
||||
!----------------------------------------------------------------------
|
||||
!
|
||||
! in this routine the beta_l(r) are smoothed
|
||||
!
|
||||
USE kinds, ONLY : DP
|
||||
USE gvecw, ONLY : ecutwfc
|
||||
USE cellmd, ONLY : cell_factor
|
||||
USE io_global, ONLY : stdout
|
||||
USE constants, ONLY : fpi, sqrt2, eps8
|
||||
USE atom, ONLY : rgrid
|
||||
USE ions_base, ONLY : ntyp => nsp
|
||||
USE cell_base, ONLY : omega, tpiba
|
||||
USE us, ONLY : dq
|
||||
USE uspp_param, ONLY : upf, nbetam
|
||||
USE mp_bands, ONLY : intra_bgrp_comm
|
||||
USE mp, ONLY : mp_sum
|
||||
!
|
||||
implicit none
|
||||
!
|
||||
! here a few local variables
|
||||
!
|
||||
logical, parameter :: tprint=.false. ! whether the beta_l(r) and its relatives are printed or not
|
||||
integer, parameter :: nn=16 ! smoothing parameter, order of the polynomial inverse gaussian approximant
|
||||
real(DP), parameter:: a=22.0 ! smoothing parameter, exponent of the gaussian decaying factor
|
||||
real (DP) :: aa, rcut ! parameter to be used in the mask function, localization radius of the mask function
|
||||
|
||||
integer :: nqx
|
||||
real(DP),allocatable :: tab0(:,:), tab(:,:), beta(:,:), betas(:,:)
|
||||
!
|
||||
integer :: nt, nb, l, ir, iq, startq, lastq, ilast, ndm
|
||||
! various counters
|
||||
real(DP), allocatable :: aux (:), besr (:)
|
||||
! various work space
|
||||
real(DP) :: pref, q, qi, qmax
|
||||
! the prefactor of the beta functions
|
||||
! the modulus of g for each shell
|
||||
! q-point grid for interpolation
|
||||
real(DP) :: vqint
|
||||
! interpolated value
|
||||
integer, external :: sph_ind
|
||||
!
|
||||
character(LEN=4) :: filename
|
||||
|
||||
!
|
||||
|
||||
call start_clock ('init_us_b0')
|
||||
!
|
||||
! Initialization of the variables
|
||||
!
|
||||
|
||||
aa = ecutwfc / abs (log (eps8)) ; rcut = abs(log(eps8))/sqrt(ecutwfc)
|
||||
qmax = 3.d0 * sqrt(ecutwfc)
|
||||
nqx = int( qmax / dq + 4) ! Think about what happens in a variable cell calculations
|
||||
|
||||
ALLOCATE (tab0( nqx , nbetam ), tab( nqx, nbetam) )
|
||||
|
||||
if (tprint) write ( stdout, * ) 'upf(nt)%kkbeta ', upf(1:ntyp)%kkbeta
|
||||
do nt=1,ntyp
|
||||
do ir = upf(nt)%kkbeta, upf(nt)%mesh
|
||||
if ( rgrid(nt)%r(ir) < rcut ) upf(nt)%kkbeta=ir
|
||||
end do
|
||||
end do
|
||||
|
||||
ndm = MAXVAL ( upf(:)%kkbeta )
|
||||
ALLOCATE (beta( ndm, nbetam ), betas( ndm, nbetam ) )
|
||||
allocate (aux ( ndm ), besr( ndm ))
|
||||
|
||||
write (6,'(a,f6.2,a,i4,4(a,f11.8))') 'FILTER : a=',a,', nn=',nn,', filter(1.d0)=', filter(1.d0,a,nn), &
|
||||
', filter(1.1d0)=', filter(1.1d0,a,nn), &
|
||||
', filter(1.2d0)=', filter(1.2d0,a,nn), &
|
||||
', filter(1.5d0)=', filter(1.5d0,a,nn)
|
||||
|
||||
if (tprint) then
|
||||
write ( stdout, * ) " PSEUDOPOTENTIAL REPORT "
|
||||
write ( stdout, * ) ' NDM :', ndm, ' ', upf(1:ntyp)%kkbeta
|
||||
write ( stdout, * ) ' NQX :', nqx, ' NBETAM :', nbetam
|
||||
write ( stdout, * ) ' r(ndm):', (rgrid(nt)%r(upf(nt)%kkbeta),nt=1,ntyp), ' rcut :', rcut
|
||||
end if
|
||||
|
||||
!
|
||||
! fill the interpolation table tab
|
||||
!
|
||||
pref = fpi / sqrt (omega)
|
||||
call divide (intra_bgrp_comm, nqx, startq, lastq)
|
||||
do nt = 1, ntyp
|
||||
if ( upf(nt)%is_gth ) cycle
|
||||
|
||||
tab0(:,:) = 0.d0 ; tab (:,:) = 0.d0
|
||||
beta (:,:) = 0.d0 ; betas(:,:) = 0.d0
|
||||
|
||||
if (tprint) then
|
||||
filename = 'br_' ! the radial beta_l(r) as defined in the pseudopotential
|
||||
WRITE (filename( 4:4 ),'(i1)') nt
|
||||
OPEN (4,file=filename,form='formatted', status='unknown')
|
||||
write (4, *) ' nbeta :', upf(nt)%nbeta,' kkbeta :',upf(nt)%kkbeta
|
||||
do ir =1,upf(nt)%kkbeta
|
||||
write (4,'(12f16.10)') rgrid(nt)%r(ir), (upf(nt)%beta(ir,nb), nb=1,upf(nt)%nbeta)
|
||||
end do
|
||||
CLOSE (4)
|
||||
end if
|
||||
!-
|
||||
do nb = 1, upf(nt)%nbeta
|
||||
l = upf(nt)%lll (nb)
|
||||
do iq = startq, lastq
|
||||
qi = (iq - 1) * dq
|
||||
call sph_bes (upf(nt)%kkbeta, rgrid(nt)%r, qi, l, besr)
|
||||
do ir = 1, upf(nt)%kkbeta
|
||||
! aux (ir) = upf(nt)%beta (ir, nb) * besr (ir) * rgrid(nt)%r(ir) / mask(rgrid(nt)%r(ir),aa)
|
||||
aux (ir) = upf(nt)%beta (ir, nb) * besr (ir) * rgrid(nt)%r(ir)
|
||||
enddo
|
||||
call simpson (upf(nt)%kkbeta, aux, rgrid(nt)%rab, vqint)
|
||||
|
||||
tab0(iq, nb) = vqint
|
||||
tab (iq, nb) = vqint * filter( 1.1d0 * qi / qmax, a, nn )
|
||||
|
||||
do ir = 1, upf(nt)%kkbeta
|
||||
! betas(ir,nb) = betas(ir,nb) + qi*qi * dq * tab (iq,nb) * besr (ir) * rgrid(nt)%r(ir) * mask(rgrid(nt)%r(ir),aa)
|
||||
beta (ir,nb) = beta (ir,nb) + qi*qi * dq * tab0(iq,nb) * besr (ir) * rgrid(nt)%r(ir)
|
||||
betas(ir,nb) = betas(ir,nb) + qi*qi * dq * tab (iq,nb) * besr (ir) * rgrid(nt)%r(ir)
|
||||
enddo
|
||||
enddo
|
||||
!-
|
||||
enddo
|
||||
|
||||
tab0 = tab0 * pref ; call mp_sum( tab0, intra_bgrp_comm )
|
||||
tab = tab * pref ; call mp_sum( tab , intra_bgrp_comm )
|
||||
beta = beta * 8.0/fpi ; call mp_sum( beta , intra_bgrp_comm )
|
||||
betas= betas* 8.0/fpi ; call mp_sum( betas, intra_bgrp_comm )
|
||||
|
||||
upf(nt)%beta(1:upf(nt)%kkbeta,1:upf(nt)%nbeta) = betas(1:upf(nt)%kkbeta,1:upf(nt)%nbeta)
|
||||
|
||||
if (tprint) then
|
||||
!-
|
||||
filename(1:3) = 'bq_' ! the radial fourier transform of beta_l in reciprcal space up to qmax
|
||||
OPEN (4,file=filename,form='formatted', status='unknown')
|
||||
write (4, *) ' nbeta :', upf(nt)%nbeta,' nqx :',nqx, dq*nqx
|
||||
do iq=1,nqx
|
||||
qi = (iq - 1) * dq
|
||||
write (4,'(12f16.10)') qi,(tab0(iq,nb), nb=1,upf(nt)%nbeta)
|
||||
end do
|
||||
CLOSE (4)
|
||||
!-
|
||||
filename(1:3) = 'bqs' ! the smoothed radial fourier transform of beta_l in reciprcal space up to qmax
|
||||
OPEN (4,file=filename,form='formatted', status='unknown')
|
||||
write (4, *) ' nbeta :', upf(nt)%nbeta,' nqx :',nqx, dq*nqx
|
||||
do iq=1,nqx
|
||||
qi = (iq - 1) * dq
|
||||
write (4,'(12f16.10)') qi,(tab(iq,nb), nb=1,upf(nt)%nbeta)
|
||||
end do
|
||||
CLOSE (4)
|
||||
!-
|
||||
filename(1:3) = 'brq' ! the back radial fourier transform of beta_l in real space
|
||||
OPEN (4,file=filename,form='formatted', status='unknown')
|
||||
write (4, *) ' nbeta :', upf(nt)%nbeta,' kkbeta :',upf(nt)%kkbeta
|
||||
do ir =1,upf(nt)%kkbeta
|
||||
write (4,'(12f16.10)') rgrid(nt)%r(ir), (beta(ir,nb), nb=1,upf(nt)%nbeta)
|
||||
end do
|
||||
CLOSE (4)
|
||||
!-
|
||||
filename(1:3) = 'brs' ! the back radial fourier transform of the smoothed beta_l in real space
|
||||
OPEN (4,file=filename,form='formatted', status='unknown')
|
||||
write (4, *) ' nbeta :', upf(nt)%nbeta,' kkbeta :',upf(nt)%kkbeta
|
||||
do ir =1,upf(nt)%kkbeta
|
||||
write (4,'(12f16.10)') rgrid(nt)%r(ir), (betas(ir,nb), nb=1,upf(nt)%nbeta)
|
||||
end do
|
||||
CLOSE (4)
|
||||
!-
|
||||
end if
|
||||
|
||||
enddo
|
||||
|
||||
deallocate (tab0, tab)
|
||||
deallocate (beta, betas)
|
||||
deallocate (besr, aux)
|
||||
|
||||
call stop_clock ('init_us_b0')
|
||||
return
|
||||
|
||||
contains
|
||||
|
||||
real (DP) function mask(x,a)
|
||||
real (DP), intent (IN) :: x,a
|
||||
|
||||
mask = exp (- a*x*x )
|
||||
|
||||
return
|
||||
|
||||
end function mask
|
||||
|
||||
REAL(DP) function filter ( x, a, n )
|
||||
implicit none
|
||||
REAL (DP), INTENT (IN) :: x, a
|
||||
INTEGER, INTENT (IN) :: n
|
||||
REAL (DP) :: axx, ff
|
||||
integer :: k
|
||||
|
||||
axx = a * x * x
|
||||
|
||||
ff = 1.d0
|
||||
do k = n, 1, -1
|
||||
ff = (1.d0+axx/REAL(k)*ff)
|
||||
end do
|
||||
filter = ff * exp(-axx)
|
||||
|
||||
return
|
||||
end function filter
|
||||
|
||||
end subroutine init_us_b0
|
||||
|
|
@ -148,6 +148,7 @@ SUBROUTINE iosys()
|
|||
lkpoint_dir_ => lkpoint_dir, &
|
||||
tqr_ => tqr, &
|
||||
tq_smoothing_ => tq_smoothing, &
|
||||
tbeta_smoothing_ => tbeta_smoothing, &
|
||||
io_level, ethr, lscf, lbfgs, lmd, &
|
||||
lbands, lconstrain, restart, twfcollect, &
|
||||
llondon, do_makov_payne, lxdm, &
|
||||
|
@ -246,7 +247,7 @@ SUBROUTINE iosys()
|
|||
!
|
||||
USE input_parameters, ONLY : electron_maxstep, mixing_mode, mixing_beta, &
|
||||
mixing_ndim, mixing_fixed_ns, conv_thr, &
|
||||
tqr, tq_smoothing, &
|
||||
tqr, tq_smoothing, tbeta_smoothing, &
|
||||
diago_thr_init, diago_cg_maxiter, &
|
||||
diago_david_ndim, diagonalization, &
|
||||
diago_full_acc, startingwfc, startingpot, &
|
||||
|
@ -1086,6 +1087,7 @@ SUBROUTINE iosys()
|
|||
real_space_ = real_space
|
||||
!
|
||||
tq_smoothing_ = tq_smoothing
|
||||
tbeta_smoothing_ = tbeta_smoothing
|
||||
!
|
||||
title_ = title
|
||||
lkpoint_dir_=lkpoint_dir
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
ip_nr3 => nr3, ip_nr1s => nr1s, ip_nr2s => nr2s,ip_nr3s => nr3s, ip_nr1b=>nr1b, &
|
||||
ip_nr2b=>nr2b, ip_nr3b => nr3b, &
|
||||
ip_diagonalization=>diagonalization, mixing_mode, mixing_beta, &
|
||||
mixing_ndim, tqr, tq_smoothing, electron_maxstep, &
|
||||
mixing_ndim, tqr, tq_smoothing, tbeta_smoothing, electron_maxstep, &
|
||||
diago_thr_init, diago_full_acc, diago_cg_maxiter, diago_david_ndim, &
|
||||
nk1, nk2, nk3, k1, k2, k3, nkstot, ip_xk => xk, ip_wk => wk, &
|
||||
ion_dynamics, upscale, remove_rigid_rot, refold_pos, pot_extrapolation, &
|
||||
|
@ -240,8 +240,8 @@
|
|||
diagonalization = ip_diagonalization
|
||||
END IF
|
||||
CALL qexsd_init_electron_control(obj%electron_control, diagonalization, mixing_mode, mixing_beta, conv_thr, &
|
||||
mixing_ndim, electron_maxstep, tqr, tq_smoothing, diago_thr_init, diago_full_acc, &
|
||||
diago_cg_maxiter, diago_david_ndim )
|
||||
mixing_ndim, electron_maxstep, tqr, tq_smoothing, tbeta_smoothing, diago_thr_init, &
|
||||
diago_full_acc, diago_cg_maxiter, diago_david_ndim )
|
||||
!--------------------------------------------------------------------------------------------------------------------------------
|
||||
! K POINTS IBZ ELEMENT
|
||||
!------------------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -104,7 +104,8 @@ USE io_files, ONLY : tmp_dir, prefix, iunpun, xmlpun, delete_if_present, &
|
|||
!
|
||||
USE control_flags, ONLY : istep, twfcollect, conv_ions, &
|
||||
lscf, lkpoint_dir, gamma_only, &
|
||||
tqr, tq_smoothing, noinv, do_makov_payne, smallmem, &
|
||||
tqr, tq_smoothing, tbeta_smoothing, &
|
||||
noinv, do_makov_payne, smallmem, &
|
||||
llondon, lxdm, ts_vdw, scf_error, n_scf_steps
|
||||
USE realus, ONLY : real_space
|
||||
USE uspp, ONLY : okvan
|
||||
|
@ -480,7 +481,8 @@ USE io_files, ONLY : tmp_dir, prefix, iunpun, xmlpun, delete_if_present, &
|
|||
!
|
||||
USE control_flags, ONLY : twfcollect, conv_ions, &
|
||||
lscf, lkpoint_dir, gamma_only, &
|
||||
tqr, tq_smoothing, noinv, do_makov_payne, smallmem, &
|
||||
tqr, tq_smoothing, tbeta_smoothing, &
|
||||
noinv, do_makov_payne, smallmem, &
|
||||
llondon, lxdm, ts_vdw
|
||||
USE realus, ONLY : real_space
|
||||
USE global_version, ONLY : version_number
|
||||
|
@ -759,8 +761,8 @@ USE io_files, ONLY : tmp_dir, prefix, iunpun, xmlpun, delete_if_present, &
|
|||
!-------------------------------------------------------------------------------
|
||||
!
|
||||
CALL qexml_write_control( PP_CHECK_FLAG=conv_ions, LKPOINT_DIR=lkpoint_dir, &
|
||||
Q_REAL_SPACE=tqr, TQ_SMOOTHING=tq_smoothing, &
|
||||
BETA_REAL_SPACE=real_space )
|
||||
Q_REAL_SPACE=tqr, TQ_SMOOTHING=tq_smoothing, &
|
||||
BETA_REAL_SPACE=real_space, TBETA_SMOOTHING=tbeta_smoothing )
|
||||
!
|
||||
!-------------------------------------------------------------------------------
|
||||
! ... CELL
|
||||
|
|
|
@ -36,7 +36,7 @@ SUBROUTINE summary()
|
|||
nelec, nelup, neldw, two_fermi_energies
|
||||
USE ktetra, ONLY : ltetra
|
||||
USE control_flags, ONLY : imix, nmix, mixing_beta, nstep, lscf, &
|
||||
tr2, isolve, lmd, lbfgs, iverbosity, tqr, tq_smoothing
|
||||
tr2, isolve, lmd, lbfgs, iverbosity, tqr, tq_smoothing, tbeta_smoothing
|
||||
USE noncollin_module,ONLY : noncolin
|
||||
USE spin_orb, ONLY : domag, lspinorb
|
||||
USE funct, ONLY : write_dft_name, dft_is_hybrid
|
||||
|
@ -375,6 +375,7 @@ SUBROUTINE summary()
|
|||
IF ( real_space ) WRITE( stdout, &
|
||||
& '(5x,"Real space treatment of Beta functions,", &
|
||||
& " V.1 (BE SURE TO CHECK MANUAL!)")' )
|
||||
IF ( tbeta_smoothing ) WRITE( stdout, '(5x,"Beta functions are smoothed ")' )
|
||||
IF ( tqr ) WRITE( stdout, '(5x,"Real space treatment of Q(r)")' )
|
||||
IF ( tq_smoothing ) WRITE( stdout, '(5x,"Augmentation charges are smoothed ")' )
|
||||
|
||||
|
|
Loading…
Reference in New Issue