(git:08825b9)
Loading...
Searching...
No Matches
integral_library_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2026 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Library choices for electronic integral APIs.
10! **************************************************************************************************
13 USE kinds, ONLY: default_path_length,&
14 dp
15
16 IMPLICIT NONE
17
18 PRIVATE
19
20 INTEGER, PARAMETER, PUBLIC :: library_native = 0, &
22
23#if defined(__LIBINT)
24 INTEGER, PARAMETER, PUBLIC :: default_coulomb_library = library_libint
25 LOGICAL, PARAMETER :: libint_available = .true.
26#else
27 INTEGER, PARAMETER, PUBLIC :: default_coulomb_library = library_native
28 LOGICAL, PARAMETER :: libint_available = .false.
29#endif
30
31 TYPE, PUBLIC :: integral_library_type
32 INTEGER :: coulomb2_library = default_coulomb_library
33 INTEGER :: coulomb3_library = default_coulomb_library
35
36 TYPE, PUBLIC :: coulomb_operator_type
37 INTEGER :: potential_type = do_potential_coulomb
38 REAL(dp) :: omega = 0.0_dp ! SR: erfc(omega*r)/r
39 REAL(dp) :: cutoff_radius = 0.0_dp ! TC cutoff/effective SR range
40 CHARACTER(default_path_length) :: filename = ""
41 REAL(dp) :: scale_coulomb = 0.0_dp ! Only for WFC methods
42 REAL(dp) :: scale_longrange = 0.0_dp ! Only for WFC methods
44
46
47 PUBLIC :: integral_library_init
48
49CONTAINS
50
51! **************************************************************************************************
52!> \brief Resolves requested Coulomb integral libraries against the compiled-in backends.
53!> \param coulomb2_library requested two-center Coulomb integral library
54!> \param coulomb3_library requested three-center Coulomb integral library
55!> \param fallback_applied whether an unavailable Libint request was replaced by the native backend
56! **************************************************************************************************
57 SUBROUTINE integral_library_init(coulomb2_library, coulomb3_library, fallback_applied)
58 INTEGER, INTENT(IN) :: coulomb2_library, coulomb3_library
59 LOGICAL, INTENT(OUT) :: fallback_applied
60
61 active_integral_library%coulomb2_library = coulomb2_library
62 active_integral_library%coulomb3_library = coulomb3_library
63 fallback_applied = .false.
64
65 IF (.NOT. libint_available) THEN
66 IF (active_integral_library%coulomb2_library == library_libint) THEN
68 fallback_applied = .true.
69 END IF
70 IF (active_integral_library%coulomb3_library == library_libint) THEN
72 fallback_applied = .true.
73 END IF
74 END IF
75
76 END SUBROUTINE integral_library_init
77
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public do_potential_coulomb
Library choices for electronic integral APIs.
subroutine, public integral_library_init(coulomb2_library, coulomb3_library, fallback_applied)
Resolves requested Coulomb integral libraries against the compiled-in backends.
type(integral_library_type), save, public active_integral_library
integer, parameter, public default_coulomb_library
integer, parameter, public library_native
integer, parameter, public library_libint
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_path_length
Definition kinds.F:58