Introduced the possibility to print the eigenvalues (also relativistic) of

an hydrogen-like atom using the variable noscf.
Some cleanup.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@6272 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
dalcorso 2010-01-08 09:57:03 +00:00
parent e64007042b
commit 0e22365865
7 changed files with 63 additions and 29 deletions

View File

@ -18,7 +18,7 @@ subroutine elsd (zed,grid,rho,vxt,vh,vxc,exc,excgga,nwf,nspin,enl,oc, &
use kinds, only : DP
use radial_grids, only: ndmx, radial_grid_type
use funct, only: get_iexch
use ld1inc, only: vx
use ld1inc, only: vx, noscf
implicit none
integer, intent(in) :: nwf, nspin
type(radial_grid_type),intent(in)::grid
@ -32,6 +32,7 @@ subroutine elsd (zed,grid,rho,vxt,vh,vxc,exc,excgga,nwf,nspin,enl,oc, &
integer:: i,n,is,ierr
logical:: oep
if (noscf) return
oep=get_iexch().eq.4
allocate(f1(grid%mesh),stat=ierr)

View File

@ -13,7 +13,17 @@ SUBROUTINE export_upf(iunps)
use kinds, only : dp
use radial_grids, only : radial_grid_COPY, allocate_radial_grid, nullify_radial_grid, &
deallocate_radial_grid
use ld1inc
use ld1inc, only : author, nlcc, zval, lpaw, write_coulomb, &
lgipaw_reconstruction, etots, rel, ecutwfc, ecutrho, &
nwfts, nbeta, lmax, which_augfun, elts, octs, llts, &
nnts, rcutusts, rcutts, rcut, rcutus, els, ikk, nwfs, &
lls, nns, ocs, beta, bmat, qq, qvan, qvanl, rcloc, lloc, &
betas, grid, rhos, phits, psipaw, vpsloc, phis, &
rmatch_augfun, etot, etots, jjs, pawsetup, nn, &
core_state, ll, el, nwf, psi, vpot, nconf, zed, &
jjts, vpstot, lltsc, rcuttsc, rcutustsc, eltsc, &
lsave_wfc, wfc_ae_recon, wfc_ps_recon, tm, enlts, &
nstoaets, pseudotype, enls, rhoc
use funct, only: get_dft_name
use iotk_module, only: iotk_newline
!

View File

@ -39,7 +39,7 @@ subroutine ld1_readin
rmatch_augfun, which_augfun, & !paw
rhos, bmat, lsmall, & ! extra for paw2us
lgipaw_reconstruction, lsave_wfc, &
relpert
relpert, noscf
use funct, only : set_dft_from_name
use radial_grids, only: do_mesh, check_mesh
@ -88,6 +88,7 @@ subroutine ld1_readin
rytoev_fact, & ! conversion between Ry and eV
cau_fact, & ! speed of light in a.u.
vdw, & ! if .true. vdW coefficient in TF+vW will be calculated
noscf, & ! if .true. the charge density is not computed
write_coulomb, & ! if .true. write a fake pseudopotential file with the
! Coulomb potential for usage in all-electron calculations
relpert ! compute relativistic perturbative corrections
@ -197,6 +198,7 @@ subroutine ld1_readin
author='anonymous'
vdw = .false.
noscf = .false.
write_coulomb = .false.
lsave_wfc = .false.
lgipaw_reconstruction = .false.
@ -243,6 +245,11 @@ subroutine ld1_readin
if (nld > nwfsx) &
call errore('ld1_readin','too many nld',1)
if ( noscf .and. iswitch /= 1) call errore('ld1_readin',&
'hydrogenic levels available only with iswitch=1',1)
if ( noscf .and. lsd == 1 ) call errore('ld1_readin',&
'hydrogenic levels available only with lsd=0',1)
if (isic == 1 .and. latt == 1) call errore('ld1_readin', &
& 'isic and latter correction not allowed',1)
if (isic == 1 .and. iswitch .ne. 1 ) call errore('ld1_readin', &
@ -632,7 +639,10 @@ end subroutine ld1_readin
subroutine bcast_input()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
use ld1inc
USE ld1inc, ONLY : zed, beta, tr2, iswitch, nlc, rlderiv, eminld, emaxld, &
deld, lsd, rel, lsmall, isic, latt, title, prefix, vdw, &
nld, noscf, relpert
implicit none
#ifdef __PARA
@ -652,6 +662,8 @@ implicit none
call mp_bcast( latt, ionode_id )
call mp_bcast( title, ionode_id )
call mp_bcast( prefix, ionode_id )
call mp_bcast( noscf, ionode_id )
call mp_bcast( relpert, ionode_id )
call mp_bcast( vdw, ionode_id )
#endif
return
@ -700,7 +712,8 @@ end subroutine bcast_inputp
subroutine bcast_test()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
use ld1inc
USE ld1inc, ONLY : nconf, file_pseudo, ecutmin, ecutmax, decut, rm, &
frozen_core, lsdts
implicit none
#ifdef __PARA
@ -719,7 +732,7 @@ end subroutine bcast_test
subroutine bcast_config()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
use ld1inc
USE ld1inc, ONLY : nwf, el, nn, ll, oc, isw, jj
implicit none
#ifdef __PARA
@ -737,7 +750,8 @@ end subroutine bcast_config
subroutine bcast_psconfig()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
use ld1inc
USE ld1inc, ONLY : nwfs, els, nns, lls, ocs, jjs, isws, enls, rcut, &
rcutus
implicit none
#ifdef __PARA
@ -758,7 +772,8 @@ end subroutine bcast_psconfig
subroutine bcast_pstsconfig()
USE io_global, ONLY : ionode_id
USE mp, ONLY : mp_bcast
use ld1inc
USE ld1inc, ONLY : nwftsc, nntsc, lltsc, octsc, jjtsc, iswtsc, rcuttsc,&
rcutustsc
implicit none
#ifdef __PARA
@ -774,5 +789,3 @@ implicit none
return
end subroutine bcast_pstsconfig

View File

@ -164,21 +164,20 @@ module ld1inc
! 1 scalar relativistic calculation
! 2 calculation with the full dirac equation
logical :: &
lsmall ! if true writes the small component on file
lsmall, & ! if true writes the small component on file
relpert, & ! compute relativistic perturbative corrections
frozen_core, & ! if true the all-electron calculation is frozen core
write_coulomb, & ! if true write a fake UPF pseudopotential file named
! X.coul (X=atomic symbol) - for usage in special cases
! when the bare coulomb potential is required
noscf ! if true a hydrogenic atom is solved. The charge
! density is not computed.
character(len=4) :: &
verbosity ! if 'high' writes more information on output
logical :: &
frozen_core ! if true the all-electron calculation is frozen core
logical :: &
write_coulomb ! if true write a fake UPF pseudopotential file named
! X.coul (X=atomic symbol) - for usage in special cases
! when the bare coulomb potential is required
logical :: &
relpert ! compute relativistic perturbative corrections
real(DP) :: &
beta, & ! the mixing parameter
@ -264,8 +263,6 @@ module ld1inc
type(paw_t) :: &
pawsetup ! the PAW dataset
real(DP) :: &
phitcut(ndmx,nwfsx),& !
kcorr(nwfsx,nwfsx),& !
rmatch_augfun, & ! define the matching radius for paw aug.fun.
psipaw(ndmx,nwfsx),& ! the all-electron wavefunctions for any beta
aeccharge(ndmx), & ! true, not smoothened, AE core charge for PAW

View File

@ -18,7 +18,7 @@ subroutine scf(ic)
use ld1inc, only : grid, zed, psi, isic, vpot, vh, vxt, rho, iter, &
lsd, rel, latt, enne, beta, nspin, tr2, eps0, &
nwf, nn, ll, jj, enl, oc, isw, core_state, frozen_core, &
vsic, vsicnew, vhn1, egc, relpert
vsic, vsicnew, vhn1, egc, relpert, noscf
implicit none
integer, intent(in) :: ic
@ -71,6 +71,7 @@ subroutine scf(ic)
! calculate charge density (spherical approximation)
!
rho=0.0_dp
if (noscf) goto 500
do n=1,nwf
do i=1,grid%mesh
rho(i,isw(n))=rho(i,isw(n))+oc(n)*(psi(i,1,n)**2+psi(i,2,n)**2)
@ -104,6 +105,10 @@ subroutine scf(ic)
call vpack(grid%mesh,ndmx,nspin,vnew,vpot,-1)
! write(6,*) iter, eps0
!
500 if (noscf) then
conv=.true.
eps0=0.0_DP
endif
if (conv) then
if (nerr /= 0) call infomsg ('scf','errors in KS equations')
goto 45

View File

@ -17,7 +17,7 @@ subroutine starting_potential &
! electron cannot be smaller than 1 (far from the core)
!
use kinds, only : DP
use ld1inc, only : frozen_core
use ld1inc, only : frozen_core, noscf
implicit none
integer :: nwf, nn(nwf), ll(nwf), ndm, mesh, n, i, nspin
real(DP) :: r(ndm), vpot(ndm,2), v0(ndm), vxt(ndm), enl(nwf), oc(nwf), &
@ -46,8 +46,12 @@ subroutine starting_potential &
t= zz/(1.0_DP+sqrt(x)*(0.02747_dp-x*(0.1486_dp-0.007298_dp*x)) &
+ x*(1.243_dp+x*(0.2302_dp+0.006944_dp*x)))
t = max(1.0_dp,t)
vpot(i,1) = -e2*t/r(i) + vxt(i)
v0(i)= -e2 * zed / r(i)
if (noscf) then
vpot(i,1) = v0(i)+vxt(i)
else
vpot(i,1) = -e2*t/r(i) + vxt(i)
endif
enddo
!
if (nspin.eq.2) then

View File

@ -19,7 +19,7 @@ subroutine write_results
nwf, nn, ll, jj, el, isw, oc, enl, file_wavefunctions, &
dhrsic, dxcsic, eps0, iter, psi, rytoev_fact, lsmall, &
core_state, ekinc, ekinv, ae_fc_energy, cau_fact, &
relpert, evel, edar, eso
relpert, evel, edar, eso, noscf
use funct, only : get_iexch, get_dft_name
implicit none
@ -166,10 +166,11 @@ subroutine write_results
endif
1121 format(4x,2i2,f4.1,1x,a2,i2,7x,f15.4,f15.4,f15.4)
!!!
1100 format(4x,2i2,5x,a2,i2,'(',f5.2,')',f15.4,f15.4,f15.4)
1120 format(4x,2i2,f4.1,1x,a2,i2,'(',f5.2,')',f15.4,f15.4,f15.4)
if (noscf) goto 500
write(stdout,1200) eps0,iter
1200 format(/5x,'eps =',1pe8.1,' iter =',i3)
write(stdout,*)
@ -278,6 +279,9 @@ subroutine write_results
2313 format(5x,'int-Eh=',f14.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
2320 format(5x,'Esictot=',f13.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
endif
500 continue
write(stdout,1310)
1310 format(//5x,'normalization and overlap integrals'/)