Skip to content

Commit

Permalink
Merge pull request #206 from VVitale/develop
Browse files Browse the repository at this point in the history
Bugfix in SLWF+C from Jae-Mo-Lin.
  • Loading branch information
giovannipizzi authored Oct 8, 2018
2 parents bf1111f + 485e383 commit e233ffe
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/wannierise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1680,8 +1680,12 @@ end subroutine wann_phases
subroutine wann_omega(csheet, sheet, rave, r2ave, rave2, wann_spread)
!==================================================================!
! !
!! Calculate the Wannier Function spread
!! Calculate the Wannier Function spread !
! !
! Modified by Valerio Vitale for the SLWF+C method (PRB 90, 165125)!
! Jun 2018
! Based on a previous implementation by Charles T. Johnson
! and original implementation by Radu Miron
!===================================================================
use w90_parameters, only: num_wann, m_matrix, nntot, wb, bk, num_kpts, &
omega_invariant, timing_level, &
Expand Down Expand Up @@ -1868,12 +1872,12 @@ subroutine wann_omega(csheet, sheet, rave, r2ave, rave2, wann_spread)

call comms_allreduce(wann_spread%om_nu, 1, 'SUM')

wann_spread%om_nu = wann_spread%om_nu/real(num_kpts, dp)

do n = 1, slwf_num
wann_spread%om_nu = wann_spread%om_nu + lambda_loc*sum(ccentres_cart(n, :)**2)
end do

wann_spread%om_nu = wann_spread%om_nu/real(num_kpts, dp)

end if

wann_spread%om_tot = wann_spread%om_iod + wann_spread%om_d + wann_spread%om_nu
Expand Down Expand Up @@ -1953,6 +1957,10 @@ subroutine wann_domega(csheet, sheet, rave, cdodq)
! !
! Calculate the Gradient of the Wannier Function spread !
! !
! Modified by Valerio Vitale for the SLWF+C method (PRB 90, 165125)!
! Jun 2018
! Based on a previous implementation by Charles T. Johnson
! and original implementation by Radu Miron
!===================================================================
use w90_parameters, only: num_wann, wb, bk, nntot, m_matrix, num_kpts, &
timing_level, selective_loc, &
Expand Down Expand Up @@ -2137,10 +2145,10 @@ subroutine wann_domega(csheet, sheet, rave, cdodq)
(crt(m, n)*ln_tmp_loc(n, nn, nkp_loc) &
+ conjg(crt(n, m)*ln_tmp_loc(m, nn, nkp_loc))) &
*cmplx(0.0_dp, -0.5_dp, kind=dp)
cdodq_loc(m, n, nkp_loc) = &
cdodq_loc(m, n, nkp_loc) - wb(nn) &
*(crt(m, n)*rnkb_loc(n, nn, nkp_loc) + &
conjg(crt(n, m)*rnkb_loc(m, nn, nkp_loc)))*cmplx(0.0_dp, -0.5_dp, kind=dp)
cdodq_loc(m, n, nkp_loc) = cdodq_loc(m, n, nkp_loc) - wb(nn) &
*(crt(m, n)*rnkb_loc(n, nn, nkp_loc) &
+ conjg(crt(n, m)*rnkb_loc(m, nn, nkp_loc))) &
*cmplx(0.0_dp, -0.5_dp, kind=dp)
enddo
enddo
end if
Expand Down

0 comments on commit e233ffe

Please sign in to comment.