In the atomic code, the conversion factor from Ry to eV can

be given in input. It can be used to compare with old papers.


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@4163 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
dalcorso 2007-08-20 12:23:54 +00:00
parent 2e3460bbee
commit 414726156c
5 changed files with 48 additions and 34 deletions

View File

@ -14,6 +14,7 @@ subroutine ld1_readin
use kinds, ONLY : dp
use radial_grids, only: ndmx
use ld1_parameters, only: ncmax1, nwfx, nwfsx
use constants, ONLY : rytoev
USE io_global, ONLY : ionode, ionode_id
USE mp, ONLY : mp_bcast
use ld1inc, only : els, lls, betas, qq, qvan, ikk, nbeta, pseudotype, &
@ -31,7 +32,7 @@ subroutine ld1_readin
file_wfcaegen, file_wfcncgen, file_wfcusgen, &
file_core, file_beta, file_chi, author, &
nld, rlderiv, eminld, emaxld, deld, &
ecutmin, ecutmax, decut
ecutmin, ecutmax, decut, rytoev_fact
use funct, only : set_dft_from_name
use radial_grids, only: do_mesh, check_mesh
@ -76,6 +77,7 @@ subroutine ld1_readin
latt, & ! if <> 0 Latter correction is applied
title, & ! the title of the run
prefix, & ! the prefix for file names
rytoev_fact, & ! conversion between Ry and eV
vdw ! if .true. vdW coefficient in TF+vW will be calculated
namelist /test/ &
@ -148,6 +150,7 @@ subroutine ld1_readin
nld=0
deld=0.03_dp
rytoev_fact=rytoev
rel = 5
lsd = 0
dft = 'LDA'

View File

@ -235,6 +235,13 @@ module ld1inc
aeccharge(ndmx), & ! true, not smoothened, AE core charge for PAW
psccharge(ndmx) ! smoothened core charge for PAW
!
! conversion factor
!
real(DP) :: &
rytoev_fact ! Conversion from Ry and eV. A value
! different from default can be used
! to reproduce results of old papers.
!
! file names
!
character(len=75) :: title ! the title of the run

View File

@ -12,11 +12,11 @@ subroutine write_results
use kinds, only : dp
use io_global, only : stdout, ionode_id, ionode
use mp, only : mp_bcast
use constants, only : rytoev, eps6
use constants, only : eps6
use ld1inc, only : title, rel, zed, lsd, nspin, isic, latt, beta, tr2, &
grid, enzero, etot, ekin, encl, ehrt, evxt, ecxc, &
nwf, nn,ll,jj,el,isw,oc,enl, file_wavefunctions, &
dhrsic, dxcsic, eps0,iter, psi
dhrsic, dxcsic, eps0,iter, psi, rytoev_fact
use funct, only : get_iexch, get_dft_name
implicit none
@ -44,6 +44,7 @@ subroutine write_results
' beta=',f4.2,' tr2=',1pe7.1)
write(stdout,1270) grid%mesh,grid%r(grid%mesh),grid%xmin,grid%dx
1270 format(5x,'mesh =',i4,' r(mesh) =',f10.5,' xmin =',f6.2,' dx =',f8.5)
write(stdout,'(5x "1 Ry = ",f12.8, " eV" )') rytoev_fact
if (rel.lt.2) then
write(stdout,1000)
1000 format(/5x, &
@ -54,7 +55,7 @@ subroutine write_results
do n=1,nwf
if (oc(n)>-eps6) write(stdout,1100) &
nn(n),ll(n),el(n),isw(n),oc(n),enl(n),enl(n)*0.5_dp, &
enl(n)*rytoev
enl(n)*rytoev_fact
enddo
if (oep) then
enl(1:nwf) = enl(1:nwf) + enzero(isw(1:nwf))
@ -63,10 +64,10 @@ subroutine write_results
write(stdout,'(5x,a)') "OEP WARNING: printed eigenvalues were shifted by"
if (nspin==1) write(stdout,'(17x,a,3f15.4)') ( "shift :", &
enzero(is), enzero(is)*0.5_dp, &
enzero(is)*rytoev, is=1,nspin)
enzero(is)*rytoev_fact, is=1,nspin)
if (nspin==2) write(stdout,'(8x,a,i2,3x,a,3f15.4)') ( "spin",is,"shift :", &
enzero(is), enzero(is)*0.5_dp, &
enzero(is)*rytoev, is=1,nspin)
enzero(is)*rytoev_fact, is=1,nspin)
end if
else
write(stdout,1001)
@ -76,7 +77,7 @@ subroutine write_results
do n=1,nwf
if (oc(n)>-eps6) write(stdout,1120) &
nn(n),ll(n),jj(n),el(n),isw(n),oc(n),enl(n),enl(n)*0.5_dp, &
enl(n)*rytoev
enl(n)*rytoev_fact
enddo
write(stdout,'(5x,"Averaged results")')
ok=.true.
@ -86,12 +87,12 @@ subroutine write_results
ene=(enl(n)*2.0_dp*ll(n) &
+ enl(n+1)*(2.0_dp*ll(n)+2.0_dp))/(4.0_dp*ll(n)+2.0_dp)
write(stdout,1100) nn(n),ll(n),el(n), isw(n),oc(n)+oc(n+1), &
ene,ene*0.5_dp, ene*rytoev
ene,ene*0.5_dp, ene*rytoev_fact
ok=.false.
else
if (ll(n).eq.0) &
write(stdout,1100) nn(n),ll(n),el(n),isw(n),oc(n), &
enl(n),enl(n)*0.5_dp,enl(n)*rytoev
enl(n),enl(n)*0.5_dp,enl(n)*rytoev_fact
ok=.true.
endif
endif
@ -103,7 +104,7 @@ subroutine write_results
1200 format(/5x,'eps =',1pe8.1,' iter =',i3)
write(stdout,*)
write(stdout,'(5x,''Etot ='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,'' eV'')') &
etot, etot*0.5_dp, etot*rytoev
etot, etot*0.5_dp, etot*rytoev_fact
if (lsd.eq.1) then
mm=0.d0
do n=1,nwf
@ -115,31 +116,31 @@ subroutine write_results
write(stdout,'(5x,''Total magnetization:'',f8.2,'' Bohr mag. '')') mm
endif
write(stdout,'(/,5x,''Ekin ='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,'' eV'')')&
ekin, ekin*0.5_dp, ekin*rytoev
ekin, ekin*0.5_dp, ekin*rytoev_fact
write(stdout,'(5x,''Encl ='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,'' eV'')')&
encl, encl*0.5_dp, encl*rytoev
encl, encl*0.5_dp, encl*rytoev_fact
write(stdout,'(5x,''Eh ='',f15.6,'' Ry,'',f15.6, '' Ha,'',f15.6,'' eV'')') &
ehrt, ehrt*0.5_dp, ehrt*rytoev
ehrt, ehrt*0.5_dp, ehrt*rytoev_fact
write(stdout,&
'(5x,''Exc ='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,'' eV'')') &
ecxc, ecxc*0.5_dp, ecxc*rytoev
ecxc, ecxc*0.5_dp, ecxc*rytoev_fact
write(stdout,&
'(5x,''Evxt ='',f15.6,'' Ry,'',f15.6,'' Ha,'',f15.6,'' eV'')') &
evxt, evxt*0.5_dp, evxt*rytoev
evxt, evxt*0.5_dp, evxt*rytoev_fact
if (isic.ne.0) then
write(stdout,*)
write(stdout,'(5x,"SIC information:")')
write(stdout,1300) dhrsic, dhrsic*0.5_dp, dhrsic*rytoev
write(stdout,2310) dxcsic, dxcsic*0.5_dp, dxcsic*rytoev
write(stdout,1300) dhrsic, dhrsic*0.5_dp, dhrsic*rytoev_fact
write(stdout,2310) dxcsic, dxcsic*0.5_dp, dxcsic*rytoev_fact
write(stdout,2320) dxcsic+dhrsic,(dxcsic+dhrsic)*0.5_dp, &
(dxcsic+dhrsic)*rytoev
(dxcsic+dhrsic)*rytoev_fact
write(stdout,*)
write(stdout,2311) ecxc-dxcsic-dhrsic, &
& (ecxc-dxcsic-dhrsic)*0.5_dp, (ecxc-dxcsic-dhrsic)*rytoev
& (ecxc-dxcsic-dhrsic)*0.5_dp, (ecxc-dxcsic-dhrsic)*rytoev_fact
write(stdout,2312) ecxc-dhrsic, &
& (ecxc-dhrsic)*0.5_dp, (ecxc-dhrsic)*rytoev
& (ecxc-dhrsic)*0.5_dp, (ecxc-dhrsic)*rytoev_fact
write(stdout,2313) ehrt+dhrsic, &
& (ehrt+dhrsic)*0.5_dp, (ehrt+dhrsic)*rytoev
& (ehrt+dhrsic)*0.5_dp, (ehrt+dhrsic)*rytoev_fact
1300 format(5x,'Esich=',f15.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
2310 format(5x,'Esicxc=',f14.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
2311 format(5x,'tot-Exc=',f13.6,' Ry,',f15.6,' Ha,',f15.6,' eV')

View File

@ -12,12 +12,12 @@ subroutine write_resultsps
use radial_grids, only : ndmx
use io_global, only : stdout, ionode, ionode_id
use mp, only : mp_bcast
use constants, only : rytoev, eps6
use constants, only : eps6
use ld1inc, only : title, rel, zed, zval, lsd, isic, latt, beta, tr2, &
nwfts, nnts, llts, jjts, elts, octs, iswts, enlts, nstoaets, &
grid, enl, eps0, iter, etot, etots, etot0, &
etots0, ekin, encl, ehrt, ecxc, nlcc, ecc, evxt, epseu, &
dhrsic, dxcsic, file_wavefunctionsps, phits
dhrsic, dxcsic, file_wavefunctionsps, phits, rytoev_fact
use funct, only: get_dft_name
implicit none
@ -74,9 +74,9 @@ subroutine write_resultsps
write(stdout,1200) eps0,iter
1200 format(/5x,'eps =',1pe8.1,' iter =',i3)
write(stdout,*)
write(stdout,1211) etot, etot*0.5_dp, etot*rytoev
write(stdout,1211) etot, etot*0.5_dp, etot*rytoev_fact
1211 format (5x,'Etot =',f15.6,' Ry,',f15.6, ' Ha,',f15.6,' eV')
write(stdout,1221) etots, etots*0.5_dp, etots*rytoev
write(stdout,1221) etots, etots*0.5_dp, etots*rytoev_fact
1221 format (5x,'Etotps =',f13.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
if (abs(etot-etot0)> 1.d-9) then
write(stdout,1231) etot-etot0
@ -88,23 +88,23 @@ subroutine write_resultsps
'(5x,''dEtot_ps ='',f15.6,'' Ry,'','' Delta E='', f15.6,'' Ry'' )') &
etots-etots0, etot-etot0-(etots-etots0)
else
if (ionode) write(13,1211) etot, etot*0.5_dp, etot*rytoev
if (ionode) write(13,1221) etots, etots*0.5_dp, etots*rytoev
if (ionode) write(13,1211) etot, etot*0.5_dp, etot*rytoev_fact
if (ionode) write(13,1221) etots, etots*0.5_dp, etots*rytoev_fact
endif
write(stdout,1251) ekin, ekin*0.5_dp, ekin*rytoev
write(stdout,1251) ekin, ekin*0.5_dp, ekin*rytoev_fact
1251 format (/,5x,'Ekin =',f15.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
write(stdout,1261) encl, encl*0.5_dp, encl*rytoev
write(stdout,1261) encl, encl*0.5_dp, encl*rytoev_fact
1261 format (5x,'Encl =',f15.6,' Ry,',f15.6, ' Ha,',f15.6,' eV')
write(stdout,1271) ehrt, ehrt*0.5_dp, ehrt*rytoev
write(stdout,1271) ehrt, ehrt*0.5_dp, ehrt*rytoev_fact
1271 format (5x,'Ehrt =',f15.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
write(stdout,1281) ecxc, ecxc*0.5_dp, ecxc*rytoev
write(stdout,1281) ecxc, ecxc*0.5_dp, ecxc*rytoev_fact
1281 format (5x,'Ecxc =',f15.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
if (nlcc) write(stdout,1282) ecc, ecc*0.5_dp, ecc*rytoev
if (nlcc) write(stdout,1282) ecc, ecc*0.5_dp, ecc*rytoev_fact
1282 format (5x,'(Ecc =',f15.6,' Ry,',f15.6,' Ha,',f15.6,' eV)')
write(stdout,1291) evxt, evxt*0.5_dp, evxt*rytoev
write(stdout,1291) evxt, evxt*0.5_dp, evxt*rytoev_fact
1291 format(5x,'Evxt =',f15.6,' Ry,',f15.6,' Ha,',f15.6,' eV')
write(stdout,1292) epseu, epseu*0.5_dp, epseu*rytoev
write(stdout,1292) epseu, epseu*0.5_dp, epseu*rytoev_fact
1292 format (5x,'Epseu=',f15.6,' Ry,',f15.6, ' Ha,',f15.6,' eV')
if(isic.ne.0) write(stdout,1300) dhrsic+dxcsic, dhrsic, dxcsic
1300 format(5x,'desic:'/5x,0pf12.4,24x,2(0pf12.4))

View File

@ -57,6 +57,9 @@ Needed for pseudo-potential (PP) test. optional for PP generation:
isic= 1 (0) : (no) Self-interaction correction (default: no)
(only for all-electron calculation)
rytoev_fact : (default:see file ../Modules/constants.f90)
factor used to convert Ry into eV.
vdw = .true. or .false. (default: .false.)
If .true., the frequency dependent polarizability and van der
Waals coefficient C6 will be computed in Thomas-Fermi and