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