Commit f5e8a67b authored by Matthias Redies's avatar Matthias Redies

add XC info to usage.json

parent f76c451c
......@@ -2133,8 +2133,44 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
CALL xcpot%init(jspins,id_x,id_c)
END SELECT
CALL set_xcpot_usage(xcpot)
END SUBROUTINE setXCParameters
SUBROUTINE set_xcpot_usage(xcpot)
use m_judft_usage
USE m_types
USE m_types_xcpot_inbuild
USE m_types_xcpot_libxc
implicit none
class(t_xcpot), intent(in) :: xcpot
! give some information about XC functional to usage.json
! 1 -> LDA
! 2 -> GGA
! 3 -> MetaGGA
! 4 -> Hybrid functional
if(xcpot%is_lda()) then
call add_usage_data("XC-treatment", 1)
return
endif
if(xcpot%is_MetaGGA()) then
call add_usage_data("XC-treatment", 3)
return
endif
if(xcpot%is_GGA()) then
call add_usage_data("XC-treatment", 2)
return
endif
if(xcpot%is_hybrid()) then
call add_usage_data("XC-treatment", 4)
return
endif
END SUBROUTINE set_xcpot_usage
SUBROUTINE getIntegerSequenceFromString(string, sequence, count)
IMPLICIT NONE
......
......@@ -32,8 +32,8 @@ CONTAINS
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN):: key
INTEGER,intent(in) :: value
CHARACTER(len=20)::txt
WRITE(txt,*) VALUE
CALL add_usage_data_s(key,txt)
END SUBROUTINE add_usage_data_i
......
......@@ -19,6 +19,7 @@ MODULE m_types_xcpot
TYPE,ABSTRACT :: t_xcpot
REAL :: gmaxxc
CONTAINS
PROCEDURE :: is_lda=>xcpot_is_lda
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: is_MetaGGA=>xcpot_is_MetaGGA
PROCEDURE :: needs_grad=>xcpot_needs_grad
......@@ -47,6 +48,11 @@ MODULE m_types_xcpot
END TYPE t_gradients
CONTAINS
LOGICAL FUNCTION xcpot_is_lda(xcpot)
IMPLICIT NONE
CLASS(t_xcpot),INTENT(IN):: xcpot
xcpot_is_lda=.false.
END FUNCTION xcpot_is_lda
LOGICAL FUNCTION xcpot_is_gga(xcpot)
IMPLICIT NONE
......
......@@ -43,6 +43,7 @@ MODULE m_types_xcpot_inbuild
CONTAINS
!overloading t_xcpot:
PROCEDURE :: is_lda=>xcpot_is_lda
PROCEDURE :: is_gga=>xcpot_is_gga
PROCEDURE :: is_hybrid=>xcpot_is_hybrid
PROCEDURE :: get_exchange_weight=>xcpot_get_exchange_weight
......@@ -105,6 +106,12 @@ CONTAINS
xcpot%DATA%exchange_weight=xcpot%get_exchange_weight()
END SUBROUTINE xcpot_init
LOGICAL FUNCTION xcpot_is_lda(xcpot)
IMPLICIT NONE
CLASS(t_xcpot_inbuild),INTENT(IN):: xcpot
xcpot_is_lda = (.not. xcpot%is_gga()) .and. (.not. xcpot%is_hybrid())
END FUNCTION xcpot_is_lda
LOGICAL FUNCTION xcpot_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