Skip to content

Commit

Permalink
RTP: Update matrix_ks when needed for apply_delta_pulse_periodic
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiatj authored and oschuett committed Jan 16, 2020
1 parent 20168dc commit 2d3efb1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/qs_energy.F
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ SUBROUTINE qs_energies(qs_env, consistent_energies, calc_forces)

IF (PRESENT(consistent_energies)) THEN
IF (consistent_energies) THEN
CALL qs_ks_update_qs_env(qs_env, calculate_forces=.FALSE., just_energy=.TRUE.)
IF (ASSOCIATED(dft_control%rtp_control)) THEN
IF (dft_control%rtp_control%periodic) THEN
CALL qs_ks_update_qs_env(qs_env, calculate_forces=.FALSE., just_energy=.FALSE.)
ELSE
CALL qs_ks_update_qs_env(qs_env, calculate_forces=.FALSE., just_energy=.TRUE.)
ENDIF
ELSE
CALL qs_ks_update_qs_env(qs_env, calculate_forces=.FALSE., just_energy=.TRUE.)
ENDIF
! add MP2 energy if necessary
IF (ASSOCIATED(qs_env%mp2_env)) THEN
energy%total = energy%total + energy%mp2
Expand Down

0 comments on commit 2d3efb1

Please sign in to comment.