Octopus
xc_noncollinear.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
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 comm_oct_m
23 use debug_oct_m
27 use global_oct_m
28 use grid_oct_m
29 use iso_c_binding
30 use, intrinsic :: iso_fortran_env
33 use math_oct_m
37 use space_oct_m
39 use xc_f03_lib_m
43
44 implicit none
45
46 private
47 public :: xc_get_nc_vxc
48
49contains
50
51#include "xc_vxc_nc_inc.F90"
52
53 subroutine copy_global_to_local(global, local, n_block, nspin, ip)
54 real(real64), intent(in) :: global(:,:)
55 real(real64), intent(out) :: local(:,:)
56 integer, intent(in) :: n_block
57 integer, intent(in) :: nspin
58 integer, intent(in) :: ip
59
60 integer :: ib, is
61
62 push_sub(copy_global_to_local)
63
64 do is = 1, nspin
65 !$omp parallel do
66 do ib = 1, n_block
67 local(is, ib) = global(ib + ip - 1, is)
68 end do
69 end do
70
72 end subroutine copy_global_to_local
73
74 subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
75 real(real64), intent(in) :: local(:,:)
76 real(real64), intent(inout) :: global(:,:)
77 integer, intent(in) :: n_block
78 integer, intent(in) :: spin_channels
79 integer, intent(in) :: ip
80
81 integer :: ib, is
82
84
85 do is = 1, spin_channels
86 !$omp parallel do
87 do ib = 1, n_block
88 global(ib + ip - 1, is) = global(ib + ip - 1, is) + local(is, ib)
89 end do
90 end do
91
93 end subroutine copy_local_to_global
94
95 subroutine xc_release_internal_quantities(quantities)
96 type(internal_quantities_t), intent(inout) :: quantities
97
99
100 nullify(quantities%rho)
101 safe_deallocate_a(quantities%dens)
102 safe_deallocate_a(quantities%gdens)
103 safe_deallocate_a(quantities%ldens)
104 safe_deallocate_a(quantities%tau)
105
107 end subroutine xc_release_internal_quantities
108
109end module xc_noncollinear_oct_m
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
This module implements the underlying real-space grid.
Definition: grid.F90:119
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:117
subroutine xc_compute_vxc_nc(gr, xcs, st, namespace, quantities, vxc, ex, ec, vtau, ex_density, ec_density)
This routines is similar to xc_update_internal_quantities but for noncollinear functionals,...
subroutine, public xc_get_nc_vxc(gr, xcs, st, kpoints, space, namespace, rho, vxc, ex, ec, vtau, ex_density, ec_density)
This routines is similar to xc_get_vxc but for noncollinear functionals, which are not implemented in...
subroutine xc_release_internal_quantities(quantities)
subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
subroutine copy_global_to_local(global, local, n_block, nspin, ip)
Definition: xc.F90:116
pure logical function, public family_is_mgga(family, only_collinear)
Is the xc function part of the mGGA family.
Definition: xc.F90:580
logical pure function, public family_is_mgga_with_exc(xcs)
Is the xc function part of the mGGA family with an energy functional.
Definition: xc.F90:599
pure logical function, public family_is_nc_mgga(family)
Definition: xc.F90:591