1+ ! GauXC Copyright (c) 2020-2024, The Regents of the University of California,
2+ ! through Lawrence Berkeley National Laboratory (subject to receipt of
3+ ! any required approvals from the U.S. Dept. of Energy).
4+ !
5+ ! (c) 2024-2025, Microsoft Corporation
6+ !
7+ ! All rights reserved.
8+ !
9+ ! See LICENSE.txt for details
10+
11+ ! > @brief Module defining basis set functionality for GauXC
12+ module gauxc_basisset
13+ use iso_c_binding, only : c_ptr, c_null_ptr, c_size_t
14+ use gauxc_status, only : gauxc_status_type
15+ use gauxc_types, only : gauxc_header_type, gauxc_type_basisset
16+ use gauxc_shell, only : gauxc_shell_type
17+ implicit none
18+ private
19+
20+ public :: &
21+ & gauxc_basisset_new, &
22+ & gauxc_basisset_new_from_shells, &
23+ & gauxc_basisset_delete
24+
25+ public :: &
26+ & gauxc_delete
27+
28+ ! > @brief C interoperable basis set type
29+ type, bind(c), public :: gauxc_basisset_type
30+ ! > Header containing type information
31+ type (gauxc_header_type) :: header = gauxc_header_type(gauxc_type_basisset)
32+ ! > Pointer to the internal basis set object
33+ type (c_ptr) :: ptr = c_null_ptr
34+ end type gauxc_basisset_type
35+
36+ interface
37+ ! > @brief Create new basis set object
38+ function gauxc_basisset_new (status ) result(basis) bind(c)
39+ import :: gauxc_basisset_type, gauxc_status_type
40+ implicit none
41+ ! > @param status Status of the operation
42+ type (gauxc_status_type), intent (out ) :: status
43+ ! > @return Pointer to the newly created basis set object
44+ type (gauxc_basisset_type) :: basis
45+ end function gauxc_basisset_new
46+
47+ ! > @brief Create a new BasisSet instance from an array of Shells
48+ function gauxc_basisset_new_from_shells (status , shells , nshells ) result(basis) bind(c)
49+ import :: c_size_t, gauxc_status_type, gauxc_shell_type, gauxc_basisset_type
50+ implicit none
51+ ! > @param status Status of the operation
52+ type (gauxc_status_type), intent (out ) :: status
53+ ! > @param shells Pointer to an array of Shell objects
54+ type (gauxc_shell_type), intent (in ) :: shells(* )
55+ ! > @param nshells Number of shells in the array
56+ integer (c_size_t), value :: nshells
57+ ! > @return Pointer to the newly created basis set object
58+ type (gauxc_basisset_type) :: basis
59+ end function gauxc_basisset_new_from_shells
60+ end interface
61+
62+ interface gauxc_delete
63+ ! > @brief Delete a GauXC basis set object
64+ subroutine gauxc_basisset_delete (status , basis ) bind(c)
65+ import :: gauxc_status_type, gauxc_basisset_type
66+ implicit none
67+ ! > @param status Status of the operation
68+ type (gauxc_status_type), intent (out ) :: status
69+ ! > @param basis Pointer to the basis set object to delete
70+ type (gauxc_basisset_type), intent (inout ) :: basis
71+ end subroutine gauxc_basisset_delete
72+ end interface gauxc_delete
73+
74+ contains
75+
76+ end module gauxc_basisset
0 commit comments