(git:27c966b)
Loading...
Searching...
No Matches
gw_auto_ri_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 Input and persistent data for automatic RI basis optimization.
10!> \par History
11!> 09.2026 created [Jan Wilhelm]
12! **************************************************************************************************
14 USE base_hooks, ONLY: timeset,&
16 USE cp_fm_types, ONLY: cp_fm_release,&
18 USE kinds, ONLY: dp
19
20 IMPLICIT NONE
21 PRIVATE
22
23 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'gw_auto_ri_types'
24
26
28
29 ! Input parameters.
30 REAL(kind=dp) :: occ_energy_window = -1.0_dp
31 LOGICAL :: enabled = .false.
32 REAL(kind=dp) :: ri_ao_ratio = -1.0_dp
33
34 ! Two-center matrices M_pq and V_pq of optimized RI basis set
35 TYPE(cp_fm_type) :: v_pq = cp_fm_type()
36 TYPE(cp_fm_type) :: m_pq_inv = cp_fm_type()
37 LOGICAL :: ready = .false.
38 INTEGER, ALLOCATABLE :: sizes_opt_ri(:)
39 INTEGER, ALLOCATABLE :: sizes_ref_ri(:)
40 REAL(kind=dp), ALLOCATABLE :: u_pp_atom(:)
41 INTEGER, ALLOCATABLE :: u_pp_atom_offset(:)
42
43 END TYPE auto_ri_type
44
45CONTAINS
46
47! **************************************************************************************************
48!> \brief Releases all data owned by an optimized AUTO_RI basis.
49!> \param auto_ri AUTO_RI input and optimized-basis data
50! **************************************************************************************************
51 SUBROUTINE auto_ri_release(auto_ri)
52 TYPE(auto_ri_type), INTENT(INOUT) :: auto_ri
53
54 CHARACTER(LEN=*), PARAMETER :: routinen = 'auto_ri_release'
55
56 INTEGER :: handle
57
58 CALL timeset(routinen, handle)
59
60 IF (ALLOCATED(auto_ri%sizes_opt_RI)) DEALLOCATE (auto_ri%sizes_opt_RI)
61 IF (ALLOCATED(auto_ri%sizes_ref_RI)) DEALLOCATE (auto_ri%sizes_ref_RI)
62 IF (ALLOCATED(auto_ri%U_Pp_atom)) DEALLOCATE (auto_ri%U_Pp_atom)
63 IF (ALLOCATED(auto_ri%U_Pp_atom_offset)) DEALLOCATE (auto_ri%U_Pp_atom_offset)
64 CALL cp_fm_release(auto_ri%V_pq)
65 CALL cp_fm_release(auto_ri%M_pq_inv)
66 auto_ri%ready = .false.
67
68 CALL timestop(handle)
69
70 END SUBROUTINE auto_ri_release
71
72END MODULE gw_auto_ri_types
Central dispatch for basic hooks.
Definition base_hooks.F:12
subroutine, public timeset(routinen, handle)
Start timer.
Definition base_hooks.F:127
subroutine, public timestop(handle)
Stop timer.
Definition base_hooks.F:143
represent a full matrix distributed on many processors
Definition cp_fm_types.F:15
Input and persistent data for automatic RI basis optimization.
subroutine, public auto_ri_release(auto_ri)
Releases all data owned by an optimized AUTO_RI basis.
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
represent a full matrix