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