Commit 1bdbe1b6 authored by Matthias Redies's avatar Matthias Redies

split vxc_is_bla into vx and vc

parent 6e7d99fc
......@@ -21,17 +21,26 @@ MODULE m_types_xcpot
REAL :: gmaxxc
TYPE(t_potden) :: core_den, val_den
CONTAINS
PROCEDURE :: vxc_is_LDA=>xcpot_vxc_is_LDA
PROCEDURE :: exc_is_LDA=>xcpot_exc_is_LDA
PROCEDURE :: vxc_is_gga=>xcpot_vxc_is_gga
PROCEDURE :: exc_is_gga=>xcpot_exc_is_gga
PROCEDURE :: exc_is_MetaGGA=>xcpot_exc_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
PROCEDURE :: vxc_is_LDA => xcpot_vxc_is_LDA
PROCEDURE :: vxc_is_GGA => xcpot_vxc_is_GGA
PROCEDURE :: vx_is_LDA => xcpot_vx_is_LDA
PROCEDURE :: vx_is_GGA => xcpot_vx_is_GGA
PROCEDURE :: vc_is_LDA => xcpot_vc_is_LDA
PROCEDURE :: vc_is_GGA => xcpot_vc_is_GGA
PROCEDURE :: exc_is_LDA => xcpot_exc_is_LDA
PROCEDURE :: exc_is_GGA => xcpot_exc_is_GGA
PROCEDURE :: exc_is_MetaGGA => xcpot_exc_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
......@@ -53,10 +62,22 @@ MODULE m_types_xcpot
CONTAINS
! LDA
LOGICAL FUNCTION xcpot_vc_is_LDA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_vc_is_LDA=.false.
END FUNCTION xcpot_vc_is_LDA
LOGICAL FUNCTION xcpot_vx_is_LDA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_vx_is_LDA=.false.
END FUNCTION xcpot_vx_is_LDA
LOGICAL FUNCTION xcpot_vxc_is_LDA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_vxc_is_LDA=.false.
xcpot_vxc_is_LDA = xcpot%vx_is_LDA() .and. xcpot%vc_is_LDA()
END FUNCTION xcpot_vxc_is_LDA
LOGICAL FUNCTION xcpot_exc_is_LDA(xcpot)
......@@ -66,10 +87,22 @@ CONTAINS
END FUNCTION xcpot_exc_is_LDA
! GGA
LOGICAL FUNCTION xcpot_vc_is_GGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_vc_is_GGA=.false.
END FUNCTION xcpot_vc_is_GGA
LOGICAL FUNCTION xcpot_vx_is_GGA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_vx_is_GGA=.false.
END FUNCTION xcpot_vx_is_GGA
LOGICAL FUNCTION xcpot_vxc_is_gga(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_vxc_is_gga=.false.
xcpot_vxc_is_gga= xcpot%vx_is_GGA() .and. xcpot%vc_is_GGA()
END FUNCTION xcpot_vxc_is_gga
LOGICAL FUNCTION xcpot_exc_is_gga(xcpot)
......
......@@ -49,18 +49,23 @@ MODULE m_types_xcpot_inbuild
CONTAINS
!overloading t_xcpot:
PROCEDURE :: vxc_is_LDA=>xcpot_is_LDA
PROCEDURE :: exc_is_LDA=>xcpot_is_LDA
PROCEDURE :: vxc_is_gga=>xcpot_vxc_is_gga
PROCEDURE :: exc_is_gga=>xcpot_exc_is_gga
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 :: vx_is_LDA => xcpot_vx_is_LDA
PROCEDURE :: vx_is_GGA => xcpot_vx_is_GGA
PROCEDURE :: vc_is_LDA => xcpot_vc_is_LDA
PROCEDURE :: vc_is_GGA => xcpot_vc_is_GGA
PROCEDURE :: exc_is_LDA => xcpot_exc_is_LDA
PROCEDURE :: exc_is_gga => xcpot_exc_is_gga
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
!not overloaded
PROCEDURE :: get_name=>xcpot_get_name
PROCEDURE :: is_name=>xcpot_is_name
PROCEDURE :: init=>xcpot_init
PROCEDURE :: get_name => xcpot_get_name
PROCEDURE :: is_name => xcpot_is_name
PROCEDURE :: init => xcpot_init
END TYPE t_xcpot_inbuild
PUBLIC t_xcpot_inbuild
CONTAINS
......@@ -116,20 +121,35 @@ CONTAINS
END SUBROUTINE xcpot_init
!! LDA
LOGICAL FUNCTION xcpot_is_lda(xcpot)
IMPLICIT NONE
logical function xcpot_exc_is_lda(xcpot)
implicit none
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_is_lda = (.not. xcpot%vxc_is_gga()) .and. (.not. xcpot%is_hybrid())
END FUNCTION xcpot_is_lda
xcpot_exc_is_lda= xcpot%vxc_is_lda()
end function xcpot_exc_is_lda
!! GGA
logical function xcpot_vx_is_lda(xcpot)
implicit none
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_vx_is_lda=(.not. xcpot%vxc_is_gga()) .and. (.not. xcpot%is_hybrid())
end function xcpot_vx_is_lda
LOGICAL FUNCTION xcpot_vxc_is_gga(xcpot)
IMPLICIT NONE
logical function xcpot_vc_is_lda(xcpot)
implicit none
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_vc_is_lda=(.not. xcpot%vxc_is_gga()) .and. (.not. xcpot%is_hybrid())
end function xcpot_vc_is_lda
logical function xcpot_vx_is_gga(xcpot)
implicit none
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_vx_is_gga=priv_gga(xcpot%icorr)
end function xcpot_vx_is_gga
logical function xcpot_vc_is_gga(xcpot)
implicit none
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_vxc_is_gga=priv_gga(xcpot%icorr)
END FUNCTION xcpot_vxc_is_gga
xcpot_vc_is_gga=priv_gga(xcpot%icorr)
end function xcpot_vc_is_gga
LOGICAL FUNCTION xcpot_exc_is_gga(xcpot)
IMPLICIT NONE
......
......@@ -30,11 +30,19 @@ MODULE m_types_xcpot_libxc
CONTAINS
PROCEDURE :: vxc_is_LDA => xcpot_vxc_is_LDA
PROCEDURE :: exc_is_LDA => xcpot_exc_is_LDA
PROCEDURE :: vxc_is_gga => xcpot_vxc_is_gga
PROCEDURE :: exc_is_gga => xcpot_exc_is_gga
PROCEDURE :: exc_is_MetaGGA => xcpot_exc_is_MetaGGA
!PROCEDURE :: vxc_is_LDA => xcpot_vxc_is_LDA
!PROCEDURE :: vxc_is_gga => xcpot_vxc_is_gga
PROCEDURE :: vx_is_LDA => xcpot_vx_is_LDA
PROCEDURE :: vx_is_GGA => xcpot_vx_is_GGA
PROCEDURE :: vc_is_LDA => xcpot_vc_is_LDA
PROCEDURE :: vc_is_GGA => xcpot_vc_is_GGA
PROCEDURE :: exc_is_LDA => xcpot_exc_is_LDA
PROCEDURE :: exc_is_gga => xcpot_exc_is_gga
PROCEDURE :: exc_is_MetaGGA => xcpot_exc_is_MetaGGA
PROCEDURE :: is_hybrid => xcpot_is_hybrid
PROCEDURE :: get_exchange_weight => xcpot_get_exchange_weight
PROCEDURE :: get_vxc => xcpot_get_vxc
......@@ -128,19 +136,32 @@ CONTAINS
END SUBROUTINE xcpot_init
! LDA
LOGICAL FUNCTION xcpot_vxc_is_LDA(xcpot)
LOGICAL FUNCTION xcpot_vx_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%vxc_func_x)
xcpot_vxc_is_LDA = XC_FAMILY_LDA == xc_f03_func_info_get_family(xc_info)
xcpot_vx_is_LDA = XC_FAMILY_LDA == xc_f03_func_info_get_family(xc_info)
#else
xcpot_vxc_is_LDA = .false.
xcpot_vx_is_LDA = .false.
#endif
END FUNCTION xcpot_vxc_is_LDA
END FUNCTION xcpot_vx_is_LDA
LOGICAL FUNCTION xcpot_vc_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%vxc_func_c)
xcpot_vc_is_LDA = XC_FAMILY_LDA == xc_f03_func_info_get_family(xc_info)
#else
xcpot_vc_is_LDA = .false.
#endif
END FUNCTION xcpot_vc_is_LDA
LOGICAL FUNCTION xcpot_exc_is_LDA(xcpot)
IMPLICIT NONE
CLASS(t_xcpot_libxc),INTENT(IN):: xcpot
......@@ -155,18 +176,31 @@ CONTAINS
END FUNCTION xcpot_exc_is_LDA
! GGA
LOGICAL FUNCTION xcpot_vxc_is_gga(xcpot)
LOGICAL FUNCTION xcpot_vc_is_gga(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%vxc_func_x)
xcpot_vxc_is_gga = ANY([XC_FAMILY_GGA, XC_FAMILY_HYB_GGA]==xc_f03_func_info_get_family(xc_info))
xc_info = xc_f03_func_get_info(xcpot%vxc_func_c)
xcpot_vc_is_gga = ANY([XC_FAMILY_GGA, XC_FAMILY_HYB_GGA]==xc_f03_func_info_get_family(xc_info))
#else
xcpot_vc_is_gga=.false.
#endif
END FUNCTION xcpot_vc_is_gga
LOGICAL FUNCTION xcpot_vx_is_gga(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%vxc_func_c)
xcpot_vx_is_gga = ANY([XC_FAMILY_GGA, XC_FAMILY_HYB_GGA]==xc_f03_func_info_get_family(xc_info))
#else
xcpot_vxc_is_gga=.false.
xcpot_vx_is_gga=.false.
#endif
END FUNCTION xcpot_vxc_is_gga
END FUNCTION xcpot_vx_is_gga
LOGICAL FUNCTION xcpot_exc_is_gga(xcpot)
IMPLICIT NONE
......
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