Commit d4eb1d7b authored by Matthias Redies's avatar Matthias Redies

added start vxc for inbuild xcpot

parent 2e7cbaa0
......@@ -311,7 +311,7 @@ SUBROUTINE stden(mpi,sphhar,stars,atoms,sym,DIMENSION,vacuum,&
END DO
CALL qsf(vacuum%delz,sigm,vacpar(ivac),vacuum%nmz,0)
denz1 = den%vacz(1,ivac,ispin) ! get estimate for potential at vacuum boundary
CALL xcpot%get_vxc(1,denz1,vacpot,vacxpot)
CALL xcpot%get_vxc_start(1,denz1,vacpot,vacxpot)
! seems to be the best choice for 1D not to substract vacpar
IF (.NOT.oneD%odi%d1) THEN
vacpot = vacpot - fpi_const*vacpar(ivac)
......
......@@ -25,6 +25,7 @@ MODULE m_types_xcpot
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
PROCEDURE :: get_vxc=>xcpot_get_vxc
PROCEDURE :: get_vxc_start=>xcpot_get_vxc_start
PROCEDURE :: get_exc=>xcpot_get_exc
PROCEDURE,NOPASS :: alloc_gradients=>xcpot_alloc_gradients
END TYPE t_xcpot
......@@ -92,6 +93,16 @@ CONTAINS
TYPE(t_gradients),OPTIONAL,INTENT(INOUT)::grad
END SUBROUTINE xcpot_get_vxc
SUBROUTINE xcpot_get_vxc_start(xcpot,jspins,rh,vxc,vx,grad)
CLASS(t_xcpot),INTENT(IN) :: xcpot
INTEGER, INTENT (IN) :: jspins
!--> charge density
REAL,INTENT (IN) :: rh(:,:)
!---> xc potential
REAL, INTENT (OUT) :: vxc (:,:),vx(:,:)
TYPE(t_gradients),OPTIONAL,INTENT(INOUT)::grad
END SUBROUTINE xcpot_get_vxc_start
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad)
CLASS(t_xcpot),INTENT(IN) :: xcpot
......
......@@ -47,6 +47,7 @@ MODULE m_types_xcpot_inbuild
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
PROCEDURE :: get_vxc=>xcpot_get_vxc
PROCEDURE :: get_vxc_start=>xcpot_get_vxc_start
PROCEDURE :: get_exc=>xcpot_get_exc
!not overloaded
PROCEDURE :: get_name=>xcpot_get_name
......@@ -84,7 +85,6 @@ CONTAINS
if (xcpot%icorr==0) CALL judft_error("Unkown xc-potential:"//namex,calledby="types_xcpot.F90")
xcpot%data%krla=MERGE(1,0,relcor)
!Code from exchpbe to speed up determination of constants
IF (xcpot%is_name("rpbe")) THEN
xcpot%data%uk=1.2450
......@@ -107,7 +107,6 @@ CONTAINS
END SUBROUTINE xcpot_init
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
......@@ -134,9 +133,21 @@ CONTAINS
IF (xcpot%is_name("vhse")) a_ex=amix_hse
END FUNCTION xcpot_get_exchange_weight
!***********************************************************************
SUBROUTINE xcpot_get_vxc_start(xcpot,jspins,rh, vxc,vx, grad)
CLASS(t_xcpot_inbuild),INTENT(IN) :: xcpot
INTEGER, INTENT (IN) :: jspins
REAL,INTENT (IN) :: rh(:,:)
REAL, INTENT (OUT) :: vx (:,:)
REAL, INTENT (OUT) :: vxc(:,:)
TYPE(t_gradients), INTENT(INOUT), OPTIONAL :: grad
! there is no difference for inbuild case
call xcpot%get_vxc(jspins, rh, vxc, vx, grad)
END SUBROUTINE xcpot_get_vxc_start
SUBROUTINE xcpot_get_vxc(xcpot,jspins,rh, vxc,vx, grad)
!***********************************************************************
!
USE m_xcxal, ONLY : vxcxal
USE m_xcwgn, ONLY : vxcwgn
......@@ -308,13 +319,10 @@ CONTAINS
END SUBROUTINE xcpot_get_exc
LOGICAL FUNCTION xcpot_is_name(xcpot,name)
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
CHARACTER(len=*),INTENT(IN) :: name
xcpot_is_name=(TRIM(xc_names(xcpot%icorr))==TRIM((name)))
END FUNCTION xcpot_is_name
END MODULE m_types_xcpot_inbuild
END MODULE m_types_xcpot_inbuild
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment