mirror of https://gitlab.com/QEF/q-e.git
XClib - beef gnu+acc compatibility and small cleanup
This commit is contained in:
parent
358541f58d
commit
8cbbf78742
|
@ -254,8 +254,8 @@ SUBROUTINE v_xc_meta( rho, rho_core, rhog_core, etxc, vtxc, v, kedtaur )
|
|||
CALL xc_metagcx( dfftp%nnr, 1, np, rho%of_r, grho, tau, ex, ec, &
|
||||
v1x, v2x, v3x, v1c, v2c, v3c, gpu_args_=.TRUE. )
|
||||
!
|
||||
!$acc parallel loop reduction(+:etxc) reduction(+:vtxc) reduction(-:rhoneg1) &
|
||||
!$acc& reduction(-:rhoneg2) present(rho)
|
||||
!$acc parallel loop reduction(+:etxc,vtxc) reduction(-:rhoneg1,rhoneg2) &
|
||||
!$acc& present(rho)
|
||||
DO k = 1, dfftp%nnr
|
||||
!
|
||||
v(k,1) = (v1x(k,1)+v1c(k,1)) * e2
|
||||
|
@ -290,8 +290,7 @@ SUBROUTINE v_xc_meta( rho, rho_core, rhog_core, etxc, vtxc, v, kedtaur )
|
|||
!
|
||||
! ... first term of the gradient correction : D(rho*Exc)/D(rho)
|
||||
!
|
||||
!$acc parallel loop reduction(+:etxc) reduction(+:vtxc) reduction(-:rhoneg1) &
|
||||
!$acc& reduction(-:rhoneg2)
|
||||
!$acc parallel loop reduction(+:etxc,vtxc) reduction(-:rhoneg1,rhoneg2)
|
||||
DO k = 1, dfftp%nnr
|
||||
!
|
||||
v(k,1) = (v1x(k,1) + v1c(k,1)) * e2
|
||||
|
@ -474,8 +473,7 @@ SUBROUTINE v_xc( rho, rho_core, rhog_core, etxc, vtxc, v )
|
|||
!
|
||||
CALL xc( dfftp%nnr, 1, 1, rho%of_r, ex, ec, vx, vc, gpu_args_=.TRUE. )
|
||||
!
|
||||
!$acc parallel loop reduction(+:etxc) reduction(+:vtxc) reduction(-:rhoneg1) &
|
||||
!$acc& present(rho)
|
||||
!$acc parallel loop reduction(+:etxc,vtxc) reduction(-:rhoneg1) present(rho)
|
||||
DO ir = 1, dfftp%nnr
|
||||
v(ir,1) = e2*( vx(ir,1) + vc(ir,1) )
|
||||
etxc = etxc + e2*( ex(ir) + ec(ir) )*rho%of_r(ir,1)
|
||||
|
@ -490,8 +488,8 @@ SUBROUTINE v_xc( rho, rho_core, rhog_core, etxc, vtxc, v )
|
|||
!
|
||||
CALL xc( dfftp%nnr, 2, 2, rho%of_r, ex, ec, vx, vc, gpu_args_=.TRUE. )
|
||||
!
|
||||
!$acc parallel loop reduction(+:etxc) reduction(+:vtxc) reduction(-:rhoneg1) &
|
||||
!$acc& reduction(-:rhoneg2) present(rho)
|
||||
!$acc parallel loop reduction(+:etxc,vtxc) reduction(-:rhoneg1,rhoneg2) &
|
||||
!$acc& present(rho)
|
||||
DO ir = 1, dfftp%nnr
|
||||
v(ir,1) = e2*( vx(ir,1) + vc(ir,1) )
|
||||
v(ir,2) = e2*( vx(ir,2) + vc(ir,2) )
|
||||
|
@ -511,8 +509,8 @@ SUBROUTINE v_xc( rho, rho_core, rhog_core, etxc, vtxc, v )
|
|||
!
|
||||
CALL xc( dfftp%nnr, 4, 2, rho%of_r, ex, ec, vx, vc, gpu_args_=.TRUE. )
|
||||
!
|
||||
!$acc parallel loop reduction(+:etxc) reduction(+:vtxc) reduction(-:rhoneg1) &
|
||||
!$acc& reduction(+:rhoneg2) present(rho)
|
||||
!$acc parallel loop reduction(+:etxc,vtxc) reduction(-:rhoneg1,rhoneg2) &
|
||||
!$acc& present(rho)
|
||||
DO ir = 1, dfftp%nnr
|
||||
arho = ABS( rho%of_r(ir,1) )
|
||||
IF ( arho < vanishing_charge ) THEN
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
#define nmax 30
|
||||
|
||||
#pragma acc routine (dgemv_) seq
|
||||
extern void dgemv_(const char *, const int *, const int *, const double *,
|
||||
double *, const int *, double *, const int *, const double *, double *,
|
||||
const int *);
|
||||
#pragma acc routine (dgemv_) seq
|
||||
|
||||
#pragma acc routine seq
|
||||
double ddot1(double v[], double u[], int n)
|
||||
|
|
|
@ -587,7 +587,6 @@ END SUBROUTINE dmxc_nc
|
|||
!
|
||||
!-----------------------------------------------------------------------
|
||||
FUNCTION dpz( rs, iflg )
|
||||
!$acc routine seq
|
||||
!-----------------------------------------------------------------------
|
||||
!! Derivative of the correlation potential with respect to local density
|
||||
!! Perdew and Zunger parameterization of the Ceperley-Alder functional.
|
||||
|
@ -596,6 +595,8 @@ FUNCTION dpz( rs, iflg )
|
|||
!
|
||||
IMPLICIT NONE
|
||||
!
|
||||
!$acc routine seq
|
||||
!
|
||||
REAL(DP), INTENT(IN) :: rs
|
||||
INTEGER, INTENT(IN) :: iflg
|
||||
REAL(DP) :: dpz
|
||||
|
@ -627,7 +628,6 @@ END FUNCTION dpz
|
|||
!
|
||||
!-----------------------------------------------------------------------
|
||||
FUNCTION dpz_polarized( rs, iflg )
|
||||
!$acc routine seq
|
||||
!-----------------------------------------------------------------------
|
||||
!! Derivative of the correlation potential with respect to local density
|
||||
!! Perdew and Zunger parameterization of the Ceperley-Alder functional. |
|
||||
|
@ -637,6 +637,8 @@ FUNCTION dpz_polarized( rs, iflg )
|
|||
!
|
||||
IMPLICIT NONE
|
||||
!
|
||||
!$acc routine seq
|
||||
!
|
||||
REAL(DP), INTENT(IN) :: rs
|
||||
INTEGER, INTENT(IN) :: iflg
|
||||
REAL(DP) :: dpz_polarized
|
||||
|
|
|
@ -22,33 +22,33 @@ MODULE beef_interface
|
|||
INTERFACE
|
||||
!
|
||||
SUBROUTINE beefx( r, g, e, dr, dg, addlda ) BIND(C, NAME="beefx_")
|
||||
!$acc routine seq
|
||||
USE iso_c_binding
|
||||
USE iso_c_binding
|
||||
!$acc routine seq
|
||||
REAL (C_DOUBLE) :: r, g, e, dr, dg
|
||||
INTEGER(C_INT), INTENT(IN) :: addlda
|
||||
END SUBROUTINE beefx
|
||||
!
|
||||
SUBROUTINE beeflocalcorr( r, g, e, dr, dg, addlda) BIND(C, NAME="beeflocalcorr_")
|
||||
!$acc routine seq
|
||||
USE iso_c_binding
|
||||
USE iso_c_binding
|
||||
!$acc routine seq
|
||||
REAL (C_DOUBLE), INTENT(INOUT) :: r, g, e, dr, dg
|
||||
INTEGER(C_INT), INTENT(IN) :: addlda
|
||||
END SUBROUTINE beeflocalcorr
|
||||
!
|
||||
SUBROUTINE beeflocalcorrspin(r, z, g, e, drup, drdown, dg, addlda) BIND(C, NAME="beeflocalcorrspin_")
|
||||
!$acc routine seq
|
||||
USE iso_c_binding
|
||||
USE iso_c_binding
|
||||
!$acc routine seq
|
||||
REAL (C_DOUBLE), INTENT(INOUT) :: r, z, g, e, drup, drdown, dg
|
||||
INTEGER(C_INT), INTENT(IN) :: addlda
|
||||
END SUBROUTINE beeflocalcorrspin
|
||||
!
|
||||
SUBROUTINE beefsetmode(mode) BIND(C, NAME="beefsetmode_")
|
||||
USE iso_c_binding
|
||||
USE iso_c_binding
|
||||
INTEGER(C_INT), INTENT(IN) :: mode
|
||||
END SUBROUTINE beefsetmode
|
||||
!
|
||||
SUBROUTINE beefrandinit(seed) BIND(C, NAME="beefrandinit_")
|
||||
USE iso_c_binding
|
||||
USE iso_c_binding
|
||||
INTEGER(C_INT), INTENT(IN) :: seed
|
||||
END SUBROUTINE beefrandinit
|
||||
!
|
||||
|
@ -56,7 +56,7 @@ MODULE beef_interface
|
|||
END SUBROUTINE beefrandinitdef
|
||||
!
|
||||
SUBROUTINE beefensemble(beefxc, ensemble) BIND(C, NAME="beefensemble_")
|
||||
USE iso_c_binding
|
||||
USE iso_c_binding
|
||||
REAL (C_DOUBLE), INTENT(INOUT) :: beefxc(*), ensemble(*)
|
||||
END SUBROUTINE beefensemble
|
||||
!
|
||||
|
@ -102,27 +102,27 @@ MODULE beef_interface
|
|||
! and not in the above interfaces.
|
||||
!
|
||||
SUBROUTINE beefx( r, g, e, dr, dg, addlda )
|
||||
!$acc routine seq
|
||||
!! Evaluate bee exchange energy and its derivatives \(d\epsilon/d\rho\) and
|
||||
!! \( (d\epsilon/d|\nabla \rho| ) / |\nabla\rho|\).
|
||||
USE kind_l, ONLY : dp
|
||||
!$acc routine seq
|
||||
REAL (dp) :: r, g, e, dr, dg
|
||||
INTEGER :: addlda
|
||||
END SUBROUTINE beefx
|
||||
!
|
||||
SUBROUTINE beeflocalcorr( r, g, e, dr, dg, addlda)
|
||||
!$acc routine seq
|
||||
!! Evaluate local part of bee correlation and its derivatives \(d\epsilon/drho\)
|
||||
!! and \( (d\epsilon/d|\nabla\rho|) / |\nabla\rho| \).
|
||||
USE kind_l, ONLY : dp
|
||||
!$acc routine seq
|
||||
REAL (dp), INTENT(INOUT) :: r, g, e, dr, dg
|
||||
INTEGER :: addlda
|
||||
END SUBROUTINE beeflocalcorr
|
||||
!
|
||||
SUBROUTINE beeflocalcorrspin(r, z, g, e, drup, drdown, dg, addlda)
|
||||
!$acc routine seq
|
||||
!! Evaluate local part of bee correlation for spin polarized system.
|
||||
USE kind_l, ONLY : dp
|
||||
!$acc routine seq
|
||||
REAL (dp), INTENT(INOUT) :: r, z, g, e, drup, drdown, dg
|
||||
INTEGER :: addlda
|
||||
END SUBROUTINE beeflocalcorrspin
|
||||
|
|
Loading…
Reference in New Issue