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
35 use mpi_oct_m
38 use space_oct_m
40 use xc_f03_lib_m
44
45 implicit none
46
47 private
48 public :: xc_get_nc_vxc
49
50contains
51
52#include "xc_vxc_nc_inc.F90"
53
54 subroutine copy_global_to_local(global, local, n_block, nspin, ip)
55 real(real64), intent(in) :: global(:,:)
56 real(real64), intent(out) :: local(:,:)
57 integer, intent(in) :: n_block
58 integer, intent(in) :: nspin
59 integer, intent(in) :: ip
60
61 integer :: ib, is
62
63 push_sub(copy_global_to_local)
64
65 do is = 1, nspin
66 !$omp parallel do
67 do ib = 1, n_block
68 local(is, ib) = global(ib + ip - 1, is)
69 end do
70 end do
71
73 end subroutine copy_global_to_local
74
75 subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
76 real(real64), intent(in) :: local(:,:)
77 real(real64), intent(inout) :: global(:,:)
78 integer, intent(in) :: n_block
79 integer, intent(in) :: spin_channels
80 integer, intent(in) :: ip
81
82 integer :: ib, is
83
85
86 do is = 1, spin_channels
87 !$omp parallel do
88 do ib = 1, n_block
89 global(ib + ip - 1, is) = global(ib + ip - 1, is) + local(is, ib)
90 end do
91 end do
92
94 end subroutine copy_local_to_global
95
96 subroutine xc_release_internal_quantities(quantities)
97 type(internal_quantities_t), intent(inout) :: quantities
98
100
101 nullify(quantities%rho)
102 safe_deallocate_a(quantities%dens)
103 safe_deallocate_a(quantities%gdens)
104 safe_deallocate_a(quantities%ldens)
105 safe_deallocate_a(quantities%tau)
106
108 end subroutine xc_release_internal_quantities
109
110end 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:120
pure logical function, public family_is_mgga(family, only_collinear)
Is the xc function part of the mGGA family.
Definition: xc.F90:715
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:734
pure logical function, public family_is_nc_mgga(family)
Definition: xc.F90:726