Skip to content

Commit

Permalink
QS: Add scaling factor for the rVV10 dispersion correction (#1226)
Browse files Browse the repository at this point in the history
  • Loading branch information
fstein93 committed Dec 17, 2020
1 parent f213cf7 commit 6e2783a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/input_cp2k_xc.F
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,12 @@ SUBROUTINE create_vdw_potential_section(section)
type_of_var=real_t, default_r_vals=(/6.3_dp, 0.0093_dp/), n_var=2)
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="SCALE", &
description="Scales the energy contribution of the rVV10 functional", &
usage="SCALE 1.0", &
type_of_var=real_t, default_r_val=1.0_dp)
CALL section_add_keyword(subsection, keyword)
CALL keyword_release(keyword)

CALL section_add_subsection(section, subsection)
CALL section_release(subsection)
Expand Down
5 changes: 3 additions & 2 deletions src/qs_dispersion_nonloc.F
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, &
END SELECT
END IF
CALL mp_sum(Ec_nl, para_env%group)
IF (nl_type == vdw_nl_RVV10) Ec_nl = Ec_nl*dispersion_env%scale_rvv10
edispersion = Ec_nl
IF (energy_only) THEN
Expand Down Expand Up @@ -476,8 +477,8 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, &
END IF
SELECT CASE (nl_type)
CASE (vdw_nl_RVV10)
potential(:) = 0.5_dp*potential(:) + beta
hpot(:) = 0.5_dp*hpot(:)
potential(:) = (0.5_dp*potential(:) + beta)*dispersion_env%scale_rvv10
hpot(:) = 0.5_dp*dispersion_env%scale_rvv10*hpot(:)
END SELECT
CALL pw_pool_create_pw(pw_pool, vxc_r, use_data=REALDATA3D, in_space=REALSPACE)
DO i = 1, 3
Expand Down
2 changes: 1 addition & 1 deletion src/qs_dispersion_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ MODULE qs_dispersion_types
REAL(KIND=dp) :: kgc8 !s8 scaling parameter
!vdW-DF variables
REAL(KIND=dp) :: pw_cutoff
REAL(KIND=dp) :: b_value, c_value !parameters for the rVV10 functional
REAL(KIND=dp) :: b_value, c_value, scale_rvv10 !parameters for the rVV10 functional
INTEGER :: nqs, nr_points
!! The number of q points and radial points
!! used in generating the kernel phi(q1*r, q2*r)
Expand Down
1 change: 1 addition & 0 deletions src/qs_dispersion_utils.F
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ SUBROUTINE qs_dispersion_env_set(dispersion_env, xc_section)
CALL section_vals_val_get(nl_section, "TYPE", i_val=dispersion_env%nl_type)
CALL section_vals_val_get(nl_section, "CUTOFF", r_val=dispersion_env%pw_cutoff)
CALL section_vals_val_get(nl_section, "PARAMETERS", r_vals=params)
CALL section_vals_val_get(nl_section, "SCALE", r_val=dispersion_env%scale_rvv10)
dispersion_env%b_value = params(1)
dispersion_env%c_value = params(2)
END IF
Expand Down
1 change: 1 addition & 0 deletions tests/QS/regtest-hybrid-4/wB97X-V.inp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
VERBOSE_OUTPUT
KERNEL_FILE_NAME rVV10_kernel_table.dat
CUTOFF 40
SCALE 1.0
&END NON_LOCAL
&END vdW_POTENTIAL
&END XC
Expand Down

0 comments on commit 6e2783a

Please sign in to comment.