119 #include "../base/base_uses.f90"
125 LOGICAL,
PARAMETER :: debug_this_module = .false.
126 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xc_derivatives'
146 needs, max_deriv, print_warn)
147 TYPE(section_vals_type),
POINTER :: functional
148 LOGICAL,
INTENT(in) :: lsd
149 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
150 TYPE(xc_rho_cflags_type),
INTENT(inout),
OPTIONAL :: needs
151 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
152 LOGICAL,
INTENT(IN),
OPTIONAL :: print_warn
155 REAL(kind=
dp) :: r_param
157 cpassert(
ASSOCIATED(functional))
158 SELECT CASE (functional%section%name)
161 CALL b97_lsd_info(reference=reference, shortform=shortform, &
162 needs=needs, max_deriv=max_deriv, b97_params=functional)
164 CALL b97_lda_info(reference=reference, shortform=shortform, &
165 needs=needs, max_deriv=max_deriv, b97_params=functional)
167 CASE (
"BECKE88_LR_ADIABATIC")
170 needs=needs, max_deriv=max_deriv)
173 needs=needs, max_deriv=max_deriv)
175 CASE (
"LYP_ADIABATIC")
178 needs=needs, max_deriv=max_deriv)
181 needs=needs, max_deriv=max_deriv)
186 needs=needs, max_deriv=max_deriv)
189 needs=needs, max_deriv=max_deriv)
193 CALL xb88_lsd_info(reference=reference, shortform=shortform, &
194 needs=needs, max_deriv=max_deriv)
196 CALL xb88_lda_info(reference=reference, shortform=shortform, &
197 needs=needs, max_deriv=max_deriv)
202 needs=needs, max_deriv=max_deriv)
205 needs=needs, max_deriv=max_deriv)
209 CALL lyp_lsd_info(reference=reference, shortform=shortform, &
210 needs=needs, max_deriv=max_deriv)
212 CALL lyp_lda_info(reference=reference, shortform=shortform, &
213 needs=needs, max_deriv=max_deriv)
216 CALL pade_info(reference, shortform, lsd=lsd, needs=needs)
220 CALL hcth_lda_info(i_param, reference, shortform, needs, max_deriv)
229 CALL cs1_lsd_info(reference, shortform, needs, max_deriv)
231 CALL cs1_lda_info(reference, shortform, needs=needs, max_deriv=max_deriv)
235 CALL xgga_info(i_param, lsd, reference, shortform, needs, max_deriv)
238 CALL ke_gga_info(i_param, lsd, reference, shortform, needs, max_deriv)
241 cpabort(
"BP functional not implemented with LSD")
243 CALL p86_lda_info(reference, shortform, needs, max_deriv)
247 CALL perdew_wang_info(i_param, lsd, reference, shortform, needs, max_deriv, &
251 CALL pz_info(i_param, lsd, reference, shortform, needs, max_deriv)
254 CALL tfw_lsd_info(reference, shortform, needs, max_deriv)
256 CALL tfw_lda_info(reference, shortform, needs, max_deriv)
262 CALL vwn_lsd_info(reference, shortform, needs, max_deriv)
264 CALL vwn_lda_info(reference, shortform, needs, max_deriv)
268 CALL xalpha_info(lsd, reference, shortform, needs, max_deriv, &
269 xa_parameter=r_param)
272 cpabort(
"TPSS functional not implemented with LSD. Use the LIBXC version instead.")
274 CALL tpss_lda_info(functional, reference, shortform, needs, max_deriv)
278 CALL pbe_lsd_info(functional, reference, shortform, needs, max_deriv)
280 CALL pbe_lda_info(functional, reference, shortform, needs, max_deriv)
288 CASE (
"BECKE_ROUSSEL")
294 CASE (
"LDA_HOLE_T_C_LR")
300 CASE (
"PBE_HOLE_T_C_LR")
315 CALL libxc_lsd_info(functional, reference, shortform, needs, max_deriv, print_warn)
317 CALL libxc_lda_info(functional, reference, shortform, needs, max_deriv, print_warn)
341 SUBROUTINE xc_functional_eval(functional, lsd, rho_set, deriv_set, deriv_order)
343 TYPE(section_vals_type),
POINTER :: functional
344 LOGICAL,
INTENT(in) :: lsd
345 TYPE(xc_rho_set_type),
INTENT(IN) :: rho_set
346 TYPE(xc_derivative_set_type),
INTENT(IN) :: deriv_set
347 INTEGER,
INTENT(IN) :: deriv_order
349 CHARACTER(len=*),
PARAMETER :: routinen =
'xc_functional_eval'
351 INTEGER :: handle, i_param
352 LOGICAL :: fun_active
353 REAL(kind=
dp) :: density_cut, gradient_cut, r_param
355 CALL timeset(routinen, handle)
358 drho_cutoff=gradient_cut)
361 IF (.NOT. fun_active)
THEN
362 CALL timestop(handle)
366 SELECT CASE (functional%section%name)
369 CALL b97_lsd_eval(rho_set, deriv_set, deriv_order, functional)
371 CALL b97_lda_eval(rho_set, deriv_set, deriv_order, functional)
373 CASE (
"BECKE88_LR_ADIABATIC")
379 CASE (
"LYP_ADIABATIC")
387 CALL xb88_lsd_eval(rho_set, deriv_set, deriv_order, functional)
389 CALL xb88_lda_eval(rho_set, deriv_set, deriv_order, functional)
405 CALL lyp_lsd_eval(rho_set, deriv_set, deriv_order, functional)
407 CALL lyp_lda_eval(rho_set, deriv_set, deriv_order, functional)
422 CALL optx_lsd_eval(rho_set, deriv_set, deriv_order, functional)
424 CALL optx_lda_eval(rho_set, deriv_set, deriv_order, functional)
434 CALL xgga_eval(i_param, lsd, rho_set, deriv_set, deriv_order)
444 CALL p86_lda_eval(rho_set, deriv_set, deriv_order, functional)
458 CALL pz_lsd_eval(i_param, rho_set, deriv_set, deriv_order, functional)
460 CALL pz_lda_eval(i_param, rho_set, deriv_set, deriv_order, functional)
476 CALL vwn_lsd_eval(rho_set, deriv_set, deriv_order, functional)
478 CALL vwn_lda_eval(rho_set, deriv_set, deriv_order, functional)
484 xa_parameter=r_param, xa_params=functional)
487 xa_parameter=r_param, xa_params=functional)
491 cpabort(
"TPSS functional not implemented with LSD. Use the LIBXC version instead.")
493 CALL tpss_lda_eval(rho_set, deriv_set, deriv_order, functional)
497 CALL pbe_lsd_eval(rho_set, deriv_set, deriv_order, functional)
499 CALL pbe_lda_eval(rho_set, deriv_set, deriv_order, functional)
507 CASE (
"BECKE_ROUSSEL")
513 CASE (
"LDA_HOLE_T_C_LR")
519 CASE (
"PBE_HOLE_T_C_LR")
542 CALL timestop(handle)
543 END SUBROUTINE xc_functional_eval
565 TYPE(section_vals_type),
POINTER :: functionals
566 LOGICAL,
INTENT(in) :: lsd
567 TYPE(xc_rho_set_type),
INTENT(IN) :: rho_set
568 TYPE(xc_derivative_set_type),
INTENT(IN) :: deriv_set
569 INTEGER,
INTENT(in) :: deriv_order
572 TYPE(section_vals_type),
POINTER :: xc_fun
574 cpassert(
ASSOCIATED(functionals))
579 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
580 CALL xc_functional_eval(xc_fun, &
583 deriv_set=deriv_set, &
584 deriv_order=deriv_order)
600 TYPE(section_vals_type),
POINTER :: functionals
601 LOGICAL,
INTENT(in) :: lsd
602 LOGICAL,
INTENT(in),
OPTIONAL :: calc_potential
603 TYPE(xc_rho_cflags_type) :: needs
606 LOGICAL :: my_calc_potential
607 TYPE(section_vals_type),
POINTER :: xc_fun
609 my_calc_potential = .false.
610 IF (
PRESENT(calc_potential)) my_calc_potential = calc_potential
612 cpassert(
ASSOCIATED(functionals))
619 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
623 IF (my_calc_potential)
THEN
625 needs%rho_spin = .true.
626 needs%tau_spin = needs%tau_spin .OR. needs%tau
630 IF (needs%norm_drho .OR. needs%norm_drho_spin)
THEN
632 needs%drho_spin = .true.
Defines the basic variable types.
integer, parameter, public dp
calculates the b97 correlation functional
subroutine, public b97_lda_info(b97_params, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public b97_lda_eval(rho_set, deriv_set, grad_deriv, b97_params)
evaluates the b97 correlation functional for lda
subroutine, public b97_lsd_info(b97_params, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public b97_lsd_eval(rho_set, deriv_set, grad_deriv, b97_params)
evaluates the b 97 xc functional for lsd
Calculate the CS1 Functional (Handy s improved LYP functional)
subroutine, public cs1_lda_eval(rho_set, deriv_set, order)
...
subroutine, public cs1_lsd_eval(rho_set, deriv_set, order)
...
subroutine, public cs1_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public cs1_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
represent a group ofunctional derivatives
type(xc_rho_cflags_type) function, public xc_functionals_get_needs(functionals, lsd, calc_potential)
...
subroutine, public xc_functional_get_info(functional, lsd, reference, shortform, needs, max_deriv, print_warn)
get the information about the given functional
subroutine, public xc_functionals_eval(functionals, lsd, rho_set, deriv_set, deriv_order)
...
Calculate several different exchange energy functionals with a GGA form.
subroutine, public xgga_eval(functional, lsd, rho_set, deriv_set, order)
evaluates different exchange gga
subroutine, public xgga_info(functional, lsd, reference, shortform, needs, max_deriv)
return various information on the xgga functionals
calculate the Hamprecht, Cohen, Tozer, and Handy (HCTH) exchange functional
subroutine, public hcth_lda_info(iparset, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public hcth_lda_eval(iparset, rho_set, deriv_set, grad_deriv)
evaluates the hcth functional for lda
Calculate the several different kinetic energy functionals with a GGA form.
subroutine, public ke_gga_lsd_eval(functional, rho_set, deriv_set, order)
...
subroutine, public ke_gga_info(functional, lsd, reference, shortform, needs, max_deriv)
...
subroutine, public ke_gga_lda_eval(functional, rho_set, deriv_set, order)
...
calculates a functional from libxc and its derivatives
subroutine, public libxc_lda_eval(rho_set, deriv_set, grad_deriv, libxc_params)
evaluates the functional from libxc
subroutine, public libxc_lsd_eval(rho_set, deriv_set, grad_deriv, libxc_params)
evaluates the functional from libxc
subroutine, public libxc_lsd_info(libxc_params, reference, shortform, needs, max_deriv, print_warn)
info about the functional from libxc
subroutine, public libxc_lda_info(libxc_params, reference, shortform, needs, max_deriv, print_warn)
info about the functional from libxc
Calculates the density_scaled Lyp functional when used in adiabatic hybrids. The energy is given as.
subroutine, public lyp_adiabatic_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_adiabatic_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_adiabatic_lda_eval(rho_set, deriv_set, grad_deriv, lyp_adiabatic_params)
...
subroutine, public lyp_adiabatic_lsd_eval(rho_set, deriv_set, grad_deriv, lyp_adiabatic_params)
...
calculates the lyp correlation functional
subroutine, public lyp_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_lsd_eval(rho_set, deriv_set, grad_deriv, lyp_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public lyp_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_lda_eval(rho_set, deriv_set, grad_deriv, lyp_params)
evaluates the lyp correlation functional for lda
subroutine, public optx_lda_info(reference, shortform, needs, max_deriv)
info about the optx functional
subroutine, public optx_lsd_eval(rho_set, deriv_set, grad_deriv, optx_params)
evaluates the optx functional for lsd
subroutine, public optx_lda_eval(rho_set, deriv_set, grad_deriv, optx_params)
evaluates the optx functional for lda
subroutine, public optx_lsd_info(reference, shortform, needs, max_deriv)
info about the optx functional (LSD)
Calculate the LDA functional in the Pade approximation Literature: S. Goedecker, M....
subroutine, public pade_init(cutoff, debug)
...
subroutine, public pade_lsd_pw_eval(deriv_set, rho_set, order)
...
subroutine, public pade_info(reference, shortform, lsd, needs, max_deriv)
...
subroutine, public pade_lda_pw_eval(deriv_set, rho_set, order)
...
calculates the pbe correlation functional
subroutine, public pbe_lda_eval(rho_set, deriv_set, grad_deriv, pbe_params)
evaluates the pbe correlation functional for lda
subroutine, public pbe_lsd_info(pbe_params, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public pbe_lsd_eval(rho_set, deriv_set, grad_deriv, pbe_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public pbe_lda_info(pbe_params, reference, shortform, needs, max_deriv)
return various information on the functional
Calculate the Perdew Correlation from 1986.
subroutine, public p86_lda_info(reference, shortform, needs, max_deriv)
...
subroutine, public p86_lda_eval(rho_set, deriv_set, order, p86_params)
...
Calculate the Perdew-Wang correlation potential and energy density and ist derivatives with respect t...
subroutine, public perdew_wang_lda_eval(method, rho_set, deriv_set, order, scale)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
subroutine, public perdew_wang_info(method, lsd, reference, shortform, needs, max_deriv, scale)
Return some info on the functionals.
subroutine, public perdew_wang_lsd_eval(method, rho_set, deriv_set, order, scale)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
Calculate the Perdew-Zunger correlation potential and energy density and ist derivatives with respect...
subroutine, public pz_lda_eval(method, rho_set, deriv_set, order, pz_params)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
subroutine, public pz_lsd_eval(method, rho_set, deriv_set, order, pz_params)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
subroutine, public pz_info(method, lsd, reference, shortform, needs, max_deriv)
Return some info on the functionals.
elemental subroutine, public xc_rho_cflags_setall(cflags, value)
sets all the flags to the given value
subroutine, public xc_rho_set_get(rho_set, can_return_null, rho, drho, norm_drho, rhoa, rhob, norm_drhoa, norm_drhob, rho_1_3, rhoa_1_3, rhob_1_3, laplace_rho, laplace_rhoa, laplace_rhob, drhoa, drhob, rho_cutoff, drho_cutoff, tau_cutoff, tau, tau_a, tau_b, local_bounds)
returns the various attributes of rho_set
Calculate the Thomas-Fermi kinetic energy functional plus the von Weizsaecker term.
subroutine, public tfw_lda_info(reference, shortform, needs, max_deriv)
...
subroutine, public tfw_lda_eval(rho_set, deriv_set, order)
...
subroutine, public tfw_lsd_info(reference, shortform, needs, max_deriv)
...
subroutine, public tfw_lsd_eval(rho_set, deriv_set, order)
...
Calculate the Thomas-Fermi kinetic energy functional.
subroutine, public thomas_fermi_lsd_eval(rho_set, deriv_set, order)
...
subroutine, public thomas_fermi_lda_eval(rho_set, deriv_set, order)
...
subroutine, public thomas_fermi_info(lsd, reference, shortform, needs, max_deriv)
...
Calculates the tpss functional.
subroutine, public tpss_lda_eval(rho_set, deriv_set, grad_deriv, tpss_params)
evaluates the tpss functional in the spin unpolarized (lda) case
subroutine, public tpss_lda_info(tpss_params, reference, shortform, needs, max_deriv)
return various information on the functional
Calculate the LDA functional according to Vosk, Wilk and Nusair Literature: S. H. Vosko,...
subroutine, public vwn_lda_info(reference, shortform, needs, max_deriv)
...
subroutine, public vwn_lda_eval(rho_set, deriv_set, order, vwn_params)
...
subroutine, public vwn_lsd_eval(rho_set, deriv_set, order, vwn_params)
...
subroutine, public vwn_lsd_info(reference, shortform, needs, max_deriv)
...
Calculate the local exchange functional.
subroutine, public xalpha_lda_eval(rho_set, deriv_set, order, xa_params, xa_parameter)
...
subroutine, public xalpha_info(lsd, reference, shortform, needs, max_deriv, xa_parameter, scaling)
...
subroutine, public xalpha_lsd_eval(rho_set, deriv_set, order, xa_params, xa_parameter)
...
calculates the longrange part of Becke 88 exchange functional
subroutine, public xb88_lr_lda_eval(rho_set, deriv_set, grad_deriv, xb88_lr_params)
evaluates the becke 88 longrange exchange functional for lda
subroutine, public xb88_lr_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lr_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lr_lsd_eval(rho_set, deriv_set, grad_deriv, xb88_lr_params)
evaluates the becke 88 longrange exchange functional for lsd
Calculates the density_scaled BECKE88 long-range functional when used in adiabatic hybrids....
subroutine, public xb88_lr_adiabatic_lda_eval(rho_set, deriv_set, grad_deriv, xb88_lr_ad_params)
evaluates the becke 88 longrange exchange functional for lda
subroutine, public xb88_lr_adiabatic_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lr_adiabatic_lsd_eval(rho_set, deriv_set, grad_deriv, xb88_lr_ad_params)
evaluates the becke 88 longrange exchange functional for lsd
subroutine, public xb88_lr_adiabatic_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
calculates the Becke 88 exchange functional
subroutine, public xb88_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lda_eval(rho_set, deriv_set, grad_deriv, xb88_params)
evaluates the becke 88 exchange functional for lda
subroutine, public xb88_lsd_eval(rho_set, deriv_set, grad_deriv, xb88_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public xb88_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
Calculates the exchange energy based on the Becke-Roussel exchange hole. Takes advantage of an analyt...
subroutine, public xbecke_roussel_lsd_eval(rho_set, deriv_set, grad_deriv, br_params)
evaluates the Becke Roussel exchange functional for lda
subroutine, public xbecke_roussel_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbecke_roussel_lda_eval(rho_set, deriv_set, grad_deriv, br_params)
evaluates the Becke Roussel exchange functional for lda
subroutine, public xbecke_roussel_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
calculates the Exchange contribution in the BEEF-vdW functional
subroutine, public xbeef_lda_eval(rho_set, deriv_set, grad_deriv, xbeef_params)
evaluates the beef exchange functional for lda
subroutine, public xbeef_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbeef_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbeef_lsd_eval(rho_set, deriv_set, grad_deriv, xbeef_params)
evaluates the beef 88 exchange functional for lsd
This functional is a combination of three different exchange hole models. The ingredients are:
subroutine, public xbr_pbe_lda_hole_tc_lr_lsd_eval(rho_set, deriv_set, grad_deriv, params)
Intermediate routine that gets grids, derivatives and some params.
subroutine, public xbr_pbe_lda_hole_tc_lr_lda_eval(rho_set, deriv_set, grad_deriv, params)
Intermediate routine that gets grids, derivatives and some params.
subroutine, public xbr_pbe_lda_hole_tc_lr_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbr_pbe_lda_hole_tc_lr_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
Calculates the lda exchange hole in a truncated coulomb potential. Can be used as longrange correctio...
subroutine, public xlda_hole_t_c_lr_lda_eval(rho_set, deriv_set, order, params)
evaluates the truncated lda exchange hole
subroutine, public xlda_hole_t_c_lr_lda_info(reference, shortform, needs, max_deriv)
returns various information on the functional
subroutine, public xlda_hole_t_c_lr_lsd_eval(rho_set, deriv_set, order, params)
evaluates the truncated lsd exchange hole. Calls the lda routine and applies spin scaling relation
subroutine, public xlda_hole_t_c_lr_lsd_info(reference, shortform, needs, max_deriv)
returns various information on the functional
Calculates the exchange energy for the pbe hole model in a truncated coulomb potential,...
subroutine, public xpbe_hole_t_c_lr_lda_info(reference, shortform, needs, max_deriv)
returns various information on the functional
subroutine, public xpbe_hole_t_c_lr_lda_eval(rho_set, deriv_set, order, params)
evaluates the pbe-hole exchange in a truncated coulomb potential
subroutine, public xpbe_hole_t_c_lr_lsd_eval(rho_set, deriv_set, order, params)
evaluates the pbe-hole exchange in a truncated coulomb potential
subroutine, public xpbe_hole_t_c_lr_lsd_info(reference, shortform, needs, max_deriv)
returns various information on the functional
Calculates short range exchange part for wPBE functional and averaged PBE exchange-hole functional (o...
subroutine, public xwpbe_lda_eval(rho_set, deriv_set, order, xwpbe_params)
evaluates the screened hole averaged PBE exchange functional for lda
subroutine, public xwpbe_lsd_eval(rho_set, deriv_set, order, xwpbe_params)
evaluates the screened hole averaged PBE exchange functional for lsd
subroutine, public xwpbe_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xwpbe_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional