Octopus
xc.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
21module xc_oct_m
22 use comm_oct_m
23 use debug_oct_m
28 use global_oct_m
29 use grid_oct_m
30 use io_oct_m
32 use iso_c_binding
33 use, intrinsic :: iso_fortran_env
38 use math_oct_m
39 use mesh_oct_m
42 use mpi_oct_m
44 use parser_oct_m
47 use space_oct_m
51 use xc_cam_oct_m
52 use xc_f03_lib_m
53#ifdef HAVE_LIBXC_FUNCS
54 use xc_f03_funcs_m
55#endif
56 use xc_fbe_oct_m
59
60 implicit none
61
62 private
63 public :: &
64 xc_t, &
65 xc_init, &
66 xc_end, &
68 xc_get_vxc, &
70 xc_get_fxc, &
71 xc_get_kxc, &
79
80 ! A Structure that contains the quantities needed to compute the functionals
82 real(real64), pointer :: rho(:,:) ! A pointer to the full density
83
84 real(real64), allocatable :: dens(:,:) ! Density (in the local frame of the magnetization)
85 real(real64), allocatable :: gdens(:,:,:) ! Gradient of the density
86 real(real64), allocatable :: ldens(:,:) ! Laplacian of the density
87 real(real64), allocatable :: tau(:,:) ! Kinetic energy density
89
90
91 type xc_t
92 private
93 integer, public :: family
94 integer, public :: flags
95 integer, public :: kernel_family
96 type(xc_functional_t), public :: functional(2,2)
98
99 type(xc_functional_t), public :: kernel(2,2)
100 real(real64), public :: kernel_lrc_alpha
101 type(xc_cam_t), public :: cam
102
103 logical :: use_gi_ked
104 integer :: xc_density_correction
105 logical :: xcd_optimize_cutoff
106 real(real64) :: xcd_ncutoff
107 logical :: xcd_minimum
108 logical :: xcd_normalize
109 logical :: parallel
110
111 type(internal_quantities_t) :: quantities
112 end type xc_t
113
114 ! TODO(Alex) Relocate this
115 real(real64), parameter :: tiny = 1.0e-12_real64
116
117 integer, parameter :: &
118 LR_NONE = 0, &
119 lr_x = 1
120
121contains
122
123 ! ---------------------------------------------------------
124 subroutine xc_write_info(xcs, iunit, namespace)
125 type(xc_t), intent(in) :: xcs
126 integer, optional, intent(in) :: iunit
127 type(namespace_t), optional, intent(in) :: namespace
128
129 integer :: ifunc
130
131 push_sub(xc_write_info)
132
133 write(message(1), '(a)') "Exchange-correlation:"
134 call messages_info(1, iunit=iunit, namespace=namespace)
135
136 do ifunc = func_x, func_c
137 call xc_functional_write_info(xcs%functional(ifunc, 1), iunit, namespace)
138 end do
139
140 if (abs(xcs%cam%alpha + xcs%cam%beta) > m_epsilon) then
141 write(message(1), '(1x)')
142 write(message(2), '(a,f8.5)') "Exact exchange mixing = ", xcs%cam%alpha
143 write(message(3), '(a,f8.5)') "Exact exchange for short-range beta = ", xcs%cam%beta
144 write(message(4), '(a,f8.5)') "Exact exchange range-separate omega = ", xcs%cam%omega
145 call messages_info(4, iunit=iunit, namespace=namespace)
146 end if
147
148
149 pop_sub(xc_write_info)
150 end subroutine xc_write_info
151
152
153 ! ---------------------------------------------------------
154 subroutine xc_init(xcs, namespace, ndim, periodic_dim, nel, x_id, c_id, xk_id, ck_id, hartree_fock, ispin)
155 type(xc_t), intent(out) :: xcs
156 type(namespace_t), intent(in) :: namespace
157 integer, intent(in) :: ndim
158 integer, intent(in) :: periodic_dim
159 real(real64), intent(in) :: nel
160 integer, intent(in) :: x_id
161 integer, intent(in) :: c_id
162 integer, intent(in) :: xk_id
163 integer, intent(in) :: ck_id
164 logical, intent(in) :: hartree_fock
165 integer, intent(in) :: ispin
166
167 integer :: isp, xc_major, xc_minor, xc_micro
168 logical :: ll
169 type(block_t) :: blk
170 type(xc_cam_t) :: cam_ext
171
172 push_sub(xc_init)
173
174 call xc_f03_version(xc_major, xc_minor, xc_micro)
176 xcs%family = 0
177 xcs%flags = 0
178 xcs%kernel_family = 0
180 call parse()
181
182 !we also need XC functionals that do not depend on the current
183 !get both spin-polarized and unpolarized
185 ! TODO: check that nel should not be spin polarized here
186 do isp = 1, 2
188 call xc_functional_init(xcs%functional(func_x, isp), namespace, x_id, ndim, nel, isp)
189 call xc_functional_init(xcs%functional(func_c, isp), namespace, c_id, ndim, nel, isp)
190
191 call xc_functional_init(xcs%kernel(func_x, isp), namespace, xk_id, ndim, nel, isp)
192 call xc_functional_init(xcs%kernel(func_c, isp), namespace, ck_id, ndim, nel, isp)
194 end do
195
196 xcs%family = ior(xcs%family, xcs%functional(func_x,1)%family)
197 xcs%family = ior(xcs%family, xcs%functional(func_c,1)%family)
199 xcs%flags = ior(xcs%flags, xcs%functional(func_x,1)%flags)
200 xcs%flags = ior(xcs%flags, xcs%functional(func_c,1)%flags)
202 xcs%kernel_family = ior(xcs%kernel_family, xcs%kernel(func_x,1)%family)
203 xcs%kernel_family = ior(xcs%kernel_family, xcs%kernel(func_c,1)%family)
205
206 if (xc_is_not_size_consistent(xcs, namespace) .and. periodic_dim > 0) then
207 message(1) = "Cannot perform a periodic calculation with a functional"
208 message(2) = "that depends on the number of electrons."
209 call messages_fatal(2, namespace=namespace)
210 end if
211
212 ! Take care of hybrid functionals (they appear in the correlation functional)
213 xcs%cam = cam_null
214
215 ll = (hartree_fock) &
216 .or.(xcs%functional(func_x,1)%id == xc_oep_x) &
218 if (ll) then
219 if ((xcs%functional(func_x,1)%id /= 0).and.(xcs%functional(func_x,1)%id /= xc_oep_x)) then
220 message(1) = "You cannot use an exchange functional when performing"
221 message(2) = "a Hartree-Fock calculation or using a hybrid functional."
222 call messages_fatal(2, namespace=namespace)
223 end if
224
225 if (periodic_dim == ndim) then
226 call messages_experimental("Fock operator (Hartree-Fock, OEP, hybrids) in fully periodic systems", namespace=namespace)
227 end if
228
229 ! get the mixing coefficient for hybrids
230 if (family_is_hybrid(xcs)) then
231 if( .not. cam_ext%is_null() ) call set_hybrid_params(xcs, namespace, cam_ext)
232 call xc_f03_hyb_cam_coef(xcs%functional(func_c,1)%conf, xcs%cam%omega, &
233 xcs%cam%alpha, xcs%cam%beta)
234 call xc_f03_hyb_cam_coef(xcs%functional(func_c,2)%conf, xcs%cam%omega, &
235 xcs%cam%alpha, xcs%cam%beta)
236 else
237 ! we are doing Hartree-Fock plus possibly a correlation functional
238 xcs%cam = cam_exact_exchange
239 end if
240
241 ! reset certain variables
242 xcs%functional(func_x,1)%family = xc_family_oep
243 xcs%functional(func_x,1)%id = xc_oep_x
244 xcs%functional(func_x,2)%family = xc_family_oep
245 xcs%functional(func_x,2)%id = xc_oep_x
246 if (.not. hartree_fock) then
247 xcs%family = ior(xcs%family, xc_family_oep)
248 end if
249 end if
250
251 if (in_family(xcs%family, [xc_family_lca])) then
252 call messages_not_implemented("LCA current functionals", namespace) ! not even in libxc!
253 end if
254
255 call messages_obsolete_variable(namespace, 'MGGAimplementation')
256 call messages_obsolete_variable(namespace, 'CurrentInTau', 'XCUseGaugeIndependentKED')
257
258 if (xcs%functional(func_x, 1)%id == xc_mgga_x_tb09 .and. periodic_dim /= 3) then
259 message(1) = "mgga_x_tb09 functional can only be used for 3D periodic systems"
260 call messages_fatal(1, namespace=namespace)
261 end if
262
263 if (family_is_mgga(xcs%family) .or. family_is_nc_mgga(xcs%family)) then
264 !%Variable XCUseGaugeIndependentKED
265 !%Type logical
266 !%Default yes
267 !%Section Hamiltonian::XC
268 !%Description
269 !% If true, when evaluating the XC functional, a term including the (paramagnetic or total) current
270 !% is added to the kinetic-energy density such as to make it gauge-independent.
271 !% Applies only to meta-GGA (and hybrid meta-GGA) functionals.
272 !%End
273 call parse_variable(namespace, 'XCUseGaugeIndependentKED', .true., xcs%use_gi_ked)
274 end if
275
276 pop_sub(xc_init)
277
278 contains
279
280 subroutine parse()
281
282 push_sub(xc_init.parse)
283
284 ! the values of x_id, c_id, xk_id, and c_id are read outside the routine
285
286 !%Variable XCKernelLRCAlpha
287 !%Type float
288 !%Default 0.0
289 !%Section Hamiltonian::XC
290 !%Description
291 !% Set to a non-zero value to add a long-range correction for solids to the kernel.
292 !% This is the <math>\alpha</math> parameter defined in S. Botti <i>et al.</i>, <i>Phys. Rev. B</i>
293 !% 69, 155112 (2004). The <math>\Gamma = \Gamma` = 0</math> term <math>-\alpha/q^2</math> is taken
294 !% into account by introducing an additional pole to the polarizability (see R. Stubner
295 !% <i>et al.</i>, <i>Phys. Rev. B</i> 70, 245119 (2004)). The rest of the terms are included by
296 !% multiplying the Hartree term by <math>1 - \alpha / 4 \pi</math>. The use of non-zero
297 !% <math>\alpha</math> in combination with <tt>HamiltonianVariation</tt> = <tt>V_ext_only</tt>
298 !% corresponds to account of only the <math>\Gamma = \Gamma` = 0</math> term.
299 !% Applicable only to isotropic systems. (Experimental)
300 !%End
301
302 call parse_variable(namespace, 'XCKernelLRCAlpha', m_zero, xcs%kernel_lrc_alpha)
303 if (abs(xcs%kernel_lrc_alpha) > m_epsilon) then
304 call messages_experimental("Long-range correction to kernel", namespace=namespace)
305 end if
306
307 !%Variable XCDensityCorrection
308 !%Type integer
309 !%Default none
310 !%Section Hamiltonian::XC::DensityCorrection
311 !%Description
312 !% This variable controls the long-range correction of the XC
313 !% potential using the <a href=http://arxiv.org/abs/1107.4339>XC density representation</a>.
314 !%Option none 0
315 !% No correction is applied.
316 !%Option long_range_x 1
317 !% The correction is applied to the exchange potential.
318 !%End
319 call parse_variable(namespace, 'XCDensityCorrection', lr_none, xcs%xc_density_correction)
320
321 if (xcs%xc_density_correction /= lr_none) then
322 call messages_experimental('XC density correction', namespace=namespace)
323
324 if(ispin /= unpolarized) then
325 call messages_not_implemented('XCDensityCorrection with SpinComponents /= unpolarized', namespace)
326 end if
327
328 !%Variable XCDensityCorrectionOptimize
329 !%Type logical
330 !%Default true
331 !%Section Hamiltonian::XC::DensityCorrection
332 !%Description
333 !% When enabled, the density cutoff will be
334 !% optimized to replicate the boundary conditions of the exact
335 !% XC potential. If the variable is set to no, the value of
336 !% the cutoff must be given by the <tt>XCDensityCorrectionCutoff</tt>
337 !% variable.
338 !%End
339 call parse_variable(namespace, 'XCDensityCorrectionOptimize', .true., xcs%xcd_optimize_cutoff)
340
341 !%Variable XCDensityCorrectionCutoff
342 !%Type float
343 !%Default 0.0
344 !%Section Hamiltonian::XC::DensityCorrection
345 !%Description
346 !% The value of the cutoff applied to the XC density.
347 !%End
348 call parse_variable(namespace, 'XCDensityCorrectionCutoff', m_zero, xcs%xcd_ncutoff)
349
350 !%Variable XCDensityCorrectionMinimum
351 !%Type logical
352 !%Default true
353 !%Section Hamiltonian::XC::DensityCorrection
354 !%Description
355 !% When enabled, the cutoff optimization will
356 !% return the first minimum of the <math>q_{xc}</math> function if it does
357 !% not find a value of -1 (<a href=http://arxiv.org/abs/1107.4339>details</a>).
358 !% This is required for atoms or small
359 !% molecules, but may cause numerical problems.
360 !%End
361 call parse_variable(namespace, 'XCDensityCorrectionMinimum', .true., xcs%xcd_minimum)
362
363 !%Variable XCDensityCorrectionNormalize
364 !%Type logical
365 !%Default true
366 !%Section Hamiltonian::XC::DensityCorrection
367 !%Description
368 !% When enabled, the correction will be
369 !% normalized to reproduce the exact boundary conditions of
370 !% the XC potential.
371 !%End
372 call parse_variable(namespace, 'XCDensityCorrectionNormalize', .true., xcs%xcd_normalize)
374 end if
375
376 !%Variable ParallelXC
377 !%Type logical
378 !%Default true
379 !%Section Execution::Parallelization
380 !%Description
381 !% When enabled, additional parallelization
382 !% will be used for the calculation of the XC functional.
383 !%End
384 call messages_obsolete_variable(namespace, 'XCParallel', 'ParallelXC')
385 call parse_variable(namespace, 'ParallelXC', .true., xcs%parallel)
386
387
388 !%Variable HybridCAMParameters
389 !%Type block
390 !%Section Hamiltonian::XC
391 !%Description
392 !% This variable specifies the <math>\alpha, \beta, \omega<math> for CAM-type
393 !% hybrid functionals. Defaults are zero.
394 !%End
395 cam_ext = cam_null
396
397 if(parse_block(namespace, 'HybridCamParameters', blk) == 0) then
398 call parse_block_float(blk, 0, 0, cam_ext%alpha)
399 call parse_block_float(blk, 0, 1, cam_ext%beta)
400 call parse_block_float(blk, 0, 2, cam_ext%omega)
401 call parse_block_end(blk)
402 end if
403
404 if(.not. cam_ext%is_null()) then
405 call cam_ext%print(namespace, msg="Info: Setting external CAM parameters")
406 endif
407
408 pop_sub(xc_init.parse)
409 end subroutine parse
410
411 end subroutine xc_init
412
413
414 ! ---------------------------------------------------------
415 subroutine xc_end(xcs)
416 type(xc_t), intent(inout) :: xcs
417
418 integer :: isp
419
420 push_sub(xc_end)
421
422 do isp = 1, 2
423 call xc_functional_end(xcs%functional(func_x, isp))
424 call xc_functional_end(xcs%functional(func_c, isp))
425 call xc_functional_end(xcs%kernel(func_x, isp))
426 call xc_functional_end(xcs%kernel(func_c, isp))
427 end do
428 xcs%family = 0
429 xcs%flags = 0
430
431 pop_sub(xc_end)
432 end subroutine xc_end
433
434 ! ---------------------------------------------------------
439 logical pure function xc_is_orbital_dependent(xcs)
440 type(xc_t), intent(in) :: xcs
441
442 xc_is_orbital_dependent = family_is_hybrid(xcs) .or. &
443 in_family(xcs%functional(func_x,1)%family, [xc_family_oep]) .or. &
444 in_family(xcs%family, [xc_family_mgga, xc_family_nc_mgga])
445
446 end function xc_is_orbital_dependent
447
448 ! ---------------------------------------------------------
450 pure logical function family_is_gga(family, only_collinear)
451 integer, intent(in) :: family
452 logical, optional, intent(in) :: only_collinear
453
454 if(optional_default(only_collinear, .false.)) then
455 family_is_gga = in_family(family, [xc_family_gga, xc_family_hyb_gga, &
456 xc_family_mgga, xc_family_hyb_mgga, xc_family_libvdwxc])
457 else
458 family_is_gga = in_family(family, [xc_family_gga, xc_family_hyb_gga, &
459 xc_family_mgga, xc_family_hyb_mgga, xc_family_libvdwxc, xc_family_nc_mgga])
460 end if
461 end function family_is_gga
462
463 !----------------------------------------------------------------------
468 pure logical function family_is_supported(family)
469 integer, intent(in) :: family
470
471 family_is_supported = in_family(family, [xc_family_lda, xc_family_hyb_lda, xc_family_gga, xc_family_hyb_gga, &
472 xc_family_mgga, xc_family_hyb_mgga, xc_family_libvdwxc])
473 end function family_is_supported
474
475 ! ---------------------------------------------------------
477 pure logical function family_is_mgga(family, only_collinear)
478 integer, optional, intent(in) :: family
479 logical, optional, intent(in) :: only_collinear
480
481 if(optional_default(only_collinear, .false.)) then
482 family_is_mgga = in_family(family, [xc_family_mgga, xc_family_hyb_mgga])
483 else
484 family_is_mgga = in_family(family, [xc_family_mgga, xc_family_hyb_mgga, xc_family_nc_mgga])
485 end if
486 end function family_is_mgga
487
488 ! ---------------------------------------------------------
490 logical pure function family_is_mgga_with_exc(xcs)
491 type(xc_t), intent(in) :: xcs
492
493 integer :: ixc
494
496 do ixc = 1, 2
497 if (in_family(xcs%functional(ixc, 1)%family, [xc_family_mgga, xc_family_hyb_mgga, xc_family_nc_mgga]) &
498 .and. xc_functional_is_energy_functional(xcs%functional(ixc, 1))) then
500 end if
501 end do
502 end function family_is_mgga_with_exc
503
505 logical pure function family_is_hybrid(xcs)
506 type(xc_t), intent(in) :: xcs
507
508 integer :: ixc
509
510 family_is_hybrid = .false.
511 do ixc = 1, 2
512 if (in_family(xcs%functional(ixc, 1)%family, [xc_family_hyb_lda, xc_family_hyb_gga, xc_family_hyb_mgga])) then
514 end if
515 end do
516 end function family_is_hybrid
517
518 pure logical function in_family(family, xc_families)
519 integer, intent(in) :: family
520 integer, intent(in) :: xc_families(:)
521
522 in_family = bitand(family, sum(xc_families)) /= 0
523 end function in_family
524
525 ! ---------------------------------------------------------
527 subroutine copy_global_to_local(global, local, n_block, nspin, ip)
528 real(real64), intent(in) :: global(:,:)
529 real(real64), intent(out) :: local(:,:)
530 integer, intent(in) :: n_block
531 integer, intent(in) :: nspin
532 integer, intent(in) :: ip
533
534 integer :: ib, is
535
536 push_sub(copy_global_to_local)
537
538 do is = 1, nspin
539 !$omp parallel do
540 do ib = 1, n_block
541 local(is, ib) = global(ib + ip - 1, is)
542 end do
543 end do
544
545 pop_sub(copy_global_to_local)
546 end subroutine copy_global_to_local
547
548 ! ---------------------------------------------------------
549 subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
550 real(real64), intent(in) :: local(:,:)
551 real(real64), intent(inout) :: global(:,:)
552 integer, intent(in) :: n_block
553 integer, intent(in) :: spin_channels
554 integer, intent(in) :: ip
555
556 integer :: ib, is
557
559
560 do is = 1, spin_channels
561 !$omp parallel do
562 do ib = 1, n_block
563 global(ib + ip - 1, is) = global(ib + ip - 1, is) + local(is, ib)
564 end do
565 end do
566
568 end subroutine copy_local_to_global
569
570 ! ---------------------------------------------------------
572 subroutine set_hybrid_params(xcs, namespace, cam_ext)
573 type(xc_t), intent(inout) :: xcs
574 type(namespace_t), intent(in) :: namespace
575 type(xc_cam_t), intent(in) :: cam_ext
576
577 real(real64), parameter :: default_alpha_pbe0 = 0.25_real64
578 real(real64) :: parameters(3)
579
580 push_sub(set_hybrid_params)
581
582 ! LibXC expects an array of reals, ordered [alpha, beta, omega]
583 parameters = cam_ext%as_array()
584 xcs%cam%alpha = parameters(1)
585
586 select case(xcs%functional(func_c, 1)%id)
587
588 case(xc_hyb_gga_xc_pbeh, xc_hyb_lda_xc_lda0) ! original PBE0/LDA0 in libxc
589 if(parameters(1) < m_zero) parameters(1) = default_alpha_pbe0
590 call xc_f03_func_set_ext_params(xcs%functional(func_c, 1)%conf, parameters)
591 call xc_f03_func_set_ext_params(xcs%functional(func_c, 2)%conf, parameters)
592 write(message(1), '(a,f6.3,a)') 'Info: Setting mixing parameter (' , parameters(1) ,').'
593 call messages_info(1)
594
595 case(xc_hyb_gga_xc_cam_pbeh, xc_hyb_lda_xc_cam_lda0)
596 xcs%cam%beta = parameters(2)
597 xcs%cam%omega = parameters(3)
598 ! check parameters
599 call xc_f03_hyb_cam_coef(xcs%functional(func_c,1)%conf, xcs%cam%omega, &
600 xcs%cam%alpha, xcs%cam%beta)
601 call xc_f03_hyb_cam_coef(xcs%functional(func_c,2)%conf, xcs%cam%omega, &
602 xcs%cam%alpha, xcs%cam%beta)
603 call xcs%cam%print(namespace, msg="Setting CAM parameters:")
604
605 case default
606 assert(.false.)
607
608 end select
609
610 pop_sub(set_hybrid_params)
611 end subroutine set_hybrid_params
612
613 ! ---------------------------------------------------------
615 logical function xc_is_not_size_consistent(xcs, namespace)
616 type(xc_t), intent(in) :: xcs
617 type(namespace_t), intent(in) :: namespace
618
619 xc_is_not_size_consistent = xc_functional_is_not_size_consistent(xcs%functional(func_x,1), namespace) &
620 .or. xc_functional_is_not_size_consistent(xcs%functional(func_c,1), namespace)
621 end function xc_is_not_size_consistent
622
623 ! ---------------------------------------------------------
625 logical pure function xc_is_energy_functional(xcs)
626 type(xc_t), intent(in) :: xcs
627 xc_is_energy_functional = xc_functional_is_energy_functional(xcs%functional(func_x,1)) &
628 .or. xc_functional_is_energy_functional(xcs%functional(func_c,1))
629 end function xc_is_energy_functional
630
631#include "xc_vxc_inc.F90"
632#include "xc_fxc_inc.F90"
633#include "xc_kxc_inc.F90"
634
635#include "xc_vxc_nc_inc.F90"
636
637end module xc_oct_m
638
639
640!! Local Variables:
641!! mode: f90
642!! coding: utf-8
643!! End:
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
integer, parameter, public unpolarized
Parameters...
real(real64), parameter, public m_zero
Definition: global.F90:188
real(real64), parameter, public m_epsilon
Definition: global.F90:204
This module implements the underlying real-space grid.
Definition: grid.F90:117
Definition: io.F90:114
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:115
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:118
subroutine, public messages_not_implemented(feature, namespace)
Definition: messages.F90:1113
character(len=512), private msg
Definition: messages.F90:165
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:1045
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:160
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:414
subroutine, public messages_experimental(name, namespace)
Definition: messages.F90:1085
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:616
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:618
This module handles spin dimensions of the states and the k-point distribution.
This module defines the unit system, used for input and output.
type(xc_cam_t), parameter, public cam_null
All CAM parameters set to zero.
Definition: xc_cam.F90:150
type(xc_cam_t), parameter, public cam_exact_exchange
Use only Hartree Fock exact exchange.
Definition: xc_cam.F90:153
subroutine, public xc_functional_write_info(functl, iunit, namespace)
Write functional information.
subroutine, public xc_functional_init(functl, namespace, id, ndim, nel, spin_channels)
integer, parameter, public xc_family_nc_mgga
integer, parameter, public xc_oep_x
Exact exchange.
subroutine, public xc_functional_end(functl)
integer, parameter, public func_c
integer, parameter, public func_x
Definition: xc.F90:114
subroutine, public xc_write_info(xcs, iunit, namespace)
Definition: xc.F90:218
subroutine xc_compute_vxc(der, xcs, st, psolver, namespace, space, quantities, ispin, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc)
Definition: xc.F90:970
subroutine, public xc_init(xcs, namespace, ndim, periodic_dim, nel, x_id, c_id, xk_id, ck_id, hartree_fock, ispin)
Definition: xc.F90:248
subroutine, public xc_get_kxc(xcs, mesh, namespace, rho, ispin, kxc)
Definition: xc.F90:2317
pure logical function family_is_supported(family)
Is the xc family internally supported by Octopus.
Definition: xc.F90:562
pure logical function, public family_is_mgga(family, only_collinear)
Is the xc function part of the mGGA family.
Definition: xc.F90:571
subroutine set_hybrid_params(xcs, namespace, cam_ext)
Sets external parameters for some hybrid functionals.
Definition: xc.F90:666
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:584
integer, parameter lr_x
Definition: xc.F90:210
subroutine, public xc_end(xcs)
Definition: xc.F90:509
logical pure function, public xc_is_energy_functional(xcs)
Is one of the x or c functional is not an energy functional.
Definition: xc.F90:719
subroutine, public xc_get_vxc(gr, xcs, st, kpoints, psolver, namespace, space, rho, ispin, rcell_volume, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc, force_orbitalfree)
Definition: xc.F90:745
logical pure function, public family_is_hybrid(xcs)
Returns true if the functional is an hybrid functional.
Definition: xc.F90:599
logical function, public xc_is_not_size_consistent(xcs, namespace)
Is one of the x or c functional is not size consistent.
Definition: xc.F90:709
subroutine copy_local_to_global(local, global, n_block, spin_channels, ip)
Definition: xc.F90:643
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...
Definition: xc.F90:2503
pure logical function family_is_nc_mgga(family)
Returns true is the functional is a noncollinear functional.
Definition: xc.F90:3076
subroutine, public xc_get_fxc(xcs, gr, namespace, rho, ispin, fxc, fxc_grad, fxc_grad_spin)
Returns the exchange-correlation kernel.
Definition: xc.F90:1975
pure logical function family_is_gga(family, only_collinear)
Is the xc function part of the GGA family.
Definition: xc.F90:544
pure logical function, public in_family(family, xc_families)
Definition: xc.F90:612
subroutine copy_global_to_local(global, local, n_block, nspin, ip)
make a local copy with the correct memory order for libxc
Definition: xc.F90:621
logical pure function, public xc_is_orbital_dependent(xcs)
Is the xc family orbital dependent.
Definition: xc.F90:533
int true(void)
subroutine parse()
Definition: xc.F90:374