Merge lp:~nickpapior/siesta/merge-OSSO-class into lp:~albertog/siesta/merge-OSSO
- merge-OSSO-class
- Merge into merge-OSSO
Proposed by
Nick Papior
Status: | Merged |
---|---|
Merged at revision: | 701 |
Proposed branch: | lp:~nickpapior/siesta/merge-OSSO-class |
Merge into: | lp:~albertog/siesta/merge-OSSO |
Diff against target: |
704 lines (+173/-177) 8 files modified
Src/compute_energies.F90 (+28/-28) Src/final_H_f_stress.F (+12/-7) Src/nlefsm.f (+13/-11) Src/setup_H0.F (+25/-26) Src/setup_hamiltonian.F (+76/-85) Src/sparse_matrices.F (+7/-7) Src/state_init.F (+11/-12) version.info (+1/-1) |
To merge this branch: | bzr merge lp:~nickpapior/siesta/merge-OSSO-class |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Garcia | Approve | ||
Review via email: mp+343801@code.launchpad.net |
Commit message
Transferred H0_offsiteSO to H_so_off_2D as a class-object.
Fixed some possible inconsistencies in the conversion between
complex and real/imaginary part without kind specifications.
Clarified usage in setup_hamiltonian. Now the structure has been
re-assigned as prior to the OSSO implementation.
Description of the change
Transferred H0_offsiteSO to H_so_off_2D as a class-object.
Fixed some possible inconsistencies in the conversion between
complex and real/imaginary part without kind specifications.
Clarified usage in setup_hamiltonian. Now the structure has been
re-assigned as prior to the OSSO implementation.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Src/compute_energies.F90' | |||
2 | --- Src/compute_energies.F90 2018-04-23 07:36:55 +0000 | |||
3 | +++ Src/compute_energies.F90 2018-04-23 11:10:59 +0000 | |||
4 | @@ -48,8 +48,7 @@ | |||
5 | 48 | rmaxo, no_l | 48 | rmaxo, no_l |
6 | 49 | use m_ntm, only: ntm | 49 | use m_ntm, only: ntm |
7 | 50 | 50 | ||
10 | 51 | use m_spin, only: spin | 51 | use m_spin, only: spin |
9 | 52 | use sparse_matrices, only: H0_offsiteSO | ||
11 | 53 | use parallel, only: IONode | 52 | use parallel, only: IONode |
12 | 54 | 53 | ||
13 | 55 | use m_dipol, only: dipol | 54 | use m_dipol, only: dipol |
14 | @@ -300,10 +299,15 @@ | |||
15 | 300 | use files, only : filesOut_t ! derived type for output file names | 299 | use files, only : filesOut_t ! derived type for output file names |
16 | 301 | use class_dSpData1D, only : val | 300 | use class_dSpData1D, only : val |
17 | 302 | use class_dSpData2D, only : val | 301 | use class_dSpData2D, only : val |
19 | 303 | use sparse_matrices, only: H_kin_1D, H_vkb_1D, H_so_2D | 302 | use class_zSpData2D, only : val |
20 | 303 | use sparse_matrices, only: H_kin_1D, H_vkb_1D | ||
21 | 304 | use sparse_matrices, only: H_so_on_2D, H_so_off_2D | ||
22 | 305 | |||
23 | 304 | 306 | ||
24 | 305 | type(filesOut_t) :: filesOut ! blank output file names | 307 | type(filesOut_t) :: filesOut ! blank output file names |
26 | 306 | real(dp), pointer :: H_vkb(:), H_kin(:), H_so(:,:) | 308 | real(dp), pointer :: H_vkb(:), H_kin(:), H_so_on(:,:) |
27 | 309 | complex(dp), pointer :: H_so_off(:,:) | ||
28 | 310 | |||
29 | 307 | 311 | ||
30 | 308 | complex(dp) :: Hc, Dc | 312 | complex(dp) :: Hc, Dc |
31 | 309 | real(dp) :: dummy_stress(3,3), dummy_fa(1,1) | 313 | real(dp) :: dummy_stress(3,3), dummy_fa(1,1) |
32 | @@ -356,41 +360,37 @@ | |||
33 | 356 | Eso = 0._dp | 360 | Eso = 0._dp |
34 | 357 | 361 | ||
35 | 358 | if ( spin%SO_offsite ) then | 362 | if ( spin%SO_offsite ) then |
36 | 363 | H_so_off => val(H_so_off_2D) | ||
37 | 359 | 364 | ||
39 | 360 | ! The computation of the trace is different here, as H0_offsiteSO has | 365 | ! The computation of the trace is different here, as H_so_off has |
40 | 361 | ! a different structure from H and the DM. | 366 | ! a different structure from H and the DM. |
41 | 362 | do io = 1, maxnh | 367 | do io = 1, maxnh |
42 | 363 | 368 | ||
43 | 364 | !-------- Eso(u,u) | 369 | !-------- Eso(u,u) |
47 | 365 | Dc = cmplx(Dscf(io,1),Dscf(io,5),kind=dp) | 370 | Dc = cmplx(Dscf(io,1),Dscf(io,5), dp) |
48 | 366 | Hc = H0_offsiteSO(io,1) | 371 | Eso = Eso + real( H_so_off(io,1)*Dc, dp) |
46 | 367 | Eso = Eso + real( Hc*Dc ) | ||
49 | 368 | !-------- Eso(d,d) | 372 | !-------- Eso(d,d) |
53 | 369 | Dc = cmplx(Dscf(io,2),Dscf(io,6),kind=dp) | 373 | Dc = cmplx(Dscf(io,2),Dscf(io,6), dp) |
54 | 370 | Hc = H0_offsiteSO(io,2) | 374 | Eso = Eso + real( H_so_off(io,2)*Dc, dp) |
52 | 371 | Eso = Eso + real( Hc*Dc ) | ||
55 | 372 | !-------- Eso(u,d) | 375 | !-------- Eso(u,d) |
59 | 373 | Dc = cmplx(Dscf(io,3),Dscf(io,4),kind=dp) | 376 | Dc = cmplx(Dscf(io,3),Dscf(io,4), dp) |
60 | 374 | Hc = H0_offsiteSO(io,4) | 377 | Eso = Eso + real( H_so_off(io,4)*Dc, dp) |
58 | 375 | Eso = Eso + real( Hc*Dc ) | ||
61 | 376 | !-------- Eso(d,u) | 378 | !-------- Eso(d,u) |
71 | 377 | Dc = cmplx(Dscf(io,7),-Dscf(io,8),kind=dp) | 379 | Dc = cmplx(Dscf(io,7),-Dscf(io,8), dp) |
72 | 378 | Hc = H0_offsiteSO(io,3) | 380 | Eso = Eso + real( H_so_off(io,3)*Dc, dp) |
73 | 379 | Eso = Eso + real( Hc*Dc ) | 381 | |
74 | 380 | 382 | end do | |
75 | 381 | enddo | 383 | |
76 | 382 | 384 | else if ( spin%SO_onsite ) then | |
68 | 383 | endif | ||
69 | 384 | |||
70 | 385 | if ( spin%SO_onsite ) then | ||
77 | 386 | ! Sadly some compilers (g95), does | 385 | ! Sadly some compilers (g95), does |
78 | 387 | ! not allow bounds for pointer assignments :( | 386 | ! not allow bounds for pointer assignments :( |
80 | 388 | H_so => val(H_so_2D) | 387 | H_so_on => val(H_so_on_2D) |
81 | 389 | do io = 1,maxnh | 388 | do io = 1,maxnh |
86 | 390 | Eso = Eso + H_so(io,1)*Dscf(io,7) + H_so(io,2)*Dscf(io,8) & | 389 | Eso = Eso + H_so_on(io,1)*Dscf(io,7) + H_so_on(io,2)*Dscf(io,8) & |
87 | 391 | + H_so(io,5)*Dscf(io,3) + H_so(io,6)*Dscf(io,4) & | 390 | + H_so_on(io,5)*Dscf(io,3) + H_so_on(io,6)*Dscf(io,4) & |
88 | 392 | - H_so(io,3)*Dscf(io,5) - H_so(io,4)*Dscf(io,6) | 391 | - H_so_on(io,3)*Dscf(io,5) - H_so_on(io,4)*Dscf(io,6) |
89 | 393 | end do | 392 | end do |
90 | 393 | |||
91 | 394 | end if | 394 | end if |
92 | 395 | 395 | ||
93 | 396 | #ifdef MPI | 396 | #ifdef MPI |
94 | 397 | 397 | ||
95 | === modified file 'Src/final_H_f_stress.F' | |||
96 | --- Src/final_H_f_stress.F 2018-04-20 09:41:55 +0000 | |||
97 | +++ Src/final_H_f_stress.F 2018-04-23 11:10:59 +0000 | |||
98 | @@ -21,8 +21,9 @@ | |||
99 | 21 | use siesta_options, only: recompute_H_after_scf | 21 | use siesta_options, only: recompute_H_after_scf |
100 | 22 | use sparse_matrices, only: numh, listh, listhptr | 22 | use sparse_matrices, only: numh, listh, listhptr |
101 | 23 | use sparse_matrices, only: H, S, Dscf, Escf, maxnh, xijo | 23 | use sparse_matrices, only: H, S, Dscf, Escf, maxnh, xijo |
103 | 24 | use sparse_matrices, only: H_ldau_2D | 24 | use sparse_matrices, only: H_ldau_2D, H_so_off_2D |
104 | 25 | use class_dSpData2D, only: val | 25 | use class_dSpData2D, only: val |
105 | 26 | use class_zSpData2D, only: val | ||
106 | 26 | 27 | ||
107 | 27 | use siesta_geom | 28 | use siesta_geom |
108 | 28 | use atomlist, only: no_u, iaorb, iphkb, qtot, indxuo, datm, | 29 | use atomlist, only: no_u, iaorb, iphkb, qtot, indxuo, datm, |
109 | @@ -30,7 +31,7 @@ | |||
110 | 30 | & rmaxo, no_l, iza | 31 | & rmaxo, no_l, iza |
111 | 31 | use metaforce, only: lMetaForce, meta | 32 | use metaforce, only: lMetaForce, meta |
112 | 32 | use molecularmechanics, only : twobody | 33 | use molecularmechanics, only : twobody |
114 | 33 | use m_nlefsm, only: nlefsm, nlefsm_offsiteSO | 34 | use m_nlefsm, only: nlefsm, nlefsm_SO_off |
115 | 34 | use m_overfsm, only: overfsm | 35 | use m_overfsm, only: overfsm |
116 | 35 | use m_kinefsm, only: kinefsm | 36 | use m_kinefsm, only: kinefsm |
117 | 36 | use m_naefs, only: naefs | 37 | use m_naefs, only: naefs |
118 | @@ -91,6 +92,8 @@ | |||
119 | 91 | real(dp), pointer :: H_tmp(:,:) => null() | 92 | real(dp), pointer :: H_tmp(:,:) => null() |
120 | 92 | real(dp), pointer :: S_tmp(:) => null() | 93 | real(dp), pointer :: S_tmp(:) => null() |
121 | 93 | real(dp), pointer :: H_ldau(:,:) | 94 | real(dp), pointer :: H_ldau(:,:) |
122 | 95 | complex(dp), pointer :: H_so_off(:,:) | ||
123 | 96 | |||
124 | 94 | #ifdef FINAL_CHECK_HS | 97 | #ifdef FINAL_CHECK_HS |
125 | 95 | real(dp) :: diff_H, diff_S | 98 | real(dp) :: diff_H, diff_S |
126 | 96 | #endif | 99 | #endif |
127 | @@ -176,13 +179,14 @@ | |||
128 | 176 | call globalize_sum(Enl,buffer1) | 179 | call globalize_sum(Enl,buffer1) |
129 | 177 | Enl = buffer1 | 180 | Enl = buffer1 |
130 | 178 | #endif | 181 | #endif |
133 | 179 | else | 182 | else |
134 | 180 | call nlefsm_offsiteSO(scell, na_u, na_s, isa, xa, indxua, | 183 | H_so_off => val(H_so_off_2D) |
135 | 184 | call nlefsm_SO_off(scell, na_u, na_s, isa, xa, indxua, | ||
136 | 181 | & maxnh, maxnh, lasto, lastkb, iphorb, iphKB, | 185 | & maxnh, maxnh, lasto, lastkb, iphorb, iphKB, |
137 | 182 | & numh, listhptr, listh, numh, listhptr, listh, | 186 | & numh, listhptr, listh, numh, listhptr, listh, |
138 | 183 | & spin%Grid, | 187 | & spin%Grid, |
139 | 184 | & Enl, Eso, fal, | 188 | & Enl, Eso, fal, |
141 | 185 | & stressl, H_tmp, | 189 | & stressl, H_tmp, H_so_off, |
142 | 186 | & matrix_elements_only=.false.) | 190 | & matrix_elements_only=.false.) |
143 | 187 | #ifdef MPI | 191 | #ifdef MPI |
144 | 188 | ! Global reduction of energy terms | 192 | ! Global reduction of energy terms |
145 | @@ -193,7 +197,7 @@ | |||
146 | 193 | #endif | 197 | #endif |
147 | 194 | endif | 198 | endif |
148 | 195 | 199 | ||
150 | 196 | if ( spin%SO_onsite) then | 200 | if ( spin%SO_onsite ) then |
151 | 197 | call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo, | 201 | call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo, |
152 | 198 | & maxnh,numh,listhptr,listh,Dscf,H_tmp(:,3:),Eso) | 202 | & maxnh,numh,listhptr,listh,Dscf,H_tmp(:,3:),Eso) |
153 | 199 | endif | 203 | endif |
154 | @@ -292,7 +296,8 @@ | |||
155 | 292 | & diff_S | 296 | & diff_S |
156 | 293 | end if | 297 | end if |
157 | 294 | #endif | 298 | #endif |
159 | 295 | 299 | ||
160 | 300 | ! TODO I am not sure this works with SO_offsite? | ||
161 | 296 | if (recompute_H_after_scf) then | 301 | if (recompute_H_after_scf) then |
162 | 297 | if (ionode) then | 302 | if (ionode) then |
163 | 298 | write(6,"(a)") ":!: Updating H after scf cycle" // | 303 | write(6,"(a)") ":!: Updating H after scf cycle" // |
164 | 299 | 304 | ||
165 | === modified file 'Src/nlefsm.f' | |||
166 | --- Src/nlefsm.f 2018-04-23 09:26:04 +0000 | |||
167 | +++ Src/nlefsm.f 2018-04-23 11:10:59 +0000 | |||
168 | @@ -8,11 +8,10 @@ | |||
169 | 8 | module m_nlefsm | 8 | module m_nlefsm |
170 | 9 | 9 | ||
171 | 10 | use precision, only : dp | 10 | use precision, only : dp |
172 | 11 | use sparse_matrices, only: H0_offsiteSO | ||
173 | 12 | 11 | ||
174 | 13 | implicit none | 12 | implicit none |
175 | 14 | 13 | ||
177 | 15 | public :: nlefsm, nlefsm_offsiteSO, calc_Vj_offsiteSO | 14 | public :: nlefsm, nlefsm_SO_off |
178 | 16 | 15 | ||
179 | 17 | private | 16 | private |
180 | 18 | 17 | ||
181 | @@ -445,11 +444,12 @@ | |||
182 | 445 | C nlefsm_offsiteSO calculates the KB elements to the total Hamiltonian | 444 | C nlefsm_offsiteSO calculates the KB elements to the total Hamiltonian |
183 | 446 | C (including the SO contribution) | 445 | C (including the SO contribution) |
184 | 447 | C when Off-Site Spin Orbit is included in the calculation | 446 | C when Off-Site Spin Orbit is included in the calculation |
186 | 448 | subroutine nlefsm_offsiteSO( scell, nua, na, isa, xa, indxua, | 447 | subroutine nlefsm_SO_off( scell, nua, na, isa, xa, indxua, |
187 | 449 | . maxnh, maxnd, lasto, lastkb, iphorb, | 448 | . maxnh, maxnd, lasto, lastkb, iphorb, |
188 | 450 | . iphKB, numd, listdptr, listd, numh, | 449 | . iphKB, numd, listdptr, listd, numh, |
189 | 451 | . listhptr, listh, nspin, Enl, Enl_offsiteSO, | 450 | . listhptr, listh, nspin, Enl, Enl_offsiteSO, |
191 | 452 | . fa, stress, H0 , matrix_elements_only) | 451 | . fa, stress, H0 , H0_off, |
192 | 452 | & matrix_elements_only) | ||
193 | 453 | 453 | ||
194 | 454 | 454 | ||
195 | 455 | C ********************************************************************* | 455 | C ********************************************************************* |
196 | @@ -496,7 +496,8 @@ | |||
197 | 496 | C ******************* INPUT and OUTPUT ********************************* | 496 | C ******************* INPUT and OUTPUT ********************************* |
198 | 497 | C real*8 fa(3,na) : NL forces (added to input fa) | 497 | C real*8 fa(3,na) : NL forces (added to input fa) |
199 | 498 | C real*8 stress(3,3) : NL stress (added to input stress) | 498 | C real*8 stress(3,3) : NL stress (added to input stress) |
201 | 499 | C real*8 H(maxnh,nspin) : NL Hamiltonian (added to input H) | 499 | C real*8 H0(maxnh,nspin) : NL Hamiltonian (added to input H) |
202 | 500 | C complex*16 H0_off(maxnh,nspin) : NL off-site Hamiltonian (added to input H) | ||
203 | 500 | C **************************** OUTPUT ********************************* | 501 | C **************************** OUTPUT ********************************* |
204 | 501 | C real*8 Enl : NL energy | 502 | C real*8 Enl : NL energy |
205 | 502 | C ********************************************************************* | 503 | C ********************************************************************* |
206 | @@ -525,7 +526,8 @@ | |||
207 | 525 | 526 | ||
208 | 526 | real(dp), intent(in) :: scell(3,3), xa(3,na) | 527 | real(dp), intent(in) :: scell(3,3), xa(3,na) |
209 | 527 | real(dp), intent(inout) :: fa(3,nua), stress(3,3) | 528 | real(dp), intent(inout) :: fa(3,nua), stress(3,3) |
211 | 528 | real(dp), intent(inout) :: H0(maxnh) | 529 | real(dp), intent(inout) :: H0(maxnh) |
212 | 530 | complex(dp), intent(inout) :: H0_off(maxnh,4) | ||
213 | 529 | 531 | ||
214 | 530 | real(dp), intent(out) :: Enl, Enl_offsiteSO | 532 | real(dp), intent(out) :: Enl, Enl_offsiteSO |
215 | 531 | logical, intent(in) :: matrix_elements_only | 533 | logical, intent(in) :: matrix_elements_only |
216 | @@ -853,10 +855,10 @@ | |||
217 | 853 | ind = listhptr(iio)+j | 855 | ind = listhptr(iio)+j |
218 | 854 | jo = listh(ind) | 856 | jo = listh(ind) |
219 | 855 | H0(ind) = H0(ind) + Vi(jo) | 857 | H0(ind) = H0(ind) + Vi(jo) |
224 | 856 | H0_offsiteSO(ind,1) = H0_offsiteSO(ind,1) + V_so(1,1,jo) | 858 | H0_off(ind,1) = H0_off(ind,1) + V_so(1,1,jo) |
225 | 857 | H0_offsiteSO(ind,2) = H0_offsiteSO(ind,2) + V_so(2,2,jo) | 859 | H0_off(ind,2) = H0_off(ind,2) + V_so(2,2,jo) |
226 | 858 | H0_offsiteSO(ind,3) = H0_offsiteSO(ind,3) + V_so(1,2,jo) | 860 | H0_off(ind,3) = H0_off(ind,3) + V_so(1,2,jo) |
227 | 859 | H0_offsiteSO(ind,4) = H0_offsiteSO(ind,4) + V_so(2,1,jo) | 861 | H0_off(ind,4) = H0_off(ind,4) + V_so(2,1,jo) |
228 | 860 | 862 | ||
229 | 861 | 863 | ||
230 | 862 | C Careful with this Vi() | 864 | C Careful with this Vi() |
231 | @@ -894,7 +896,7 @@ | |||
232 | 894 | 896 | ||
233 | 895 | call timer( 'nlefsm', 2 ) | 897 | call timer( 'nlefsm', 2 ) |
234 | 896 | 898 | ||
236 | 897 | end subroutine nlefsm_offsiteSO | 899 | end subroutine nlefsm_SO_off |
237 | 898 | 900 | ||
238 | 899 | c----------------------------------------------------------------------- | 901 | c----------------------------------------------------------------------- |
239 | 900 | c | 902 | c |
240 | 901 | 903 | ||
241 | === modified file 'Src/setup_H0.F' | |||
242 | --- Src/setup_H0.F 2018-04-19 12:47:26 +0000 | |||
243 | +++ Src/setup_H0.F 2018-04-23 11:10:59 +0000 | |||
244 | @@ -17,11 +17,10 @@ | |||
245 | 17 | 17 | ||
246 | 18 | USE siesta_options, only: g2cut | 18 | USE siesta_options, only: g2cut |
247 | 19 | use sparse_matrices, only: H_kin_1D, H_vkb_1D | 19 | use sparse_matrices, only: H_kin_1D, H_vkb_1D |
249 | 20 | use sparse_matrices, only: H_so_2D | 20 | use sparse_matrices, only: H_so_on_2D, H_so_off_2D |
250 | 21 | use sparse_matrices, only: Dscf | 21 | use sparse_matrices, only: Dscf |
251 | 22 | 22 | ||
254 | 23 | use sparse_matrices, only: H0_offsiteSO | 23 | use m_nlefsm, only: nlefsm_SO_off |
253 | 24 | use m_nlefsm, only: nlefsm_offsiteSO | ||
255 | 25 | use m_spin, only: spin | 24 | use m_spin, only: spin |
256 | 26 | 25 | ||
257 | 27 | use sparse_matrices, only: listh, listhptr, numh, maxnh | 26 | use sparse_matrices, only: listh, listhptr, numh, maxnh |
258 | @@ -44,6 +43,7 @@ | |||
259 | 44 | use alloc, only: re_alloc, de_alloc | 43 | use alloc, only: re_alloc, de_alloc |
260 | 45 | use class_dSpData1D, only: val | 44 | use class_dSpData1D, only: val |
261 | 46 | use class_dSpData2D, only: val | 45 | use class_dSpData2D, only: val |
262 | 46 | use class_zSpData2D, only: val | ||
263 | 47 | 47 | ||
264 | 48 | #ifdef MPI | 48 | #ifdef MPI |
265 | 49 | use m_mpi_utils, only: globalize_sum | 49 | use m_mpi_utils, only: globalize_sum |
266 | @@ -57,13 +57,15 @@ | |||
267 | 57 | integer :: ia, is | 57 | integer :: ia, is |
268 | 58 | 58 | ||
269 | 59 | real(dp) :: dummy_Eso | 59 | real(dp) :: dummy_Eso |
272 | 60 | integer :: io, ispin, i, j | 60 | integer :: ispin, i, j |
273 | 61 | complex(dp) :: Hc, Dc | 61 | complex(dp) :: Dc |
274 | 62 | #ifdef MPI | 62 | #ifdef MPI |
276 | 63 | real(dp) :: buffer1 | 63 | real(dp) :: buffer1 |
277 | 64 | #endif | 64 | #endif |
278 | 65 | 65 | ||
280 | 66 | real(dp), pointer :: H_val(:), H_so(:,:) | 66 | real(dp), pointer :: H_val(:), H_so_on(:,:) |
281 | 67 | complex(dp), pointer :: H_so_off(:,:) | ||
282 | 68 | |||
283 | 67 | 69 | ||
284 | 68 | #ifdef DEBUG | 70 | #ifdef DEBUG |
285 | 69 | call write_debug( ' PRE setup_H0' ) | 71 | call write_debug( ' PRE setup_H0' ) |
286 | @@ -136,13 +138,14 @@ | |||
287 | 136 | & H_val, | 138 | & H_val, |
288 | 137 | & matrix_elements_only=.true.) | 139 | & matrix_elements_only=.true.) |
289 | 138 | else | 140 | else |
292 | 139 | H0_offsiteSO=dcmplx(0.0d0,0.0d0) | 141 | H_so_off => val(H_so_off_2D) |
293 | 140 | call nlefsm_offsiteSO(scell, na_u, na_s, isa, xa, indxua, | 142 | H_so_off = dcmplx(0._dp, 0._dp) |
294 | 143 | call nlefsm_SO_off(scell, na_u, na_s, isa, xa, indxua, | ||
295 | 141 | & maxnh, maxnh, lasto, lastkb, iphorb, iphKB, | 144 | & maxnh, maxnh, lasto, lastkb, iphorb, iphKB, |
296 | 142 | & numh, listhptr, listh, numh, listhptr, listh, | 145 | & numh, listhptr, listh, numh, listhptr, listh, |
297 | 143 | & spin%Grid, | 146 | & spin%Grid, |
298 | 144 | & dummy_E, dummy_Eso, dummy_fa, | 147 | & dummy_E, dummy_Eso, dummy_fa, |
300 | 145 | & dummy_stress, H_val, | 148 | & dummy_stress, H_val, H_so_off, |
301 | 146 | & matrix_elements_only=.true.) | 149 | & matrix_elements_only=.true.) |
302 | 147 | 150 | ||
303 | 148 | 151 | ||
304 | @@ -153,24 +156,20 @@ | |||
305 | 153 | ! DM in a such way that the result gives Re{Tr[H_SO*DM]}. | 156 | ! DM in a such way that the result gives Re{Tr[H_SO*DM]}. |
306 | 154 | ! | 157 | ! |
307 | 155 | 158 | ||
309 | 156 | do io = 1, maxnh | 159 | do i = 1, maxnh |
310 | 157 | 160 | ||
311 | 158 | !-------- Eso(u,u) | 161 | !-------- Eso(u,u) |
315 | 159 | Dc = cmplx(Dscf(io,1),Dscf(io,5),kind=dp) | 162 | Dc = cmplx(Dscf(i,1),Dscf(i,5), dp) |
316 | 160 | Hc = H0_offsiteSO(io,1) | 163 | Eso = Eso + real( H_so_off(i,1)*Dc, dp) |
314 | 161 | Eso = Eso + real( Hc*Dc ) | ||
317 | 162 | !-------- Eso(d,d) | 164 | !-------- Eso(d,d) |
321 | 163 | Dc = cmplx(Dscf(io,2),Dscf(io,6),kind=dp) | 165 | Dc = cmplx(Dscf(i,2),Dscf(i,6),dp) |
322 | 164 | Hc = H0_offsiteSO(io,2) | 166 | Eso = Eso + real( H_so_off(i,2)*Dc, dp) |
320 | 165 | Eso = Eso + real( Hc*Dc ) | ||
323 | 166 | !-------- Eso(u,d) | 167 | !-------- Eso(u,d) |
327 | 167 | Dc = cmplx(Dscf(io,3),Dscf(io,4),kind=dp) | 168 | Dc = cmplx(Dscf(i,3),Dscf(i,4), dp) |
328 | 168 | Hc = H0_offsiteSO(io,4) | 169 | Eso = Eso + real( H_so_off(i,4)*Dc, dp) |
326 | 169 | Eso = Eso + real( Hc*Dc ) | ||
329 | 170 | !-------- Eso(d,u) | 170 | !-------- Eso(d,u) |
333 | 171 | Dc = cmplx(Dscf(io,7),-Dscf(io,8),kind=dp) | 171 | Dc = cmplx(Dscf(i,7),-Dscf(i,8), dp) |
334 | 172 | Hc = H0_offsiteSO(io,3) | 172 | Eso = Eso + real( H_so_off(i,3)*Dc, dp) |
332 | 173 | Eso = Eso + real( Hc*Dc ) | ||
335 | 174 | 173 | ||
336 | 175 | enddo | 174 | enddo |
337 | 176 | 175 | ||
338 | @@ -188,12 +187,12 @@ | |||
339 | 188 | ! should be enough | 187 | ! should be enough |
340 | 189 | ! | 188 | ! |
341 | 190 | if ( spin%SO_onsite ) then | 189 | if ( spin%SO_onsite ) then |
343 | 191 | H_so => val(H_so_2D) | 190 | H_so_on => val(H_so_on_2D) |
344 | 192 | !$OMP parallel workshare default(shared) | 191 | !$OMP parallel workshare default(shared) |
346 | 193 | H_so = 0._dp | 192 | H_so_on(:,:) = 0._dp |
347 | 194 | !$OMP end parallel workshare | 193 | !$OMP end parallel workshare |
348 | 195 | call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo, | 194 | call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo, |
350 | 196 | & maxnh,numh,listhptr,listh,Dscf,H_so,Eso) | 195 | & maxnh,numh,listhptr,listh,Dscf,H_so_on,Eso) |
351 | 197 | end if | 196 | end if |
352 | 198 | 197 | ||
353 | 199 | C This will take care of possible changes to the mesh and atomic-related | 198 | C This will take care of possible changes to the mesh and atomic-related |
354 | 200 | 199 | ||
355 | === modified file 'Src/setup_hamiltonian.F' | |||
356 | --- Src/setup_hamiltonian.F 2018-04-20 09:41:55 +0000 | |||
357 | +++ Src/setup_hamiltonian.F 2018-04-23 11:10:59 +0000 | |||
358 | @@ -14,12 +14,14 @@ | |||
359 | 14 | 14 | ||
360 | 15 | USE siesta_options | 15 | USE siesta_options |
361 | 16 | use sparse_matrices, only: H_kin_1D, H_vkb_1D | 16 | use sparse_matrices, only: H_kin_1D, H_vkb_1D |
363 | 17 | use sparse_matrices, only: H_ldau_2D, H_so_2D | 17 | use sparse_matrices, only: H_ldau_2D |
364 | 18 | use sparse_matrices, only: H_so_on_2D, H_so_off_2D | ||
365 | 18 | use sparse_matrices, only: listh, listhptr, numh, maxnh | 19 | use sparse_matrices, only: listh, listhptr, numh, maxnh |
366 | 19 | use sparse_matrices, only: H, S, Hold | 20 | use sparse_matrices, only: H, S, Hold |
367 | 20 | use sparse_matrices, only: Dscf, Escf, xijo | 21 | use sparse_matrices, only: Dscf, Escf, xijo |
368 | 21 | use class_dSpData1D, only: val | 22 | use class_dSpData1D, only: val |
369 | 22 | use class_dSpData2D, only: val | 23 | use class_dSpData2D, only: val |
370 | 24 | use class_zSpData2D, only: val | ||
371 | 23 | 25 | ||
372 | 24 | use siesta_geom | 26 | use siesta_geom |
373 | 25 | use atmfuncs, only: uion | 27 | use atmfuncs, only: uion |
374 | @@ -42,7 +44,6 @@ | |||
375 | 42 | use m_ntm | 44 | use m_ntm |
376 | 43 | 45 | ||
377 | 44 | use m_spin, only: spin | 46 | use m_spin, only: spin |
378 | 45 | use sparse_matrices, only: H0_offsiteSO | ||
379 | 46 | 47 | ||
380 | 47 | use m_dipol | 48 | use m_dipol |
381 | 48 | use alloc, only: re_alloc, de_alloc | 49 | use alloc, only: re_alloc, de_alloc |
382 | @@ -71,9 +72,11 @@ | |||
383 | 71 | type(filesOut_t) :: filesOut ! blank output file names | 72 | type(filesOut_t) :: filesOut ! blank output file names |
384 | 72 | logical :: use_rhog_in | 73 | logical :: use_rhog_in |
385 | 73 | 74 | ||
387 | 74 | real(dp), pointer :: H_vkb(:), H_kin(:), H_ldau(:,:), H_so(:,:) | 75 | real(dp), pointer :: H_vkb(:), H_kin(:), H_ldau(:,:) |
388 | 76 | real(dp), pointer :: H_so_on(:,:) | ||
389 | 77 | complex(dp), pointer:: H_so_off(:,:) | ||
390 | 75 | 78 | ||
392 | 76 | complex(dp):: Hc, Dc | 79 | complex(dp):: Dc |
393 | 77 | integer :: ind, i, j | 80 | integer :: ind, i, j |
394 | 78 | 81 | ||
395 | 79 | !------------------------------------------------------------------------- BEGIN | 82 | !------------------------------------------------------------------------- BEGIN |
396 | @@ -90,53 +93,53 @@ | |||
397 | 90 | do ispin = 1, spin%H | 93 | do ispin = 1, spin%H |
398 | 91 | do io = 1,maxnh | 94 | do io = 1,maxnh |
399 | 92 | Hold(io,ispin) = H(io,ispin) | 95 | Hold(io,ispin) = H(io,ispin) |
402 | 93 | enddo | 96 | end do |
403 | 94 | enddo | 97 | end do |
404 | 95 | !$OMP end do | 98 | !$OMP end do |
405 | 96 | 99 | ||
406 | 97 | !$OMP single | 100 | !$OMP single |
407 | 98 | H_kin => val(H_kin_1D) | 101 | H_kin => val(H_kin_1D) |
408 | 99 | H_vkb => val(H_vkb_1D) | 102 | H_vkb => val(H_vkb_1D) |
409 | 103 | |||
410 | 100 | if ( spin%SO_onsite ) then | 104 | if ( spin%SO_onsite ) then |
414 | 101 | ! Sadly some compilers (g95), does | 105 | ! Sadly some compilers (g95), does |
415 | 102 | ! not allow bounds for pointer assignments :( | 106 | ! not allow bounds for pointer assignments :( |
416 | 103 | H_so => val(H_so_2D) | 107 | H_so_on => val(H_so_on_2D) |
417 | 108 | |||
418 | 109 | else if ( spin%SO_offsite ) then | ||
419 | 110 | H_so_off => val(H_so_off_2D) | ||
420 | 111 | |||
421 | 104 | end if | 112 | end if |
422 | 105 | !$OMP end single ! keep wait | 113 | !$OMP end single ! keep wait |
423 | 106 | 114 | ||
441 | 107 | if ( .not. spin%SO_offsite ) then | 115 | ! Initialize diagonal Hamiltonian |
442 | 108 | do ispin = 1, spin%spinor | 116 | do ispin = 1, spin%spinor |
443 | 109 | if (ispin .le. 2) then | 117 | !$OMP do |
444 | 110 | !$OMP do | 118 | do io = 1,maxnh |
445 | 111 | do io = 1,maxnh | 119 | H(io,ispin) = H_kin(io) + H_vkb(io) |
446 | 112 | H(io,ispin) = H_kin(io) + H_vkb(io) | 120 | end do |
447 | 113 | end do | 121 | !$OMP end do nowait |
448 | 114 | !$OMP end do nowait | 122 | end do |
432 | 115 | else | ||
433 | 116 | !$OMP do | ||
434 | 117 | do io = 1,maxnh | ||
435 | 118 | H(io,ispin) = 0.0_dp | ||
436 | 119 | end do | ||
437 | 120 | !$OMP end do nowait | ||
438 | 121 | end if | ||
439 | 122 | end do | ||
440 | 123 | end if | ||
449 | 124 | 123 | ||
450 | 125 | if ( spin%SO_onsite ) then | 124 | if ( spin%SO_onsite ) then |
451 | 126 | !$OMP do collapse(2) | 125 | !$OMP do collapse(2) |
465 | 127 | do ispin = 3 , spin%H | 126 | do ispin = 3 , spin%H |
466 | 128 | do io = 1,maxnh | 127 | do io = 1,maxnh |
467 | 129 | H(io,ispin) = H_so(io,ispin-2) | 128 | H(io,ispin) = H_so_on(io,ispin-2) |
468 | 130 | end do | 129 | end do |
469 | 131 | end do | 130 | end do |
470 | 132 | !$OMP end do nowait | 131 | !$OMP end do nowait |
471 | 133 | else if ( spin%NCol ) then | 132 | |
472 | 134 | !$OMP do | 133 | else |
473 | 135 | do io = 1,maxnh | 134 | |
474 | 136 | H(io,3) = 0._dp | 135 | !$OMP do collapse(2) |
475 | 137 | H(io,4) = 0._dp | 136 | do ispin = 3 , spin%H |
476 | 138 | end do | 137 | do io = 1,maxnh |
477 | 139 | !$OMP end do nowait | 138 | H(io,ispin) = 0._dp |
478 | 139 | end do | ||
479 | 140 | end do | ||
480 | 141 | !$OMP end do nowait | ||
481 | 142 | |||
482 | 140 | end if | 143 | end if |
483 | 141 | 144 | ||
484 | 142 | ! .................. | 145 | ! .................. |
485 | @@ -171,40 +174,36 @@ | |||
486 | 171 | ! DM in a such way that the result gives Re{Tr[H_SO*DM]}. | 174 | ! DM in a such way that the result gives Re{Tr[H_SO*DM]}. |
487 | 172 | ! | 175 | ! |
488 | 173 | 176 | ||
491 | 174 | if( spin%SO_offsite ) then | 177 | if ( spin%SO_offsite ) then |
490 | 175 | |||
492 | 176 | do io = 1, maxnh | 178 | do io = 1, maxnh |
493 | 177 | 179 | ||
494 | 178 | !-------- Eso(u,u) | 180 | !-------- Eso(u,u) |
498 | 179 | Dc = cmplx(Dscf(io,1),Dscf(io,5),kind=dp) | 181 | Dc = cmplx(Dscf(io,1),Dscf(io,5), dp) |
499 | 180 | Hc = H0_offsiteSO(io,1) | 182 | Eso = Eso + real( H_so_off(io,1)*Dc, dp) |
497 | 181 | Eso = Eso + real( Hc*Dc ) | ||
500 | 182 | !-------- Eso(d,d) | 183 | !-------- Eso(d,d) |
504 | 183 | Dc = cmplx(Dscf(io,2),Dscf(io,6),kind=dp) | 184 | Dc = cmplx(Dscf(io,2),Dscf(io,6), dp) |
505 | 184 | Hc = H0_offsiteSO(io,2) | 185 | Eso = Eso + real( H_so_off(io,2)*Dc, dp) |
503 | 185 | Eso = Eso + real( Hc*Dc ) | ||
506 | 186 | !-------- Eso(u,d) | 186 | !-------- Eso(u,d) |
510 | 187 | Dc = cmplx(Dscf(io,3),Dscf(io,4),kind=dp) | 187 | Dc = cmplx(Dscf(io,3),Dscf(io,4), dp) |
511 | 188 | Hc = H0_offsiteSO(io,4) | 188 | Eso = Eso + real( H_so_off(io,4)*Dc, dp) |
509 | 189 | Eso = Eso + real( Hc*Dc ) | ||
512 | 190 | !-------- Eso(d,u) | 189 | !-------- Eso(d,u) |
522 | 191 | Dc = cmplx(Dscf(io,7),-Dscf(io,8),kind=dp) | 190 | Dc = cmplx(Dscf(io,7),-Dscf(io,8), dp) |
523 | 192 | Hc = H0_offsiteSO(io,3) | 191 | Eso = Eso + real( H_so_off(io,3)*Dc, dp) |
524 | 193 | Eso = Eso + real( Hc*Dc ) | 192 | |
525 | 194 | 193 | end do | |
526 | 195 | enddo | 194 | |
527 | 196 | 195 | else if ( spin%SO_onsite ) then | |
528 | 197 | endif | 196 | |
520 | 198 | |||
521 | 199 | if ( spin%SO_onsite ) then | ||
529 | 200 | !$OMP do reduction(+:Eso) | 197 | !$OMP do reduction(+:Eso) |
530 | 201 | do io = 1, maxnh | 198 | do io = 1, maxnh |
534 | 202 | Eso = Eso + H_so(io,1)*Dscf(io,7) + H_so(io,2)*Dscf(io,8) | 199 | Eso = Eso + H_so_on(io,1)*Dscf(io,7) + |
535 | 203 | . + H_so(io,5)*Dscf(io,3) + H_so(io,6)*Dscf(io,4) | 200 | & H_so_on(io,2)*Dscf(io,8)+ H_so_on(io,5)*Dscf(io,3) + |
536 | 204 | . - H_so(io,3)*Dscf(io,5) - H_so(io,4)*Dscf(io,6) | 201 | & H_so_on(io,6)*Dscf(io,4)- H_so_on(io,3)*Dscf(io,5) - |
537 | 202 | & H_so_on(io,4)*Dscf(io,6) | ||
538 | 205 | end do | 203 | end do |
539 | 206 | !$OMP end do nowait | 204 | !$OMP end do nowait |
541 | 207 | end if | 205 | |
542 | 206 | end if | ||
543 | 208 | 207 | ||
544 | 209 | !$OMP end parallel | 208 | !$OMP end parallel |
545 | 210 | 209 | ||
546 | @@ -224,10 +223,6 @@ | |||
547 | 224 | ! Non-SCF part of total energy | 223 | ! Non-SCF part of total energy |
548 | 225 | call update_E0() | 224 | call update_E0() |
549 | 226 | 225 | ||
550 | 227 | if ( spin%SO_offsite ) then | ||
551 | 228 | H(:,:) = 0.0_dp | ||
552 | 229 | endif | ||
553 | 230 | |||
554 | 231 | ! Hubbard term for LDA+U: energy, forces, stress and matrix elements .... | 226 | ! Hubbard term for LDA+U: energy, forces, stress and matrix elements .... |
555 | 232 | if( switch_ldau ) then | 227 | if( switch_ldau ) then |
556 | 233 | if ( spin%NCol ) then | 228 | if ( spin%NCol ) then |
557 | @@ -285,24 +280,20 @@ | |||
558 | 285 | 280 | ||
559 | 286 | if ( spin%SO_offsite ) then | 281 | if ( spin%SO_offsite ) then |
560 | 287 | 282 | ||
579 | 288 | do is = 1 , spin%spinor | 283 | ! H(:, [5, 6]) are not updated in dhscf, see vmat for details. |
580 | 289 | do io = 1, maxnh | 284 | |
581 | 290 | H(io,is) = H(io,is) + H_kin(io) + H_vkb(io) | 285 | !------- H(u,u) |
582 | 291 | enddo | 286 | H(:,1) = H(:,1) + real(H_so_off(:,1), dp) |
583 | 292 | enddo | 287 | H(:,5) = dimag(H_so_off(:,1)) |
584 | 293 | 288 | !------- H(d,d) | |
585 | 294 | C------- H(u,u) | 289 | H(:,2) = H(:,2) + real(H_so_off(:,2), dp) |
586 | 295 | H(:,1) = H(:,1) + real(H0_offsiteSO(:,1)) | 290 | H(:,6) = dimag(H_so_off(:,2)) |
587 | 296 | H(:,5) = imag(H0_offsiteSO(:,1)) | 291 | !------- H(u,d) |
588 | 297 | C------- H(d,d) | 292 | H(:,3) = H(:,3) + real(H_so_off(:,3), dp) |
589 | 298 | H(:,2) = H(:,2) + real(H0_offsiteSO(:,2)) | 293 | H(:,4) = H(:,4) +dimag(H_so_off(:,3)) |
590 | 299 | H(:,6) = imag(H0_offsiteSO(:,2)) | 294 | !------- H(d,u) |
591 | 300 | C------- H(u,d) | 295 | H(:,7) = H(:,7) + real(H_so_off(:,4), dp) |
592 | 301 | H(:,3) = H(:,3) + real(H0_offsiteSO(:,3)) | 296 | H(:,8) = H(:,8) -dimag(H_so_off(:,4)) |
575 | 302 | H(:,4) = H(:,4) + imag(H0_offsiteSO(:,3)) | ||
576 | 303 | C------- H(d,u) | ||
577 | 304 | H(:,7) = H(:,7) + real(H0_offsiteSO(:,4)) | ||
578 | 305 | H(:,8) = H(:,8) - imag(H0_offsiteSO(:,4)) | ||
593 | 306 | 297 | ||
594 | 307 | endif | 298 | endif |
595 | 308 | 299 | ||
596 | 309 | 300 | ||
597 | === modified file 'Src/sparse_matrices.F' | |||
598 | --- Src/sparse_matrices.F 2018-04-19 12:47:26 +0000 | |||
599 | +++ Src/sparse_matrices.F 2018-04-23 11:10:59 +0000 | |||
600 | @@ -9,6 +9,7 @@ | |||
601 | 9 | use precision | 9 | use precision |
602 | 10 | use class_dSpData1D | 10 | use class_dSpData1D |
603 | 11 | use class_dSpData2D | 11 | use class_dSpData2D |
604 | 12 | use class_zSpData2D | ||
605 | 12 | use class_Sparsity | 13 | use class_Sparsity |
606 | 13 | use class_OrbitalDistribution | 14 | use class_OrbitalDistribution |
607 | 14 | use class_Fstack_Pair_Geometry_dSpData2D | 15 | use class_Fstack_Pair_Geometry_dSpData2D |
608 | @@ -37,7 +38,10 @@ | |||
609 | 37 | ! Formerly there was a single array H0 for this | 38 | ! Formerly there was a single array H0 for this |
610 | 38 | type(dSpData1D), public, save :: H_vkb_1D, H_kin_1D | 39 | type(dSpData1D), public, save :: H_vkb_1D, H_kin_1D |
611 | 39 | ! LDA+U and spin-orbit coupling Hamiltonian | 40 | ! LDA+U and spin-orbit coupling Hamiltonian |
613 | 40 | type(dSpData2D), public, save :: H_ldau_2D, H_so_2D | 41 | type(dSpData2D), public, save :: H_ldau_2D, H_so_on_2D |
614 | 42 | ! Spin-orbit off-site | ||
615 | 43 | type(zSpData2D), public, save :: H_so_off_2D | ||
616 | 44 | |||
617 | 41 | 45 | ||
618 | 42 | ! New interface data | 46 | ! New interface data |
619 | 43 | type(Sparsity), public, save :: sparse_pattern | 47 | type(Sparsity), public, save :: sparse_pattern |
620 | @@ -56,7 +60,6 @@ | |||
621 | 56 | 60 | ||
622 | 57 | subroutine resetSparseMatrices( ) | 61 | subroutine resetSparseMatrices( ) |
623 | 58 | use alloc, only : de_alloc | 62 | use alloc, only : de_alloc |
624 | 59 | use m_spin, only : spin | ||
625 | 60 | 63 | ||
626 | 61 | implicit none | 64 | implicit none |
627 | 62 | 65 | ||
628 | @@ -67,7 +70,8 @@ | |||
629 | 67 | call delete( H_kin_1D ) | 70 | call delete( H_kin_1D ) |
630 | 68 | call delete( H_vkb_1D ) | 71 | call delete( H_vkb_1D ) |
631 | 69 | call delete( H_ldau_2D ) | 72 | call delete( H_ldau_2D ) |
633 | 70 | call delete( H_so_2D ) | 73 | call delete( H_so_on_2D ) |
634 | 74 | call delete( H_so_off_2D ) | ||
635 | 71 | 75 | ||
636 | 72 | call delete( DM_2D ) ; nullify(Dscf) | 76 | call delete( DM_2D ) ; nullify(Dscf) |
637 | 73 | call delete( EDM_2D ) ; nullify(Escf) | 77 | call delete( EDM_2D ) ; nullify(Escf) |
638 | @@ -76,10 +80,6 @@ | |||
639 | 76 | call delete( xij_2D ) ; nullify(xijo) | 80 | call delete( xij_2D ) ; nullify(xijo) |
640 | 77 | 81 | ||
641 | 78 | call delete( DM_history ) | 82 | call delete( DM_history ) |
642 | 79 | |||
643 | 80 | if( spin%SO_offsite ) then | ||
644 | 81 | call de_alloc( H0_offsiteSO, 'H0_offsiteSO', 'sparseMat' ) | ||
645 | 82 | endif | ||
646 | 83 | 83 | ||
647 | 84 | ! Using MixH is bad as several utilities | 84 | ! Using MixH is bad as several utilities |
648 | 85 | ! are not relying on FoX, better to leave out | 85 | ! are not relying on FoX, better to leave out |
649 | 86 | 86 | ||
650 | === modified file 'Src/state_init.F' | |||
651 | --- Src/state_init.F 2018-04-19 12:47:26 +0000 | |||
652 | +++ Src/state_init.F 2018-04-23 11:10:59 +0000 | |||
653 | @@ -26,10 +26,9 @@ | |||
654 | 26 | use sparse_matrices, only: xijo, xij_2D | 26 | use sparse_matrices, only: xijo, xij_2D |
655 | 27 | use sparse_matrices, only: S , S_1D | 27 | use sparse_matrices, only: S , S_1D |
656 | 28 | 28 | ||
657 | 29 | use sparse_matrices, only: H0_offsiteSO | ||
658 | 30 | |||
659 | 31 | use sparse_matrices, only: H_kin_1D, H_vkb_1D | 29 | use sparse_matrices, only: H_kin_1D, H_vkb_1D |
661 | 32 | use sparse_matrices, only: H_ldau_2D, H_so_2D | 30 | use sparse_matrices, only: H_ldau_2D |
662 | 31 | use sparse_matrices, only: H_so_on_2D, H_so_off_2D | ||
663 | 33 | 32 | ||
664 | 34 | use sparse_matrices, only: sparse_pattern | 33 | use sparse_matrices, only: sparse_pattern |
665 | 35 | use sparse_matrices, only: block_dist, single_dist | 34 | use sparse_matrices, only: block_dist, single_dist |
666 | @@ -100,6 +99,7 @@ | |||
667 | 100 | use class_Sparsity | 99 | use class_Sparsity |
668 | 101 | use class_dSpData1D | 100 | use class_dSpData1D |
669 | 102 | use class_dSpData2D | 101 | use class_dSpData2D |
670 | 102 | use class_zSpData2D | ||
671 | 103 | use class_dData2D | 103 | use class_dData2D |
672 | 104 | #ifdef TEST_IO | 104 | #ifdef TEST_IO |
673 | 105 | use m_test_io | 105 | use m_test_io |
674 | @@ -564,15 +564,14 @@ | |||
675 | 564 | end if | 564 | end if |
676 | 565 | end if | 565 | end if |
677 | 566 | 566 | ||
687 | 567 | if ( spin%SO_onsite ) then | 567 | if ( spin%SO_onsite ) then |
688 | 568 | write(oname,"(a,i0)") "H_so (onsite) at geom step ", istep | 568 | write(oname,"(a,i0)") "H_so (onsite) at geom step ", istep |
689 | 569 | call newdSpData2D(sparse_pattern,spin%H - 2, | 569 | call newdSpData2D(sparse_pattern,spin%H - 2, |
690 | 570 | & block_dist,H_so_2D,name=oname) | 570 | & block_dist,H_so_on_2D,name=oname) |
691 | 571 | end if | 571 | else if ( spin%SO_offsite ) then |
692 | 572 | 572 | write(oname,"(a,i0)") "H_so (offsite) at geom step ", istep | |
693 | 573 | if ( spin%SO_offsite ) then | 573 | call newzSpData2D(sparse_pattern,4, |
694 | 574 | call re_alloc(H0_offsiteSO, 1,maxnh, 1,4, 'H0_offsiteSO', | 574 | & block_dist,H_so_off_2D,name=oname) |
686 | 575 | $ 'state_init') | ||
695 | 576 | endif | 575 | endif |
696 | 577 | 576 | ||
697 | 578 | write(oname,"(a,i0)") "S at geom step ", istep | 577 | write(oname,"(a,i0)") "S at geom step ", istep |
698 | 579 | 578 | ||
699 | === modified file 'version.info' | |||
700 | --- version.info 2018-04-23 09:26:04 +0000 | |||
701 | +++ version.info 2018-04-23 11:10:59 +0000 | |||
702 | @@ -1,2 +1,2 @@ | |||
704 | 1 | trunk-688--merge-OSSO-700 | 1 | trunk-688--merge-OSSO-700--class-1 |
705 | 2 | 2 |
Great. Thanks!