69 hf_energy, just_energy, calculate_forces, use_virial)
72 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: ks_matrix
75 TYPE(
pw_r3d_rs_type),
DIMENSION(:),
POINTER :: v_rspace_new, v_tau_rspace
76 REAL(
dp),
DIMENSION(:) :: hf_energy
77 LOGICAL,
INTENT(in) :: just_energy, calculate_forces, use_virial
79 CHARACTER(LEN=*),
PARAMETER :: routinen =
'rescale_xc_potential'
81 INTEGER :: adiabatic_functional, adiabatic_model, &
82 handle, n_rep_hf, nimages
83 LOGICAL :: do_adiabatic_rescaling, do_hfx, gapw, &
85 REAL(
dp) :: adiabatic_lambda, adiabatic_omega, &
86 scale_ddfa, scale_ddw0, scale_dex1, &
87 scale_dex2, total_energy_xc
91 TYPE(
hfx_type),
DIMENSION(:, :),
POINTER :: x_data
96 hfx_sections, input, xc_section
98 CALL timeset(routinen, handle)
99 NULLIFY (para_env, dft_control, adiabatic_rescaling_section, hfx_sections, &
100 input, xc_section, rho_xc, ks_env, rho_ao, rho_ao_resp, x_data)
103 dft_control=dft_control, &
110 IF (x_data(1, 1)%do_hfx_ri) cpabort(
"RI-HFX not compatible with this kinf of functionals")
111 nimages = dft_control%nimages
112 cpassert(nimages == 1)
117 CALL section_vals_get(adiabatic_rescaling_section, explicit=do_adiabatic_rescaling)
122 gapw = dft_control%qs_control%gapw
123 gapw_xc = dft_control%qs_control%gapw_xc
126 i_val=adiabatic_functional)
128 i_val=adiabatic_model)
130 r_val=adiabatic_lambda)
132 r_val=adiabatic_omega)
133 SELECT CASE (adiabatic_functional)
135 SELECT CASE (adiabatic_model)
138 CALL cp_abort(__location__, &
139 "For this kind of adiababatic hybrid functional 2 HF sections have to be provided. "// &
140 "Please check your input file.")
142 adiabatic_omega, scale_dex1, scale_ddw0, scale_ddfa, &
143 scale_dex2, total_energy_xc)
152 IF (calculate_forces)
THEN
153 cpassert(.NOT. use_virial)
156 para_env, 1, use_virial, &
157 adiabatic_rescale_factor=scale_dex1)
159 para_env, 2, use_virial, &
160 adiabatic_rescale_factor=scale_dex2)
166 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho_xc, xc_section=xc_section, &
167 vxc_rho=v_rspace_new, vxc_tau=v_tau_rspace, exc=energy%exc, &
168 just_energy=just_energy, adiabatic_rescale_factor=scale_ddfa)
170 CALL qs_vxc_create(ks_env=ks_env, rho_struct=rho, xc_section=xc_section, &
171 vxc_rho=v_rspace_new, vxc_tau=v_tau_rspace, exc=energy%exc, &
172 just_energy=just_energy, adiabatic_rescale_factor=scale_ddfa)
176 IF (gapw .OR. gapw_xc)
THEN
177 CALL calculate_vxc_atom(qs_env, just_energy, energy%exc1, adiabatic_rescale_factor=scale_ddfa)
182 energy%exc = total_energy_xc
186 CALL timestop(handle)
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.