Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannipizzi authored Dec 21, 2018
2 parents e248126 + 4555d4b commit f5d9ea6
Show file tree
Hide file tree
Showing 8 changed files with 6,254 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/disentangle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ subroutine internal_find_u_gamma()

u_opt_r(:, :) = real(u_matrix_opt(1:ndimwin(1), 1:num_wann, 1), dp)

a_matrix_r(:, :) = real(a_matrix(:, :, 1), kind=dp)
a_matrix_r(:, :) = real(a_matrix(1:ndimwin(1), 1:num_wann, 1), kind=dp)

call dgemm('T', 'N', num_wann, num_wann, ndimwin(1), 1.0_dp, &
u_opt_r, ndimwin(1), a_matrix_r, ndimwin(1), &
Expand Down
29 changes: 20 additions & 9 deletions src/wannierise.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ subroutine wann_phases(csheet, sheet, rguide, irguide, m_w)
!===================================================================
use w90_constants, only: eps6
use w90_parameters, only: num_wann, nntot, neigh, &
nnh, bk, bka, num_kpts, timing_level
nnh, bk, bka, num_kpts, timing_level, m_matrix, gamma_only
use w90_io, only: io_stopwatch
use w90_utility, only: utility_inv3

Expand Down Expand Up @@ -1529,14 +1529,25 @@ subroutine wann_phases(csheet, sheet, rguide, irguide, m_w)

if (.not. present(m_w)) then
! get average phase for each unique bk direction
do na = 1, nnh
csum(na) = cmplx_0
do nkp_loc = 1, counts(my_node_id)
nkp = nkp_loc + displs(my_node_id)
nn = neigh(nkp, na)
csum(na) = csum(na) + m_matrix_loc(loop_wann, loop_wann, nn, nkp_loc)
if (gamma_only) then
do na = 1, nnh
csum(na) = cmplx_0
do nkp_loc = 1, counts(my_node_id)
nkp = nkp_loc + displs(my_node_id)
nn = neigh(nkp, na)
csum(na) = csum(na) + m_matrix(loop_wann, loop_wann, nn, nkp_loc)
enddo
enddo
enddo
else
do na = 1, nnh
csum(na) = cmplx_0
do nkp_loc = 1, counts(my_node_id)
nkp = nkp_loc + displs(my_node_id)
nn = neigh(nkp, na)
csum(na) = csum(na) + m_matrix_loc(loop_wann, loop_wann, nn, nkp_loc)
enddo
enddo
endif

else

Expand Down Expand Up @@ -2785,7 +2796,7 @@ subroutine wann_main_gamma
! Set up the MPI arrays for a serial run.
allocate (counts(0:0), displs(0:0), stat=ierr)
if (ierr /= 0) call io_error('Error in allocating counts and displs in wann_main_gamma')
counts(0) = 0; displs(0) = 0
counts(0) = 1; displs(0) = 0

! store original U before rotating
!~ ! phase factor ph_g is applied to u_matrix
Expand Down
8 changes: 8 additions & 0 deletions test-suite/tests/jobconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ output = silane.wout
# This is a gamma-only test, can only run in serial
max_nprocs = 0

# Silane, valence states, Gamma only
[testw90_na_chain_gamma/]
program = WANNIER90_WOUT_OK
inputs_args = ('Na_chain.win', '')
output = Na_chain.wout
# This is a gamma-only test, can only run in serial
max_nprocs = 0

# Silicon, valence states
[testw90_example11_1/]
program = WANNIER90_WOUT_OK
Expand Down
302 changes: 302 additions & 0 deletions test-suite/tests/testw90_na_chain_gamma/Na_chain.amn

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions test-suite/tests/testw90_na_chain_gamma/Na_chain.eig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
1 1 -3.755340246893
2 1 -3.587440095753
3 1 -3.587437057123
4 1 -3.085820693883
5 1 -3.085818307589
6 1 -2.258938687000
7 1 -2.258937573115
8 1 -1.147125405714
9 1 -1.147125395633
10 1 -1.139197987849
11 1 -1.139196797182
12 1 -0.980024716382
13 1 -0.980024692168
14 1 -0.980022347534
15 1 -0.980022331700
16 1 -0.478728095813
17 1 -0.478728074503
18 1 -0.478726693846
19 1 -0.478726682987
20 1 -0.164089176783
21 1 -0.149392420456
22 1 0.001635735705
23 1 0.001637004270
24 1 0.356717880921
25 1 0.356717890887
26 1 0.356718118354
27 1 0.356718134778
28 1 0.361336685258
29 1 0.496968900465
30 1 0.496978660842
Loading

0 comments on commit f5d9ea6

Please sign in to comment.