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