XClib - threshold adjustments

This commit is contained in:
fabrizio22 2020-06-04 11:58:19 +02:00
parent 6a80871719
commit bf643a39c2
3 changed files with 29 additions and 11 deletions

View File

@ -303,7 +303,8 @@ SUBROUTINE dgcxc_unpol( length, r_in, s2_in, vrrx, vsrx, vssx, vrrc, vsrc, vssc
!! potentials.
!
USE kinds, ONLY: DP
USE xc_interfaces, ONLY: gcxc
USE funct, ONLY: is_libxc
USE xc_interfaces, ONLY: gcxc, get_gga_threshold
!
IMPLICIT NONE
!
@ -321,6 +322,8 @@ SUBROUTINE dgcxc_unpol( length, r_in, s2_in, vrrx, vsrx, vssx, vrrc, vsrc, vssc
REAL(DP), ALLOCATABLE :: sx(:), sc(:)
REAL(DP), PARAMETER :: small = 1.E-30_DP
!
IF ( ANY(.NOT.is_libxc(3:4)) ) CALL get_gga_threshold( 1.E-10_DP, 1.E-10_DP )
!
ALLOCATE( v1x(4*length), v2x(4*length), sx(4*length) )
ALLOCATE( v1c(4*length), v2c(4*length), sc(4*length) )
!
@ -371,6 +374,7 @@ SUBROUTINE dgcxc_spin( length, r_in, g_in, vrrx, vrsx, vssx, vrrc, vrsc, &
!! This routine computes the derivative of the exchange and correlation
!! potentials in the spin-polarized case.
!
USE funct, ONLY: is_libxc
USE xc_interfaces, ONLY: gcx_spin, gcc_spin
USE kinds, ONLY: DP
!
@ -413,6 +417,8 @@ SUBROUTINE dgcxc_spin( length, r_in, g_in, vrrx, vrsx, vssx, vrrc, vrsc, &
REAL(DP), PARAMETER :: rho_trash = 0.4_DP, zeta_trash = 0.2_DP, &
s2_trash = 0.1_DP
!
IF ( ANY(.NOT.is_libxc(3:4)) ) CALL get_gga_threshold( 1.E-10_DP, 1.E-10_DP )
!
vrrx = 0.0_DP ; vrsx = 0.0_DP ; vssx = 0.0_DP
vrrc = 0.0_DP ; vrsc = 0.0_DP ; vrzc = 0.0_DP
vssc = 0.0_DP
@ -578,6 +584,7 @@ SUBROUTINE d3gcxc( r, s2, vrrrx, vsrrx, vssrx, vsssx, &
! same for (c)
!
USE kinds, ONLY : DP
USE funct, ONLY: is_libxc
!
IMPLICIT NONE
!
@ -591,6 +598,8 @@ SUBROUTINE d3gcxc( r, s2, vrrrx, vsrrx, vssrx, vsssx, &
REAL(DP), DIMENSION(4) :: vrrx_rs, vsrx_rs, vssx_rs, vrrc_rs, &
vsrc_rs, vssc_rs
!
IF ( ANY(.NOT.is_libxc(3:4)) ) CALL get_gga_threshold( 1.E-10_DP, 1.E-10_DP )
!
s = SQRT(s2)
dr = MIN(1.d-4, 1.d-2 * r)
ds = MIN(1.d-4, 1.d-2 * s)

View File

@ -182,11 +182,10 @@ SUBROUTINE dmxc_lda( length, rho_in, dmuxc )
!! Computes the derivative of the xc potential with respect to the
!! local density.
!
!USE xc_lda_lsda, ONLY: xc_lda
!USE exch_lda, ONLY: slater
USE xc_interfaces, ONLY: xc_lda, slater, pz
USE funct, ONLY: get_iexch, get_icorr
USE kinds, ONLY: DP
USE xc_interfaces, ONLY: xc_lda, slater, pz, &
get_lda_threshold
USE funct, ONLY: get_iexch, get_icorr, is_libxc
USE kinds, ONLY: DP
!
IMPLICIT NONE
!
@ -223,6 +222,8 @@ SUBROUTINE dmxc_lda( length, rho_in, dmuxc )
iexch = get_iexch()
icorr = get_icorr()
!
IF ( ANY(.NOT.is_libxc(1:2)) ) CALL get_lda_threshold( 1.E-10_DP )
!
dmuxc = 0.0_DP
!
! ... first case: analytical derivatives available
@ -308,8 +309,9 @@ SUBROUTINE dmxc_lsda( length, rho_in, dmuxc )
!! local density in the spin-polarized case.
!
USE kinds, ONLY: DP
USE funct, ONLY: get_iexch, get_icorr
USE xc_interfaces, ONLY: xc_lsda, slater, pz, pz_polarized
USE funct, ONLY: get_iexch, get_icorr, is_libxc
USE xc_interfaces, ONLY: xc_lsda, slater, pz, pz_polarized, &
get_lda_threshold
!
IMPLICIT NONE
!
@ -348,6 +350,8 @@ SUBROUTINE dmxc_lsda( length, rho_in, dmuxc )
iexch = get_iexch()
icorr = get_icorr()
!
IF ( ANY(.NOT.is_libxc(1:2)) ) CALL get_lda_threshold( 1.E-10_DP )
!
dmuxc = 0.0_DP
ALLOCATE(rhotot(length))
rhotot(:) = rho_in(:,1) + rho_in(:,2)
@ -490,7 +494,8 @@ SUBROUTINE dmxc_nc( length, rho_in, m, dmuxc )
!! Computes the derivative of the xc potential with respect to the
!! local density and magnetization in the non-collinear case.
!
USE xc_interfaces, ONLY: xc_lsda
USE funct, ONLY: is_libxc
USE xc_interfaces, ONLY: xc_lsda, get_lda_threshold
USE kinds, ONLY: DP
!
IMPLICIT NONE
@ -527,6 +532,8 @@ SUBROUTINE dmxc_nc( length, rho_in, m, dmuxc )
rho_trash = 0.5_DP, zeta_trash = 0.5_DP, &
amag_trash= 0.025_DP
!
IF ( ANY(.NOT.is_libxc(1:2)) ) CALL get_lda_threshold( 1.E-10_DP )
!
dmuxc = 0.0_DP
!
ALLOCATE( rhoaux(length*5), zetaux(length*5) )

View File

@ -55,9 +55,9 @@ PROGRAM do_ppacf
USE funct, ONLY : dft_is_nonlocc, nlc
USE funct, ONLY : get_iexch, get_icorr, get_igcx, get_igcc
USE funct, ONLY : set_exx_fraction, set_auxiliary_flags, &
enforce_input_dft
enforce_input_dft, is_libxc
USE xc_interfaces, ONLY : gcxc, gcx_spin, gcc_spin, slater, &
slater_spin
slater_spin, get_gga_threshold
USE xc_lda_lsda, ONLY : xc
USE wvfct, ONLY : npw, npwx
USE environment, ONLY : environment_start, environment_end
@ -190,6 +190,8 @@ PROGRAM do_ppacf
!--------------- READ IN PREFIX --------------------------------!
CALL environment_start( 'ppacf' )
!
IF ( ANY(.NOT.is_libxc(3:4)) ) CALL get_gga_threshold( 1.E-10_DP, 1.E-10_DP )
!
! ... set default values for variables in namelist
!
code_num = 1