diff --git a/Modules/input_parameters.f90 b/Modules/input_parameters.f90 index baf1e62ac..98cfaa034 100644 --- a/Modules/input_parameters.f90 +++ b/Modules/input_parameters.f90 @@ -484,8 +484,10 @@ MODULE input_parameters ! OBSOLESCENT: same as vdw_corr='grimme-d2' ! other DFT-D parameters ( see Modules/mm_dispersion.f90 ) ! london_s6 = default global scaling parameter for PBE + ! london_c6 = user specified atomic C6 coefficients REAL ( DP ) :: london_s6 = 0.75_DP , & - london_rcut = 200.00_DP + london_rcut = 200.00_DP , & + london_c6( nsx ) = -1.0_DP LOGICAL :: ts_vdw = .false. ! OBSOLESCENT: same as vdw_corr='Tkatchenko-Scheffler' @@ -563,7 +565,7 @@ MODULE input_parameters constrained_magnetization, B_field, fixed_magnetization, & sic, sic_epsilon, force_pairing, sic_alpha, & tot_charge, tot_magnetization, spline_ps, one_atom_occupations, & - vdw_corr, london, london_s6, london_rcut, & + vdw_corr, london, london_s6, london_rcut, london_c6, & ts_vdw, ts_vdw_isolated, ts_vdw_econv_thr, & xdm, xdm_a1, xdm_a2, & step_pen, A_pen, sigma_pen, alpha_pen, no_t_rev, & diff --git a/Modules/mm_dispersion.f90 b/Modules/mm_dispersion.f90 index c321547df..1e250a69d 100644 --- a/Modules/mm_dispersion.f90 +++ b/Modules/mm_dispersion.f90 @@ -15,6 +15,7 @@ MODULE london_module ! [ S. Grimme, J. Comp. Chem., 27, 1787 (2006) ]. ! USE kinds , ONLY : DP + USE parameters , ONLY : nsx ! IMPLICIT NONE ! @@ -35,10 +36,11 @@ MODULE london_module ! r ( 3 , mxr ) : ordered distance vectors ! dist2 ( mxr ) : ordered distances ! - REAL ( DP ) , PUBLIC :: scal6=0._dp , lon_rcut=0._dp + REAL ( DP ) , PUBLIC :: scal6=0._dp , lon_rcut=0._dp , in_C6 ( nsx ) ! ! scal6 : global scaling factor ! lon_rcut : public cut-off radius + ! in_C6 ( ntyp ) : input (user) specified atomic C6 coefficients ! INTEGER , PRIVATE :: mxr ! @@ -204,7 +206,11 @@ MODULE london_module ! i = atomic_number ( atom_label ( ilab ) ) IF ( i > 0 .AND. i < 87 ) THEN - C6_i ( ilab ) = vdw_coeffs(1,i) + IF ( in_C6 (ilab) > 0.0_DP ) THEN + C6_i ( ilab ) = in_C6 (ilab) + ELSE + C6_i ( ilab ) = vdw_coeffs(1,i) + END IF R_vdw ( ilab ) = vdw_coeffs(2,i) ELSE CALL errore ( ' init_london ' ,& diff --git a/Modules/read_namelists.f90 b/Modules/read_namelists.f90 index f0a34c560..c29286503 100644 --- a/Modules/read_namelists.f90 +++ b/Modules/read_namelists.f90 @@ -245,6 +245,7 @@ MODULE read_namelists_module london = .false. london_s6 = 0.75_DP london_rcut = 200.00_DP + london_c6 = -1.0_DP ts_vdw = .FALSE. ts_vdw_isolated = .FALSE. ts_vdw_econv_thr = 1.E-6_DP @@ -803,6 +804,7 @@ MODULE read_namelists_module CALL mp_bcast( london, ionode_id, intra_image_comm ) CALL mp_bcast( london_s6, ionode_id, intra_image_comm ) CALL mp_bcast( london_rcut, ionode_id, intra_image_comm ) + CALL mp_bcast( london_c6, ionode_id, intra_image_comm ) CALL mp_bcast( xdm, ionode_id, intra_image_comm ) CALL mp_bcast( xdm_a1, ionode_id, intra_image_comm ) CALL mp_bcast( xdm_a2, ionode_id, intra_image_comm )