vdW-DF: Implementing vdW-DF3-opt1, vdW-DF3-opt2, and vdW-DF-C6 & inlc cleanup

We implemented the new vdW-DF type functionals vdW-DF3-opt1, vdW-DF3-opt2, and
vdW-DF-C6. For purposes of non-local functional implementation and evaluation,
we also grouped similar implementations into ranges for the "inlc" variable. To
this end, we have reserved inlc=1 to inlc=25 for vdW-DF development and we
moved rVV10 to inlc=26. This allows for a cleaner code when parsing through the
various non-local functionals. In addition, we have removed all instances of
"inlc" and "get_inlc" in several source files where they are no longer needed.
This work was performed by T. Thonhauser and is supported by NSF Grant No.
1712425.
This commit is contained in:
T. Thonhauser 2020-05-21 12:49:41 -04:00
parent 7193911aa5
commit f047985b92
18 changed files with 246 additions and 170 deletions

View File

@ -66,7 +66,7 @@ MODULE cp_restart_new
USE cell_base, ONLY : ibrav, alat, tpiba, s_to_r
USE ions_base, ONLY : nsp, nat, na, atm, zv, &
amass, iforce, ityp
USE funct, ONLY : get_dft_name, get_inlc, &
USE funct, ONLY : get_dft_name, &
dft_is_hybrid, get_exx_fraction, get_screening_parameter, &
dft_is_nonlocc, get_nonlocc_name
USE ldaU_cp, ONLY : lda_plus_U, ns, Hubbard_l, &

View File

@ -791,7 +791,7 @@ MODULE input
USE ensemble_dft, ONLY : ensemble_initval,tens
USE wannier_base, ONLY : wannier_init
USE efield_module, ONLY : tefield
USE funct, ONLY : dft_is_nonlocc, get_inlc
USE funct, ONLY : dft_is_nonlocc
USE control_flags, ONLY : llondon, ts_vdw_ => ts_vdw
USE london_module, ONLY : init_london, scal6, lon_rcut
USE tsvdw_module, ONLY : vdw_isolated, vdw_econv_thr
@ -800,7 +800,7 @@ MODULE input
!
REAL(DP) :: alat_ , massa_totale
! ... DIIS
INTEGER :: ia, iss, inlc
INTEGER :: ia, iss
LOGICAL :: ltest
!
! Subroutine Body

View File

@ -44,7 +44,7 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
USE funct, ONLY: dft_is_meta, dft_is_nonlocc, nlc, get_inlc,&
dft_is_hybrid, exx_is_active
USE vdW_DF, ONLY: vdW_DF_stress
use rVV10, ONLY: stress_rVV10
use rVV10, ONLY: rVV10_stress
USE pres_ai_mod, ONLY: abivol, abisur, v_vol, P_ext, volclu, &
Surf_t, surfclu
USE fft_interfaces, ONLY: fwfft, invfft
@ -391,7 +391,6 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
END DO
END DO
denlc(:,:) = 0.0_dp
inlc = get_inlc()
!
!^^ ... TEMPORARY FIX (newlsda) ...
IF ( nspin==2 ) THEN
@ -400,11 +399,12 @@ SUBROUTINE vofrho_x( nfi, rhor, drhor, rhog, drhog, rhos, rhoc, tfirst, &
END IF
!^^.......................
!
if (inlc==1 .or. inlc==2) then
CALL vdW_DF_stress(rhosave(:,1), rhocsave, nspin, denlc )
elseif (inlc == 3) then
CALL stress_rVV10(rhosave(:,1), rhocsave, nspin, denlc )
end if
inlc = get_inlc()
IF ( inlc > 0 .AND. inlc < 26 ) THEN
CALL vdW_DF_stress ( rhosave(:,1), rhocsave, nspin, denlc )
ELSEIF ( inlc == 26 ) then
CALL rVV10_stress ( rhosave(:,1), rhocsave, nspin, denlc )
END IF
!
dxc(:,:) = dxc(:,:) - omega/e2 * MATMUL(denlc,TRANSPOSE(ainv))
END IF

View File

@ -6,32 +6,37 @@
! or http://www.gnu.org/copyleft/gpl.txt .
!
!--------------------------------------------------------------------
subroutine dnonloccorr(rho, drho, xq, dvaux )
! ===================
!--------------------------------------------------------------------
SUBROUTINE dnonloccorr( rho, drho, xq, dvaux )
!------------------------------------------------------------------
!
USE kinds, ONLY : DP
USE kinds, ONLY : DP
USE noncollin_module, ONLY : nspin_mag
USE fft_base, ONLY: dfftp
USE funct, ONLY : dft_is_gradient, dft_is_nonlocc, get_inlc
USE ph_vdW_DF, ONLY : dv_drho_vdwdf
USE ph_rVV10, ONLY : dv_drho_rvv10
USE fft_base, ONLY : dfftp
USE funct, ONLY : dft_is_gradient, dft_is_nonlocc, get_inlc
USE ph_vdW_DF, ONLY : dv_drho_vdwdf
USE ph_rVV10, ONLY : dv_drho_rvv10
!
implicit none
!
real(DP), INTENT(IN) :: rho (dfftp%nnr, nspin_mag), xq(3)
complex(DP), INTENT(IN) :: drho (dfftp%nnr, nspin_mag)
real(DP), INTENT(IN) :: rho (dfftp%nnr, nspin_mag), xq(3)
complex(DP), INTENT(IN) :: drho (dfftp%nnr, nspin_mag)
complex(DP), INTENT(INOUT) :: dvaux (dfftp%nnr, nspin_mag)
complex(DP), ALLOCATABLE :: dvnonloc(:,:)
integer :: inlc
complex(DP), ALLOCATABLE :: dvnonloc(:,:)
integer :: inlc
allocate( dvnonloc(dfftp%nnr, nspin_mag) )
dvnonloc(:,:) = (0.D0,0.D0)
inlc = get_inlc()
IF ( inlc > 0 .AND. inlc < 26 ) THEN
CALL dv_drho_vdwdf(rho, drho, nspin_mag, xq, dvnonloc)
ELSEIF ( inlc == 26) THEN
CALL dv_drho_rvv10(rho, drho, nspin_mag, xq, dvnonloc)
ENDIF
allocate(dvnonloc(dfftp%nnr,nspin_mag))
dvnonloc(:,:)= (0.d0,0.d0)
if (get_inlc()==1 .or. get_inlc()==2) CALL dv_drho_vdwdf(rho, drho, nspin_mag, xq, dvnonloc)
if (get_inlc()==3) CALL dv_drho_rvv10(rho, drho, nspin_mag, xq, dvnonloc)
dvaux = dvaux + dvnonloc
deallocate(dvnonloc)
DEALLOCATE( dvnonloc )
return
end subroutine dnonloccorr
END SUBROUTINE dnonloccorr

View File

@ -469,9 +469,9 @@ end subroutine get_delta_v
integer :: i_grid, index, count=0 !! Indexing variables
if (inlc==1) Z_ab = -0.8491D0
if (inlc==2) Z_ab = -1.887D0
if ( inlc == 1 .OR. inlc == 3 ) Z_ab = -0.8491D0
if ( inlc == 2 .OR. inlc == 4 .OR. inlc == 5 ) Z_ab = -1.887D0
! initialize q0-related arrays ...
q0(:) = q_cut

View File

@ -98,14 +98,15 @@ END SUBROUTINE ggax
SUBROUTINE pbex( rho, grho, iflag, sx, v1x, v2x ) !<GPU:DEVICE>
!---------------------------------------------------------------
!! PBE exchange (without Slater exchange):
!! iflag=1 J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996);
!! iflag=2 "revised' PBE: Y. Zhang et al., PRL 80, 890 (1998);
!! iflag=3 PBEsol: J.P.Perdew et al., PRL 100, 136406 (2008);
!! iflag=4 PBEQ2D: L. Chiodo et al., PRL 108, 126402 (2012);
!! iflag=5 optB88: Klimes et al., J. Phys. Cond. Matter, 22, 022201 (2010);
!! iflag=6 optB86b: Klimes et al., Phys. Rev. B 83, 195131 (2011);
!! iflag=7 ev: Engel and Vosko, PRB 47, 13164 (1991);
!! iflag=8 RPBE: B. Hammer, et al., Phys. Rev. B 59, 7413 (1999).
!! iflag=1 J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996)
!! iflag=2 "revised' PBE: Y. Zhang et al., PRL 80, 890 (1998)
!! iflag=3 PBEsol: J.P.Perdew et al., PRL 100, 136406 (2008)
!! iflag=4 PBEQ2D: L. Chiodo et al., PRL 108, 126402 (2012)
!! iflag=5 optB88: Klimes et al., J. Phys. Cond. Matter, 22, 022201 (2010)
!! iflag=6 optB86b: Klimes et al., Phys. Rev. B 83, 195131 (2011)
!! iflag=7 ev: Engel and Vosko, PRB 47, 13164 (1991)
!! iflag=8 RPBE: B. Hammer, et al., Phys. Rev. B 59, 7413 (1999)
!! iflag=9 W31X: D. Chakraborty, K. Berland, and T. Thonhauser, TBD (2020)
!
USE kinds, ONLY : DP
!
@ -135,19 +136,19 @@ SUBROUTINE pbex( rho, grho, iflag, sx, v1x, v2x ) !<GPU:DEVIC
REAL(DP), PARAMETER :: pi=3.14159265358979323846d0
REAL(DP), PARAMETER :: third=1._DP/3._DP, c1=0.75_DP/pi, &
c2=3.093667726280136_DP, c5=4._DP*third, &
c6=c2*2.51984210_DP, c7=5._DP/6._DP, c8=0.8_DP
c6=c2*2.51984210_DP, c7=0.8_DP
! (3pi^2)^(1/3)*2^(4/3)
! parameters of the functional
REAL(DP) :: k(8), mu(8), ev(6)
! pbe revpbe pbesol pbeq2d optB88 optB86b
! rpbe
DATA k / 0.804_DP, 1.2450_DP, 0.804_DP , 0.804_DP, 0.0_DP, 0.0_DP, &
0.000_DP, 0.8040_DP /, &
REAL(DP) :: k(9), mu(9), ev(6)
! pbe revpbe pbesol pbeq2d optB88 optB86b
! ev rpbe W31x
DATA k / 0.804_DP, 1.2450_DP, 0.804_DP , 0.804_DP, 1.2_DP, 0.0_DP, &
0.000_DP, 0.8040_DP, 1.10_DP /, &
mu / 0.2195149727645171_DP, 0.2195149727645171_DP, 0.12345679012345679_DP, &
0.12345679012345679_DP, 0.22_DP, 0.1234_DP, &
0.000_DP, 0.2195149727645171_DP/, &
0.12345679012345679_DP, 0.22_DP, 0.1234_DP, 0.000_DP, &
0.2195149727645171_DP, 0.12345679012345679_DP /, &
ev / 1.647127_DP, 0.980118_DP, 0.017399_DP, 1.523671_DP, 0.367229_DP, &
0.011282_DP / ! a and b parameters of Engel and Vosko
0.011282_DP / ! a and b parameters of Engel and Vosko
!
SELECT CASE( iflag )
CASE( 4 )
@ -188,13 +189,13 @@ SUBROUTINE pbex( rho, grho, iflag, sx, v1x, v2x ) !<GPU:DEVIC
v2x = exunif * dfx * dsg / agrho
sx = sx_s * rho
!
CASE( 5 )
CASE( 5, 9 )
!
agrho = SQRT(grho)
kf = c2 * rho**third
dsg = 0.5_DP / kf
s1 = agrho * dsg / rho
ab = mu(iflag)*c7 ! mu/ab=1.2
ab = mu(iflag) / k(iflag)
p = s1*c6
c = LOG(p + SQRT(p*p+1)) ! asinh(p)
dfx1 = 1 + ab*s1*c
@ -219,14 +220,14 @@ SUBROUTINE pbex( rho, grho, iflag, sx, v1x, v2x ) !<GPU:DEVIC
dsg = 0.5_DP / kf
s1 = agrho * dsg / rho
p = mu(iflag)*s1*s1
fx = p / ( 1._DP + p )**c8
fx = p / ( 1._DP + p )**c7
!
exunif = - c1 * kf
sx_s = exunif * fx
!
dxunif = exunif * third
!
dfx = 2*mu(iflag)*s1*fx*(1+(1-c8)*p)/(p*(1+p))
dfx = 2*mu(iflag)*s1*fx*(1+(1-c7)*p)/(p*(1+p))
ds = - c5 * s1
!
v1x = sx_s + dxunif * fx + exunif * dfx * ds
@ -1070,6 +1071,7 @@ SUBROUTINE b86b( rho, grho, iflag, sx, v1x, v2x ) !<GPU:DEVIC
!! iflag=1: A. D. Becke, J. Chem. Phys. 85, 7184 (1986) (B86b)
!! iflag=2: J. Klimes, Phys. Rev. B 83, 195131 (2011). (OptB86b)
!! iflag=3: I. Hamada, Phys. Rev. B 89, 121103(R) (B86R)
!! iflag=4: D. Chakraborty, K. Berland, and T. Thonhauser, TBD (2020)
!
!! Ikutaro Hamada - HAMADA.Ikutaro@nims.go.jp
!! National Institute for Materials Science
@ -1098,9 +1100,9 @@ SUBROUTINE b86b( rho, grho, iflag, sx, v1x, v2x ) !<GPU:DEVIC
REAL(DP), PARAMETER :: third=1._DP/3._DP, c1=0.75_DP/pi, &
c2=3.093667726280136_DP, c5=4._DP*third
! parameters of the functional
REAL(DP) :: k(3), mu(3)
DATA k / 0.5757_DP, 1.0000_DP, 0.711357_DP/, &
mu/ 0.2449_DP, 0.1234_DP, 0.1234_DP /
REAL(DP) :: k(4), mu(4)
DATA k / 0.5757_DP, 1.0000_DP, 0.711357_DP, 0.58_DP /, &
mu/ 0.2449_DP, 0.1234_DP, 0.1234_DP, 0.12345679012345679_DP /
!
agrho = SQRT(grho)
kf = c2 * rho**third

View File

@ -117,22 +117,22 @@ MODULE funct
! "x3lyp" = X3LYP
! "vwn-rpa" = VWN LDA using vwn1-rpa parametrization
! "gaupbe"= "sla+pw+gaup+pbc" = Gau-PBE (also "gaup")
! "vdw-df" ="sla+pw+rpb +vdw1" = vdW-DF1
! "vdw-df2" ="sla+pw+rw86+vdw2" = vdW-DF2
! "vdw-df-c09" ="sla+pw+c09x+vdw1" = vdW-DF-C09
! "vdw-df2-c09" ="sla+pw+c09x+vdw2" = vdW-DF2-C09
! "vdw-df-obk8" ="sla+pw+obk8+vdw1" = vdW-DF-obk8 (optB88-vdW)
! "vdw-df-ob86" ="sla+pw+ob86+vdw1" = vdW-DF-ob86 (optB86b-vdW)
! "vdw-df2-b86r" ="sla+pw+b86r+vdw2" = vdW-DF2-B86R (rev-vdw-df2)
! "vdw-df-cx" ="sla+pw+cx13+vdW1" = vdW-DF-cx
! "vdw-df-cx0" ="sla+pw+cx13+vdW1+HF/4" = vdW-DF-cx-0
! "vdw-df2-0" ="sla+pw+rw86+vdw2+HF/4" = vdW-DF2-0
! "vdw-df2-br0" ="sla+pw+b86r+vdW2+HF/4" = vdW-DF2-b86r-0
! "vdw-df-c090" ="sla+pw+c09x+vdw1+HF/4" = vdW-DF-C09-0
! "vdw-df-x" ="sla+pw+????+vdwx" = vdW-DF-x, reserved Thonhauser, not implemented
! "vdw-df-y" ="sla+pw+????+vdwy" = vdW-DF-y, reserved Thonhauser, not implemented
! "vdw-df-z" ="sla+pw+????+vdwz" = vdW-DF-z, reserved Thonhauser, not implemented
! "rvv10" = "sla+pw+rw86+pbc+vv10" = rVV10
! "vdw-df" ="sla+pw+rpb +vdw1" = vdW-DF1
! "vdw-df2" ="sla+pw+rw86+vdw2" = vdW-DF2
! "vdw-df-c09" ="sla+pw+c09x+vdw1" = vdW-DF-C09
! "vdw-df2-c09" ="sla+pw+c09x+vdw2" = vdW-DF2-C09
! "vdw-df-obk8" ="sla+pw+obk8+vdw1" = vdW-DF-obk8 (optB88-vdW)
! "vdw-df-ob86" ="sla+pw+ob86+vdw1" = vdW-DF-ob86 (optB86b-vdW)
! "vdw-df2-b86r" ="sla+pw+b86r+vdw2" = vdW-DF2-B86R (rev-vdw-df2)
! "vdw-df-cx" ="sla+pw+cx13+vdW1" = vdW-DF-cx
! "vdw-df-cx0" ="sla+pw+cx13+vdW1+HF/4" = vdW-DF-cx-0
! "vdw-df2-0" ="sla+pw+rw86+vdw2+HF/4" = vdW-DF2-0
! "vdw-df2-br0" ="sla+pw+b86r+vdW2+HF/4" = vdW-DF2-b86r-0
! "vdw-df-c090" ="sla+pw+c09x+vdw1+HF/4" = vdW-DF-C09-0
! "vdw-df3-opt1" ="sla+pw+w31x+w31c" = vdW-DF3-opt1
! "vdw-df3-opt2" ="sla+pw+w32x+w32c" = vdW-DF3-opt2
! "vdw-df-C6" ="sla+pw+b86r+wc6" = vdW-DF-C6
! "rvv10" = "sla+pw+rw86+pbc+vv10" = rVV10
!
! Any nonconflicting combination of the following keywords is acceptable:
!
@ -209,6 +209,8 @@ MODULE funct
! "b88x" B88 exchange * 0.50 igcx =42
! "beex" BEE exchange igcx =43
! "rpbe" Hammer-Hansen-Norskov igcx =44
! "w31x" vdW-DF3-opt1 exchange igcx =45
! "w32x" vdW-DF3-opt2 exchange igcx =46
!
! Gradient Correction on Correlation:
! "nogc" none igcc =0 (default)
@ -232,17 +234,19 @@ MODULE funct
! "scan" SCAN Meta-GGA imeta=5
! "sca0" SCAN0 Meta-GGA imeta=6
!
! Van der Waals functionals (nonlocal term only)
! van der Waals functionals (nonlocal term only)
! "nonlc" none inlc =0 (default)
!--------------inlc = 1 to inlc = 25 reserved for vdW-DF--------------
! "vdw1" vdW-DF1 inlc =1
! "vdw2" vdW-DF2 inlc =2
! "vv10" rVV10 inlc =3
! "vdwx" vdW-DF-x inlc =4, reserved Thonhauser, not implemented
! "vdwy" vdW-DF-y inlc =5, reserved Thonhauser, not implemented
! "vdwz" vdW-DF-z inlc =6, reserved Thonhauser, not implemented
! "w31c" vdW-DF3-opt1 inlc =3
! "w32c" vdW-DF3-opt2 inlc =4
! "wc6" vdW-DF-C6 inlc =5
!---------------------------------------------------------------------
! "vv10" rVV10 inlc =26
!
! Meta-GGA with Van der Waals
! "rvv10-scan" rVV10 (with b=15.7) and scan inlc=3 (PRX 6, 041005 (2016))
! Meta-GGA with van der Waals
! "rvv10-scan" rVV10 (with b=15.7) and scan inlc=26 (PRX 6, 041005 (2016))
!
! Note: as a rule, all keywords should be unique, and should be different
! from the short name, but there are a few exceptions.
@ -263,6 +267,8 @@ MODULE funct
! b86b A.D.Becke, J.Chem.Phys. 85, 7184 (1986)
! ob86 Klimes, Bowler, Michaelides, PRB 83, 195131 (2011)
! b86r I. Hamada, Phys. Rev. B 89, 121103(R) (2014)
! w31x D. Chakraborty, K. Berland, and T. Thonhauser, TBD (2020)
! w32x D. Chakraborty, K. Berland, and T. Thonhauser, TBD (2020)
! pbe J.P.Perdew, K.Burke, M.Ernzerhof, PRL 77, 3865 (1996)
! pw91 J.P.Perdew and Y. Wang, PRB 46, 6671 (1992)
! blyp C.Lee, W.Yang, R.G.Parr, PRB 37, 785 (1988)
@ -291,6 +297,9 @@ MODULE funct
! J. Chem. Phys. 148, 194115 (2018)
! vdW-DF-obk8 Klimes et al, J. Phys. Cond. Matter, 22, 022201 (2010)
! vdW-DF-ob86 Klimes et al, Phys. Rev. B, 83, 195131 (2011)
! vdW-DF3-opt1 D. Chakraborty, K. Berland, and T. Thonhauser, TBD (2020)
! vdW-DF3-opt2 D. Chakraborty, K. Berland, and T. Thonhauser, TBD (2020)
! vdW-DF-C6 K. Berland, D. Chakraborty, and T. Thonhauser, PRB 99, 195418 (2019)
! c09x V. R. Cooper, Phys. Rev. B 81, 161104(R) (2010)
! tpss J.Tao, J.P.Perdew, V.N.Staroverov, G.E. Scuseria,
! PRL 91, 146401 (2003)
@ -363,7 +372,7 @@ MODULE funct
INTEGER :: beefvdw = 0
#endif
!
INTEGER, PARAMETER :: nxc=8, ncc=10, ngcx=44, ngcc=13, nmeta=6, ncnl=6
INTEGER, PARAMETER :: nxc=8, ncc=10, ngcx=46, ngcc=13, nmeta=6, ncnl=26
CHARACTER(LEN=4) :: exc, corr, gradx, gradc, meta, nonlocc
DIMENSION :: exc(0:nxc), corr(0:ncc), gradx(0:ngcx), gradc(0:ngcc), &
meta(0:nmeta), nonlocc(0:ncnl)
@ -378,14 +387,14 @@ MODULE funct
'OBK8', 'OB86', 'EVX', 'B86R', 'CX13', 'X3LP', &
'CX0', 'R860', 'CX0P', 'AHCX', 'AHF2', &
'AHPB', 'AHPS', 'CX14', 'CX15', 'BR0', 'CX16', 'C090', &
'B86X', 'B88X', 'BEEX', 'RPBX'/
'B86X', 'B88X', 'BEEX', 'RPBX', 'W31X', 'W32X' /
!
DATA gradc / 'NOGC', 'P86', 'GGC', 'BLYP', 'PBC', 'HCTH', 'NONE',&
'B3LP', 'PSC', 'PBE', 'xxxx', 'xxxx', 'Q2DC', 'BEEC' /
!
DATA meta / 'NONE', 'TPSS', 'M06L', 'TB09', 'META', 'SCAN', 'SCA0' /
!
DATA nonlocc/ 'NONE', 'VDW1', 'VDW2', 'VV10', 'VDWX', 'VDWY', 'VDWZ' /
DATA nonlocc/ 'NONE', 'VDW1', 'VDW2', 'W31C', 'W32C', 'WC6', 20*'NONE', 'VV10' /
!
#if defined(__LIBXC)
INTEGER :: libxc_major=0, libxc_minor=0, libxc_micro=0
@ -575,6 +584,15 @@ CONTAINS
! Special case vdW-DF2
CASE( 'VDW-DF2' )
dft_defined = set_dft_values(1,4,13,0,2,0)
! Special case vdW-DF3-opt1
CASE( 'VDW-DF3-OPT1' )
dft_defined = set_dft_values(1,4,45,0,3,0)
! Special case vdW-DF3-opt2
CASE( 'VDW-DF3-OPT2' )
dft_defined = set_dft_values(1,4,46,0,4,0)
! Special case vdW-DF-C6
CASE( 'VDW-DF-C6' )
dft_defined = set_dft_values(1,4,26,0,5,0)
! Special case vdW-DF with C09 exchange
CASE( 'VDW-DF-C09' )
dft_defined = set_dft_values(1,4,16,0,1,0)
@ -610,10 +628,10 @@ CONTAINS
dft_defined = set_dft_values(6,4,40,0,1,0)
! Special case rVV10
CASE( 'RVV10' )
dft_defined = set_dft_values(1,4,13,4,3,0)
dft_defined = set_dft_values(1,4,13,4,26,0)
! Special case rVV10+scan
CASE( 'RVV10-SCAN' )
dft_defined = set_dft_values(0,0,0,0,3,5)
dft_defined = set_dft_values(0,0,0,0,26,5)
! special case : B3LYP hybrid
CASE( 'B3LYP' )
dft_defined = set_dft_values(7,12,9,7,0,0)
@ -1575,6 +1593,12 @@ CONTAINS
shortname = 'VDW-DF2-BR0'
ENDIF
ELSEIF (inlc==3) THEN
shortname = 'VDW-DF3-OPT1'
ELSEIF (inlc==4) THEN
shortname = 'VDW-DF3-OPT2'
ELSEIF (inlc==5) THEN
shortname = 'VDW-DF-C6'
ELSEIF (inlc==26) THEN
shortname = 'RVV10'
ENDIF
!
@ -1659,7 +1683,7 @@ SUBROUTINE nlc (rho_valence, rho_core, nspin, enl, vnl, v)
REAL(DP), INTENT(INOUT) :: v(:,:)
REAL(DP), INTENT(INOUT) :: enl, vnl
!
IF ( inlc == 1 .OR. inlc == 2) THEN
IF ( inlc > 0 .AND. inlc < 26 ) THEN
!
inlc_ = inlc
IF ( nspin == 1 ) THEN
@ -1670,7 +1694,7 @@ SUBROUTINE nlc (rho_valence, rho_core, nspin, enl, vnl, v)
CALL errore ('nlc', 'vdW-DF not available for noncollinear spin case',1)
END If
!
ELSE IF ( inlc == 3 ) THEN
ELSE IF ( inlc == 26 ) THEN
!
IF ( imeta == 0 ) THEN
CALL xc_rVV10 (rho_valence(:,1), rho_core, nspin, enl, vnl, v)

View File

@ -656,6 +656,14 @@ SUBROUTINE gcxc( length, rho_in, grho_in, sx_out, sc_out, v1x_out, &
!
CALL pbex( rho, grho, 8, sx, v1x, v2x )
!
CASE( 45 ) ! 'W31X'
!
CALL pbex( rho, grho, 9, sx, v1x, v2x )
!
CASE( 46 ) ! 'W32X'
!
CALL b86b( rho, grho, 4, sx, v1x, v2x )
!
CASE DEFAULT
!
sx = 0.0_DP
@ -849,10 +857,10 @@ SUBROUTINE gcx_spin( length, rho_in, grho2_in, sx_tot, v1x_out, v2x_out )
sx_tot(ir) = 0.5_DP * ( sx(1)*rnull(1) + sx(2)*rnull(2) )
v2x = 2.0_DP * v2x
!
CASE( 3, 4, 8, 10, 12, 20, 23, 24, 25, 44 )
! igcx=3: PBE, igcx=4: revised PBE, igcx=8: PBE0, igcx=10: PBEsol
! igcx=12: HSE, igcx=20: gau-pbe, igcx=23: obk8, igcx=24: ob86, igcx=25: ev93
! igcx=44: RPBE
CASE( 3, 4, 8, 10, 12, 20, 23, 24, 25, 44, 45 )
! igcx=3: PBE, igcx=4: revised PBE, igcx=8: PBE0, igcx=10: PBEsol
! igcx=12: HSE, igcx=20: gau-pbe, igcx=23: obk8, igcx=24: ob86,
! igcx=25: ev93, igcx=44: RPBE, igcx=45: W31X
!
iflag = 1
IF ( igcx== 4 ) iflag = 2
@ -860,7 +868,8 @@ SUBROUTINE gcx_spin( length, rho_in, grho2_in, sx_tot, v1x_out, v2x_out )
IF ( igcx==23 ) iflag = 5
IF ( igcx==24 ) iflag = 6
IF ( igcx==25 ) iflag = 7
IF ( igcx==43 ) iflag = 8
IF ( igcx==44 ) iflag = 8
IF ( igcx==45 ) iflag = 9
!
rho = 2.0_DP * rho
grho2 = 4.0_DP * grho2
@ -969,13 +978,15 @@ SUBROUTINE gcx_spin( length, rho_in, grho2_in, sx_tot, v1x_out, v2x_out )
sx_tot(ir) = 0.5_DP * ( sx(1)*rnull(1) + sx(2)*rnull(2) )
v2x = 2.0_DP * v2x
!
CASE( 26 ) ! 'B86R for rev-vdW-DF2'
CASE( 26, 46 ) ! 'B86R for rev-vdW-DF2'
!
rho = 2.0_DP * rho
grho2 = 4.0_DP * grho2
!
CALL b86b( rho(1), grho2(1), 3, sx(1), v1x(1), v2x(1) )
CALL b86b( rho(2), grho2(2), 3, sx(2), v1x(2), v2x(2) )
IF ( igcx==26 ) iflag = 3 ! B86R for rev-vdW-DF2
IF ( igcx==46 ) iflag = 4 ! W32X for vdW-DF3-opt2
CALL b86b( rho(1), grho2(1), iflag, sx(1), v1x(1), v2x(1) )
CALL b86b( rho(2), grho2(2), iflag, sx(2), v1x(2), v2x(2) )
!
sx_tot(ir) = 0.5_DP * ( sx(1)*rnull(1) + sx(2)*rnull(2) )
v2x = 2.0_DP * v2x

View File

@ -49,7 +49,7 @@ MODULE rVV10
public :: xc_rVV10, &
interpolate_kernel, &
initialize_spline_interpolation, &
stress_rVV10, b_value, &
rVV10_stress, b_value, &
q_mesh, Nr_points, r_max, q_min, q_cut, Nqs
CONTAINS
@ -241,10 +241,10 @@ CONTAINS
!! #################################################################################################
!! | |
!! | STRESS_rVV10 |
!! | rVV10_STRESS |
!! |_________________|
SUBROUTINE stress_rVV10(rho_valence, rho_core, nspin, sigma)
SUBROUTINE rVV10_stress (rho_valence, rho_core, nspin, sigma)
USE fft_base, ONLY : dfftp
use gvect, ONLY : ngm, g
@ -274,8 +274,7 @@ CONTAINS
!! Tests
!! --------------------------------------------------------------------------------------------------------
!call errore('stress_rVV10','vdW functional not implemented for spin polarized runs', size(rho_valence,2)-1)
if (nspin>2) call errore('xc_vdW_DF','vdW functional not implemented for nspin > 2', nspin)
if (nspin>2) call errore('rV10_stress',' rVV10 stress not implemented for nspin > 2', nspin)
sigma(:,:) = 0.0_DP
sigma_grad(:,:) = 0.0_DP
@ -316,10 +315,10 @@ CONTAINS
!! ---------------------------------------------------------------------------------------
!! Stress
!! ---------------------------------------------------------------------------------------
CALL stress_rVV10_gradient(total_rho, gradient_rho, q0, dq0_drho, &
CALL rVV10_stress_gradient(total_rho, gradient_rho, q0, dq0_drho, &
dq0_dgradrho, thetas, sigma_grad)
CALL stress_rVV10_kernel(total_rho, q0, thetas, sigma_ker)
CALL rVV10_stress_kernel(total_rho, q0, thetas, sigma_ker)
sigma = - (sigma_grad + sigma_ker)
@ -331,13 +330,13 @@ CONTAINS
deallocate( gradient_rho, total_rho, q0, dq0_drho, dq0_dgradrho, thetas )
END SUBROUTINE stress_rVV10
END SUBROUTINE rVV10_stress
!! ###############################################################################################################
!! | |
!! | stress_rVV10_gradient |
!! | rVV10_stress_gradient |
SUBROUTINE stress_rVV10_gradient (total_rho, gradient_rho, q0, dq0_drho, &
SUBROUTINE rVV10_stress_gradient (total_rho, gradient_rho, q0, dq0_drho, &
dq0_dgradrho, thetas, sigma)
!!-----------------------------------------------------------------------------------
@ -485,16 +484,16 @@ CONTAINS
deallocate( d2y_dx2, u_vdW )
END SUBROUTINE stress_rVV10_gradient
END SUBROUTINE rVV10_stress_gradient
!! ###############################################################################################################
!! | |
!! | stress_rVV10_kernel |
!! | rVV10_stress_kernel |
!! | |
SUBROUTINE stress_rVV10_kernel (total_rho, q0, thetas, sigma)
SUBROUTINE rVV10_stress_kernel (total_rho, q0, thetas, sigma)
!! Modules to include
!! ----------------------------------------------------------------------------------
@ -562,7 +561,7 @@ CONTAINS
deallocate( dkernel_of_dk )
END SUBROUTINE stress_rVV10_kernel
END SUBROUTINE rVV10_stress_kernel
!! ###############################################################################################################

View File

@ -53,7 +53,7 @@ MODULE vdW_DF
USE kinds, ONLY : dp
USE constants, ONLY : pi, e2
USE constants, ONLY : pi, fpi, e2
USE mp, ONLY : mp_sum, mp_barrier, mp_get, mp_size, mp_rank, mp_bcast
USE mp_images, ONLY : intra_image_comm
USE mp_bands, ONLY : intra_bgrp_comm
@ -202,11 +202,15 @@ CONTAINS
FUNCTION Fs(s)
IMPLICIT NONE
REAL(DP) :: s, Fs, Z_ab=0.0D0
REAL(DP) :: s, Fs, Z_ab = 0.0D0
IF (inlc == 1) Z_ab = -0.8491D0
IF (inlc == 2) Z_ab = -1.887D0
Fs = 1.0D0 - Z_ab * s**2 / 9.0D0
IF ( inlc == 1 .OR. inlc == 3 ) THEN
Z_ab = -0.8491D0
ELSE IF ( inlc == 2 .OR. inlc == 4 .OR. inlc == 5 ) THEN
Z_ab = -1.887D0
END IF
Fs = 1.0D0 - Z_ab * s * s / 9.0D0
END FUNCTION Fs
@ -216,11 +220,16 @@ CONTAINS
FUNCTION dFs_ds(s)
IMPLICIT NONE
REAL(DP) :: s, dFs_ds, Z_ab=0.0D0
REAL(DP) :: s, dFs_ds, Z_ab = 0.0D0
REAL(DP), PARAMETER :: prefac = -2.0D0/9.0D0
IF (inlc == 1) Z_ab = -0.8491D0
IF (inlc == 2) Z_ab = -1.887D0
dFs_ds = -2.0D0 * s * Z_ab / 9.0D0
IF ( inlc == 1 .OR. inlc == 3 ) THEN
Z_ab = -0.8491D0
ELSE IF ( inlc == 2 .OR. inlc == 4 .OR. inlc == 5 ) THEN
Z_ab = -1.887D0
END IF
dFs_ds = prefac * s * Z_ab
END FUNCTION dFs_ds
@ -230,9 +239,10 @@ CONTAINS
FUNCTION kF(rho)
IMPLICIT NONE
REAL(DP) :: rho, kF
REAL(DP) :: rho, kF
REAL(DP), PARAMETER :: ex = 1.0D0/3.0D0
kF = ( 3.0D0 * pi**2 * rho )**(1.0D0/3.0D0)
kF = ( 3.0D0 * pi * pi * rho )**ex
END FUNCTION kF
@ -242,9 +252,10 @@ CONTAINS
FUNCTION dkF_drho(rho)
IMPLICIT NONE
REAL(DP) :: rho, dkF_drho
REAL(DP) :: rho, dkF_drho
REAL(DP), PARAMETER :: prefac = 1.0D0/3.0D0
dkF_drho = (1.0D0/3.0D0) * kF(rho) / rho
dkF_drho = prefac * kF(rho) / rho
END FUNCTION dkF_drho
@ -268,7 +279,7 @@ CONTAINS
IMPLICIT NONE
REAL(DP) :: rho, ds_dgradrho
ds_dgradrho = 1.0D0 / (2.0D0 * kF(rho) * rho)
ds_dgradrho = 0.5D0 / (kF(rho) * rho)
END FUNCTION ds_dgradrho
@ -290,10 +301,36 @@ CONTAINS
FUNCTION h_function(y)
IMPLICIT NONE
REAL(DP) :: y, h_function
REAL(DP), PARAMETER :: gamma = 4.0D0*pi/9.0D0
REAL(DP) :: y, y2, y4, h_function
REAL(DP), PARAMETER :: g1 = fpi/9.0D0 ! vdW-DF1/2
REAL(DP), PARAMETER :: a3 = 0.94950D0, g3 = 1.12D0, g32 = g3*g3 ! vdW-DF3-opt1
REAL(DP), PARAMETER :: a4 = 0.28248D0, g4 = 1.29D0, g42 = g4*g4 ! vdW-DF3-opt2
REAL(DP), PARAMETER :: a5 = 2.01059D0, b5 = 8.17471D0, g5 = 1.84981D0, & ! vdW-DF-C6
AA = ( b5 + a5*(a5/2.0D0-g5) ) / ( 1.0D0+g5-a5 ) !
h_function = 1.0D0 - EXP( -gamma * y**2 )
y2 = y*y
IF ( inlc == 1 .OR. inlc == 2 ) THEN
h_function = 1.0D0 - EXP( -g1*y2 )
ELSE IF ( inlc == 3 ) THEN
y4 = y2*y2
h_function = 1.0D0 - 1.0D0 / ( 1.0D0 + g3*y2 + g32*y4 + a3*y4*y4 )
ELSE IF ( inlc == 4 ) THEN
y4 = y2*y2
h_function = 1.0D0 - 1.0D0 / ( 1.0D0 + g4*y2 + g42*y4 + a4*y4*y4 )
ELSE IF ( inlc == 5 ) THEN
y4 = y2*y2
h_function = 1.0D0 - ( 1.0D0 + ( (a5-g5)*y2 + AA*y4 ) / ( 1.0D0+AA*y2 ) ) * EXP( -a5*y2 )
END IF
END FUNCTION
@ -371,6 +408,7 @@ CONTAINS
! Write out the vdW-DF information and initialize the calculation.
IF ( first_iteration ) THEN
IF ( inlc > 5 ) CALL errore( 'xc_vdW_DF', 'inlc not implemented', 1 )
CALL generate_kernel
IF ( ionode ) CALL vdW_info
first_iteration = .FALSE.
@ -550,6 +588,7 @@ CONTAINS
! Write out the vdW-DF information and initialize the calculation.
IF ( first_iteration ) THEN
IF ( inlc > 5 ) CALL errore( 'xc_vdW_DF_spin', 'inlc not implemented', 1 )
CALL generate_kernel
IF ( ionode ) CALL vdW_info
first_iteration = .FALSE.
@ -1665,16 +1704,18 @@ CONTAINS
! --------------------------------------------------------------------
! Tests
IF ( inlc > 5 ) CALL errore( 'xc_vdW_DF', 'inlc not implemented', 1 )
#if defined (__SPIN_BALANCED)
IF ( nspin==2 ) THEN
WRITE(stdout,'(/,/ " Performing spin-balanced Ecnl stress calculation!")')
ELSE IF ( nspin > 2 ) THEN
CALL errore ('stres_vdW_DF', 'noncollinear vdW stress not implemented', 1)
CALL errore ('vdW_DF_stress', 'noncollinear vdW stress not implemented', 1)
END IF
#else
IF ( nspin>=2 ) THEN
CALL errore ('vdW_DF_stress', 'vdW stress not implemented for nspin > 1', 1)
CALL errore ('vdW_DF_stress', 'vdW stress not implemented for nspin > 1', 1)
END IF
#endif
@ -1848,11 +1889,11 @@ CONTAINS
prefactor = u_vdW(i_grid,q_i) * dP_dq0 * dq0_dgradrho(i_grid) / grad2
DO l = 1, 3
DO m = 1, l
DO m = 1, l
sigma (l, m) = sigma (l, m) - e2 * prefactor * &
(grad_rho(l,i_grid) * grad_rho(m,i_grid))
END DO
sigma (l, m) = sigma (l, m) - e2 * prefactor * &
(grad_rho(l,i_grid) * grad_rho(m,i_grid))
END DO
END DO
END DO
@ -1926,16 +1967,16 @@ CONTAINS
END IF
DO q2_i = 1, Nqs
DO q1_i = 1, Nqs
DO l = 1, 3
DO m = 1, l
DO q1_i = 1, Nqs
DO l = 1, 3
DO m = 1, l
sigma (l, m) = sigma (l, m) - G_multiplier * 0.5 * e2 * thetas(dfftp%nl(g_i),q1_i) * &
dkernel_of_dk(q1_i,q2_i)*conjg(thetas(dfftp%nl(g_i),q2_i))* &
(g (l, g_i) * g (m, g_i) * tpiba2) / g_kernel
END DO
END DO
sigma (l, m) = sigma (l, m) - G_multiplier * 0.5 * e2 * thetas(dfftp%nl(g_i),q1_i) * &
dkernel_of_dk(q1_i,q2_i)*conjg(thetas(dfftp%nl(g_i),q2_i))* &
(g (l, g_i) * g (m, g_i) * tpiba2) / g_kernel
END DO
END DO
END DO
END DO
IF ( g_i < gstart ) sigma(:,:) = sigma(:,:) / G_multiplier

View File

@ -37,8 +37,8 @@ CONTAINS
IMPLICIT NONE
REAL(DP) :: s, Fs, Z_ab=0.0D0
IF (inlc == 1) Z_ab = -0.8491D0
IF (inlc == 2) Z_ab = -1.887D0
IF ( inlc == 1 .OR. inlc == 3 ) Z_ab = -0.8491D0
IF ( inlc == 2 .OR. inlc == 4 .OR. inlc == 5 ) Z_ab = -1.887D0
Fs = 1.0D0 - Z_ab * s**2 / 9.0D0
END FUNCTION Fs
@ -139,7 +139,7 @@ CONTAINS
! --------------------------------------------------------------------
! Check that the requested non-local functional is implemented.
if ( inlc /= 1 .AND. inlc /= 2) call errore('xc_vdW_DF','E^nl_c not implemented',1)
if ( inlc > 5 ) call errore('xc_vdW_DF','E^nl_c not implemented',1)
! --------------------------------------------------------------------
@ -275,7 +275,7 @@ CONTAINS
! --------------------------------------------------------------------
! Check that the requested non-local functional is implemented.
if ( inlc /= 1 .AND. inlc /= 2) call errore('xc_vdW_DF','E^nl_c not implemented',1)
if ( inlc > 5 ) call errore('xc_vdW_DF','E^nl_c not implemented',1)
! --------------------------------------------------------------------

View File

@ -15,7 +15,7 @@ SUBROUTINE iosys()
!
USE kinds, ONLY : DP
USE funct, ONLY : dft_is_hybrid, dft_has_finite_size_correction, &
set_finite_size_volume, get_inlc, get_dft_short
set_finite_size_volume, get_dft_short
USE funct, ONLY : set_exx_fraction, set_screening_parameter
USE control_flags, ONLY : adapt_thr, tr2_init, tr2_multi
USE constants, ONLY : autoev, eV_to_kelvin, pi, rytoev, &
@ -339,7 +339,7 @@ SUBROUTINE iosys()
CHARACTER(LEN=256), EXTERNAL :: trimcheck
CHARACTER(LEN=256):: dft_
!
INTEGER :: ia, nt, inlc, tempunit, i, j
INTEGER :: ia, nt, tempunit, i, j
LOGICAL :: exst, parallelfs, domag
REAL(DP) :: at_dum(3,3), theta, phi, ecutwfc_pp, ecutrho_pp, V
CHARACTER(len=256) :: tempfile

View File

@ -33,7 +33,6 @@ SUBROUTINE punch( what )
USE scf, ONLY : rho
USE lsda_mod, ONLY : nspin
USE ions_base, ONLY : nsp
USE funct, ONLY : get_inlc
USE pw_restart_new, ONLY : pw_write_schema, pw_write_binaries
USE qexsd_module, ONLY : qexsd_reset_steps
USE io_rho_xml, ONLY : write_scf
@ -50,7 +49,7 @@ SUBROUTINE punch( what )
!
LOGICAL :: exst, only_init, wf_collect
CHARACTER(LEN=320) :: cp_source, cp_dest
INTEGER :: cp_status, nt, inlc
INTEGER :: cp_status, nt
!
!
IF (io_level < -1 ) RETURN

View File

@ -67,7 +67,7 @@
USE constants, ONLY: e2,bohr_radius_angs
USE ions_base, ONLY: iob_tau=>tau
USE cell_base, ONLY: cb_at => at, cb_alat => alat, cb_iforceh => iforceh
USE funct, ONLY: get_dft_is_hybrid => dft_is_hybrid, get_inlc, &
USE funct, ONLY: get_dft_is_hybrid => dft_is_hybrid, &
get_dft_is_nonlocc => dft_is_nonlocc, get_nonlocc_name, get_dft_short
USE uspp_param, ONLY: upf
USE control_flags, ONLY: cf_nstep => nstep
@ -85,7 +85,7 @@
CHARACTER(256) :: tagname
REAL(DP),ALLOCATABLE :: tau(:,:)
REAL(DP) :: alat, a1(3), a2(3), a3(3), gamma_xk(3,1), gamma_wk(1)
INTEGER :: inlc,nt
INTEGER :: nt
LOGICAL :: lsda,dft_is_hybrid, dft_is_nonlocc, is_hubbard(ntypx)=.FALSE.,&
is_hubbard_back(ntypx) = .FALSE., ibrav_lattice
INTEGER :: Hubbard_l=0,hublmax=0

View File

@ -107,7 +107,7 @@ MODULE pw_restart_new
USE lsda_mod, ONLY : nspin, isk, lsda, starting_magnetization, magtot, absmag
USE noncollin_module, ONLY : angle1, angle2, i_cons, mcons, bfield, magtot_nc, &
lambda
USE funct, ONLY : get_dft_short, get_inlc, get_nonlocc_name, dft_is_nonlocc
USE funct, ONLY : get_dft_short, get_nonlocc_name, dft_is_nonlocc
USE scf, ONLY : rho
USE force_mod, ONLY : lforce, sumfor, force, sigma, lstres
USE extfield, ONLY : tefield, dipfield, edir, etotefield, &
@ -149,7 +149,7 @@ MODULE pw_restart_new
CHARACTER(LEN=8) :: smearing_loc
CHARACTER(LEN=8), EXTERNAL :: schema_smearing
INTEGER :: i, ig, ngg, ipol
INTEGER :: npwx_g, ispin, inlc
INTEGER :: npwx_g, ispin
INTEGER, ALLOCATABLE :: ngk_g(:)
INTEGER :: iclass, isym, ielem
CHARACTER(LEN=15) :: symop_2_class(48)
@ -450,7 +450,6 @@ MODULE pw_restart_new
starting_ns = starting_ns_eigenvalue, Hub_ns = rho%ns, Hub_ns_nc = rho%ns_nc)
END IF
dft_name = get_dft_short()
inlc = get_inlc()
!
CALL qexsd_init_dft (output_obj%dft, dft_name, hybrid_obj, vdw_obj, dftU_obj)
IF (ASSOCIATED (hybrid_obj)) THEN

View File

@ -134,7 +134,7 @@ SUBROUTINE post_xml_init ( )
USE paw_init, ONLY : paw_init_onecenter, allocate_paw_internals
USE paw_onecenter, ONLY : paw_potential
USE dfunct, ONLY : newd
USE funct, ONLY : get_inlc, get_dft_name
USE funct, ONLY : get_dft_name
USE ldaU, ONLY : lda_plus_u, eth, init_lda_plus_u, U_projection, &
lda_plus_u_kind
USE esm, ONLY : do_comp_esm, esm_init
@ -163,7 +163,6 @@ SUBROUTINE post_xml_init ( )
!
IMPLICIT NONE
!
INTEGER :: inlc
REAL(DP) :: ehart, etxc, vtxc, etotefield, charge
CHARACTER(LEN=20) :: dft_name
!

View File

@ -7,37 +7,34 @@
!
!
!----------------------------------------------------------------------------
subroutine stres_nonloc_dft( rho, rho_core, nspin, sigma_nonloc_dft )
SUBROUTINE stres_nonloc_dft( rho, rho_core, nspin, sigma_nonloc_dft )
!----------------------------------------------------------------------------
!
USE kinds, ONLY : DP
use funct, ONLY : get_igcc, get_inlc
USE funct, ONLY : get_igcc, get_inlc
USE mp, ONLY : mp_sum
USE fft_base, ONLY : dfftp
USE vdW_DF, ONLY : vdW_DF_stress
USE rVV10, ONLY : stress_rVV10
USE rVV10, ONLY : rVV10_stress
USE io_global, ONLY : stdout
!
IMPLICIT NONE
!
integer, intent(in) ::nspin
integer, intent(in) :: nspin
real(DP), intent(in) :: rho (dfftp%nnr), rho_core (dfftp%nnr)
real(DP), intent(inout) :: sigma_nonloc_dft (3, 3)
integer :: l, m, inlc
sigma_nonloc_dft(:,:) = 0.d0
sigma_nonloc_dft(:,:) = 0.D0
inlc = get_inlc()
if ( inlc==1 .or. inlc==2 ) then
CALL vdW_DF_stress(rho, rho_core, nspin, sigma_nonloc_dft)
elseif ( inlc == 3 ) then
CALL stress_rVV10(rho, rho_core, nspin, sigma_nonloc_dft)
end if
return
end subroutine stres_nonloc_dft
IF ( inlc > 0 .AND. inlc < 26 ) THEN
CALL vdW_DF_stress (rho, rho_core, nspin, sigma_nonloc_dft)
ELSEIF ( inlc == 26 ) THEN
CALL rVV10_stress (rho, rho_core, nspin, sigma_nonloc_dft)
END IF
END SUBROUTINE stres_nonloc_dft

View File

@ -120,7 +120,7 @@ subroutine write_rrkj (iunps)
integer :: nb, mb, & ! counters on beta functions
ios, & ! I/O control
ir ! counter on mesh points
integer :: iexch, icorr, igcx, igcc, inlc
integer :: iexch, icorr, igcx, igcc
logical :: nonlocc
!
!
@ -140,7 +140,7 @@ subroutine write_rrkj (iunps)
icorr = get_icorr()
igcx = get_igcx()
igcc = get_igcc()
inlc = 0
write( iunps, '(4i5)',err=100, iostat=ios ) iexch, icorr, igcx, igcc
write( iunps, '(2e17.11,i5)') zval, etots, lmax