diff --git a/Modules/dgcxc_drivers.f90 b/Modules/dgcxc_drivers.f90 index a6e5f6f31..70a5ec4d2 100644 --- a/Modules/dgcxc_drivers.f90 +++ b/Modules/dgcxc_drivers.f90 @@ -11,7 +11,7 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss ) USE constants, ONLY: e2 USE kinds, ONLY: DP USE funct, ONLY: get_igcx, get_igcc, is_libxc - USE xc_interfaces, ONLY: gcxc, gcx_spin, dgcxc_unpol + USE xc_interfaces, ONLY: gcxc, gcx_spin, dgcxc_unpol, dgcxc_spin #if defined(__LIBXC) #include "xc_version.h" USE xc_f03_lib_m @@ -299,265 +299,4 @@ SUBROUTINE dgcxc( length, sp, r_in, g_in, dvxc_rr, dvxc_sr, dvxc_ss ) END SUBROUTINE ! ! -!-------------------------------------------------------------------------- -SUBROUTINE dgcxc_spin( length, r_in, g_in, vrrx, vrsx, vssx, vrrc, vrsc, & - vssc, vrzc ) - !------------------------------------------------------------------------ - !! 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 - ! - IMPLICIT NONE - ! - INTEGER, INTENT(IN) :: length - REAL(DP), INTENT(IN), DIMENSION(length,2) :: r_in - REAL(DP), INTENT(IN), DIMENSION(length,3,2) :: g_in - ! input: the charges and the gradient - REAL(DP), INTENT(OUT), DIMENSION(length,2) :: vrrx, vrsx, vssx - REAL(DP), INTENT(OUT), DIMENSION(length,2) :: vrrc, vrsc, vrzc - REAL(DP), INTENT(OUT), DIMENSION(length) :: vssc - ! output: derivatives of the exchange and of the correlation - ! - ! ... local variables - ! - INTEGER :: i1, i2, i3, i4, i5, i6, i7, i8 - INTEGER :: f1, f2, f3, f4, f5, f6, f7, f8 - ! block delimiters - REAL(DP), DIMENSION(length,2) :: r, s, s2 - REAL(DP), DIMENSION(length,2) :: drup, drdw, dsup, dsdw - ! deltas for rho and gradient - REAL(DP), ALLOCATABLE :: sx(:), v1x(:,:), v2x(:,:) - ! exchange energy and potentials for each block - REAL(DP), ALLOCATABLE :: sc(:), v1c(:,:), v2c(:) - ! correlation energy and potentials for each block - REAL(DP), DIMENSION(length) :: rt, zeta, st, s2t - ! rho tot, zeta, gradient, square tot gradient - REAL(DP), DIMENSION(length) :: dr, ds, dz - ! deltas for rho tot, gradient and zeta - REAL(DP), DIMENSION(length,2) :: null_v - ! used to set output values to zero when input values - ! are too small (e.g. rho eps) - zeta = (r_in(:,1) - r_in(:,2)) / rt(:) - ELSEWHERE - zeta = zeta_trash - null_v(:,1) = 0.0_DP - END WHERE - ! - s2t = (g_in(:,1,1) + g_in(:,1,2))**2 + & - (g_in(:,2,1) + g_in(:,2,2))**2 + & - (g_in(:,3,1) + g_in(:,3,2))**2 - st = SQRT(s2t) - ! - WHERE (rt1._DP .OR. st eps) + zeta = (r_in(:,1) - r_in(:,2)) / rt(:) + ELSEWHERE + zeta = zeta_trash + null_v(:,1) = 0.0_DP + END WHERE + ! + s2t = (g_in(:,1,1) + g_in(:,1,2))**2 + & + (g_in(:,2,1) + g_in(:,2,2))**2 + & + (g_in(:,3,1) + g_in(:,3,2))**2 + st = SQRT(s2t) + ! + WHERE (rt1._DP .OR. st