Commit 25a42faf authored by Matthias Redies's avatar Matthias Redies

fix etot typo

parent 89a6a65b
......@@ -53,7 +53,6 @@ SUBROUTINE cdncore(mpi,dimension,oneD,input,vacuum,noco,sym,&
REAL :: tec(atoms%ntype,DIMENSION%jspd)
REAL :: rhTemp(dimension%msh,atoms%ntype,dimension%jspd)
write (*,*) "cdncore present(EnergyDen)", present(EnergyDen)
results%seigc = 0.0
IF (mpi%irank==0) THEN
......
......@@ -46,8 +46,6 @@ CONTAINS
REAL stateEnergies(29)
! ..
write (*,*) "cored present(EnergyDen)", present(EnergyDen)
c = c_light(1.0)
seig = 0.
!
......
......@@ -1120,14 +1120,18 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
IF(xmlGetNumberOfNodes(TRIM(xPathA) // '/@etot_exchange') == 1) THEN
exc_id_x = evaluateFirstOnly(xmlGetAttributeValue(xPathA // '/@etot_exchange'))
write (*,*) "read exc_id_x"
ELSE
exc_id_x = vxc_id_x
write (*,*) "ignore exc_id_x"
ENDIF
IF(xmlGetNumberOfNodes(TRIM(xPathA) // '/@exc_correlation') == 1) THEN
exc_id_c = evaluateFirstOnly(xmlGetAttributeValue(xPathA // '/@exc_correlation'))
write (*,*) "read exc_id_c"
ELSE
exc_id_c = vxc_id_c
write (*,*) "ignore exc_id_c"
ENDIF
#else
CALL judft_error("To use libxc functionals you have to compile with libXC support")
......@@ -1141,18 +1145,22 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(xPathB) // '/@correlation')))
vxc_id_c = xc_f03_functional_get_number(TRIM(valueString))
IF(xmlGetNumberOfNodes(TRIM(xPathB) // '/@exc_exchange') == 1) THEN
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(xPathB) // '/@exc_exchange')))
IF(xmlGetNumberOfNodes(TRIM(xPathB) // '/@etot_exchange') == 1) THEN
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(xPathB) // '/@etot_exchange')))
exc_id_x = xc_f03_functional_get_number(TRIM(valueString))
write (*,*) "read exc_id_x"
ELSE
exc_id_x = vxc_id_x
write (*,*) "ignore exc_id_x"
ENDIF
IF(xmlGetNumberOfNodes(TRIM(xPathB) // '/@exc_correlation') == 1) THEN
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(xPathB) // '/@exc_correlation')))
IF(xmlGetNumberOfNodes(TRIM(xPathB) // '/@etot_correlation') == 1) THEN
valueString = TRIM(ADJUSTL(xmlGetAttributeValue(TRIM(xPathB) // '/@etot_correlation')))
exc_id_c = xc_f03_functional_get_number(TRIM(valueString))
write (*,*) "read exc_id_c"
ELSE
exc_id_c = vxc_id_c
write (*,*) "ignore exc_id_c"
ENDIF
#else
CALL judft_error("To use libxc functionals you have to compile with libXC support")
......@@ -2102,7 +2110,13 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
TYPE IS(t_xcpot_inbuild)
CALL xcpot%init(namex(1:4),relcor,atoms%ntype)
TYPE IS(t_xcpot_libxc)
write (*,*) "vxc_id_x", vxc_id_x
write (*,*) "vxc_id_c", vxc_id_c
write (*,*) "exc_id_x", exc_id_x
write (*,*) "exc_id_c", exc_id_c
CALL xcpot%init(jspins,vxc_id_x,vxc_id_c,exc_id_x,exc_id_c)
write (*,*) "is gga", xcpot%is_gga()
END SELECT
END SUBROUTINE setXCParameters
......
......@@ -12,111 +12,109 @@
!! In addition to overloading the t_xcpot datatype also mpi_bc_xcpot must be adjusted
!! for additional implementations.
MODULE m_types_xcpot
IMPLICIT NONE
PRIVATE
PUBLIC :: t_xcpot,t_gradients
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
IMPLICIT NONE
PRIVATE
PUBLIC :: t_xcpot,t_gradients
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
CONTAINS
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: is_MetaGGA=>xcpot_is_MetaGGA
PROCEDURE :: needs_grad=>xcpot_needs_grad
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
PROCEDURE :: get_vxc=>xcpot_get_vxc
PROCEDURE :: get_exc=>xcpot_get_exc
PROCEDURE,NOPASS :: alloc_gradients=>xcpot_alloc_gradients
END TYPE t_xcpot
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: is_MetaGGA=>xcpot_is_MetaGGA
PROCEDURE :: needs_grad=>xcpot_needs_grad
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
PROCEDURE :: get_vxc=>xcpot_get_vxc
PROCEDURE :: get_exc=>xcpot_get_exc
PROCEDURE,NOPASS :: alloc_gradients=>xcpot_alloc_gradients
END TYPE t_xcpot
TYPE t_gradients
!Naming convention:
!t,u,d as last letter for total,up,down
!agr for absolute value of gradient
!g2r for laplacien of gradient
!+??
REAL,ALLOCATABLE :: agrt(:),agru(:),agrd(:)
REAL,ALLOCATABLE :: g2ru(:),g2rd(:),gggrt(:)
REAL,ALLOCATABLE :: gggru(:),gzgr(:),g2rt(:)
REAL,ALLOCATABLE :: gggrd(:),grgru(:),grgrd(:)
!These are the contracted Gradients used in libxc
REAL,ALLOCATABLE :: sigma(:,:)
REAL,ALLOCATABLE :: vsigma(:,:)
REAL,ALLOCATABLE :: gr(:,:,:)
REAL,ALLOCATABLE :: laplace(:,:)
END TYPE t_gradients
TYPE t_gradients
!Naming convention:
!t,u,d as last letter for total,up,down
!agr for absolute value of gradient
!g2r for laplacien of gradient
!+??
REAL,ALLOCATABLE :: agrt(:),agru(:),agrd(:)
REAL,ALLOCATABLE :: g2ru(:),g2rd(:),gggrt(:)
REAL,ALLOCATABLE :: gggru(:),gzgr(:),g2rt(:)
REAL,ALLOCATABLE :: gggrd(:),grgru(:),grgrd(:)
!These are the contracted Gradients used in libxc
REAL,ALLOCATABLE :: sigma(:,:)
REAL,ALLOCATABLE :: vsigma(:,:)
REAL,ALLOCATABLE :: gr(:,:,:)
REAL,ALLOCATABLE :: laplace(:,:)
END TYPE t_gradients
CONTAINS
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_gga=.false.
END FUNCTION xcpot_is_gga
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_gga=.false.
END FUNCTION xcpot_is_gga
LOGICAL FUNCTION xcpot_is_MetaGGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_MetaGGA=.false.
END FUNCTION xcpot_is_MetaGGA
LOGICAL FUNCTION xcpot_is_MetaGGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_MetaGGA=.false.
END FUNCTION xcpot_is_MetaGGA
LOGICAL FUNCTION xcpot_needs_grad(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
LOGICAL FUNCTION xcpot_needs_grad(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_needs_grad= xcpot%is_gga() .or. xcpot%is_MetaGGA()
END FUNCTION xcpot_needs_grad
xcpot_needs_grad= xcpot%is_gga() .or. xcpot%is_MetaGGA()
END FUNCTION xcpot_needs_grad
LOGICAL FUNCTION xcpot_is_hybrid(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_hybrid=.FALSE.
END FUNCTION xcpot_is_hybrid
FUNCTION xcpot_get_exchange_weight(xcpot) RESULT(a_ex)
USE m_judft
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
REAL:: a_ex
a_ex=-1
END FUNCTION xcpot_get_exchange_weight
LOGICAL FUNCTION xcpot_is_hybrid(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_hybrid=.FALSE.
END FUNCTION xcpot_is_hybrid
FUNCTION xcpot_get_exchange_weight(xcpot) RESULT(a_ex)
USE m_judft
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
REAL:: a_ex
a_ex=-1
END FUNCTION xcpot_get_exchange_weight
SUBROUTINE xcpot_get_vxc(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
SUBROUTINE xcpot_get_vxc(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
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad)
CLASS(t_xcpot),INTENT(IN) :: xcpot
INTEGER, INTENT (IN) :: jspins
!--> charge density
REAL,INTENT (IN) :: rh(:,:)
!---> xc energy density
REAL, INTENT (OUT) :: exc (:)
TYPE(t_gradients),OPTIONAL,INTENT(IN)::grad
END SUBROUTINE xcpot_get_exc
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad)
CLASS(t_xcpot),INTENT(IN) :: xcpot
INTEGER, INTENT (IN) :: jspins
!--> charge density
REAL,INTENT (IN) :: rh(:,:)
!---> xc energy density
REAL, INTENT (OUT) :: exc (:)
TYPE(t_gradients),OPTIONAL,INTENT(IN)::grad
END SUBROUTINE xcpot_get_exc
SUBROUTINE xcpot_alloc_gradients(ngrid,jspins,grad)
INTEGER, INTENT (IN) :: jspins,ngrid
TYPE(t_gradients),INTENT(INOUT):: grad
SUBROUTINE xcpot_alloc_gradients(ngrid,jspins,grad)
INTEGER, INTENT (IN) :: jspins,ngrid
TYPE(t_gradients),INTENT(INOUT):: grad
IF (allocated(grad%agrt)) THEN
DEALLOCATE(grad%agrt,grad%agru,grad%agrd)
DEALLOCATE(grad%g2ru,grad%g2rd,grad%gggrt)
DEALLOCATE(grad%gggru,grad%gzgr,grad%g2rt)
DEALLOCATE(grad%gggrd,grad%grgru,grad%grgrd)
ENDIF
!For the in-build xc-pots
ALLOCATE(grad%agrt(ngrid),grad%agru(ngrid),grad%agrd(ngrid))
ALLOCATE(grad%g2ru(ngrid),grad%g2rd(ngrid),grad%gggrt(ngrid))
ALLOCATE(grad%gggru(ngrid),grad%gzgr(ngrid),grad%g2rt(ngrid))
ALLOCATE(grad%gggrd(ngrid),grad%grgru(ngrid),grad%grgrd(ngrid))
END SUBROUTINE xcpot_alloc_gradients
IF (allocated(grad%agrt)) THEN
DEALLOCATE(grad%agrt,grad%agru,grad%agrd)
DEALLOCATE(grad%g2ru,grad%g2rd,grad%gggrt)
DEALLOCATE(grad%gggru,grad%gzgr,grad%g2rt)
DEALLOCATE(grad%gggrd,grad%grgru,grad%grgrd)
ENDIF
!For the in-build xc-pots
ALLOCATE(grad%agrt(ngrid),grad%agru(ngrid),grad%agrd(ngrid))
ALLOCATE(grad%g2ru(ngrid),grad%g2rd(ngrid),grad%gggrt(ngrid))
ALLOCATE(grad%gggru(ngrid),grad%gzgr(ngrid),grad%g2rt(ngrid))
ALLOCATE(grad%gggrd(ngrid),grad%grgru(ngrid),grad%grgrd(ngrid))
END SUBROUTINE xcpot_alloc_gradients
END MODULE m_types_xcpot
......@@ -105,6 +105,11 @@ CONTAINS
xcpot%DATA%exchange_weight=xcpot%get_exchange_weight()
END SUBROUTINE xcpot_init
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_is_gga=priv_LDA(xcpot%icorr)
END FUNCTION xcpot_is_gga
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
......@@ -132,7 +137,6 @@ CONTAINS
IF (xcpot%is_name("vhse")) a_ex=amix_hse
END FUNCTION xcpot_get_exchange_weight
SUBROUTINE xcpot_get_vxc(xcpot,jspins,rh, vxc,vx, grad)
!
USE m_xcxal, ONLY : vxcxal
......
......@@ -102,6 +102,8 @@ CONTAINS
ELSE
WRITE(*,*) "No Correlation functional for TotalE"
ENDIF
ELSE
write (*,*) "Using same functional for VXC and EXC"
END IF
#else
CALL judft_error("You specified a libxc-exchange correlation potential but FLEUR is not linked against libxc", &
......@@ -122,19 +124,6 @@ CONTAINS
#endif
END FUNCTION xcpot_is_gga
LOGICAL FUNCTION xcpot_is_LDA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot_libxc),INTENT(IN):: xcpot
#ifdef CPP_LIBXC
TYPE(xc_f03_func_info_t) :: xc_info
xc_info = xc_f03_func_get_info(xcpot%exc_func_x)
xcpot_is_LDA= (XC_FAMILY_LDA==xc_f03_func_info_get_family(xc_info))
#else
xcpot_is_LDA=.false.
#endif
END FUNCTION xcpot_is_LDA
LOGICAL FUNCTION xcpot_is_MetaGGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot_libxc),INTENT(IN):: xcpot
......@@ -206,6 +195,8 @@ CONTAINS
CALL xc_f03_lda_vxc(xcpot%vxc_func_c, SIZE(rh,1), TRANSPOSE(rh), vxc_tmp)
vxc_tmp=vxc_tmp+vx_tmp
ENDIF
ELSE
call juDFT_error("xcpot Type not known")
ENDIF
vx=TRANSPOSE(vx_tmp)
vxc=TRANSPOSE(vxc_tmp)
......
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