37 #include "./base/base_uses.f90"
45 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_energy'
64 SUBROUTINE qs_energies(qs_env, consistent_energies, calc_forces)
65 TYPE(qs_environment_type),
POINTER :: qs_env
66 LOGICAL,
INTENT(IN),
OPTIONAL :: consistent_energies, calc_forces
68 CHARACTER(len=*),
PARAMETER :: routinen =
'qs_energies'
71 LOGICAL :: do_consistent_energies, &
72 do_excited_state, loverlap_deltat, &
73 my_calc_forces, run_rtp
74 TYPE(dft_control_type),
POINTER :: dft_control
75 TYPE(qs_energy_type),
POINTER :: energy
76 TYPE(section_vals_type),
POINTER :: excited_state_section
78 CALL timeset(routinen, handle)
80 my_calc_forces = .false.
81 IF (
PRESENT(calc_forces)) my_calc_forces = calc_forces
83 do_consistent_energies = .false.
84 IF (
PRESENT(consistent_energies)) do_consistent_energies = consistent_energies
88 CALL get_qs_env(qs_env=qs_env, run_rtp=run_rtp)
89 IF (.NOT. run_rtp)
THEN
91 NULLIFY (dft_control, energy)
93 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, energy=energy)
96 loverlap_deltat = .false.
97 NULLIFY (excited_state_section)
100 IF (do_excited_state)
THEN
102 l_val=loverlap_deltat)
106 IF (.NOT. loverlap_deltat)
THEN
107 IF (dft_control%qs_control%do_ls_scf)
THEN
108 CALL ls_scf(qs_env=qs_env)
109 ELSE IF (dft_control%qs_control%do_almo_scf)
THEN
112 CALL scf(qs_env=qs_env)
116 IF (do_consistent_energies)
THEN
120 IF (.NOT. (dft_control%qs_control%do_ls_scf .OR. dft_control%qs_control%do_almo_scf))
THEN
122 CALL qs_energies_mp2(qs_env, my_calc_forces)
124 IF (.NOT.
ASSOCIATED(qs_env%mp2_env))
THEN
135 IF (qs_env%energy_correction)
THEN
139 IF (.NOT. loverlap_deltat)
THEN
145 IF (dft_control%qs_control%lrigpw)
THEN
151 CALL timestop(handle)
161 SUBROUTINE qs_energies_mp2(qs_env, calc_forces)
162 TYPE(qs_environment_type),
POINTER :: qs_env
163 LOGICAL,
INTENT(IN) :: calc_forces
165 LOGICAL :: should_stop
169 IF (
ASSOCIATED(qs_env%mp2_env))
THEN
172 start_time=qs_env%start_time)
174 CALL mp2_main(qs_env=qs_env, calc_forces=calc_forces)
177 END SUBROUTINE qs_energies_mp2
Routines for all ALMO-based SCF methods 'RZK-warning' marks unresolved issues.
subroutine, public almo_entry_scf(qs_env, calc_forces)
The entry point into ALMO SCF routines.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Routines to handle the external control of CP2K.
subroutine, public external_control(should_stop, flag, globenv, target_time, start_time, force_check)
External manipulations during a run : when the <PROJECT_NAME>.EXIT_$runtype command is sent the progr...
Routines for a linear scaling quickstep SCF run based on the density matrix.
subroutine, public ls_scf(qs_env)
perform an linear scaling scf procedure: entry point
Routines for an energy correction on top of a Kohn-Sham calculation.
subroutine, public energy_correction(qs_env, ec_init, calculate_forces)
Energy Correction to a Kohn-Sham simulation Available energy corrections: (1) Harris energy functiona...
Routines for total energy and forces of excited states.
subroutine, public excited_state_energy(qs_env, calculate_forces)
Excited state energy and forces.
Calculates integral matrices for LRIGPW method lri : local resolution of the identity.
subroutine, public lri_print_stat(qs_env, ltddfpt, tddfpt_lri_env)
...
Routines to calculate MP2 energy.
subroutine, public mp2_main(qs_env, calc_forces)
the main entry point for MP2 calculations
Determine active space Hamiltonian.
subroutine, public active_space_main(qs_env)
Main method for determining the active space Hamiltonian.
Utility subroutine for qs energy calculation.
subroutine, public qs_energies_init(qs_env, calc_forces)
Refactoring of qs_energies_scf. Driver routine for the initial setup and calculations for a qs energy...
Utility subroutine for qs energy calculation.
subroutine, public qs_energies_properties(qs_env, calc_forces)
Refactoring of qs_energies_scf. Moves computation of properties into separate subroutine.
Perform a QUICKSTEP wavefunction optimization (single point)
subroutine, public qs_energies(qs_env, consistent_energies, calc_forces)
Driver routine for QUICKSTEP single point wavefunction optimization.
qs_environment methods that use many other modules
subroutine, public qs_env_rebuild_pw_env(qs_env)
rebuilds the pw_env in the given qs_env, allocating it if necessary
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_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, 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, rhs)
Get the QUICKSTEP environment.
routines that build the Kohn-Sham matrix (i.e calculate the coulomb and xc parts
subroutine, public qs_ks_update_qs_env(qs_env, calculate_forces, just_energy, print_active)
updates the Kohn Sham matrix of the given qs_env (facility method)
Utility subroutine for qs energy calculation.
subroutine, public qs_energies_compute_matrix_w(qs_env, calc_forces)
Refactoring of qs_energies_scf. Moves computation of matrix_w into separate subroutine.
Routines for the Quickstep SCF run.
subroutine, public scf(qs_env, has_converged, total_scf_steps)
perform an scf procedure in the given qs_env