Octopus
augmentation.F90
Go to the documentation of this file.
1!! Copyright (C) 2026 N. Tancogne-Dejean
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
22 use debug_oct_m
23 use global_oct_m
27
28 implicit none
29
30 private
31
32 public :: &
37
43 ! Components are public by default.
44 real(real64), allocatable :: dij(:, :, :)
45 type(paw_sphere_t), allocatable :: paw
47
53 ! Components are public by default.
55 logical :: owns_species_data = .true.
56 real(real64), pointer :: dij(:, :, :) => null()
57 real(real64), allocatable :: qij(:, :, :)
58 real(real64), allocatable :: qfunc(:, :, :)
59 integer :: qfunc_lmax = -1
60 integer :: qfunc_nbeta = 0
66 real(real64), allocatable :: qflm(:, :)
67 integer, allocatable :: qflm_map(:, :)
68 integer :: qflm_ncombo = 0
73 real(real64), allocatable :: jbasis(:, :, :)
74 integer :: jbasis_nprojs = 0
78 type(paw_sphere_t), pointer :: paw => null()
79 contains
80 procedure :: is_allocated => augmentation_is_allocated
81 end type augmentation_t
82
83contains
84
85 !---------------------------------------------------------
87 logical elemental function augmentation_is_allocated(this)
88 class(augmentation_t), intent(in) :: this
89 augmentation_is_allocated = allocated(this%qflm)
90 end function augmentation_is_allocated
91
92 !---------------------------------------------------------
93 subroutine augmentation_end(this)
94 type(augmentation_t), intent(inout) :: this
95
96 push_sub(augmentation_end)
97
98 if (this%owns_species_data) then
99 safe_deallocate_p(this%dij)
100 if (associated(this%paw)) then
101 call paw_onsite_end(this%paw)
102 deallocate(this%paw)
103 end if
104 end if
105 nullify(this%dij)
106 nullify(this%paw)
107 this%owns_species_data = .true.
108 safe_deallocate_a(this%qij)
109 safe_deallocate_a(this%qfunc)
110 safe_deallocate_a(this%qflm)
111 safe_deallocate_a(this%qflm_map)
112 safe_deallocate_a(this%jbasis)
113 this%jbasis_nprojs = 0
114 this%qfunc_lmax = -1
115 this%qfunc_nbeta = 0
116 this%qflm_ncombo = 0
118 pop_sub(augmentation_end)
119 end subroutine augmentation_end
120
121 !---------------------------------------------------------
123 subroutine augmentation_species_end(this)
124 type(augmentation_species_t), intent(inout) :: this
125
128 safe_deallocate_a(this%dij)
129 if (allocated(this%paw)) then
130 call paw_onsite_end(this%paw)
131 deallocate(this%paw)
132 end if
133
135 end subroutine augmentation_species_end
136
137end module augmentation_oct_m
139!! Local Variables:
140!! mode: f90
141!! coding: utf-8
142!! End:
logical elemental function augmentation_is_allocated(this)
Whether the augmentation data has been built (combined Q^L Y_LM columns present).
subroutine, public augmentation_end(this)
subroutine, public augmentation_species_end(this)
Free one entry of the shared per-species augmentation store.
PAW radial engine.
Definition: paw_onsite.F90:131
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
Definition: profiling.F90:122
Shared per-species augmentation data, aliased by every projector (atom) of the species.
Geometry-independent augmentation data of a pseudopotential.
int true(void)