Skip to content

Commit

Permalink
Local energy: no local core charge available case added (#885)
Browse files Browse the repository at this point in the history
* Local energy: no local core charge available case added

* Pretty
  • Loading branch information
juerghutter committed Apr 27, 2020
1 parent 91d9f7f commit 3e7b916
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/qs_local_properties.F
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,17 @@ SUBROUTINE qs_local_energy(qs_env, energy_density)
rho_tot_rspace%pw, &
use_data=REALDATA3D, &
in_space=REALSPACE)
NULLIFY (rho_core)
CALL get_qs_env(qs_env, &
v_hartree_rspace=v_hartree_rspace%pw, &
rho_core=rho_core, rho=rho)
CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho)
CALL qs_rho_get(rho, rho_r=rho_r)
CALL pw_transfer(rho_core%pw, rho_tot_rspace%pw)
IF (ASSOCIATED(rho_core)) THEN
CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho)
CALL pw_transfer(rho_core%pw, rho_tot_rspace%pw)
ELSE
CALL pw_zero(rho_tot_rspace%pw)
END IF
DO ispin = 1, nspins
CALL pw_axpy(rho_r(ispin)%pw, rho_tot_rspace%pw, alpha=-1.0_dp)
END DO
Expand Down

0 comments on commit 3e7b916

Please sign in to comment.