Merge lp:~nickpapior/siesta/trunk-k-file into lp:siesta
- trunk-k-file
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Alberto Garcia |
Approved revision: | 702 |
Merged at revision: | 698 |
Proposed branch: | lp:~nickpapior/siesta/trunk-k-file |
Merge into: | lp:siesta |
Diff against target: |
9670 lines (+3312/-2590) 49 files modified
Docs/siesta.tex (+107/-48) RELEASE_NOTES (+2/-0) Src/Makefile (+62/-57) Src/compute_dm.F (+8/-5) Src/cranknic_evolk.F90 (+9/-9) Src/final_H_f_stress.F (+7/-7) Src/kpoint_grid.F90 (+0/-228) Src/kpoint_pdos.F90 (+51/-209) Src/kpoint_scf.F90 (+53/-0) Src/kpoint_t.F90 (+598/-0) Src/local_DOS.F (+3/-2) Src/m_initwf.F90 (+16/-16) Src/m_ncdf_siesta.F90 (+6/-6) Src/m_transiesta.F90 (+7/-7) Src/m_ts_fullk.F90 (+4/-4) Src/m_ts_kpoints.F90 (+0/-323) Src/m_ts_mumpsk.F90 (+4/-4) Src/m_ts_trik.F90 (+8/-8) Src/post_scf_work.F (+5/-3) Src/projected_DOS.F (+18/-31) Src/sankey_change_basis.F90 (+236/-236) Src/siesta_analysis.F (+10/-8) Src/siesta_dicts.F90 (+3/-3) Src/siesta_forces.F90 (+1/-1) Src/siesta_init.F (+13/-12) Src/siesta_tddft.F90 (+6/-6) Src/state_init.F (+18/-10) Src/ts_init.F90 (+8/-8) Src/ts_kpoint_scf.F90 (+89/-0) Src/wavefunctions.F90 (+333/-333) Src/writewave.F (+2/-2) Tests/Reference/si_coop_kp_file.out (+483/-0) Tests/si_coop_kp_file/makefile (+7/-0) Tests/si_coop_kp_file/si_coop_kp_file.KP.input (+6/-0) Tests/si_coop_kp_file/si_coop_kp_file.fdf (+41/-0) Tests/si_coop_kp_file/si_coop_kp_file.pseudos (+1/-0) Util/COOP/Makefile (+106/-98) Util/Denchar/Src/Makefile (+67/-62) Util/Gen-basis/Makefile (+106/-98) Util/Grimme/Makefile (+106/-98) Util/Helpers/Makefile (+106/-98) Util/STM/ol-stm/Src/Makefile (+106/-98) Util/SpPivot/Makefile (+106/-98) Util/TS/TBtrans/Makefile (+60/-56) Util/TS/ts2ts/Makefile (+106/-98) Util/TS/tshs2tshs/Makefile (+106/-98) Util/VCA/Makefile (+106/-98) Util/build_all.sh (+5/-3) version.info (+1/-1) |
To merge this branch: | bzr merge lp:~nickpapior/siesta/trunk-k-file |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alberto Garcia | Approve | ||
Review via email: mp+346849@code.launchpad.net |
Commit message
Restructured k-point sampling
Now k-points may be user-supplied for further finetuning.
This may be extremely useful in various situations:
1) Detailed analysis on PDOS for spin-orbit calculations
2) Faster convergence with fewer k-points
3) Improved convergence for bias calculations by adding zoom-in
k-points in the bias-window.
4) And others.
Now the kpoints are associated with a type:
kpoint_t
this will allow one to read k-points using kgrid.File flag.
The precedence is much like the older implementation:
1) kgrid.MonkhorstPack
2) kgrid.Cutoff
3) kgrid.File
in that order. If none are specified, then the Gamma-point will be used.
This meant that several places the code needed updating.
- Projected DOS k-points
- TranSiesta k-points
- SCF k-points
Now all references to the kpoint_grid module is using kpoint_scf_m module
which uses the type.
This not only reduces lots of duplicated code, but it also allows
one implementation to benefit across all code segments.
Also added a test that reads in the k-points from a file (si_coop_kp_file).
Description of the change
This commit cleans up the k-point read utilities and enables user-defined k-grids.
I.e. SCF, PDOS and TS k-point reads are done using the same code.
Secondly, the k-points are now stored in a type which may be more easily passed around.
- 700. By Nick Papior
-
Made some memory usages smaller.
- 701. By Nick Papior
-
Updated Makefiles in Util directories
Nick Papior (nickpapior) wrote : | # |
Thanks for the comments!
I have just amended a fix for your comments.
As for your suggestion 2 it requires the epsilon(k) to be rotational invariant such that one can be sure that all irreducible wedges (for any crystal) will yield the correct result. Or, did you have something else in mind?
- 702. By Nick Papior
-
Fixed Alberto's suggestions (except point #2).
Amended documentation for the kgrid.File format.
Alberto Garcia (albertog) wrote : | # |
OK. The sanity check with the model function could wait, and it should be optional in any case, since you might need a user-defined list of k-points for many things besides full sampling.
Approved.
Preview Diff
1 | === modified file 'Docs/siesta.tex' |
2 | --- Docs/siesta.tex 2018-05-15 13:01:22 +0000 |
3 | +++ Docs/siesta.tex 2018-05-27 11:17:14 +0000 |
4 | @@ -3397,37 +3397,9 @@ |
5 | |
6 | \subsection{\texorpdfstring{$k$}{k}-point sampling} |
7 | |
8 | -These are options for the k-point grid used in the SCF cycle. For |
9 | -other specialized grids, see the Macroscopic Polarization and Density |
10 | -of States sections. |
11 | - |
12 | -\begin{fdfentry}{kgrid!Cutoff}[length]<$0.\,\mathrm{Bohr}$> |
13 | - |
14 | - Parameter which determines the fineness of the k-grid used for |
15 | - Brillouin zone sampling. It is half the length of the smallest |
16 | - lattice vector of the supercell required to obtain the same sampling |
17 | - precision with a single k point. Ref: Moreno and Soler, PRB 45, |
18 | - 13891 (1992). |
19 | - |
20 | - \textit{Use:} If it is zero, only the gamma point is used. The resulting |
21 | - k-grid is chosen in an optimal way, according to the method of Moreno |
22 | - and Soler (using an effective supercell which is as spherical as |
23 | - possible, thus minimizing the number of k-points for a given |
24 | - precision). The grid is displaced for even numbers of effective mesh |
25 | - divisions. This parameter is not used if \fdf{kgrid!MonkhorstPack} |
26 | - is specified. If the unit cell changes during the calculation (for |
27 | - example, in a cell-optimization run, the k-point |
28 | - grid will change accordingly (see \fdf{ChangeKgridInMD} for the case |
29 | - of variable-cell molecular-dynamics runs, such as Parrinello-Rahman). |
30 | - This is analogous to the changes in the |
31 | - real-space grid, whose fineness is specified by an energy cutoff. If |
32 | - sudden changes in the number of k-points are not desired, then the |
33 | - Monkhorst-Pack data block should be used instead. In this case there |
34 | - will be an implicit change in the quality of the sampling as the cell |
35 | - changes. Both methods should be equivalent for a well-converged |
36 | - sampling. |
37 | - |
38 | -\end{fdfentry} |
39 | +These are options for the $k$-point grid used in the SCF cycle. For |
40 | +other specialized grids, see Secs.~\ref{sec:macroscopic-polarization} |
41 | +and \ref{sec:dos}. |
42 | |
43 | \begin{fdfentry}{kgrid!MonkhorstPack}[block]<$\Gamma$-point> |
44 | |
45 | @@ -3464,6 +3436,59 @@ |
46 | |
47 | \end{fdfentry} |
48 | |
49 | +\begin{fdfentry}{kgrid!Cutoff}[length]<$0.\,\mathrm{Bohr}$> |
50 | + |
51 | + Parameter which determines the fineness of the $k$-grid used for |
52 | + Brillouin zone sampling. It is half the length of the smallest |
53 | + lattice vector of the supercell required to obtain the same sampling |
54 | + precision with a single k point. Ref: Moreno and Soler, PRB 45, |
55 | + 13891 (1992). |
56 | + |
57 | + \textit{Use:} If it is zero, only the gamma point is used. The resulting |
58 | + k-grid is chosen in an optimal way, according to the method of Moreno |
59 | + and Soler (using an effective supercell which is as spherical as |
60 | + possible, thus minimizing the number of k-points for a given |
61 | + precision). The grid is displaced for even numbers of effective mesh |
62 | + divisions. This parameter is not used if \fdf{kgrid!MonkhorstPack} |
63 | + is specified. If the unit cell changes during the calculation (for |
64 | + example, in a cell-optimization run, the k-point |
65 | + grid will change accordingly (see \fdf{ChangeKgridInMD} for the case |
66 | + of variable-cell molecular-dynamics runs, such as Parrinello-Rahman). |
67 | + This is analogous to the changes in the |
68 | + real-space grid, whose fineness is specified by an energy cutoff. If |
69 | + sudden changes in the number of k-points are not desired, then the |
70 | + Monkhorst-Pack data block should be used instead. In this case there |
71 | + will be an implicit change in the quality of the sampling as the cell |
72 | + changes. Both methods should be equivalent for a well-converged |
73 | + sampling. |
74 | + |
75 | +\end{fdfentry} |
76 | + |
77 | +\begin{fdfentry}{kgrid!File}[string]<none> |
78 | + |
79 | + Specify a file from where the $k$-points are read in. The format of |
80 | + the file is identical to the \sysfile{KP} file with the exception |
81 | + that the $k$-points are given in units of the reciprocal lattice |
82 | + vectors. I.e. the range of the $k$-points are $]-1/2 ; 1/2]$. |
83 | + |
84 | + An example input may be (not physically justified in any sense): |
85 | + \begin{shellexample} |
86 | + 4 |
87 | + 1 0.0 0.0 0.0 0.25 |
88 | + 2 0.5 0.5 0.5 0.25 |
89 | + 3 0.2 0.2 0.2 0.25 |
90 | + 4 0.3 0.3 0.3 0.25 |
91 | + \end{shellexample} |
92 | + The first integer specifies the total number of $k$-points in the |
93 | + file. The first column is an index; the next 3 columns are the |
94 | + $k$-point specification for each of the reciprocal lattice vectors |
95 | + while the fifth column is the weight for the $k$-point. |
96 | + |
97 | + \siesta\ checks whether the sum of weights equals 1. If not, |
98 | + \siesta\ will die. |
99 | + |
100 | +\end{fdfentry} |
101 | + |
102 | \begin{fdflogicalF}{ChangeKgridInMD} |
103 | |
104 | If \fdftrue, the $k$-point grid is recomputed at every |
105 | @@ -3870,8 +3895,8 @@ |
106 | \fdf{SCF.H!Tolerance} and high values of \fdf{MeshCutoff}. We |
107 | encourage the user to test carefully these options for each system. An |
108 | additional point to take into account is the mixing scheme |
109 | -employed. You are encouraged to use \fdf{SCF.Mix:hamiltonian} |
110 | -(currently is set up by default) instead of density matrix mixing, |
111 | +employed. You are encouraged to use \fdf{SCF.Mix:Hamiltonian} |
112 | +(currently this is the default) instead of density matrix mixing, |
113 | since it speeds up the convergence. The pseudopotentials have to be |
114 | properly generated and tested for each specific system and they have |
115 | to be in their fully relativistic form, together with the non-linear |
116 | @@ -4040,14 +4065,17 @@ |
117 | |
118 | \begin{fdfoptions} |
119 | \option[Hamiltonian]% |
120 | + \fdfindex*{SCF.Mix:Hamiltonian}% |
121 | \index{SCF!mixing!Hamiltonian} |
122 | Mix the Hamiltonian matrix (default). |
123 | |
124 | \option[density]% |
125 | + \fdfindex*{SCF.Mix:density}% |
126 | \index{SCF!mixing!Density} |
127 | Mix the density matrix. |
128 | |
129 | \option[charge]% |
130 | + \fdfindex*{SCF.Mix:charge}% |
131 | \index{SCF!mixing!Charge} |
132 | Mix the real-space charge density. Note this is an experimental |
133 | feature. |
134 | @@ -7558,7 +7586,8 @@ |
135 | |
136 | |
137 | |
138 | -\subsection{Densities of states} |
139 | +\subsection{Density of states} |
140 | +\label{sec:dos} |
141 | |
142 | \subsubsection{Total density of states} |
143 | There are several options to obtain the |
144 | @@ -8001,7 +8030,7 @@ |
145 | |
146 | |
147 | \subsection{Macroscopic polarization} |
148 | - |
149 | +\label{sec:macroscopic-polarization} |
150 | |
151 | \begin{fdfentry}{PolarizationGrids}[block] |
152 | \index{bulk polarization}% |
153 | @@ -10533,18 +10562,20 @@ |
154 | |
155 | \begin{fdfentry}{MD.TypeOfRun}[string]<TDED> |
156 | |
157 | -A new Molecular Dynamics option, \fdf{TDED}, has been |
158 | -included. The second run of \siesta\ uses this option with the files |
159 | -\sysfile{TDWF} and \sysfile{TDXV} present in the working directory. In this option ions |
160 | -and electrons are assumed to move simultaneously. The occupied |
161 | -electronic states are time-evolved instead of the usual SCF |
162 | -calculations in each step. Choose this option even if you intend to |
163 | -do only-electron dynamics. If you want to do an electron dynamics-only |
164 | -calculation set \fdf{MD.FinalTimeStep} equal to $1$. For optical |
165 | -response calculations switch off the external field during the second |
166 | -run. The \fdf{MD.LengthTimeStep}, unlike in the standard MD simulation, |
167 | -is defined by mulitpilication of \fdf{TDED.TimeStep} and \fdf{TDED.Nsteps}. |
168 | -In TDDFT calculations, the user defined \fdf{MD.LengthTimeStep} is ignored. |
169 | + A new Molecular Dynamics option, \fdf{TDED}, has been included. The |
170 | + second run of \siesta\ uses this option with the files |
171 | + \sysfile{TDWF} and \sysfile{TDXV} present in the working directory. |
172 | + In this option ions and electrons are assumed to move |
173 | + simultaneously. The occupied electronic states are time-evolved |
174 | + instead of the usual SCF calculations in each step. Choose this |
175 | + option even if you intend to do only-electron dynamics. If you want |
176 | + to do an electron dynamics-only calculation set |
177 | + \fdf{MD.FinalTimeStep} equal to $1$. For optical response |
178 | + calculations switch off the external field during the second |
179 | + run. The \fdf{MD.LengthTimeStep}, unlike in the standard MD |
180 | + simulation, is defined by mulitpilication of \fdf{TDED.TimeStep} and |
181 | + \fdf{TDED.Nsteps}. In TDDFT calculations, the user defined |
182 | + \fdf{MD.LengthTimeStep} is ignored. |
183 | |
184 | \end{fdfentry} |
185 | |
186 | @@ -11535,6 +11566,34 @@ |
187 | |
188 | \end{fdflogicalF} |
189 | |
190 | +\subsection{\texorpdfstring{$k$}{k}-point sampling} |
191 | + |
192 | +The options for $k$-point sampling are identical to the \siesta\ |
193 | +options, \fdf{kgrid!MonkhorstPack}, \fdf{kgrid!Cutoff} or |
194 | +\fdf{kgrid!File}. |
195 | + |
196 | +One may however use specific \tsiesta\ $k$-points by using these |
197 | +options: |
198 | + |
199 | +\begin{fdfentry}{TS.kgrid!MonkhorstPack}[block]<\fdfvalue{kgrid!MonkhorstPack}>% |
200 | + |
201 | + See \fdf{kgrid!MonkhorstPack} for details. |
202 | + |
203 | +\end{fdfentry} |
204 | + |
205 | +\begin{fdfentry}{TS.kgrid!Cutoff}[length]<$0.\,\mathrm{Bohr}$> |
206 | + |
207 | + See \fdf{kgrid!Cutoff} for details. |
208 | + |
209 | +\end{fdfentry} |
210 | + |
211 | +\begin{fdfentry}{TS.kgrid!File}[string]<none> |
212 | + |
213 | + See \fdf{kgrid!File} for details. |
214 | + |
215 | +\end{fdfentry} |
216 | + |
217 | + |
218 | \subsubsection{Algorithm specific options} |
219 | |
220 | These options adhere to the specific solution methods available for |
221 | @@ -12576,7 +12635,7 @@ |
222 | \sysfile{TSDE}. This file also contains geometry information |
223 | etc. needed by \tsiesta\ and \tbtrans. |
224 | |
225 | - \item[\sysfile{TSKP}]: The $k$-points used in the \tsiesta\ calculation. See |
226 | + \item[\sysfile{TS.KP}]: The $k$-points used in the \tsiesta\ calculation. See |
227 | \siesta\ \sysfile{KP} file for formatting information. |
228 | |
229 | \item[\sysfile{TSCCEQ*}]: The equilibrium complex contour integration paths. |
230 | |
231 | === modified file 'RELEASE_NOTES' |
232 | --- RELEASE_NOTES 2018-04-15 15:29:11 +0000 |
233 | +++ RELEASE_NOTES 2018-05-27 11:17:14 +0000 |
234 | @@ -18,6 +18,8 @@ |
235 | |
236 | *** New features |
237 | |
238 | + - Enabled custom k-points in PDOS and SCF calculations. |
239 | + |
240 | - Added the CheSS solver as a new solution method. This is |
241 | a linear scaling solver which calculates the density matrix and the |
242 | energy density matrix. |
243 | |
244 | === modified file 'Src/Makefile' |
245 | --- Src/Makefile 2018-05-15 13:01:22 +0000 |
246 | +++ Src/Makefile 2018-05-27 11:17:14 +0000 |
247 | @@ -103,9 +103,10 @@ |
248 | savepsi.o shaper.o timer_tree.o timer.o \ |
249 | vmb.o vmat.o vmatsp.o volcel.o \ |
250 | cgvc.o cgvc_zmatrix.o m_convergence.o \ |
251 | - iocg.o ioeig.o iofa.o iokp.o iomd.o kpoint_pdos.o typecell.o \ |
252 | + kpoint_t.o kpoint_scf.o kpoint_pdos.o \ |
253 | + iocg.o ioeig.o iofa.o iokp.o iomd.o typecell.o \ |
254 | ofc.o poison.o readsp.o radfft.o \ |
255 | - write_md_record.o kpoint_grid.o find_kgrid.o proximity_check.o\ |
256 | + write_md_record.o find_kgrid.o proximity_check.o\ |
257 | state_init.o siesta_move.o setup_hamiltonian.o compute_dm.o mixer.o\ |
258 | scfconvergence_test.o post_scf_work.o state_analysis.o write_subs.o \ |
259 | siesta_init.o struct_init.o siesta_options.o read_options.o siesta_geom.o \ |
260 | @@ -443,7 +444,7 @@ |
261 | OBJS += m_ts_io.o |
262 | |
263 | # TranSIESTA... |
264 | -TS_OBJS= m_ts_global_vars.o m_ts_options.o m_ts_aux.o m_ts_kpoints.o \ |
265 | +TS_OBJS= m_ts_global_vars.o m_ts_options.o m_ts_aux.o ts_kpoint_scf.o \ |
266 | m_ts_iodm.o \ |
267 | m_ts_electrode.o m_ts_gf.o \ |
268 | m_ts_cctype.o ts_init.o ts_show_regions.o m_ts_electype.o \ |
269 | @@ -629,7 +630,7 @@ |
270 | class_TriMat.o: alloc.o intrinsic_missing.o |
271 | coceri.o: files.o periodic_table.o precision.o units.o |
272 | compute_dm.o: atomlist.o class_SpData1D.o compute_ebs_shift.o diagon.o |
273 | -compute_dm.o: iodmhs_netcdf.o kpoint_grid.o m_chess.o m_dminim.o m_energies.o |
274 | +compute_dm.o: iodmhs_netcdf.o kpoint_scf.o m_chess.o m_dminim.o m_energies.o |
275 | compute_dm.o: m_eo.o m_gamma.o m_hsx.o m_pexsi_driver.o m_rmaxh.o m_spin.o |
276 | compute_dm.o: m_steps.o m_transiesta.o m_ts_global_vars.o m_zminim.o |
277 | compute_dm.o: normalize_dm.o ordern.o parallel.o precision.o siesta_geom.o |
278 | @@ -656,7 +657,7 @@ |
279 | cranknic_evolg.o: m_matswinvers.o m_spin.o m_steps.o parallel.o parallelsubs.o |
280 | cranknic_evolg.o: precision.o siesta_options.o sparse_matrices.o sys.o units.o |
281 | cranknic_evolg.o: wavefunctions.o |
282 | -cranknic_evolk.o: atomlist.o cranknic_evolg.o kpoint_grid.o m_energies.o m_eo.o |
283 | +cranknic_evolk.o: atomlist.o cranknic_evolg.o kpoint_scf.o m_energies.o m_eo.o |
284 | cranknic_evolk.o: m_spin.o parallel.o parallelsubs.o precision.o |
285 | cranknic_evolk.o: siesta_options.o sparse_matrices.o units.o wavefunctions.o |
286 | create_Sparsity_SC.o: class_Sparsity.o geom_helper.o intrinsic_missing.o |
287 | @@ -731,10 +732,10 @@ |
288 | final_H_f_stress.o: ldau.o ldau_specs.o m_dipol.o m_energies.o m_forces.o |
289 | final_H_f_stress.o: m_gamma.o m_hsx.o m_mpi_utils.o m_ncdf_siesta.o m_ntm.o |
290 | final_H_f_stress.o: m_spin.o m_steps.o m_stress.o m_ts_global_vars.o m_ts_io.o |
291 | -final_H_f_stress.o: m_ts_kpoints.o m_ts_options.o metaforce.o |
292 | -final_H_f_stress.o: molecularmechanics.o naefs.o nlefsm.o overfsm.o parallel.o |
293 | -final_H_f_stress.o: siesta_geom.o siesta_options.o sparse_matrices.o |
294 | -final_H_f_stress.o: spinorbit.o sys.o units.o |
295 | +final_H_f_stress.o: m_ts_options.o metaforce.o molecularmechanics.o naefs.o |
296 | +final_H_f_stress.o: nlefsm.o overfsm.o parallel.o siesta_geom.o |
297 | +final_H_f_stress.o: siesta_options.o sparse_matrices.o spinorbit.o sys.o |
298 | +final_H_f_stress.o: ts_kpoint_scf.o units.o |
299 | find_kgrid.o: alloc.o minvec.o parallel.o precision.o units.o |
300 | fire_optim.o: alloc.o m_fire.o m_mpi_utils.o parallel.o precision.o |
301 | fire_optim.o: siesta_options.o units.o |
302 | @@ -785,10 +786,10 @@ |
303 | kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o |
304 | kinefsm.o: precision.o |
305 | kpoint_convert.o: precision.o sys.o units.o |
306 | -kpoint_grid.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o |
307 | -kpoint_grid.o: siesta_cml.o siesta_options.o sys.o units.o |
308 | -kpoint_pdos.o: find_kgrid.o m_spin.o minvec.o parallel.o precision.o |
309 | -kpoint_pdos.o: siesta_options.o sys.o units.o |
310 | +kpoint_pdos.o: kpoint_t.o m_spin.o parallel.o precision.o siesta_options.o |
311 | +kpoint_scf.o: kpoint_t.o m_spin.o parallel.o precision.o siesta_options.o |
312 | +kpoint_t.o: alloc.o files.o find_kgrid.o m_char.o m_io.o m_os.o minvec.o |
313 | +kpoint_t.o: parallel.o precision.o siesta_cml.o units.o |
314 | ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o parallel.o precision.o sys.o |
315 | ksvinit.o: alloc.o parallel.o precision.o sys.o |
316 | ldau.o: alloc.o atm_types.o atmfuncs.o compute_max_diff.o ldau_specs.o |
317 | @@ -798,7 +799,7 @@ |
318 | ldau_specs.o: basis_specs.o basis_types.o interpolation.o m_cite.o parallel.o |
319 | ldau_specs.o: precision.o pseudopotential.o radial.o sys.o units.o |
320 | listsc.o: alloc.o |
321 | -local_DOS.o: atomlist.o dhscf.o diagon.o files.o kpoint_grid.o m_energies.o |
322 | +local_DOS.o: atomlist.o dhscf.o diagon.o files.o kpoint_scf.o m_energies.o |
323 | local_DOS.o: m_eo.o m_forces.o m_gamma.o m_ntm.o m_spin.o parallel.o |
324 | local_DOS.o: siesta_geom.o siesta_options.o sparse_matrices.o sys.o |
325 | m_broyddj.o: alloc.o m_mpi_utils.o parallel.o precision.o sys.o |
326 | @@ -847,7 +848,7 @@ |
327 | m_hsx.o: atm_types.o atmfuncs.o atomlist.o files.o parallel.o parallelsubs.o |
328 | m_hsx.o: precision.o siesta_geom.o sys.o |
329 | m_initwf.o: alloc.o atomlist.o densematrix.o diag.o diag_option.o fermid.o |
330 | -m_initwf.o: kpoint_grid.o m_eo.o m_gamma.o m_memory.o m_spin.o parallel.o |
331 | +m_initwf.o: kpoint_scf.o m_eo.o m_gamma.o m_memory.o m_spin.o parallel.o |
332 | m_initwf.o: parallelsubs.o precision.o sparse_matrices.o sys.o wavefunctions.o |
333 | m_integrate.o: precision.o |
334 | m_inversemm.o: precision.o |
335 | @@ -879,10 +880,10 @@ |
336 | m_ncdf_io.o: class_OrbitalDistribution.o class_SpData1D.o class_SpData2D.o |
337 | m_ncdf_io.o: class_Sparsity.o m_io_s.o parallel.o precision.o |
338 | m_ncdf_siesta.o: atm_types.o atmparams.o atomlist.o class_Sparsity.o files.o |
339 | -m_ncdf_siesta.o: kpoint_grid.o m_energies.o m_forces.o m_gamma.o m_kinetic.o |
340 | +m_ncdf_siesta.o: kpoint_scf.o m_energies.o m_forces.o m_gamma.o m_kinetic.o |
341 | m_ncdf_siesta.o: m_ncdf_io.o m_ntm.o m_spin.o m_stress.o m_ts_electype.o |
342 | -m_ncdf_siesta.o: m_ts_kpoints.o m_ts_options.o parallel.o precision.o radial.o |
343 | -m_ncdf_siesta.o: siesta_geom.o siesta_options.o sparse_matrices.o timestamp.o |
344 | +m_ncdf_siesta.o: m_ts_options.o parallel.o precision.o radial.o siesta_geom.o |
345 | +m_ncdf_siesta.o: siesta_options.o sparse_matrices.o timestamp.o ts_kpoint_scf.o |
346 | m_new_dm.o: alloc.o atomlist.o class_Data2D.o class_Fstack_Data1D.o |
347 | m_new_dm.o: class_Fstack_Pair_Geometry_SpData2D.o class_Geometry.o |
348 | m_new_dm.o: class_OrbitalDistribution.o class_Pair_Geometry_SpData2D.o |
349 | @@ -946,9 +947,9 @@ |
350 | m_transiesta.o: class_SpData2D.o class_Sparsity.o files.o m_interpolate.o |
351 | m_transiesta.o: m_ts_charge.o m_ts_contour_eq.o m_ts_contour_neq.o |
352 | m_transiesta.o: m_ts_electype.o m_ts_fullg.o m_ts_fullk.o m_ts_gf.o |
353 | -m_transiesta.o: m_ts_kpoints.o m_ts_method.o m_ts_mumpsg.o m_ts_mumpsk.o |
354 | -m_transiesta.o: m_ts_options.o m_ts_sparse.o m_ts_tri_common.o m_ts_tri_init.o |
355 | -m_transiesta.o: m_ts_trig.o m_ts_trik.o parallel.o precision.o units.o |
356 | +m_transiesta.o: m_ts_method.o m_ts_mumpsg.o m_ts_mumpsk.o m_ts_options.o |
357 | +m_transiesta.o: m_ts_sparse.o m_ts_tri_common.o m_ts_tri_init.o m_ts_trig.o |
358 | +m_transiesta.o: m_ts_trik.o parallel.o precision.o ts_kpoint_scf.o units.o |
359 | m_trialorbitalclass.o: precision.o units.o |
360 | m_trimat_invert.o: class_TriMat.o intrinsic_missing.o m_pivot_array.o |
361 | m_trimat_invert.o: precision.o |
362 | @@ -1001,9 +1002,9 @@ |
363 | m_ts_fullk.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o m_iterator.o |
364 | m_ts_fullk.o: m_ts_cctype.o m_ts_contour_eq.o m_ts_contour_neq.o m_ts_debug.o |
365 | m_ts_fullk.o: m_ts_dm_update.o m_ts_elec_se.o m_ts_electype.o m_ts_full_scat.o |
366 | -m_ts_fullk.o: m_ts_gf.o m_ts_kpoints.o m_ts_method.o m_ts_options.o |
367 | -m_ts_fullk.o: m_ts_sparse.o m_ts_sparse_helper.o m_ts_weight.o parallel.o |
368 | -m_ts_fullk.o: precision.o units.o |
369 | +m_ts_fullk.o: m_ts_gf.o m_ts_method.o m_ts_options.o m_ts_sparse.o |
370 | +m_ts_fullk.o: m_ts_sparse_helper.o m_ts_weight.o parallel.o precision.o |
371 | +m_ts_fullk.o: ts_kpoint_scf.o units.o |
372 | m_ts_gf.o: m_os.o m_ts_cctype.o m_ts_contour_eq.o m_ts_contour_neq.o |
373 | m_ts_gf.o: m_ts_electrode.o m_ts_electype.o parallel.o precision.o sys.o |
374 | m_ts_gf.o: units.o |
375 | @@ -1017,9 +1018,6 @@ |
376 | m_ts_io_ctype.o: m_io.o parallel.o precision.o units.o |
377 | m_ts_iodm.o: class_OrbitalDistribution.o class_SpData2D.o class_Sparsity.o |
378 | m_ts_iodm.o: m_io_s.o m_os.o parallel.o precision.o |
379 | -m_ts_kpoints.o: files.o find_kgrid.o kpoint_grid.o m_ts_global_vars.o |
380 | -m_ts_kpoints.o: m_ts_tdir.o minvec.o parallel.o precision.o siesta_cml.o |
381 | -m_ts_kpoints.o: siesta_options.o sys.o |
382 | m_ts_method.o: alloc.o fdf_extra.o geom_helper.o m_region.o m_ts_electype.o |
383 | m_ts_mumps_init.o: class_OrbitalDistribution.o class_Sparsity.o |
384 | m_ts_mumps_init.o: create_Sparsity_Union.o m_ts_electype.o m_ts_method.o |
385 | @@ -1036,10 +1034,10 @@ |
386 | m_ts_mumpsk.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o |
387 | m_ts_mumpsk.o: intrinsic_missing.o m_iterator.o m_ts_cctype.o m_ts_contour_eq.o |
388 | m_ts_mumpsk.o: m_ts_contour_neq.o m_ts_debug.o m_ts_dm_update.o m_ts_elec_se.o |
389 | -m_ts_mumpsk.o: m_ts_electype.o m_ts_gf.o m_ts_kpoints.o m_ts_method.o |
390 | -m_ts_mumpsk.o: m_ts_mumps_init.o m_ts_mumps_scat.o m_ts_options.o m_ts_sparse.o |
391 | +m_ts_mumpsk.o: m_ts_electype.o m_ts_gf.o m_ts_method.o m_ts_mumps_init.o |
392 | +m_ts_mumpsk.o: m_ts_mumps_scat.o m_ts_options.o m_ts_sparse.o |
393 | m_ts_mumpsk.o: m_ts_sparse_helper.o m_ts_weight.o parallel.o precision.o |
394 | -m_ts_mumpsk.o: units.o |
395 | +m_ts_mumpsk.o: ts_kpoint_scf.o units.o |
396 | m_ts_options.o: files.o intrinsic_missing.o m_mixing.o m_mixing_scf.o m_os.o |
397 | m_ts_options.o: m_ts_charge.o m_ts_chem_pot.o m_ts_contour.o m_ts_contour_eq.o |
398 | m_ts_options.o: m_ts_contour_neq.o m_ts_electype.o m_ts_global_vars.o |
399 | @@ -1084,10 +1082,10 @@ |
400 | m_ts_trik.o: m_iterator.o m_mat_invert.o m_region.o m_trimat_invert.o |
401 | m_ts_trik.o: m_ts_cctype.o m_ts_charge.o m_ts_contour_eq.o m_ts_contour_neq.o |
402 | m_ts_trik.o: m_ts_debug.o m_ts_dm_update.o m_ts_elec_se.o m_ts_electype.o |
403 | -m_ts_trik.o: m_ts_gf.o m_ts_kpoints.o m_ts_method.o m_ts_options.o |
404 | -m_ts_trik.o: m_ts_sparse.o m_ts_sparse_helper.o m_ts_tri_common.o |
405 | -m_ts_trik.o: m_ts_tri_init.o m_ts_tri_scat.o m_ts_trimat_invert.o m_ts_weight.o |
406 | -m_ts_trik.o: parallel.o precision.o units.o |
407 | +m_ts_trik.o: m_ts_gf.o m_ts_method.o m_ts_options.o m_ts_sparse.o |
408 | +m_ts_trik.o: m_ts_sparse_helper.o m_ts_tri_common.o m_ts_tri_init.o |
409 | +m_ts_trik.o: m_ts_tri_scat.o m_ts_trimat_invert.o m_ts_weight.o parallel.o |
410 | +m_ts_trik.o: precision.o ts_kpoint_scf.o units.o |
411 | m_ts_trimat_invert.o: class_TriMat.o m_pivot_array.o m_region.o |
412 | m_ts_trimat_invert.o: m_trimat_invert.o m_ts_electype.o m_ts_method.o |
413 | m_ts_trimat_invert.o: precision.o |
414 | @@ -1175,16 +1173,16 @@ |
415 | poison.o: alloc.o cellsubs.o chkgmx.o fft.o parallel.o precision.o sys.o |
416 | post_scf_work.o: atomlist.o class_Fstack_Pair_Geometry_SpData2D.o |
417 | post_scf_work.o: class_Geometry.o class_Pair_Geometry_SpData2D.o compute_dm.o |
418 | -post_scf_work.o: diagon.o final_H_f_stress.o kpoint_grid.o m_dminim.o |
419 | +post_scf_work.o: diagon.o final_H_f_stress.o kpoint_scf.o m_dminim.o |
420 | post_scf_work.o: m_energies.o m_eo.o m_gamma.o m_spin.o m_steps.o m_zminim.o |
421 | post_scf_work.o: mneighb.o parallel.o siesta_geom.o siesta_options.o |
422 | post_scf_work.o: sparse_matrices.o |
423 | print_spin.o: atomlist.o m_mpi_utils.o m_spin.o parallel.o precision.o |
424 | print_spin.o: siesta_cml.o sparse_matrices.o |
425 | printmatrix.o: alloc.o |
426 | -projected_DOS.o: alloc.o atomlist.o kpoint_grid.o kpoint_pdos.o m_eo.o |
427 | -projected_DOS.o: m_gamma.o m_spin.o parallel.o precision.o siesta_geom.o |
428 | -projected_DOS.o: siesta_options.o sparse_matrices.o sys.o units.o |
429 | +projected_DOS.o: alloc.o atomlist.o kpoint_pdos.o kpoint_scf.o m_eo.o m_gamma.o |
430 | +projected_DOS.o: m_spin.o parallel.o precision.o siesta_geom.o siesta_options.o |
431 | +projected_DOS.o: sparse_matrices.o sys.o units.o |
432 | propor.o: precision.o sys.o |
433 | proximity_check.o: chemical.o m_ts_global_vars.o mneighb.o parallel.o |
434 | proximity_check.o: precision.o siesta_geom.o siesta_options.o units.o |
435 | @@ -1213,7 +1211,7 @@ |
436 | rhoofd.o: meshdscf.o meshphi.o parallel.o parallelsubs.o precision.o sys.o |
437 | rhoofdsp.o: alloc.o atm_types.o atmfuncs.o atomlist.o listsc.o mesh.o |
438 | rhoofdsp.o: meshdscf.o meshphi.o precision.o sys.o |
439 | -sankey_change_basis.o: alloc.o atomlist.o diag_option.o kpoint_grid.o m_gamma.o |
440 | +sankey_change_basis.o: alloc.o atomlist.o diag_option.o kpoint_scf.o m_gamma.o |
441 | sankey_change_basis.o: m_matdiag.o m_spin.o parallel.o parallelsubs.o |
442 | sankey_change_basis.o: precision.o sparse_matrices.o sys.o wavefunctions.o |
443 | save_density_matrix.o: atomlist.o files.o iodm_netcdf.o m_energies.o m_iodm.o |
444 | @@ -1249,7 +1247,7 @@ |
445 | siesta2wannier90.o: files.o m_digest_nnkp.o m_spin.o m_trialorbitalclass.o |
446 | siesta2wannier90.o: parallel.o precision.o siesta_options.o sys.o |
447 | siesta_analysis.o: alloc.o atomlist.o bands.o basis_enthalpy.o dhscf.o files.o |
448 | -siesta_analysis.o: flook_siesta.o kpoint_grid.o ksv.o ksvinit.o local_DOS.o |
449 | +siesta_analysis.o: flook_siesta.o kpoint_scf.o ksv.o ksvinit.o local_DOS.o |
450 | siesta_analysis.o: m_dipol.o m_energies.o m_eo.o m_forces.o m_gamma.o |
451 | siesta_analysis.o: m_iodm_old.o m_mpi_utils.o m_ntm.o m_partial_charges.o |
452 | siesta_analysis.o: m_pexsi_dos.o m_pexsi_local_dos.o m_spin.o m_steps.o |
453 | @@ -1258,7 +1256,7 @@ |
454 | siesta_analysis.o: write_subs.o writewave.o zmatrix.o |
455 | siesta_cmlsubs.o: files.o m_uuid.o parallel.o siesta_cml.o timestamp.o |
456 | siesta_cmlsubs.o: |
457 | -siesta_dicts.o: atomlist.o files.o kpoint_grid.o m_energies.o m_forces.o |
458 | +siesta_dicts.o: atomlist.o files.o kpoint_scf.o m_energies.o m_forces.o |
459 | siesta_dicts.o: m_mixing_scf.o m_steps.o m_stress.o precision.o siesta_geom.o |
460 | siesta_dicts.o: siesta_options.o |
461 | siesta_end.o: alloc.o bands.o densematrix.o diag.o extrae_eventllist.o |
462 | @@ -1269,7 +1267,7 @@ |
463 | siesta_forces.o: atomlist.o class_Fstack_Data1D.o class_SpData2D.o compute_dm.o |
464 | siesta_forces.o: compute_energies.o compute_max_diff.o densematrix.o |
465 | siesta_forces.o: dm_charge.o files.o final_H_f_stress.o flook_siesta.o |
466 | -siesta_forces.o: kpoint_grid.o m_check_walltime.o m_convergence.o m_energies.o |
467 | +siesta_forces.o: kpoint_scf.o m_check_walltime.o m_convergence.o m_energies.o |
468 | siesta_forces.o: m_forces.o m_initwf.o m_iodm_old.o m_mixing.o m_mixing_scf.o |
469 | siesta_forces.o: m_mpi_utils.o m_ncdf_siesta.o m_pexsi.o m_pexsi_driver.o |
470 | siesta_forces.o: m_rhog.o m_spin.o m_steps.o m_stress.o m_transiesta.o |
471 | @@ -1283,8 +1281,8 @@ |
472 | siesta_geom.o: precision.o |
473 | siesta_init.o: alloc.o atomlist.o bands.o bsc_xcmod.o |
474 | siesta_init.o: class_Fstack_Pair_Geometry_SpData2D.o densematrix.o |
475 | -siesta_init.o: diag_option.o files.o flook_siesta.o ioxv.o kpoint_grid.o |
476 | -siesta_init.o: kpoint_pdos.o ksvinit.o m_check_walltime.o m_cite.o m_energies.o |
477 | +siesta_init.o: diag_option.o files.o flook_siesta.o ioxv.o kpoint_pdos.o |
478 | +siesta_init.o: kpoint_scf.o ksvinit.o m_check_walltime.o m_cite.o m_energies.o |
479 | siesta_init.o: m_eo.o m_fixed.o m_forces.o m_gamma.o m_iostruct.o m_mpi_utils.o |
480 | siesta_init.o: m_new_dm.o m_rmaxh.o m_spin.o m_steps.o m_supercell.o m_timer.o |
481 | siesta_init.o: m_wallclock.o metaforce.o molecularmechanics.o object_debug.o |
482 | @@ -1301,7 +1299,7 @@ |
483 | siesta_move.o: siesta_master.o siesta_options.o sys.o units.o write_subs.o |
484 | siesta_move.o: zm_broyden_optim.o zm_fire_optim.o zmatrix.o |
485 | siesta_tddft.o: alloc.o atomlist.o compute_energies.o final_H_f_stress.o |
486 | -siesta_tddft.o: kpoint_grid.o m_energies.o m_eo.o m_evolve.o m_gamma.o |
487 | +siesta_tddft.o: kpoint_scf.o m_energies.o m_eo.o m_evolve.o m_gamma.o |
488 | siesta_tddft.o: m_initwf.o m_iotddft.o m_mpi_utils.o m_spin.o m_steps.o |
489 | siesta_tddft.o: overfsm.o parallel.o precision.o sankey_change_basis.o |
490 | siesta_tddft.o: setup_H0.o setup_hamiltonian.o siesta_cml.o siesta_options.o |
491 | @@ -1323,16 +1321,16 @@ |
492 | state_init.o: alloc.o atomlist.o class_Data2D.o class_SpData1D.o |
493 | state_init.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o |
494 | state_init.o: create_Sparsity_SC.o domain_decom.o files.o hsparse.o |
495 | -state_init.o: iodm_netcdf.o iodmhs_netcdf.o iotdxv.o ioxv.o kpoint_grid.o |
496 | -state_init.o: ldau_specs.o m_chess.o m_energies.o m_eo.o m_gamma.o m_mixing.o |
497 | -state_init.o: m_mixing_scf.o m_mpi_utils.o m_new_dm.o m_os.o m_pivot_methods.o |
498 | -state_init.o: m_rmaxh.o m_sparse.o m_sparsity_handling.o m_spin.o m_steps.o |
499 | -state_init.o: m_supercell.o m_test_io.o m_ts_charge.o m_ts_electype.o |
500 | -state_init.o: m_ts_global_vars.o m_ts_io.o m_ts_kpoints.o m_ts_options.o |
501 | +state_init.o: iodm_netcdf.o iodmhs_netcdf.o iotdxv.o ioxv.o kpoint_scf.o |
502 | +state_init.o: kpoint_t.o ldau_specs.o m_chess.o m_energies.o m_eo.o m_gamma.o |
503 | +state_init.o: m_mixing.o m_mixing_scf.o m_mpi_utils.o m_new_dm.o m_os.o |
504 | +state_init.o: m_pivot_methods.o m_rmaxh.o m_sparse.o m_sparsity_handling.o |
505 | +state_init.o: m_spin.o m_steps.o m_supercell.o m_test_io.o m_ts_charge.o |
506 | +state_init.o: m_ts_electype.o m_ts_global_vars.o m_ts_io.o m_ts_options.o |
507 | state_init.o: m_ts_sparse.o m_ts_tri_init.o normalize_dm.o overlap.o parallel.o |
508 | state_init.o: proximity_check.o siesta_cml.o siesta_dicts.o siesta_geom.o |
509 | -state_init.o: siesta_options.o sparse_matrices.o sys.o units.o write_subs.o |
510 | -state_init.o: zmatrix.o |
511 | +state_init.o: siesta_options.o sparse_matrices.o sys.o ts_kpoint_scf.o units.o |
512 | +state_init.o: write_subs.o zmatrix.o |
513 | struct_init.o: alloc.o atmfuncs.o atomlist.o files.o iotdxv.o ioxv.o |
514 | struct_init.o: m_exp_coord.o m_iostruct.o m_mpi_utils.o m_steps.o parallel.o |
515 | struct_init.o: periodic_table.o siesta_cml.o siesta_geom.o siesta_master.o |
516 | @@ -1342,9 +1340,12 @@ |
517 | timer.o: timer_tree.o |
518 | timer_tree.o: m_walltime.o |
519 | transition_rate.o: alloc.o fermid.o parallel.o parallelsubs.o precision.o sys.o |
520 | -ts_init.o: m_fixed.o m_os.o m_ts_cctype.o m_ts_charge.o m_ts_electrode.o |
521 | -ts_init.o: m_ts_electype.o m_ts_gf.o m_ts_global_vars.o m_ts_kpoints.o |
522 | +ts_init.o: kpoint_scf.o m_fixed.o m_os.o m_ts_cctype.o m_ts_charge.o |
523 | +ts_init.o: m_ts_electrode.o m_ts_electype.o m_ts_gf.o m_ts_global_vars.o |
524 | ts_init.o: m_ts_method.o m_ts_options.o parallel.o siesta_options.o |
525 | +ts_init.o: ts_kpoint_scf.o |
526 | +ts_kpoint_scf.o: kpoint_t.o m_spin.o m_ts_global_vars.o m_ts_tdir.o parallel.o |
527 | +ts_kpoint_scf.o: precision.o siesta_options.o |
528 | ts_show_regions.o: m_region.o m_ts_electype.o m_ts_method.o parallel.o |
529 | ts_show_regions.o: precision.o units.o |
530 | typecell.o: precision.o |
531 | @@ -1356,7 +1357,7 @@ |
532 | vmatsp.o: alloc.o atm_types.o atmfuncs.o atomlist.o listsc.o mesh.o meshdscf.o |
533 | vmatsp.o: meshphi.o precision.o |
534 | vmb.o: m_fixed.o parallel.o precision.o sys.o |
535 | -wavefunctions.o: atomlist.o kpoint_grid.o m_gamma.o m_matswinvers.o m_spin.o |
536 | +wavefunctions.o: atomlist.o kpoint_scf.o m_gamma.o m_matswinvers.o m_spin.o |
537 | wavefunctions.o: parallel.o parallelsubs.o precision.o sparse_matrices.o |
538 | write_inp_wannier.o: alloc.o atmfuncs.o atomlist.o m_ntm.o m_orderbands.o |
539 | write_inp_wannier.o: mneighb.o parallel.o parallelsubs.o precision.o |
540 | @@ -1370,7 +1371,7 @@ |
541 | write_subs.o: m_steps.o m_stress.o m_ts_global_vars.o parallel.o precision.o |
542 | write_subs.o: siesta_cml.o siesta_geom.o siesta_options.o units.o zmatrix.o |
543 | writewave.o: alloc.o atmfuncs.o atomlist.o densematrix.o diag.o diag_option.o |
544 | -writewave.o: get_kpoints_scale.o kpoint_grid.o m_spin.o parallel.o |
545 | +writewave.o: get_kpoints_scale.o kpoint_scf.o m_spin.o parallel.o |
546 | writewave.o: parallelsubs.o precision.o siesta_geom.o sys.o units.o |
547 | xc.o: alloc.o bsc_xcmod.o precision.o sys.o |
548 | xml.o: precision.o |
549 | @@ -1432,6 +1433,9 @@ |
550 | diagmemory.o: memoryinfo.o |
551 | f90sockets.o: fsockets.o |
552 | fsiesta.o: fsiesta_sockets.o |
553 | +kpoint_pdos_m.o: kpoint_pdos.o |
554 | +kpoint_scf_m.o: kpoint_scf.o |
555 | +kpoint_t_m.o: kpoint_t.o |
556 | listsc_module.o: listsc.o |
557 | m_bessph.o: bessph.o |
558 | m_born_charge.o: born_charge.o |
559 | @@ -1535,6 +1539,7 @@ |
560 | t_spin.o: m_spin.o |
561 | timer_options.o: timer.o |
562 | trialorbitalclass.o: m_trialorbitalclass.o |
563 | +ts_kpoint_scf_m.o: ts_kpoint_scf.o |
564 | version_info.o: version.o |
565 | write_subs_energies.o: write_subs.o |
566 | write_subs_positions.o: write_subs.o |
567 | |
568 | === modified file 'Src/compute_dm.F' |
569 | --- Src/compute_dm.F 2018-04-19 10:08:47 +0000 |
570 | +++ Src/compute_dm.F 2018-05-27 11:17:14 +0000 |
571 | @@ -23,7 +23,7 @@ |
572 | use atomlist, only: qa, lasto, iphorb, iaorb, no_u, no_s, indxuo, |
573 | & qtot, Qtots, no_l |
574 | use sys, only: die, bye |
575 | - use Kpoint_grid |
576 | + use kpoint_scf_m, only: kpoints_scf |
577 | use m_energies, only: Ebs, Ecorrec, Entropy, DE_NEGF |
578 | use m_energies, only: Ef, Efs |
579 | use m_rmaxh |
580 | @@ -177,7 +177,8 @@ |
581 | & no_l, maxnh, maxnh, no_u, |
582 | & numh, listhptr, listh, numh, listhptr, listh, |
583 | & H, S, qtot, fixspin, qtots, temp, e1, e2, |
584 | - & gamma, xijo, indxuo, nkpnt, kpoint, kweight, |
585 | + & gamma, xijo, indxuo, |
586 | + & kpoints_scf%N, kpoints_scf%k, kpoints_scf%w, |
587 | & eo, qo, Dscf, Escf, ef, efs, Entropy, no_u, |
588 | & occtol, iscf, neigwanted) |
589 | Ecorrec = 0.0_dp |
590 | @@ -204,8 +205,9 @@ |
591 | else |
592 | call zminim(.false., PreviousCallDiagon, iscf, istp, no_l, |
593 | & spin%H, no_u, maxnh, numh, listhptr, listh, Dscf, |
594 | - & eta, qtots, no_s, xijo, indxuo, nkpnt, kpoint, |
595 | - & kweight, H, S, H_kin) |
596 | + & eta, qtots, no_s, xijo, indxuo, |
597 | + & kpoints_scf%N, kpoints_scf%k, kpoints_scf%w, |
598 | + & H, S, H_kin) |
599 | end if |
600 | Ecorrec = 0.0_dp |
601 | Entropy = 0.0_dp |
602 | @@ -229,7 +231,8 @@ |
603 | & no_l, maxnh, maxnh, no_u, |
604 | & numh, listhptr, listh, numh, listhptr, listh, |
605 | & H, S, qtot, fixspin, qtots, temp, e1, e2, |
606 | - & gamma, xijo, indxuo, nkpnt, kpoint, kweight, |
607 | + & gamma, xijo, indxuo, |
608 | + & kpoints_scf%N, kpoints_scf%k, kpoints_scf%w, |
609 | & eo, qo, Dscf, Escf, ef, efs, Entropy, no_u, |
610 | & occtol, iscf, neigwanted) |
611 | |
612 | |
613 | === modified file 'Src/cranknic_evolk.F90' |
614 | --- Src/cranknic_evolk.F90 2017-10-05 16:44:37 +0000 |
615 | +++ Src/cranknic_evolk.F90 2018-05-27 11:17:14 +0000 |
616 | @@ -32,7 +32,7 @@ |
617 | USE sparse_matrices, ONLY: H, S, numh, listh, listhptr, xijo, Dscf |
618 | USE atomlist, ONLY: no_u, no_l, indxuo |
619 | USE m_spin, ONLY: nspin |
620 | - USE Kpoint_grid, ONLY: kpoint, nkpnt |
621 | + USE kpoint_scf_m, ONLY: kpoints_scf |
622 | USE wavefunctions, ONLY: compute_tddm, wavef_ms, complx_0, complx_1 |
623 | USE m_energies, ONLY: etot |
624 | USE m_eo, ONLY: qo, eo |
625 | @@ -64,7 +64,7 @@ |
626 | call timer( 'cn_evolk', 1) |
627 | ! |
628 | ! |
629 | - DO ik = 1,nkpnt |
630 | + DO ik = 1,kpoints_scf%N |
631 | DO ispin =1,nspin |
632 | call m_allocate ( Hauxms, no_u, no_u, m_storage) |
633 | call m_allocate ( Sauxms, no_u, no_u, m_storage) |
634 | @@ -76,8 +76,8 @@ |
635 | ind = listhptr(i) + j |
636 | juo = listh(ind) |
637 | jo = indxuo (juo) |
638 | - kxij = kpoint(1,ik)*xijo(1,ind) + kpoint(2,ik)*xijo(2,ind) + & |
639 | - kpoint(3,ik)*xijo(3,ind) |
640 | + kxij = kpoints_scf%k(1,ik)*xijo(1,ind) + kpoints_scf%k(2,ik)*xijo(2,ind) + & |
641 | + kpoints_scf%k(3,ik)*xijo(3,ind) |
642 | ckxij = cos(kxij) |
643 | skxij = -sin(kxij) |
644 | cvar1 = cmplx(H(ind,ispin)*ckxij,H(ind,ispin)*skxij,dp) |
645 | @@ -132,7 +132,7 @@ |
646 | |
647 | USE wavefunctions |
648 | USE m_spin, ONLY: nspin |
649 | - USE Kpoint_grid, ONLY: nkpnt |
650 | + USE kpoint_scf_m, ONLY: kpoints_scf |
651 | USE cranknic_evolg, ONLY: Uphi |
652 | USE atomlist, ONLY: no_u |
653 | USE MatrixSwitch |
654 | @@ -165,14 +165,14 @@ |
655 | ENDIF |
656 | |
657 | IF(extrapol_H_tdks) THEN |
658 | - ALLOCATE(firstimeK(nkpnt, nspin)) |
659 | - ALLOCATE(Hsave(nkpnt, nspin)) |
660 | - DO i=1,nkpnt |
661 | + ALLOCATE(firstimeK(kpoints_scf%N, nspin)) |
662 | + ALLOCATE(Hsave(kpoints_scf%N, nspin)) |
663 | + DO i=1,kpoints_scf%N |
664 | DO j=1,nspin |
665 | call m_allocate (Hsave(i,j),no_u, no_u, m_storage) |
666 | END DO |
667 | END DO |
668 | - firstimeK(1:nkpnt,1:nspin) = .true. |
669 | + firstimeK(1:kpoints_scf%N,1:nspin) = .true. |
670 | END IF |
671 | |
672 | firsttime = .false. |
673 | |
674 | === modified file 'Src/final_H_f_stress.F' |
675 | --- Src/final_H_f_stress.F 2018-04-23 11:09:01 +0000 |
676 | +++ Src/final_H_f_stress.F 2018-05-27 11:17:14 +0000 |
677 | @@ -71,7 +71,7 @@ |
678 | use files, only : label_length |
679 | use m_ts_global_vars, only : TSrun |
680 | use m_ts_options, only : TS_HS_save |
681 | - use m_ts_kpoints, only : ts_Gamma, ts_kscell, ts_kdispl |
682 | + use ts_kpoint_scf_m, only: ts_kpoints_scf, ts_gamma_scf |
683 | use m_ts_io, only : ts_write_TSHS,fname_TSHS, FC_index |
684 | |
685 | #ifdef FINAL_CHECK_HS |
686 | @@ -340,9 +340,9 @@ |
687 | ! This is "pure" MD and we only write consecutive numbers |
688 | ! Together with this you cannot also save FC |
689 | fname = fname_TSHS(slabel, istep = istep ) |
690 | - call ts_write_tshs(fname, .false., Gamma, ts_Gamma, |
691 | + call ts_write_tshs(fname, .false., Gamma, ts_Gamma_scf, |
692 | & ucell, nsc, isc_off, na_u, no_s, spin%H, |
693 | - & ts_kscell, ts_kdispl, |
694 | + & ts_kpoints_scf%k_cell, ts_kpoints_scf%k_displ, |
695 | & xa, lasto, |
696 | & H_2D, S_1D, indxuo, |
697 | & Ef, Qtot, Temp, istep, 0) |
698 | @@ -359,17 +359,17 @@ |
699 | ! 6 = +z |
700 | call FC_index(istep,ia1,io_istep,io_ia1) |
701 | fname = fname_TSHS(slabel,istep = io_istep, ia1 = io_ia1) |
702 | - call ts_write_tshs(fname, .false., Gamma, ts_Gamma, |
703 | + call ts_write_tshs(fname, .false., Gamma, ts_Gamma_scf, |
704 | & ucell, nsc, isc_off, na_u, no_s, spin%H, |
705 | - & ts_kscell, ts_kdispl, |
706 | + & ts_kpoints_scf%k_cell, ts_kpoints_scf%k_displ, |
707 | & xa, lasto, |
708 | & H_2D, S_1D, indxuo, |
709 | & Ef, Qtot, Temp, io_istep, io_ia1) |
710 | else |
711 | fname = fname_TSHS(slabel) |
712 | - call ts_write_tshs(fname, .false., Gamma, ts_Gamma, |
713 | + call ts_write_tshs(fname, .false., Gamma, ts_Gamma_scf, |
714 | & ucell, nsc, isc_off, na_u, no_s, spin%H, |
715 | - & ts_kscell, ts_kdispl, |
716 | + & ts_kpoints_scf%k_cell, ts_kpoints_scf%k_displ, |
717 | & xa, lasto, |
718 | & H_2D, S_1D, indxuo, |
719 | & Ef, Qtot, Temp, 0, 0) |
720 | |
721 | === removed file 'Src/kpoint_grid.F90' |
722 | --- Src/kpoint_grid.F90 2018-04-14 23:14:53 +0000 |
723 | +++ Src/kpoint_grid.F90 1970-01-01 00:00:00 +0000 |
724 | @@ -1,228 +0,0 @@ |
725 | -! --- |
726 | -! Copyright (C) 1996-2016 The SIESTA group |
727 | -! This file is distributed under the terms of the |
728 | -! GNU General Public License: see COPYING in the top directory |
729 | -! or http://www.gnu.org/copyleft/gpl.txt . |
730 | -! See Docs/Contributors.txt for a list of contributors. |
731 | -! --- |
732 | -MODULE Kpoint_grid |
733 | -! |
734 | -! Contains data structures and routines to deal with the kpoint-grid |
735 | -! for the self-consistent calculation |
736 | -! Other uses (bands, optical, polarization) have their own structures. |
737 | -! |
738 | - USE precision, only : dp |
739 | - |
740 | - implicit none |
741 | - |
742 | - public :: setup_kpoint_grid, scf_kgrid_first_time, gamma_scf, & |
743 | - nkpnt, kweight, kpoint, kscell, kdispl |
744 | - public :: eff_kgrid_cutoff |
745 | - |
746 | - private |
747 | - |
748 | - logical :: scf_kgrid_first_time = .true. |
749 | - logical :: gamma_scf |
750 | - integer :: nkpnt ! Total number of k-points |
751 | - real(dp) :: eff_kgrid_cutoff ! Effective kgrid_cutoff |
752 | - |
753 | - real(dp), pointer :: kweight(:) => null() |
754 | - real(dp), pointer :: kpoint(:,:) => null() |
755 | - |
756 | - integer, dimension(3,3) :: kscell = 0 |
757 | - real(dp), dimension(3) :: kdispl = 0.0_dp |
758 | - logical :: user_requested_mp = .false. |
759 | - logical :: user_requested_cutoff = .false. |
760 | - |
761 | - logical, save :: time_reversal_symmetry = .true. |
762 | - logical :: firm_displ = .false. |
763 | - |
764 | - CONTAINS |
765 | - |
766 | - subroutine setup_Kpoint_grid( ucell ) |
767 | - USE parallel, only : Node |
768 | - USE fdf, only : fdf_defined, fdf_get |
769 | - USE m_find_kgrid, only : find_kgrid |
770 | - use m_spin, only: TrSym |
771 | - |
772 | - implicit none |
773 | - real(dp) :: ucell(3,3) |
774 | - logical :: spiral |
775 | - |
776 | - if (scf_kgrid_first_time) then |
777 | - spiral = fdf_defined('SpinSpiral') |
778 | - ! Allow the user to control the use of time-reversal-symmetry |
779 | - ! By default, it is on, except for "spin-spiral" calculations |
780 | - ! and/or non-collinear calculations |
781 | - time_reversal_symmetry = fdf_get( & |
782 | - "TimeReversalSymmetryForKpoints", & |
783 | - (.not. spiral) .and. TrSym) |
784 | - call setup_scf_kscell(ucell, firm_displ) |
785 | - |
786 | - scf_kgrid_first_time = .false. |
787 | - |
788 | - else |
789 | - if ( user_requested_mp ) then |
790 | - ! no need to set up the kscell again |
791 | - else |
792 | - ! This was wrong in the old code |
793 | - call setup_scf_kscell(ucell, firm_displ) |
794 | - endif |
795 | - endif |
796 | - |
797 | - call find_kgrid(ucell,kscell,kdispl,firm_displ, & |
798 | - time_reversal_symmetry, & |
799 | - nkpnt,kpoint,kweight, eff_kgrid_cutoff) |
800 | - |
801 | - gamma_scf = (nkpnt == 1 .and. & |
802 | - dot_product(kpoint(:,1),kpoint(:,1)) < 1.0e-20_dp) |
803 | - |
804 | - if (Node .eq. 0) call siesta_write_k_points() |
805 | - |
806 | - end subroutine setup_Kpoint_grid |
807 | - |
808 | -!-------------------------------------------------------------------- |
809 | - subroutine setup_scf_kscell( cell, firm_displ ) |
810 | - |
811 | -! ***************** INPUT ********************************************** |
812 | -! real*8 cell(3,3) : Unit cell vectors in real space cell(ixyz,ivec) |
813 | -! ***************** OUTPUT ********************************************* |
814 | -! logical firm_displ : User-specified displacements (firm)? |
815 | - |
816 | -! The relevant fdf labels are kgrid_cutoff and kgrid_Monkhorst_Pack. |
817 | -! If both are present, kgrid_Monkhorst_Pack has priority. If none is |
818 | -! present, the cutoff default is zero, producing only the gamma point. |
819 | -! Examples of fdf data specifications: |
820 | -! kgrid_cutoff 50. Bohr |
821 | -! %block kgrid_Monkhorst_Pack # Defines kscell and kdispl |
822 | -! 4 0 0 0.50 # (kscell(i,1),i=1,3), kdispl(1) |
823 | -! 0 4 0 0.50 # (kscell(i,2),i=1,3), kdispl(2) |
824 | -! 0 0 4 0.50 # (kscell(i,3),i=1,3), kdispl(3) |
825 | -! %endblock kgrid_Monkhorst_Pack |
826 | -! ********************************************************************** |
827 | - |
828 | -! Modules |
829 | - |
830 | - use precision, only : dp |
831 | - use parallel, only : Node |
832 | - use m_minvec, only : minvec |
833 | - use sys, only : die |
834 | - use fdf |
835 | - |
836 | - implicit none |
837 | - |
838 | -! Passed variables |
839 | - real(dp), intent(in) :: cell(3,3) |
840 | - logical, intent(out) :: firm_displ |
841 | - |
842 | -! Internal variables |
843 | - integer i, j, factor(3,3), expansion_factor |
844 | - real(dp) scmin(3,3), vmod, cutoff |
845 | - real(dp) ctransf(3,3) |
846 | - logical mp_input |
847 | - |
848 | - real(dp), parameter :: defcut = 0.0_dp |
849 | - integer, dimension(3,3), parameter :: unit_matrix = & |
850 | - reshape ((/1,0,0,0,1,0,0,0,1/), (/3,3/)) |
851 | - |
852 | - type(block_fdf) :: bfdf |
853 | - type(parsed_line), pointer :: pline |
854 | - |
855 | - |
856 | - mp_input = fdf_block('kgrid_Monkhorst_Pack',bfdf) |
857 | - if ( mp_input ) then |
858 | - user_requested_mp = .true. |
859 | - do i= 1, 3 |
860 | - if (.not. fdf_bline(bfdf,pline)) & |
861 | - call die('setup_scf_kscell: ERROR in ' // & |
862 | - 'kgrid_Monkhorst_Pack block') |
863 | - kscell(1,i) = fdf_bintegers(pline,1) |
864 | - kscell(2,i) = fdf_bintegers(pline,2) |
865 | - kscell(3,i) = fdf_bintegers(pline,3) |
866 | - if ( fdf_bnvalues(pline) > 3 ) then |
867 | - kdispl(i) = mod(fdf_bvalues(pline,4), 1._dp) |
868 | - else |
869 | - kdispl(i) = 0._dp |
870 | - end if |
871 | - enddo |
872 | - firm_displ = .true. |
873 | - |
874 | - else |
875 | - |
876 | - cutoff = fdf_physical('kgrid_cutoff',defcut,'Bohr') |
877 | - if (cutoff /= defcut) then |
878 | - !! write(6,"(a,f10.5)") "Kgrid cutoff input: ", cutoff |
879 | - user_requested_cutoff = .true. |
880 | - endif |
881 | - |
882 | - kdispl(1:3) = 0.0_dp ! Might be changed later |
883 | - firm_displ = .false. ! In future we might add new options |
884 | - ! for user-specified displacements |
885 | - |
886 | - ! Find equivalent rounded unit-cell |
887 | - call minvec( cell, scmin, ctransf ) |
888 | - |
889 | - expansion_factor = 1 |
890 | - do j = 1,3 |
891 | - factor(j,1:3) = 0 |
892 | - vmod = sqrt(dot_product(scmin(1:3,j),scmin(1:3,j))) |
893 | - factor(j,j) = int(2.0_dp*cutoff/vmod) + 1 |
894 | - expansion_factor = expansion_factor * factor(j,j) |
895 | - enddo |
896 | - ! Generate actual supercell skeleton |
897 | - kscell = matmul(ctransf, factor) |
898 | - ! Avoid confusing permutations |
899 | - if (expansion_factor == 1) then |
900 | - kscell = unit_matrix |
901 | - endif |
902 | - endif |
903 | - |
904 | - end subroutine setup_scf_kscell |
905 | - |
906 | - subroutine siesta_write_k_points() |
907 | - USE siesta_options, only: writek |
908 | - USE units, only: Ang |
909 | - USE siesta_cml |
910 | - |
911 | - implicit none |
912 | - |
913 | - integer :: ik, ix, i |
914 | - external :: iokp |
915 | - |
916 | - if ( writek ) then |
917 | - write(6,'(/,a)') 'siesta: k-point coordinates (Bohr**-1) and weights:' |
918 | - write(6,'(a,i4,3f12.6,3x,f12.6)') & |
919 | - ('siesta: ', ik, (kpoint(ix,ik),ix=1,3), kweight(ik), & |
920 | - ik=1,nkpnt) |
921 | - endif |
922 | - ! Always write KP file |
923 | - call iokp( nkpnt, kpoint, kweight ) |
924 | - write(6,'(/a,i6)') 'siesta: k-grid: Number of k-points =', nkpnt |
925 | - write(6,'(a,f10.3,a)') 'siesta: k-grid: Cutoff (effective) =', & |
926 | - eff_kgrid_cutoff/Ang, ' Ang' |
927 | - write(6,'(a)') 'siesta: k-grid: Supercell and displacements' |
928 | - write(6,'(a,3i4,3x,f8.3)') 'siesta: k-grid: ', & |
929 | - (kscell(i,1),i=1,3), kdispl(1) |
930 | - write(6,'(a,3i4,3x,f8.3)') 'siesta: k-grid: ', & |
931 | - (kscell(i,2),i=1,3), kdispl(2) |
932 | - write(6,'(a,3i4,3x,f8.3)') 'siesta: k-grid: ', & |
933 | - (kscell(i,3),i=1,3), kdispl(3) |
934 | - if (cml_p) then |
935 | - call cmlStartPropertyList(xf=mainXML, title="k-points", & |
936 | - dictRef="siesta:kpoints") |
937 | - call cmlAddProperty(xf=mainXML, value=nkpnt, dictref='siesta:nkpnt', & |
938 | - units="cmlUnits:countable") |
939 | - do ik=1, nkpnt |
940 | - call cmlAddKPoint(xf=mainXML, coords=kpoint(:,ik), weight=kweight(ik)) |
941 | - enddo |
942 | - call cmlAddProperty(xf=mainXML, value=eff_kgrid_cutoff/Ang, & |
943 | - dictref='siesta:kcutof', units='siestaUnits:angstrom') |
944 | - call cmlEndPropertyList(mainXML) |
945 | - call cmlAddProperty(xf=mainXML, value=kscell, dictref='siesta:kscell', & |
946 | - units="siestaUnits:Ang") |
947 | - call cmlAddProperty(xf=mainXML, value=kdispl, dictref='siesta:kdispl', & |
948 | - units="siestaUnits:Ang") |
949 | - endif |
950 | - end subroutine siesta_write_k_points |
951 | - |
952 | -END MODULE Kpoint_grid |
953 | |
954 | === modified file 'Src/kpoint_pdos.F90' |
955 | --- Src/kpoint_pdos.F90 2018-04-14 23:14:53 +0000 |
956 | +++ Src/kpoint_pdos.F90 2018-05-27 11:17:14 +0000 |
957 | @@ -5,217 +5,59 @@ |
958 | ! or http://www.gnu.org/copyleft/gpl.txt . |
959 | ! See Docs/Contributors.txt for a list of contributors. |
960 | ! --- |
961 | -MODULE Kpoint_pdos |
962 | -! |
963 | -! Contains data structures and routines to deal with the kpoint-grid |
964 | -! for the projected density of states calculation. |
965 | -! Modelled on the equivalent module for the SCF calculation. |
966 | -! |
967 | - USE precision, only : dp |
968 | +module kpoint_pdos_m |
969 | + ! |
970 | + ! Contains data structures and routines to deal with the kpoint-grid |
971 | + ! for the self-consistent calculation |
972 | + ! Other uses (bands, optical, polarization) have their own structures. |
973 | + ! |
974 | + use precision, only : dp |
975 | + |
976 | + ! The k-point-type |
977 | + use kpoint_t_m |
978 | |
979 | implicit none |
980 | |
981 | + public :: setup_kpoint_pdos |
982 | + public :: kpoints_pdos |
983 | + public :: gamma_pdos |
984 | + |
985 | private |
986 | + |
987 | + logical, save :: gamma_pdos |
988 | + type(kpoint_t), save :: kpoints_pdos |
989 | + |
990 | +contains |
991 | + |
992 | + subroutine setup_kpoint_pdos( ucell ) |
993 | + use parallel, only: Node |
994 | + use siesta_options, only: writek |
995 | + use m_spin, only: TrSym |
996 | + |
997 | + real(dp), intent(in) :: ucell(3,3) |
998 | + |
999 | + ! First try and read the k-points |
1000 | + call kpoint_read(kpoints_pdos, 'PDOS', ucell, TrSym) |
1001 | + |
1002 | + if ( kpoints_pdos%method == K_METHOD_NONE ) then |
1003 | + |
1004 | + ! The user hasn't specified a specific PDOS k-point sampling. |
1005 | + call kpoint_delete(kpoints_pdos) |
1006 | + call kpoint_read(kpoints_pdos, '', ucell, TrSym) |
1007 | + |
1008 | + end if |
1009 | + |
1010 | + gamma_pdos = (kpoints_pdos%N == 1 .and. & |
1011 | + dot_product(kpoints_pdos%k(:,1),kpoints_pdos%k(:,1)) < 1.0e-20_dp) |
1012 | + |
1013 | + ! Quick-return if non-IO |
1014 | + if ( Node /= 0 ) return |
1015 | + |
1016 | + ! Write to XML file |
1017 | + call kpoint_write_stdout(kpoints_pdos, writek, 'PDOS') |
1018 | + call kpoint_write_xml(kpoints_pdos, 'PDOS') |
1019 | + call kpoint_write_file(kpoints_pdos, 'PDOS.KP') |
1020 | + |
1021 | + end subroutine setup_kpoint_pdos |
1022 | |
1023 | - logical, public, save :: pdos_kgrid_first_time = .true. |
1024 | - logical, public, save :: gamma_pdos |
1025 | - integer, public, save :: maxk_pdos ! |
1026 | - integer, public, save :: nkpnt_pdos ! Total number of k-points |
1027 | - real(dp) :: eff_kgrid_cutoff ! Effective kgrid_cutoff |
1028 | - |
1029 | - real(dp), pointer, public, save :: kweight_pdos(:) |
1030 | - real(dp), pointer, public, save :: kpoints_pdos(:,:) |
1031 | - |
1032 | - integer, dimension(3,3), save :: kscell = 0 |
1033 | - real(dp), dimension(3), save :: kdispl = 0.0_dp |
1034 | - |
1035 | - logical, save :: user_requested_mp = .false. |
1036 | - logical, save :: user_requested_cutoff = .false. |
1037 | - |
1038 | - logical, save :: time_reversal_symmetry = .true. |
1039 | - logical, save :: firm_displ = .false. |
1040 | - |
1041 | - public :: setup_kpoint_pdos |
1042 | - |
1043 | - CONTAINS |
1044 | - |
1045 | - subroutine setup_Kpoint_pdos( ucell, different_pdos_grid ) |
1046 | - USE parallel, only : Node |
1047 | - USE fdf, only : fdf_defined, fdf_get |
1048 | - USE m_find_kgrid, only : find_kgrid |
1049 | - use m_spin, only: TrSym |
1050 | - |
1051 | - implicit none |
1052 | - real(dp), intent(in) :: ucell(3,3) |
1053 | - logical, intent(out) :: different_pdos_grid |
1054 | - |
1055 | - logical :: spiral |
1056 | - if (pdos_kgrid_first_time) then |
1057 | - nullify(kweight_pdos,kpoints_pdos) |
1058 | - spiral = fdf_defined('SpinSpiral') |
1059 | - ! Allow the user to control the use of time-reversal-symmetry |
1060 | - ! By default, it is on, except for "spin-spiral" calculations |
1061 | - ! and/or non-collinear calculations |
1062 | - time_reversal_symmetry = fdf_get( & |
1063 | - "TimeReversalSymmetryForKpoints", & |
1064 | - (.not. spiral) .and. TrSym) |
1065 | - |
1066 | - call setup_pdos_kscell(ucell, firm_displ) |
1067 | - |
1068 | - pdos_kgrid_first_time = .false. |
1069 | - |
1070 | - else |
1071 | - if ( user_requested_mp ) then |
1072 | - ! no need to set up the kscell again |
1073 | - else |
1074 | - ! This was wrong in the old code |
1075 | - call setup_pdos_kscell(ucell, firm_displ) |
1076 | - endif |
1077 | - endif |
1078 | - |
1079 | - if (user_requested_mp.or.user_requested_cutoff) then |
1080 | - different_pdos_grid = .true. |
1081 | - else |
1082 | - different_pdos_grid = .false. |
1083 | - endif |
1084 | - |
1085 | -! If the grid hasn't been explicit specified then just set dummy values |
1086 | - if (different_pdos_grid) then |
1087 | - call find_kgrid(ucell,kscell,kdispl,firm_displ, & |
1088 | - time_reversal_symmetry, & |
1089 | - nkpnt_pdos,kpoints_pdos,kweight_pdos,eff_kgrid_cutoff) |
1090 | - |
1091 | - maxk_pdos = nkpnt_pdos |
1092 | - gamma_pdos = (nkpnt_pdos == 1 .and. dot_product(kpoints_pdos(:,1),kpoints_pdos(:,1)) < 1.0e-20_dp) |
1093 | - |
1094 | - if (Node .eq. 0) call siesta_write_k_points_pdos() |
1095 | - else |
1096 | - nkpnt_pdos = 0 |
1097 | - maxk_pdos = nkpnt_pdos |
1098 | - gamma_pdos = .true. |
1099 | - endif |
1100 | - |
1101 | - end subroutine setup_Kpoint_pdos |
1102 | - |
1103 | -!-------------------------------------------------------------------- |
1104 | - subroutine setup_pdos_kscell( cell, firm_displ ) |
1105 | - |
1106 | -! ***************** INPUT ********************************************** |
1107 | -! real*8 cell(3,3) : Unit cell vectors in real space cell(ixyz,ivec) |
1108 | -! ***************** OUTPUT ********************************************* |
1109 | -! logical firm_displ : User-specified displacements (firm)? |
1110 | - |
1111 | -! The relevant fdf labels are PDOS.kgrid_cutoff and PDOS.kgrid_Monkhorst_Pack. |
1112 | -! If both are present, PDOS.kgrid_Monkhorst_Pack has priority. If neither is |
1113 | -! present, the cutoff default is zero, producing only the gamma point. |
1114 | -! Examples of fdf data specifications: |
1115 | -! PDOS.kgrid_cutoff 50. Bohr |
1116 | -! %block PDOS.kgrid_Monkhorst_Pack # Defines kscell and kdispl |
1117 | -! 4 0 0 0.50 # (kscell(i,1),i=1,3), kdispl(1) |
1118 | -! 0 4 0 0.50 # (kscell(i,2),i=1,3), kdispl(2) |
1119 | -! 0 0 4 0.50 # (kscell(i,3),i=1,3), kdispl(3) |
1120 | -! %endblock PDOS.kgrid_Monkhorst_Pack |
1121 | -! ********************************************************************** |
1122 | - |
1123 | -! Modules |
1124 | - |
1125 | - use precision, only : dp |
1126 | - use m_minvec, only : minvec |
1127 | - use sys, only : die |
1128 | - use fdf |
1129 | - |
1130 | - implicit none |
1131 | - |
1132 | -! Passed variables |
1133 | - real(dp), intent(in) :: cell(3,3) |
1134 | - logical, intent(out) :: firm_displ |
1135 | - |
1136 | -! Internal variables |
1137 | - integer i, j, factor(3,3), expansion_factor |
1138 | - |
1139 | - real(dp) scmin(3,3), vmod, cutoff |
1140 | - real(dp) ctransf(3,3) |
1141 | - logical mp_input |
1142 | - |
1143 | - real(dp), parameter :: defcut = 0.0_dp |
1144 | - integer, dimension(3,3), parameter :: unit_matrix = & |
1145 | - reshape ((/1,0,0,0,1,0,0,0,1/), (/3,3/)) |
1146 | - |
1147 | - type(block_fdf) :: bfdf |
1148 | - type(parsed_line), pointer :: pline |
1149 | - |
1150 | - mp_input = fdf_block('PDOS.kgrid_Monkhorst_Pack',bfdf) |
1151 | - if ( mp_input ) then |
1152 | - user_requested_mp = .true. |
1153 | - do i= 1, 3 |
1154 | - if (.not. fdf_bline(bfdf,pline)) & |
1155 | - call die('setup_pdos_kscell: ERROR in ' // & |
1156 | - 'PDOS.kgrid_Monkhorst_Pack block') |
1157 | - kscell(1,i) = fdf_bintegers(pline,1) |
1158 | - kscell(2,i) = fdf_bintegers(pline,2) |
1159 | - kscell(3,i) = fdf_bintegers(pline,3) |
1160 | - if ( fdf_bnvalues(pline) > 3 ) then |
1161 | - kdispl(i) = mod(fdf_bvalues(pline,4), 1._dp) |
1162 | - else |
1163 | - kdispl(i) = 0._dp |
1164 | - end if |
1165 | - enddo |
1166 | - firm_displ = .true. |
1167 | - |
1168 | - else |
1169 | - |
1170 | - cutoff = fdf_physical('PDOS.kgrid_cutoff',defcut,'Bohr') |
1171 | - if (cutoff /= defcut) then |
1172 | - !! write(6,"(a,f10.5)") "PDOS Kgrid cutoff input: ", cutoff |
1173 | - user_requested_cutoff = .true. |
1174 | - endif |
1175 | - |
1176 | - kdispl(1:3) = 0.0_dp ! Might be changed later |
1177 | - firm_displ = .false. ! In future we might add new options |
1178 | - ! for user-specified displacements |
1179 | - |
1180 | - ! Find equivalent rounded unit-cell |
1181 | - call minvec( cell, scmin, ctransf ) |
1182 | - |
1183 | - expansion_factor = 1 |
1184 | - do j = 1,3 |
1185 | - factor(j,1:3) = 0 |
1186 | - vmod = sqrt(dot_product(scmin(1:3,j),scmin(1:3,j))) |
1187 | - factor(j,j) = int(2.0_dp*cutoff/vmod) + 1 |
1188 | - expansion_factor = expansion_factor * factor(j,j) |
1189 | - enddo |
1190 | - ! Generate actual supercell skeleton |
1191 | - kscell = matmul(ctransf, factor) |
1192 | - ! Avoid confusing permutations |
1193 | - if (expansion_factor == 1) then |
1194 | - kscell = unit_matrix |
1195 | - endif |
1196 | - endif |
1197 | - |
1198 | - end subroutine setup_pdos_kscell |
1199 | - |
1200 | - subroutine siesta_write_k_points_pdos() |
1201 | - |
1202 | - USE siesta_options, only: writek |
1203 | - USE units, only: Ang |
1204 | - |
1205 | - implicit none |
1206 | - |
1207 | - integer :: ik, ix, i |
1208 | - |
1209 | - if ( writek ) then |
1210 | - write(6,'(/,a)') 'siesta: k-point coordinates (Bohr**-1) and weights for PDOS:' |
1211 | - write(6,'(a,i4,3f12.6,3x,f12.6)') & |
1212 | - ('siesta: ', ik, (kpoints_pdos(ix,ik),ix=1,3), kweight_pdos(ik), ik=1,nkpnt_pdos) |
1213 | - endif |
1214 | - |
1215 | - write(6,'(/a,i6)') 'siesta: PDOS.k-grid: Number of k-points =', nkpnt_pdos |
1216 | - write(6,'(a,f10.3,a)') 'siesta: PDOS.k-grid: Cutoff (effective) =', eff_kgrid_cutoff/Ang, ' Ang' |
1217 | - write(6,'(a)') 'siesta: PDOS.k-grid: Supercell and displacements' |
1218 | - write(6,'(a,3i4,3x,f8.3)') 'siesta: PDOS.k-grid: ', (kscell(i,1),i=1,3), kdispl(1) |
1219 | - write(6,'(a,3i4,3x,f8.3)') 'siesta: PDOS.k-grid: ', (kscell(i,2),i=1,3), kdispl(2) |
1220 | - write(6,'(a,3i4,3x,f8.3)') 'siesta: PDOS.k-grid: ', (kscell(i,3),i=1,3), kdispl(3) |
1221 | - |
1222 | - end subroutine siesta_write_k_points_pdos |
1223 | - |
1224 | -END MODULE Kpoint_pdos |
1225 | +end module kpoint_pdos_m |
1226 | |
1227 | === added file 'Src/kpoint_scf.F90' |
1228 | --- Src/kpoint_scf.F90 1970-01-01 00:00:00 +0000 |
1229 | +++ Src/kpoint_scf.F90 2018-05-27 11:17:14 +0000 |
1230 | @@ -0,0 +1,53 @@ |
1231 | +! --- |
1232 | +! Copyright (C) 1996-2016 The SIESTA group |
1233 | +! This file is distributed under the terms of the |
1234 | +! GNU General Public License: see COPYING in the top directory |
1235 | +! or http://www.gnu.org/copyleft/gpl.txt . |
1236 | +! See Docs/Contributors.txt for a list of contributors. |
1237 | +! --- |
1238 | +module kpoint_scf_m |
1239 | + ! |
1240 | + ! Contains data structures and routines to deal with the kpoint-grid |
1241 | + ! for the self-consistent calculation |
1242 | + ! Other uses (bands, optical, polarization) have their own structures. |
1243 | + ! |
1244 | + use precision, only : dp |
1245 | + |
1246 | + ! The k-point-type |
1247 | + use kpoint_t_m |
1248 | + |
1249 | + implicit none |
1250 | + |
1251 | + public :: setup_kpoint_scf |
1252 | + public :: kpoints_scf |
1253 | + public :: gamma_scf |
1254 | + |
1255 | + private |
1256 | + |
1257 | + logical, save :: gamma_scf |
1258 | + type(kpoint_t), save :: kpoints_scf |
1259 | + |
1260 | +contains |
1261 | + |
1262 | + subroutine setup_kpoint_scf( ucell ) |
1263 | + use parallel, only: Node |
1264 | + use siesta_options, only: writek |
1265 | + use m_spin, only: TrSym |
1266 | + |
1267 | + real(dp), intent(in) :: ucell(3,3) |
1268 | + |
1269 | + call kpoint_read(kpoints_scf, '', ucell, TrSym) |
1270 | + |
1271 | + gamma_scf = (kpoints_scf%N == 1 .and. & |
1272 | + dot_product(kpoints_scf%k(:,1),kpoints_scf%k(:,1)) < 1.0e-20_dp) |
1273 | + |
1274 | + ! Quick-return if non-IO |
1275 | + if ( Node /= 0 ) return |
1276 | + |
1277 | + call kpoint_write_stdout(kpoints_scf, all=writek) |
1278 | + call kpoint_write_xml(kpoints_scf) |
1279 | + call kpoint_write_file(kpoints_scf, 'KP') |
1280 | + |
1281 | + end subroutine setup_kpoint_scf |
1282 | + |
1283 | +end module kpoint_scf_m |
1284 | |
1285 | === added file 'Src/kpoint_t.F90' |
1286 | --- Src/kpoint_t.F90 1970-01-01 00:00:00 +0000 |
1287 | +++ Src/kpoint_t.F90 2018-05-27 11:17:14 +0000 |
1288 | @@ -0,0 +1,598 @@ |
1289 | +! --- |
1290 | +! Copyright (C) 1996-2016 The SIESTA group |
1291 | +! This file is distributed under the terms of the |
1292 | +! GNU General Public License: see COPYING in the top directory |
1293 | +! or http://www.gnu.org/copyleft/gpl.txt . |
1294 | +! See Docs/Contributors.txt for a list of contributors. |
1295 | +! --- |
1296 | +module kpoint_t_m |
1297 | + |
1298 | + use precision, only: dp |
1299 | + |
1300 | + implicit none |
1301 | + |
1302 | + public :: kpoint_t |
1303 | + |
1304 | + !< Method specification for non-specified k-list |
1305 | + integer, parameter, public :: K_METHOD_NONE = 0 |
1306 | + !< Method specification for Monkhorst-Pack grid |
1307 | + integer, parameter, public :: K_METHOD_MONKHORST_PACK = 1 |
1308 | + !< Method specification for cutoff designation |
1309 | + integer, parameter, public :: K_METHOD_CUTOFF = 2 |
1310 | + !< Method specification for user-defined list |
1311 | + integer, parameter, public :: K_METHOD_LIST = 3 |
1312 | + |
1313 | + type :: kpoint_t |
1314 | + |
1315 | + !< Total number of k-points |
1316 | + integer :: N = 0 |
1317 | + !< K-points |
1318 | + real(dp), pointer :: k(:,:) => null() |
1319 | + !< weights for k-points |
1320 | + real(dp), pointer :: w(:) => null() |
1321 | + !< whether these k-points are under time-reversal symmetry |
1322 | + logical :: trs = .true. |
1323 | + |
1324 | + !< The method by which these k-points are generated |
1325 | + integer :: method = K_METHOD_MONKHORST_PACK |
1326 | + |
1327 | + ! Specific elements for Monkhorst-Pack, cutoff grids |
1328 | + integer :: k_cell(3,3) = 0 |
1329 | + real(dp) :: k_displ(3) = 0._dp |
1330 | + |
1331 | + ! The cutoff requested |
1332 | + real(dp) :: cutoff = 0._dp |
1333 | + |
1334 | + end type kpoint_t |
1335 | + |
1336 | + public :: kpoint_associated |
1337 | + public :: kpoint_associate |
1338 | + public :: kpoint_nullify |
1339 | + public :: kpoint_delete |
1340 | + public :: kpoint_read |
1341 | + |
1342 | + public :: kpoint_read_file |
1343 | + public :: kpoint_write_xml |
1344 | + public :: kpoint_write_stdout |
1345 | + public :: kpoint_write_file |
1346 | + |
1347 | +contains |
1348 | + |
1349 | + !< Associate one k-point list with another (no copies made) |
1350 | + subroutine kpoint_associate(out, in) |
1351 | + type(kpoint_t), intent(inout) :: out |
1352 | + type(kpoint_t), intent(in) :: in |
1353 | + |
1354 | + out%N = in%N |
1355 | + out%k => in%k |
1356 | + out%w => in%w |
1357 | + out%trs = in%trs |
1358 | + out%method = in%method |
1359 | + out%k_cell = in%k_cell |
1360 | + out%k_displ = in%k_displ |
1361 | + |
1362 | + end subroutine kpoint_associate |
1363 | + |
1364 | + !< Figure out if two types are associated with each other |
1365 | + function kpoint_associated(a, b) result(assoc) |
1366 | + type(kpoint_t), intent(in) :: a, b |
1367 | + logical :: assoc |
1368 | + |
1369 | + assoc = associated(a%k, b%k) .and. & |
1370 | + associated(a%w, b%w) |
1371 | + |
1372 | + end function kpoint_associated |
1373 | + |
1374 | + !< Nullify k-point list |
1375 | + subroutine kpoint_nullify(this) |
1376 | + type(kpoint_t), intent(inout) :: this |
1377 | + |
1378 | + nullify(this%k, this%w) |
1379 | + call kpoint_delete(this) |
1380 | + |
1381 | + end subroutine kpoint_nullify |
1382 | + |
1383 | + !< Delete the k-point list |
1384 | + subroutine kpoint_delete(this) |
1385 | + use alloc, only: de_alloc |
1386 | + type(kpoint_t), intent(inout) :: this |
1387 | + |
1388 | + call de_alloc(this%k, name='kpoint_t%k') |
1389 | + call de_alloc(this%w, name='kpoint_t%w') |
1390 | + this%N = 0 |
1391 | + this%trs = .true. |
1392 | + this%method = K_METHOD_NONE |
1393 | + this%k_cell = 0 |
1394 | + this%k_displ = 0 |
1395 | + |
1396 | + end subroutine kpoint_delete |
1397 | + |
1398 | + !< Read settings for this k-point grid |
1399 | + !! |
1400 | + !! The order of reading the k-points are as follows: |
1401 | + !! |
1402 | + !! 1. kgrid.MonkhorstPack has precedence |
1403 | + !! If this block is found the block will be read as this: |
1404 | + !! %block kgrid.MonkhorstPack # Defines k_cell and k_displ |
1405 | + !! 4 0 0 0.50 # (k_cell(i,1),i=1,3), k_displ(1) |
1406 | + !! 0 4 0 0.50 # (k_cell(i,2),i=1,3), k_displ(2) |
1407 | + !! 0 0 4 0.50 # (k_cell(i,3),i=1,3), k_displ(3) |
1408 | + !! %endblock kgrid.MonkhorstPack |
1409 | + !! Note that the displacement defaults to zero and is an optional value. |
1410 | + !! One may also write the block like this: |
1411 | + !! %block kgrid.MonkhorstPack # Defines k_cell and k_displ |
1412 | + !! 4 0.50 # k_cell(1,1), k_displ(1) |
1413 | + !! 4 0.50 # k_cell(2,2), k_displ(2) |
1414 | + !! 4 0.50 # k_cell(3,3), k_displ(3) |
1415 | + !! %endblock kgrid.MonkhorstPack |
1416 | + !! 2. kgrid.Cutoff |
1417 | + !! The k_cell is specified using a cutoff parameter and automatically |
1418 | + !! calculated. |
1419 | + !! 3. kgrid.file |
1420 | + !! The k-points are user-supplied. In this case the k-points *must* |
1421 | + !! be provided in units of the reciprocal lattice vectors (i.e. in ]-0.5 ; 0.5]) |
1422 | + subroutine kpoint_read(this, prefix, cell, trs, process_k_cell) |
1423 | + use fdf |
1424 | + |
1425 | + type(kpoint_t), intent(inout) :: this |
1426 | + character(len=*), intent(in) :: prefix |
1427 | + real(dp), intent(in) :: cell(3,3) |
1428 | + logical, intent(in) :: trs |
1429 | + abstract interface |
1430 | + subroutine my_sub(k_cell, k_displ) |
1431 | + use precision, only: dp |
1432 | + integer, intent(inout) :: k_cell(3,3) |
1433 | + real(dp), intent(inout) :: k_displ(3) |
1434 | + end subroutine |
1435 | + end interface |
1436 | + procedure(my_sub), optional :: process_k_cell |
1437 | + |
1438 | + ! For reading the k-cell etc. |
1439 | + type(block_fdf) :: bfdf |
1440 | + type(parsed_line), pointer :: pline |
1441 | + |
1442 | + character(len=256) :: name_fdf, file |
1443 | + real(dp) :: cutoff |
1444 | + integer :: i, nvals |
1445 | + logical :: spiral |
1446 | + |
1447 | + ! If this already has k-points associated we continue |
1448 | + if ( this%N > 0 ) return |
1449 | + |
1450 | + ! Be sure to delete everything |
1451 | + call kpoint_delete(this) |
1452 | + this%method = K_METHOD_NONE |
1453 | + |
1454 | + spiral = fdf_get('Spin.Spiral', .false.) |
1455 | + ! Allow the user to control the use of time-reversal-symmetry |
1456 | + ! By default, it is on, except for "spin-spiral" calculations |
1457 | + ! and/or non-collinear calculations |
1458 | + this%trs = fdf_get("TimeReversalSymmetryForKpoints", (.not. spiral) .and. trs) |
1459 | + |
1460 | + |
1461 | + call kpoint_fdf_name(prefix, 'kgrid.MonkhorstPack', name_fdf) |
1462 | + if ( fdf_block(name_fdf, bfdf) ) then |
1463 | + |
1464 | + ! The method is a k-point MP grid |
1465 | + this%method = K_METHOD_MONKHORST_PACK |
1466 | + |
1467 | + ! Now read data |
1468 | + do i = 1, 3 |
1469 | + if ( .not. fdf_bline(bfdf,pline) ) then |
1470 | + call die('kpoint_read: ERROR in ' // trim(name_fdf) // ' block') |
1471 | + end if |
1472 | + |
1473 | + ! Read displacement |
1474 | + nvals = fdf_bnvalues(pline) |
1475 | + if ( nvals > 3 ) then |
1476 | + this%k_displ(i) = mod(fdf_bvalues(pline,4), 1._dp) |
1477 | + else |
1478 | + this%k_displ(i) = 0._dp |
1479 | + end if |
1480 | + |
1481 | + if ( nvals == 1 ) then |
1482 | + this%k_cell(i,i) = fdf_bintegers(pline,1) |
1483 | + |
1484 | + else if ( nvals == 2 ) then |
1485 | + this%k_cell(i,i) = fdf_bintegers(pline,1) |
1486 | + this%k_displ(i) = mod(fdf_bvalues(pline,2), 1._dp) |
1487 | + |
1488 | + else |
1489 | + this%k_cell(1,i) = fdf_bintegers(pline,1) |
1490 | + this%k_cell(2,i) = fdf_bintegers(pline,2) |
1491 | + this%k_cell(3,i) = fdf_bintegers(pline,3) |
1492 | + |
1493 | + end if |
1494 | + |
1495 | + end do |
1496 | + |
1497 | + call setup_mp() |
1498 | + |
1499 | + end if |
1500 | + |
1501 | + ! Quick return |
1502 | + if ( this%method /= K_METHOD_NONE ) return |
1503 | + |
1504 | + call kpoint_fdf_name(prefix, 'kgrid.Cutoff', name_fdf) |
1505 | + if ( fdf_defined(name_fdf) ) then |
1506 | + |
1507 | + ! The method is cutoff based |
1508 | + this%method = K_METHOD_CUTOFF |
1509 | + cutoff = fdf_get(name_fdf, -1._dp, 'Bohr') |
1510 | + if ( cutoff <= 0._dp ) then |
1511 | + this%method = K_METHOD_NONE |
1512 | + else |
1513 | + call setup_cutoff() |
1514 | + end if |
1515 | + |
1516 | + end if |
1517 | + |
1518 | + ! Quick return |
1519 | + if ( this%method /= K_METHOD_NONE ) return |
1520 | + |
1521 | + call kpoint_fdf_name(prefix, 'kgrid.File', name_fdf) |
1522 | + if ( fdf_defined(name_fdf) ) then |
1523 | + |
1524 | + ! A user-defined list of k-points |
1525 | + this%method = K_METHOD_LIST |
1526 | + file = fdf_get(name_fdf, '01234567890123456789') |
1527 | + |
1528 | + call setup_file() |
1529 | + |
1530 | + end if |
1531 | + |
1532 | + ! Quick return |
1533 | + if ( this%method /= K_METHOD_NONE ) return |
1534 | + |
1535 | + call setup_gamma() |
1536 | + |
1537 | + contains |
1538 | + |
1539 | + subroutine setup_mp() |
1540 | + use m_find_kgrid, only: find_kgrid |
1541 | + |
1542 | + if ( present(process_k_cell) ) then |
1543 | + call process_k_cell(this%k_cell, this%k_displ) |
1544 | + end if |
1545 | + |
1546 | + ! Find the grid |
1547 | + call find_kgrid(cell, this%k_cell, this%k_displ, .true., & |
1548 | + this%trs, & |
1549 | + this%N, this%k, this%w, this%cutoff) |
1550 | + |
1551 | + end subroutine setup_mp |
1552 | + |
1553 | + subroutine setup_cutoff() |
1554 | + use m_minvec, only : minvec |
1555 | + use m_find_kgrid, only: find_kgrid |
1556 | + |
1557 | + real(dp) :: scmin(3,3), vmod |
1558 | + real(dp) :: ctransf(3,3) |
1559 | + integer :: factor, expansion_factor |
1560 | + |
1561 | + ! Find equivalent rounded unit-cell |
1562 | + call minvec( cell, scmin, ctransf ) |
1563 | + |
1564 | + expansion_factor = 1 |
1565 | + do i = 1 , 3 |
1566 | + |
1567 | + vmod = sqrt( dot_product(scmin(:,i),scmin(:,i)) ) |
1568 | + factor = int(2.0_dp * cutoff / vmod) + 1 |
1569 | + expansion_factor = expansion_factor * factor |
1570 | + |
1571 | + ! Generate actual supercell skeleton |
1572 | + this%k_cell(:,i) = ctransf(:,i) * factor |
1573 | + |
1574 | + end do |
1575 | + |
1576 | + ! Avoid confusing permutations, revert to identity |
1577 | + if ( expansion_factor == 1 ) then |
1578 | + |
1579 | + this%k_cell(:,:) = 0 |
1580 | + do i = 1, 3 |
1581 | + this%k_cell(i,i) = 1 |
1582 | + end do |
1583 | + |
1584 | + end if |
1585 | + |
1586 | + if ( present(process_k_cell) ) then |
1587 | + call process_k_cell(this%k_cell, this%k_displ) |
1588 | + end if |
1589 | + |
1590 | + ! Find the grid |
1591 | + call find_kgrid(cell,this%k_cell, this%k_displ, .false., & |
1592 | + this%trs, & |
1593 | + this%N, this%k, this%w, this%cutoff) |
1594 | + |
1595 | + end subroutine setup_cutoff |
1596 | + |
1597 | + subroutine setup_file() |
1598 | + |
1599 | + call kpoint_read_file(file, cell, this) |
1600 | + |
1601 | + end subroutine setup_file |
1602 | + |
1603 | + subroutine setup_gamma() |
1604 | + use alloc, only: re_alloc |
1605 | + |
1606 | + ! We have a Gamma-only calculation |
1607 | + this%method = K_METHOD_NONE |
1608 | + this%N = 1 |
1609 | + call re_alloc(this%k, 1, 3, 1, 1, name='kpoint%k') |
1610 | + call re_alloc(this%w, 1, 1, name='kpoint%w') |
1611 | + this%k = 0._dp |
1612 | + this%w = 1._dp |
1613 | + this%k_cell = 0 |
1614 | + do i = 1, 3 |
1615 | + this%k_cell(i,i) = 1 |
1616 | + end do |
1617 | + |
1618 | + end subroutine setup_gamma |
1619 | + |
1620 | + end subroutine kpoint_read |
1621 | + |
1622 | + ! The user can specify their own k-points |
1623 | + subroutine kpoint_read_file(fname, cell, this) |
1624 | + use alloc, only: re_alloc |
1625 | + use parallel, only : Node |
1626 | + use m_os, only : file_exist |
1627 | +#ifdef MPI |
1628 | + use mpi_siesta |
1629 | +#endif |
1630 | + character(len=*), intent(in) :: fname |
1631 | + real(dp), intent(in) :: cell(3,3) |
1632 | + type(kpoint_t), intent(inout) :: this |
1633 | + |
1634 | + real(dp) :: rcell(3,3), k(3), wsum |
1635 | + |
1636 | +#ifdef MPI |
1637 | + integer :: MPIerror |
1638 | +#endif |
1639 | + |
1640 | + ! The user has requested to read in |
1641 | + ! k-points from a specific file... |
1642 | + ! We will do that for him/her. |
1643 | + integer :: iu, ik, ix, stat |
1644 | + |
1645 | + if ( Node == 0 ) then |
1646 | + |
1647 | + if ( .not. file_exist(trim(fname)) ) then |
1648 | + call die('Could not locate file '//trim(fname)// & |
1649 | + ' please ensure that the file exists.') |
1650 | + end if |
1651 | + |
1652 | + call io_assign( iu ) |
1653 | + open( iu, file=trim(fname), form='formatted', status='old' ) |
1654 | + |
1655 | + ! Read number of k-points |
1656 | + read(iu,*,iostat=stat) this%N |
1657 | + call kill_iokp(stat,0) |
1658 | + |
1659 | + end if |
1660 | + |
1661 | +#ifdef MPI |
1662 | + call MPI_Bcast(this%N,1,MPI_Integer,0,MPI_Comm_World,MPIerror) |
1663 | +#endif |
1664 | + |
1665 | + call re_alloc(this%k, 1, 3, 1, this%N, name='kpoint%k') |
1666 | + call re_alloc(this%w, 1, this%N, name='kpoint%w') |
1667 | + |
1668 | + if ( Node == 0 ) then |
1669 | + |
1670 | + call reclat(cell, rcell, 1) |
1671 | + |
1672 | + ! Read in the k-points |
1673 | + wsum = 0._dp |
1674 | + do ik = 1 , this%N |
1675 | + |
1676 | + ! read current k-point |
1677 | + read(iu,*,iostat=stat) ix, k(:), this%w(ik) ! (i6,3f12.6,3x,f12.6) |
1678 | + call kpoint_convert(rcell, k, this%k(:,ik), -2) |
1679 | + call kill_iokp(stat,ik) |
1680 | + wsum = wsum + this%w(ik) |
1681 | + |
1682 | + end do |
1683 | + |
1684 | + if ( abs(wsum - 1._dp) > 1.e-7_dp ) then |
1685 | + write(*,'(a)')'WARNING: Weights for user specified k-points does & |
1686 | + ¬ sum to 1.' |
1687 | + call die('User specified k-points does not sum to 1.') |
1688 | + end if |
1689 | + |
1690 | + call io_close( iu ) |
1691 | + |
1692 | + end if |
1693 | + |
1694 | +#ifdef MPI |
1695 | + call MPI_Bcast(this%k(1,1),3*this%N,MPI_Double_Precision,0,MPI_Comm_World,MPIerror) |
1696 | + call MPI_Bcast(this%w(1),this%N,MPI_Double_Precision,0,MPI_Comm_World,MPIerror) |
1697 | +#endif |
1698 | + |
1699 | + contains |
1700 | + |
1701 | + subroutine kill_iokp(stat, line) |
1702 | + integer, intent(in) :: stat, line |
1703 | + |
1704 | + if ( stat == 0 ) return |
1705 | + |
1706 | + write(*,*) 'Siesta kpoint_read could not read your input file' |
1707 | + write(*,*) 'The k-points MUST be in units of reciprocal vectors!' |
1708 | + write(*,*) 'Siesta will convert the unit to correct units.' |
1709 | + write(*,*) 'Also the sum of weights MUST equal 1.' |
1710 | + write(*,*) ! |
1711 | + if ( line == 0 ) then |
1712 | + write(*,*) 'Error occured on reading number of k-points (first line)' |
1713 | + else |
1714 | + write(*,'(a,i0,a)') 'Error occured on reading the ',line,' kpoint.' |
1715 | + end if |
1716 | + write(*,*) 'Please format your file like this:' |
1717 | + write(*,*) ' $> cat '//trim(fname) |
1718 | + write(*,*) ' <nkpt>' |
1719 | + write(*,*) ' 1 <kpt-A1> <kpt-A2> <kpt-A3> <w-kpt>' |
1720 | + write(*,*) ' 2 <kpt-A1> <kpt-A2> <kpt-A3> <w-kpt>' |
1721 | + write(*,*) ' ....' |
1722 | + write(*,*) ' <nkpt> <kpt-A1> <kpt-A2> <kpt-A3> <w-kpt>' |
1723 | + |
1724 | + call die('Siesta reading user specified k-points') |
1725 | + |
1726 | + end subroutine kill_iokp |
1727 | + |
1728 | + end subroutine kpoint_read_file |
1729 | + |
1730 | + |
1731 | + !< Write k-point list to the XML output file |
1732 | + !! |
1733 | + !! This will populate a property list with all information about the |
1734 | + !! k-point generation. |
1735 | + subroutine kpoint_write_xml(this, prefix) |
1736 | + use siesta_cml |
1737 | + use m_char, only: lcase |
1738 | + use units, only: Ang |
1739 | + |
1740 | + type(kpoint_t), intent(inout) :: this |
1741 | + character(len=*), intent(in), optional :: prefix |
1742 | + character(len=64) :: lcase_prefix |
1743 | + integer :: ik |
1744 | + |
1745 | + ! Quick return, if able |
1746 | + if ( .not. cml_p ) return |
1747 | + |
1748 | + if ( present(prefix) ) then |
1749 | + lcase_prefix = lcase(prefix) |
1750 | + |
1751 | + call cmlStartPropertyList(xf=mainXML, title=trim(prefix)//".k-points", & |
1752 | + dictRef="siesta:"//trim(lcase_prefix)//".kpoints") |
1753 | + call cmlAddProperty(xf=mainXML, value=this%N, & |
1754 | + dictref='siesta:'//trim(lcase_prefix)//'.nkpnt', & |
1755 | + units="cmlUnits:countable") |
1756 | + do ik = 1, this%N |
1757 | + call cmlAddKPoint(xf=mainXML, coords=this%k(:,ik), weight=this%w(ik)) |
1758 | + end do |
1759 | + |
1760 | + ! Add supplementary information for MP and Cutoff methods |
1761 | + select case ( this%method ) |
1762 | + case ( K_METHOD_MONKHORST_PACK, K_METHOD_CUTOFF ) |
1763 | + call cmlAddProperty(xf=mainXML, value=this%cutoff/Ang, & |
1764 | + dictref='siesta:'//trim(lcase_prefix)//'.kcutoff', units='siestaUnits:angstrom') |
1765 | + call cmlAddProperty(xf=mainXML, value=this%k_cell, & |
1766 | + dictref='siesta:'//trim(lcase_prefix)//'.kscell', units="cmlUnits:countable") |
1767 | + call cmlAddProperty(xf=mainXML, value=this%k_displ, & |
1768 | + dictref='siesta:'//trim(lcase_prefix)//'.kdispl') |
1769 | + end select |
1770 | + |
1771 | + else |
1772 | + call cmlStartPropertyList(xf=mainXML, title="k-points", & |
1773 | + dictRef="siesta:kpoints") |
1774 | + call cmlAddProperty(xf=mainXML, value=this%N, dictref='siesta:nkpnt', & |
1775 | + units="cmlUnits:countable") |
1776 | + do ik = 1, this%N |
1777 | + call cmlAddKPoint(xf=mainXML, coords=this%k(:,ik), weight=this%w(ik)) |
1778 | + end do |
1779 | + |
1780 | + ! Add supplementary information for MP and Cutoff methods |
1781 | + select case ( this%method ) |
1782 | + case ( K_METHOD_MONKHORST_PACK, K_METHOD_CUTOFF ) |
1783 | + call cmlAddProperty(xf=mainXML, value=this%cutoff/Ang, & |
1784 | + dictref='siesta:kcutoff', units='siestaUnits:angstrom') |
1785 | + call cmlAddProperty(xf=mainXML, value=this%k_cell, & |
1786 | + dictref='siesta:kscell', units="cmlUnits:countable") |
1787 | + call cmlAddProperty(xf=mainXML, value=this%k_displ, & |
1788 | + dictref='siesta:kdispl') |
1789 | + end select |
1790 | + |
1791 | + end if |
1792 | + |
1793 | + call cmlEndPropertyList(mainXML) |
1794 | + |
1795 | + end subroutine kpoint_write_xml |
1796 | + |
1797 | + !< Write to std-out the k-points and some information regarding the generation of the k-list |
1798 | + !! |
1799 | + !! The k-points are only written if `all` is `.true.`. |
1800 | + !! Otherwise only information regarding the generation will be written. |
1801 | + subroutine kpoint_write_stdout(this, all, prefix) |
1802 | + use units, only: Ang |
1803 | + type(kpoint_t), intent(in) :: this |
1804 | + logical, intent(in) :: all |
1805 | + character(len=*), intent(in), optional :: prefix |
1806 | + character(len=64) :: name |
1807 | + integer :: ik |
1808 | + |
1809 | + if ( present(prefix) ) then |
1810 | + name = trim(prefix) // ' k-' |
1811 | + else |
1812 | + name = 'k-' |
1813 | + end if |
1814 | + |
1815 | + if ( all ) then |
1816 | + write(*,'(/,3a)') 'siesta: ',trim(name), 'point coordinates (Bohr**-1) and weights:' |
1817 | + do ik = 1, this%N |
1818 | + write(*,'(a,i10,3(tr1,e13.6),tr3,e12.6)') 'siesta: ', ik, this%k(:,ik), this%w(ik) |
1819 | + end do |
1820 | + end if |
1821 | + write(*,'(/3a,i10)') 'siesta: ', trim(name), 'grid: Number of k-points =', this%N |
1822 | + |
1823 | + select case ( this%method ) |
1824 | + case ( K_METHOD_NONE ) |
1825 | + write(*,'(3a)') 'siesta: ', trim(name), 'point is Gamma-only' |
1826 | + case ( K_METHOD_MONKHORST_PACK ) |
1827 | + write(*,'(3a)') 'siesta: ', trim(name), 'points from Monkhorst-Pack grid' |
1828 | + write(*,'(3a,f10.3,a)') 'siesta: ', trim(name), 'cutoff (effective) =', this%cutoff/Ang, ' Ang' |
1829 | + write(*,'(3a)') 'siesta: ', trim(name), 'point supercell and displacements' |
1830 | + do ik = 1, 3 |
1831 | + write(*,'(a,3i4,3x,f8.3)') 'siesta: k-grid: ', this%k_cell(:,ik), this%k_displ(ik) |
1832 | + end do |
1833 | + case ( K_METHOD_CUTOFF ) |
1834 | + write(*,'(3a)') 'siesta: ', trim(name), 'points from cutoff' |
1835 | + write(*,'(3a,f10.3,a)') 'siesta: ', trim(name), 'cutoff (effective) =', this%cutoff/Ang, ' Ang' |
1836 | + write(*,'(3a)') 'siesta: ', trim(name), 'point supercell and displacements' |
1837 | + do ik = 1, 3 |
1838 | + write(*,'(a,3i4,3x,f8.3)') 'siesta: k-grid: ', this%k_cell(:,ik), this%k_displ(ik) |
1839 | + end do |
1840 | + case ( K_METHOD_LIST ) |
1841 | + write(*,'(3a)') 'siesta: ', trim(name), 'points from user-defined list' |
1842 | + end select |
1843 | + |
1844 | + end subroutine kpoint_write_stdout |
1845 | + |
1846 | + !< Write to a file the k-point information |
1847 | + subroutine kpoint_write_file(this, suffix) |
1848 | + use files, only: slabel |
1849 | + use m_io, only: io_assign, io_close |
1850 | + type(kpoint_t), intent(in) :: this |
1851 | + character(len=*), intent(in) :: suffix |
1852 | + character(len=256) :: fname |
1853 | + integer :: iu, ik |
1854 | + |
1855 | + fname = trim(slabel) // '.' // trim(suffix) |
1856 | + |
1857 | + call io_assign( iu ) |
1858 | + open( iu, file=fname, form='formatted', status='unknown' ) |
1859 | + |
1860 | + write(iu,'(i10)') this%N |
1861 | + do ik = 1, this%N |
1862 | + write(iu,'(i10,3(tr1,e13.6),tr3,e12.6)') ik, this%k(:,ik), this%w(ik) |
1863 | + end do |
1864 | + |
1865 | + call io_close( iu ) |
1866 | + |
1867 | + end subroutine kpoint_write_file |
1868 | + |
1869 | + subroutine kpoint_fdf_name(prefix, suffix, name) |
1870 | + character(len=*), intent(in) :: prefix, suffix |
1871 | + character(len=256), intent(out) :: name |
1872 | + |
1873 | + if ( len_trim(prefix) > 0 ) then |
1874 | + name = trim(prefix) // '.' // trim(suffix) |
1875 | + else |
1876 | + name = trim(suffix) |
1877 | + end if |
1878 | + |
1879 | + end subroutine kpoint_fdf_name |
1880 | + |
1881 | +end module kpoint_t_m |
1882 | + |
1883 | + |
1884 | + |
1885 | + |
1886 | + |
1887 | |
1888 | === modified file 'Src/local_DOS.F' |
1889 | --- Src/local_DOS.F 2018-02-27 14:03:49 +0000 |
1890 | +++ Src/local_DOS.F 2018-05-27 11:17:14 +0000 |
1891 | @@ -26,7 +26,7 @@ |
1892 | use sys, only: die |
1893 | use files, only: slabel ! system label |
1894 | use files, only: filesOut_t ! derived type for output file names |
1895 | - use Kpoint_grid |
1896 | + use kpoint_scf_m, only: kpoints_scf |
1897 | use parallel, only: IOnode |
1898 | use files, only : label_length |
1899 | use m_ntm |
1900 | @@ -79,7 +79,8 @@ |
1901 | call diagon(no_s, spinor_dim, no_l, maxnh, maxnh, no_u, |
1902 | . numh, listhptr, listh, numh, listhptr, listh, |
1903 | . H, S, qtot, fixspin, qtots, temp, e1, e2, |
1904 | - . gamma, xijo, indxuo, nkpnt, kpoint, kweight, |
1905 | + . gamma, xijo, indxuo, |
1906 | + . kpoints_scf%N, kpoints_scf%k, kpoints_scf%w, |
1907 | . eo, qo, Dscf, Escf, ef, efs, dummy_Entrop, no_u, |
1908 | . occtol, dummy_iscf, neigwanted) |
1909 | |
1910 | |
1911 | === modified file 'Src/m_initwf.F90' |
1912 | --- Src/m_initwf.F90 2017-11-10 16:16:08 +0000 |
1913 | +++ Src/m_initwf.F90 2018-05-27 11:17:14 +0000 |
1914 | @@ -77,7 +77,7 @@ |
1915 | use fdf |
1916 | use densematrix, only : Haux, Saux, psi |
1917 | use sparse_matrices, only : maxnh |
1918 | - use Kpoint_grid, only : nkpnt, kpoint, kweight |
1919 | + use kpoint_scf_m, only : kpoints_scf |
1920 | use atomlist, only : no_s, no_l, no_u, qtot, indxuo |
1921 | use m_spin, only : nspin |
1922 | use m_gamma, only : gamma |
1923 | @@ -163,10 +163,10 @@ |
1924 | call re_alloc(psi,1,npsi,name='psi',routine='initwf') |
1925 | allocate(muo(nuo),stat=mem_stat) |
1926 | call memory('A','I',nuo,'initwf',stat=mem_stat) |
1927 | - allocate(nocck(nkpnt,nspin),stat=mem_stat) |
1928 | - call memory('A','I',nkpnt*nspin,'initwf',stat=mem_stat) |
1929 | - allocate(occup(no_u,nspin,nkpnt),stat=mem_stat) |
1930 | - call memory('A','L',nuo*nkpnt*nspin,'initwf',stat=mem_stat) |
1931 | + allocate(nocck(kpoints_scf%N,nspin),stat=mem_stat) |
1932 | + call memory('A','I',kpoints_scf%N*nspin,'initwf',stat=mem_stat) |
1933 | + allocate(occup(no_u,nspin,kpoints_scf%N),stat=mem_stat) |
1934 | + call memory('A','L',nuo*kpoints_scf%N*nspin,'initwf',stat=mem_stat) |
1935 | ! Check indxuo ....................................................... |
1936 | do iuo = 1,nuo |
1937 | muo(iuo) = 0 |
1938 | @@ -199,7 +199,7 @@ |
1939 | ! evolved by integrating TDKS equations. ! |
1940 | ! ............................................................................! |
1941 | temp=1.0d-6 |
1942 | - call fermid( nspin, nspin, nkpnt, kweight, no_u, no_u, eo, & |
1943 | + call fermid( nspin, nspin, kpoints_scf%N, kpoints_scf%w, no_u, no_u, eo, & |
1944 | temp, qtot, qo, ef, entrp ) |
1945 | nocc(1) = 0 |
1946 | nocc(2) = 0 |
1947 | @@ -207,26 +207,26 @@ |
1948 | degen= .false. |
1949 | ! |
1950 | ! |
1951 | - do ik=1,nkpnt |
1952 | + do ik=1,kpoints_scf%N |
1953 | do ispin=1,nspin |
1954 | nocck(ik,ispin)=0 |
1955 | do io=1,no_u |
1956 | occup(io,ispin,ik)=.false. |
1957 | - if(dabs(qo(io,ispin,ik)-2.0d0*kweight(ik)/nspin).le. & |
1958 | - 1.0d-2*dabs(2.0d0*kweight(ik)/nspin)) then |
1959 | + if(dabs(qo(io,ispin,ik)-2.0d0*kpoints_scf%w(ik)/nspin).le. & |
1960 | + 1.0d-2*dabs(2.0d0**kpoints_scf%w(ik)/nspin)) then |
1961 | nocc(ispin)=nocc(ispin)+1 |
1962 | nocck(ik,ispin)=nocck(ik,ispin)+1 |
1963 | ! Accounting the number of electrons corresponding the states being marked |
1964 | ! as occupied. |
1965 | - nelect=nelect+dabs(2.0d0*kweight(ik)/nspin) |
1966 | + nelect=nelect+dabs(2.0d0*kpoints_scf%w(ik)/nspin) |
1967 | occup(io,ispin,ik)=.true. |
1968 | else |
1969 | - if ( dabs( qo(io,ispin,ik)) .gt.1.0d-2*dabs(2.0d0*kweight(ik)/nspin)) then |
1970 | + if ( dabs( qo(io,ispin,ik)) .gt.1.0d-2*dabs(2.0d0*kpoints_scf%w(ik)/nspin)) then |
1971 | IF (Node .eq. 0) THEN |
1972 | IF(.not. degen) write(6,fmt="(/,a,tr3,a,tr3,a,tr3,a)") "initwf:","ik", & |
1973 | "occupancy","maximum occupancy" |
1974 | write(6,"(tr2,I10,tr3,f8.6,tr4,f8.6)") ik, qo(io,ispin,ik), & |
1975 | - 2.0d0*kweight(ik)/nspin |
1976 | + 2.0d0*kpoints_scf%w(ik)/nspin |
1977 | END IF |
1978 | degen = .true. |
1979 | end if |
1980 | @@ -259,8 +259,8 @@ |
1981 | #else |
1982 | m_storage='szden' |
1983 | #endif |
1984 | - allocate(wavef_ms(1:nkpnt,1:nspin)) ! allocate (nkpnt*npsin) matrices inside wavef_ms |
1985 | - do i=1,nkpnt !for every value of nkpnt and nspin, allocate a matrix of size (no_u x nocck(i,j)) |
1986 | + allocate(wavef_ms(1:kpoints_scf%N,1:nspin)) ! allocate (nkpnt*npsin) matrices inside wavef_ms |
1987 | + do i=1,kpoints_scf%N !for every value of nkpnt and nspin, allocate a matrix of size (no_u x nocck(i,j)) |
1988 | do j=1,nspin |
1989 | call m_allocate(wavef_ms(i,j),no_u,nocck(i,j),m_storage) |
1990 | end do |
1991 | @@ -271,7 +271,7 @@ |
1992 | Haux, Saux, psi, no_u, occup) |
1993 | else if (nspin.le.2 .and. .not.gamma) then |
1994 | call diagkiwf( nspin, nuo, no_s, nspin, no_l, maxnh, & |
1995 | - no_u, indxuo, nkpnt, kpoint, Haux, Saux, & |
1996 | + no_u, indxuo, kpoints_scf%N, kpoints_scf%k, Haux, Saux, & |
1997 | psi, no_u, occup) |
1998 | else |
1999 | call die('initwf: ERROR: non-collinear spin options for TDDFT not yet implemented') |
2000 | @@ -279,7 +279,7 @@ |
2001 | ! Write/save wavefunction in .TDWF file to use for TDDFT calculation. |
2002 | IF (Node .eq. 0) WRITE(6,'(a)') 'initwf: Saving wavefunctions & |
2003 | &in <systemlabel>.TDWF file.' |
2004 | - call iowavef('write',wavef_ms,no_u,nkpnt,nspin) |
2005 | + call iowavef('write',wavef_ms,no_u,kpoints_scf%N,nspin) |
2006 | ! Free local arrays |
2007 | call memory('D','I',size(muo),'initwf',stat=mem_stat) |
2008 | deallocate(muo,stat=mem_stat) |
2009 | |
2010 | === modified file 'Src/m_ncdf_siesta.F90' |
2011 | --- Src/m_ncdf_siesta.F90 2018-02-27 14:03:49 +0000 |
2012 | +++ Src/m_ncdf_siesta.F90 2018-05-27 11:17:14 +0000 |
2013 | @@ -491,12 +491,12 @@ |
2014 | |
2015 | subroutine cdf_save_settings(fname) |
2016 | |
2017 | - use kpoint_grid, only: kscell, kdispl |
2018 | + use kpoint_scf_m, only: kpoints_scf |
2019 | use siesta_options, only: cdf_w_parallel |
2020 | use siesta_options, only: dDtol, dHtol, charnet, wmix, temp, g2cut |
2021 | use siesta_options, only: isolve |
2022 | use siesta_options, only: SOLVE_DIAGON, SOLVE_ORDERN, SOLVE_TRANSI |
2023 | - use m_ts_kpoints, only: ts_kscell, ts_kdispl |
2024 | + use ts_kpoint_scf_m, only: ts_kpoints_scf |
2025 | |
2026 | character(len=*), intent(in) :: fname |
2027 | |
2028 | @@ -509,8 +509,8 @@ |
2029 | call ncdf_open_grp(ncdf,'SETTINGS',grp) |
2030 | |
2031 | ! Save settings |
2032 | - call ncdf_put_var(grp,'BZ',kscell) |
2033 | - call ncdf_put_var(grp,'BZ_displ',kdispl) |
2034 | + call ncdf_put_var(grp,'BZ',kpoints_scf%k_cell) |
2035 | + call ncdf_put_var(grp,'BZ_displ',kpoints_scf%k_displ) |
2036 | call ncdf_put_var(grp,'DMTolerance',dDtol) |
2037 | call ncdf_put_var(grp,'HTolerance',dHtol) |
2038 | call ncdf_put_var(grp,'NetCharge',charnet) |
2039 | @@ -524,8 +524,8 @@ |
2040 | if ( isolve == SOLVE_TRANSI ) then |
2041 | call ncdf_open_grp(ncdf,'TRANSIESTA',grp) |
2042 | |
2043 | - call ncdf_put_var(grp,'BZ',ts_kscell) |
2044 | - call ncdf_put_var(grp,'BZ_displ',ts_kdispl) |
2045 | + call ncdf_put_var(grp,'BZ',ts_kpoints_scf%k_cell) |
2046 | + call ncdf_put_var(grp,'BZ_displ',ts_kpoints_scf%k_displ) |
2047 | |
2048 | end if |
2049 | |
2050 | |
2051 | === modified file 'Src/m_transiesta.F90' |
2052 | --- Src/m_transiesta.F90 2018-04-04 13:22:33 +0000 |
2053 | +++ Src/m_transiesta.F90 2018-05-27 11:17:14 +0000 |
2054 | @@ -58,7 +58,7 @@ |
2055 | use class_OrbitalDistribution |
2056 | use class_Sparsity |
2057 | |
2058 | - use m_ts_kpoints, only : ts_nkpnt, ts_Gamma |
2059 | + use ts_kpoint_scf_m, only : ts_kpoints_scf, ts_gamma_scf |
2060 | |
2061 | use m_ts_electype |
2062 | |
2063 | @@ -145,7 +145,7 @@ |
2064 | end if |
2065 | |
2066 | ! print out estimated memory usage... |
2067 | - call ts_print_memory(ts_Gamma) |
2068 | + call ts_print_memory(ts_gamma_scf) |
2069 | |
2070 | call ts_print_charges(N_Elec,Elecs, Qtot, sp_dist, sparse_pattern, & |
2071 | nspin, n_nzs, DM, S) |
2072 | @@ -247,7 +247,7 @@ |
2073 | call open_GF(N_Elec,Elecs,uGF,NEn,.false.) |
2074 | |
2075 | if ( ts_method == TS_FULL ) then |
2076 | - if ( ts_Gamma ) then |
2077 | + if ( ts_gamma_scf ) then |
2078 | call ts_fullg(N_Elec,Elecs, & |
2079 | nq, uGF, nspin, na_u, lasto, & |
2080 | sp_dist, sparse_pattern, & |
2081 | @@ -262,7 +262,7 @@ |
2082 | H, S, DM, EDM, Ef, DE_NEGF) |
2083 | end if |
2084 | else if ( ts_method == TS_BTD ) then |
2085 | - if ( ts_Gamma ) then |
2086 | + if ( ts_gamma_scf ) then |
2087 | call ts_trig(N_Elec,Elecs, & |
2088 | nq, uGF, nspin, na_u, lasto, & |
2089 | sp_dist, sparse_pattern, & |
2090 | @@ -278,7 +278,7 @@ |
2091 | end if |
2092 | #ifdef SIESTA__MUMPS |
2093 | else if ( ts_method == TS_MUMPS ) then |
2094 | - if ( ts_Gamma ) then |
2095 | + if ( ts_gamma_scf ) then |
2096 | call ts_mumpsg(N_Elec,Elecs, & |
2097 | nq, uGF, nspin, na_u, lasto, & |
2098 | sp_dist, sparse_pattern, & |
2099 | @@ -335,7 +335,7 @@ |
2100 | Ef = Ef + 0.01_dp * eV |
2101 | end if |
2102 | else if ( ts_method == TS_BTD ) then |
2103 | - if ( ts_Gamma ) then |
2104 | + if ( ts_gamma_scf ) then |
2105 | call ts_trig_Fermi(N_Elec,Elecs, & |
2106 | nq, uGF, nspin, na_u, lasto, & |
2107 | sp_dist, sparse_pattern, & |
2108 | @@ -588,7 +588,7 @@ |
2109 | end if |
2110 | |
2111 | if ( Elecs(iEl)%out_of_core ) then |
2112 | - call read_Green(uGF(iEl),Elecs(iEl), ts_nkpnt, NEn ) |
2113 | + call read_Green(uGF(iEl),Elecs(iEl), ts_kpoints_scf%N, NEn ) |
2114 | end if |
2115 | |
2116 | end do |
2117 | |
2118 | === modified file 'Src/m_ts_fullk.F90' |
2119 | --- Src/m_ts_fullk.F90 2017-12-12 09:13:49 +0000 |
2120 | +++ Src/m_ts_fullk.F90 2018-05-27 11:17:14 +0000 |
2121 | @@ -96,7 +96,7 @@ |
2122 | ! Self-energy expansion |
2123 | use m_ts_elec_se |
2124 | |
2125 | - use m_ts_kpoints, only : ts_nkpnt, ts_kpoint, ts_kweight |
2126 | + use ts_kpoint_scf_m, only : ts_kpoints_scf |
2127 | |
2128 | use m_ts_options, only : Calc_Forces |
2129 | use m_ts_options, only : N_mu, mus |
2130 | @@ -282,7 +282,7 @@ |
2131 | end if |
2132 | |
2133 | ! start the itterators |
2134 | - call itt_init (SpKp,end1=nspin,end2=ts_nkpnt) |
2135 | + call itt_init (SpKp,end1=nspin,end2=ts_kpoints_scf%N) |
2136 | ! point to the index iterators |
2137 | call itt_attach(SpKp,cur1=ispin,cur2=ikpt) |
2138 | |
2139 | @@ -300,10 +300,10 @@ |
2140 | end if |
2141 | |
2142 | ! Include spin factor and 1/(2\pi) |
2143 | - kpt(:) = ts_kpoint(:,ikpt) |
2144 | + kpt(:) = ts_kpoints_scf%k(:,ikpt) |
2145 | ! create the k-point in reciprocal space |
2146 | call kpoint_convert(ucell,kpt,bkpt,1) |
2147 | - kw = 0.5_dp / Pi * ts_kweight(ikpt) |
2148 | + kw = 0.5_dp / Pi * ts_kpoints_scf%w(ikpt) |
2149 | if ( nspin == 1 ) kw = kw * 2._dp |
2150 | |
2151 | #ifdef TRANSIESTA_TIMING |
2152 | |
2153 | === removed file 'Src/m_ts_kpoints.F90' |
2154 | --- Src/m_ts_kpoints.F90 2017-11-23 14:17:27 +0000 |
2155 | +++ Src/m_ts_kpoints.F90 1970-01-01 00:00:00 +0000 |
2156 | @@ -1,323 +0,0 @@ |
2157 | -! --- |
2158 | -! Copyright (C) 1996-2016 The SIESTA group |
2159 | -! This file is distributed under the terms of the |
2160 | -! GNU General Public License: see COPYING in the top directory |
2161 | -! or http://www.gnu.org/copyleft/gpl.txt . |
2162 | -! See Docs/Contributors.txt for a list of contributors. |
2163 | -! --- |
2164 | -module m_ts_kpoints |
2165 | -! |
2166 | -! Routines that are related to TS kpoint sampling |
2167 | -! |
2168 | -!============================================================================== |
2169 | -! CONTAINS: |
2170 | -! 1) setup_ts_scf_kscell |
2171 | -! 2) setup_ts_kpoint_grid |
2172 | -! 3) ts_write_k_points |
2173 | -! 4) ts_iokp |
2174 | - |
2175 | - use precision, only : dp |
2176 | - |
2177 | - implicit none |
2178 | - |
2179 | - private |
2180 | - save |
2181 | - |
2182 | -!===================== K-POINT RELATED VARIABLES ============================== |
2183 | -!============================================================================== |
2184 | -! Contains data structures and routines to deal with the kpoint-grid |
2185 | -! for the self-consistent calculation with Green Functions. |
2186 | -! Original verison modified so that the kpoint sampling is done for the |
2187 | -! direction perpendicular to the transport directins |
2188 | -! Version created to integrate TRANSIESTA in siesta2.3 |
2189 | -!============================================================================== |
2190 | -! The kpoint mesh parameters that are public may be accessed in other |
2191 | -! parts of the code. With respesct to the original names of the variables used |
2192 | -! in the m_kpoint_grid module, a "ts_" was added. Also in the SIESTA module |
2193 | -! kscell and kdispl are not public, but are made public (ts_kscell and |
2194 | -! ts_kdispl) here. |
2195 | - |
2196 | -!============================================================================== |
2197 | -! DETAILS: To obtain the kpoints for the GFs calculations it uses the same |
2198 | -! scheme as for SIESTA but puts ts_kscell(3,3)=1 and ts_kdispl(3)=0.0 |
2199 | -! |
2200 | -!============================================================================== |
2201 | - |
2202 | - logical, public :: ts_scf_kgrid_first_time = .true. |
2203 | - logical, public :: ts_Gamma |
2204 | - integer, public :: ts_nkpnt ! Total number of k-points |
2205 | - real(dp), public :: ts_eff_kgrid_cutoff ! Effective kgrid_cutoff |
2206 | - |
2207 | - real(dp), pointer, public :: ts_kweight(:) |
2208 | - real(dp), pointer, public :: ts_kpoint(:,:) |
2209 | - |
2210 | - integer, public :: ts_kscell(3,3) = 0 |
2211 | - real(dp), public :: ts_kdispl(3) = 0.0_dp |
2212 | - |
2213 | - logical, public :: ts_firm_displ = .false. |
2214 | - logical, public :: ts_user_requested_mp = .false. |
2215 | - logical, public :: ts_user_requested_cutoff = .false. |
2216 | - |
2217 | - public :: setup_ts_scf_kscell, setup_ts_kpoint_grid |
2218 | - public :: ts_write_k_points |
2219 | - |
2220 | -contains |
2221 | - |
2222 | - subroutine setup_ts_scf_kscell( cell ) |
2223 | - |
2224 | -! ***************** INPUT ********************************************** |
2225 | -! real*8 cell(3,3) : Unit cell vectors in real space cell(ixyz,ivec) |
2226 | -! type(Elec) Elecs(:) : Electrodes |
2227 | - |
2228 | -! The relevant fdf labels are kgrid_cutoff and kgrid_Monkhorst_Pack. |
2229 | -! If both are present, kgrid_Monkhorst_Pack has priority. If none is |
2230 | -! present, the cutoff default is zero, producing only the gamma point. |
2231 | -! Examples of fdf data specifications: |
2232 | -! kgrid_cutoff 50. Bohr |
2233 | -! %block kgrid_Monkhorst_Pack # Defines kscell and kdispl |
2234 | -! 4 0 0 0.50 # (kscell(i,1),i=1,3), kdispl(1) |
2235 | -! 0 4 0 0.50 # (kscell(i,2),i=1,3), kdispl(2) |
2236 | -! 0 0 4 0.50 # (kscell(i,3),i=1,3), kdispl(3) |
2237 | -! %endblock kgrid_Monkhorst_Pack |
2238 | -! ********************************************************************** |
2239 | - |
2240 | -! Modules |
2241 | - |
2242 | - use parallel, only : IONode |
2243 | - use m_minvec, only : minvec |
2244 | - use fdf |
2245 | - use sys, only : die |
2246 | -#ifdef MPI |
2247 | - use mpi_siesta |
2248 | -#endif |
2249 | - |
2250 | - use m_ts_tdir, only: ts_tidx |
2251 | - use m_ts_global_vars, only : TSmode |
2252 | - |
2253 | - implicit none |
2254 | - |
2255 | - ! Passed variables |
2256 | - real(dp), intent(in) :: cell(3,3) |
2257 | - |
2258 | - ! Internal variables |
2259 | - integer :: i, j, factor(3,3), expansion_factor |
2260 | - real(dp) :: scmin(3,3), vmod, cutoff |
2261 | - real(dp) :: ctransf(3,3) |
2262 | - |
2263 | - type(block_fdf) :: bfdf |
2264 | - type(parsed_line), pointer :: pline |
2265 | - |
2266 | - logical :: bool |
2267 | - real(dp), parameter :: defcut = 0.0_dp |
2268 | - |
2269 | - bool = fdf_block('TS.kgrid_Monkhorst_Pack',bfdf) |
2270 | - if ( .not. bool ) & |
2271 | - bool = fdf_block('kgrid_Monkhorst_Pack',bfdf) |
2272 | - |
2273 | - if ( bool ) then |
2274 | - ts_user_requested_mp = .true. |
2275 | - do i = 1,3 |
2276 | - if (fdf_bline(bfdf,pline)) then |
2277 | - ts_kscell(1,i) = fdf_bintegers(pline,1) |
2278 | - ts_kscell(2,i) = fdf_bintegers(pline,2) |
2279 | - ts_kscell(3,i) = fdf_bintegers(pline,3) |
2280 | - if ( fdf_bnvalues(pline) > 3 ) then |
2281 | - ts_kdispl(i) = mod(fdf_bvalues(pline,4), 1._dp) |
2282 | - else |
2283 | - ts_kdispl(i) = 0._dp |
2284 | - end if |
2285 | - else |
2286 | - call die( 'setup_ts_scf_kscell: ERROR no data in' // & |
2287 | - 'kgrid_Monkhorst_Pack block' ) |
2288 | - endif |
2289 | - enddo |
2290 | - ts_firm_displ = .true. |
2291 | - |
2292 | - else |
2293 | - |
2294 | - if ( IONode .and. TSmode ) then |
2295 | - write(*,*) 'WARNING !!!' |
2296 | - write(*,*) 'TS kgrid determined first with 3D cell !!!' |
2297 | - write(*,*) 'Specifying only cutoff in Electrode AND Scattering calculations might lead to problems !!' |
2298 | - end if |
2299 | - |
2300 | - cutoff = fdf_get('kgrid_cutoff',defcut,'Bohr') |
2301 | - ts_user_requested_cutoff = (cutoff /= defcut) |
2302 | - |
2303 | - ts_kdispl(1:3) = 0.0_dp ! Might be changed later |
2304 | - ts_firm_displ = .false. |
2305 | - |
2306 | - ! Find equivalent rounded unit-cell |
2307 | - call minvec( cell, scmin, ctransf ) |
2308 | - |
2309 | - expansion_factor = 1 |
2310 | - do j = 1,3 |
2311 | - factor(j,1:3) = 0 |
2312 | - vmod = sqrt(dot_product(scmin(1:3,j),scmin(1:3,j))) |
2313 | - factor(j,j) = int(2.0_dp*cutoff/vmod) + 1 |
2314 | - expansion_factor = expansion_factor * factor(j,j) |
2315 | - enddo |
2316 | - ! Generate actual supercell skeleton |
2317 | - ts_kscell = matmul(ctransf, factor) |
2318 | - |
2319 | - if ( expansion_factor == 1 ) then |
2320 | - ts_kscell = 0 |
2321 | - ts_kscell(1,1) = 1 |
2322 | - ts_kscell(2,2) = 1 |
2323 | - ts_kscell(3,3) = 1 |
2324 | - end if |
2325 | - |
2326 | - end if |
2327 | - |
2328 | - ! In case of TSmode we have a transiesta run. |
2329 | - ! This means that we truncate the k-points in the transport direction. |
2330 | - ! However, if we are dealing with an electrode calculation we simply allow it |
2331 | - ! to have the same cell (the check made will disregard the transport directions k-points) |
2332 | - if ( TSmode .and. ts_tidx > 0 ) then |
2333 | - i = ts_tidx |
2334 | - ts_kscell(:,i) = 0 |
2335 | - ts_kscell(i,:) = 0 |
2336 | - ts_kscell(i,i) = 1 |
2337 | - ts_kdispl(i) = 0._dp |
2338 | - end if |
2339 | - |
2340 | - end subroutine setup_ts_scf_kscell |
2341 | - |
2342 | - subroutine setup_ts_kpoint_grid( ucell ) |
2343 | - |
2344 | - ! SIESTA Modules |
2345 | - USE precision, only : dp |
2346 | - USE fdf, only : fdf_get |
2347 | - USE m_find_kgrid, only : find_kgrid |
2348 | - USE parallel, only : IONode |
2349 | - use m_ts_global_vars, only : TSmode |
2350 | - use kpoint_grid |
2351 | - |
2352 | - ! Local Variables |
2353 | - real(dp), intent(in) :: ucell(3,3) |
2354 | - |
2355 | - if ( .not. TSMode ) then |
2356 | - |
2357 | - ! Same as SIESTA (mainly to be able to write the TSHS files). |
2358 | - ts_Gamma = gamma_SCF |
2359 | - ts_nkpnt = nkpnt |
2360 | - ts_eff_kgrid_cutoff = eff_kgrid_cutoff |
2361 | - ts_kweight => kweight |
2362 | - ts_kpoint => kpoint |
2363 | - ts_kscell = kscell |
2364 | - ts_kdispl = kdispl |
2365 | - |
2366 | - ! Since this is not transiesta we immediately return |
2367 | - ! and then we also skip printing out transiesta information. |
2368 | - return |
2369 | - |
2370 | - end if |
2371 | - |
2372 | - if ( ts_scf_kgrid_first_time ) then |
2373 | - |
2374 | - nullify(ts_kweight,ts_kpoint) |
2375 | - if ( fdf_get('SpinSpiral', .false.) ) then |
2376 | - call die('transiesta: Does not work with spin-spiral') |
2377 | - end if |
2378 | - |
2379 | - call setup_ts_scf_kscell(ucell) |
2380 | - |
2381 | - ts_scf_kgrid_first_time = .false. |
2382 | - |
2383 | - else |
2384 | - if ( ts_user_requested_mp ) then |
2385 | - ! no need to set up the kscell again |
2386 | - else |
2387 | - call setup_ts_scf_kscell(ucell) |
2388 | - endif |
2389 | - endif |
2390 | - |
2391 | - call find_kgrid(ucell,ts_kscell,ts_kdispl,ts_firm_displ, & |
2392 | - .true., & |
2393 | - ts_nkpnt,ts_kpoint,ts_kweight, ts_eff_kgrid_cutoff) |
2394 | - |
2395 | - ts_Gamma = ts_nkpnt == 1 .and. & |
2396 | - dot_product(ts_kpoint(:,1),ts_kpoint(:,1)) < 1.0e-20_dp |
2397 | - |
2398 | - if (IONode) call ts_write_k_points() |
2399 | - |
2400 | - end subroutine setup_ts_kpoint_grid |
2401 | - |
2402 | - subroutine ts_write_k_points() |
2403 | - USE siesta_options, only: writek |
2404 | - USE siesta_cml |
2405 | - |
2406 | - implicit none |
2407 | - |
2408 | - integer :: ik, ix, i |
2409 | - |
2410 | - if ( writek ) then |
2411 | - write(*,'(/,a)') 'transiesta: ts_k-point coordinates (Bohr**-1) and weights:' |
2412 | - write(*,'(a,i4,3f12.6,3x,f12.6)') & |
2413 | - ('transiesta: ', ik, (ts_kpoint(ix,ik),ix=1,3), ts_kweight(ik), & |
2414 | - ik=1,ts_nkpnt) |
2415 | - endif |
2416 | - |
2417 | - ! Always write the TranSIESTA k-points |
2418 | - call ts_iokp( ts_nkpnt, ts_kpoint, ts_kweight ) |
2419 | - |
2420 | - write(*,'(/,a,i6)') 'transiesta: k-grid: Number of Green function k-points =', ts_nkpnt |
2421 | - write(*,'(a)') 'transiesta: k-grid: Supercell and displacements' |
2422 | - write(*,'(a,3i4,3x,f8.3)') 'transiesta: k-grid: ', & |
2423 | - (ts_kscell(i,1),i=1,3), ts_kdispl(1) |
2424 | - write(*,'(a,3i4,3x,f8.3)') 'transiesta: k-grid: ', & |
2425 | - (ts_kscell(i,2),i=1,3), ts_kdispl(2) |
2426 | - write(*,'(a,3i4,3x,f8.3)') 'transiesta: k-grid: ', & |
2427 | - (ts_kscell(i,3),i=1,3), ts_kdispl(3) |
2428 | - if (cml_p) then |
2429 | - call cmlStartPropertyList(xf=mainXML, title="Transiesta k-points", & |
2430 | - dictRef="siesta:ts_kpoints") |
2431 | - call cmlAddProperty(xf=mainXML, value=ts_nkpnt, dictref='siesta:ts_nkpnt', & |
2432 | - units="cmlUnits:countable") |
2433 | - do ik=1, ts_nkpnt |
2434 | - call cmlAddKPoint(xf=mainXML, coords=ts_kpoint(:,ik), weight=ts_kweight(ik)) |
2435 | - enddo |
2436 | - call cmlEndPropertyList(mainXML) |
2437 | - call cmlAddProperty(xf=mainXML, value=ts_kscell, dictref='siesta:ts_kscell', & |
2438 | - units="siestaUnits:Ang") |
2439 | - call cmlAddProperty(xf=mainXML, value=ts_kdispl, dictref='siesta:ts_kdispl', & |
2440 | - units="siestaUnits:Ang") |
2441 | - endif |
2442 | - end subroutine ts_write_k_points |
2443 | - |
2444 | - subroutine ts_iokp( nk, points, weight ) |
2445 | -! ******************************************************************* |
2446 | -! Saves TranSIESTA k-points (only writing) Bohr^-1 |
2447 | -! Emilio Artacho, Feb. 1999 |
2448 | -! Modified by Nick Papior Andersen to not overwrite the SIESTA k-points |
2449 | -! ********** INPUT ************************************************** |
2450 | -! integer nk : Number of TS k-points |
2451 | -! real*8 points(3,nk) : TS k-point coordinates |
2452 | -! real*8 weight(3,nk) : TS k-point weight |
2453 | -! ******************************************************************* |
2454 | - use fdf |
2455 | - use files, only : slabel, label_length |
2456 | - |
2457 | - integer :: nk |
2458 | - real(dp) :: points(3,nk), weight(nk) |
2459 | - external :: io_assign, io_close |
2460 | - |
2461 | -! Internal |
2462 | - character(len=label_length+5) :: fname |
2463 | - integer :: iu, ik, ix |
2464 | -! ------------------------------------------------------------------- |
2465 | - |
2466 | - fname = trim( slabel ) // '.TSKP' |
2467 | - |
2468 | - call io_assign( iu ) |
2469 | - open( iu, file=fname, form='formatted', status='unknown' ) |
2470 | - |
2471 | - write(iu,'(i6)') nk |
2472 | - write(iu,'(i6,3f12.6,3x,f12.6)') & |
2473 | - (ik, (points(ix,ik),ix=1,3), weight(ik), ik=1,nk) |
2474 | - |
2475 | - call io_close( iu ) |
2476 | - |
2477 | - end subroutine ts_iokp |
2478 | - |
2479 | -end module m_ts_kpoints |
2480 | |
2481 | === modified file 'Src/m_ts_mumpsk.F90' |
2482 | --- Src/m_ts_mumpsk.F90 2017-12-12 08:11:00 +0000 |
2483 | +++ Src/m_ts_mumpsk.F90 2018-05-27 11:17:14 +0000 |
2484 | @@ -66,7 +66,7 @@ |
2485 | ! Self-energy expansion |
2486 | use m_ts_elec_se |
2487 | |
2488 | - use m_ts_kpoints, only : ts_nkpnt, ts_kpoint, ts_kweight |
2489 | + use ts_kpoint_scf_m, only : ts_kpoints_scf |
2490 | |
2491 | use m_ts_options, only : Calc_Forces |
2492 | use m_ts_options, only : N_mu, mus |
2493 | @@ -236,7 +236,7 @@ |
2494 | end if |
2495 | |
2496 | ! start the itterators |
2497 | - call itt_init (SpKp,end1=nspin,end2=ts_nkpnt) |
2498 | + call itt_init (SpKp,end1=nspin,end2=ts_kpoints_scf%N) |
2499 | ! point to the index iterators |
2500 | call itt_attach(SpKp,cur1=ispin,cur2=ikpt) |
2501 | |
2502 | @@ -252,10 +252,10 @@ |
2503 | end if |
2504 | |
2505 | ! Include spin factor and 1/(2\pi) |
2506 | - kpt(:) = ts_kpoint(:,ikpt) |
2507 | + kpt(:) = ts_kpoints_scf%k(:,ikpt) |
2508 | ! create the k-point in reciprocal space |
2509 | call kpoint_convert(ucell,kpt,bkpt,1) |
2510 | - kw = 0.5_dp / Pi * ts_kweight(ikpt) |
2511 | + kw = 0.5_dp / Pi * ts_kpoints_scf%w(ikpt) |
2512 | if ( nspin == 1 ) kw = kw * 2._dp |
2513 | |
2514 | write(mum%ICNTL(1),'(/,a,i0,a,3(tr1,g10.4),/)') & |
2515 | |
2516 | === modified file 'Src/m_ts_trik.F90' |
2517 | --- Src/m_ts_trik.F90 2017-11-17 20:53:23 +0000 |
2518 | +++ Src/m_ts_trik.F90 2018-05-27 11:17:14 +0000 |
2519 | @@ -72,7 +72,7 @@ |
2520 | ! Self-energy expansion |
2521 | use m_ts_elec_se |
2522 | |
2523 | - use m_ts_kpoints, only : ts_nkpnt, ts_kpoint, ts_kweight |
2524 | + use ts_kpoint_scf_m, only : ts_kpoints_scf |
2525 | |
2526 | use m_ts_options, only : Calc_Forces |
2527 | use m_ts_options, only : N_mu, mus |
2528 | @@ -298,7 +298,7 @@ |
2529 | |
2530 | |
2531 | ! start the itterators |
2532 | - call itt_init (SpKp,end1=nspin,end2=ts_nkpnt) |
2533 | + call itt_init (SpKp,end1=nspin,end2=ts_kpoints_scf%N) |
2534 | ! point to the index iterators |
2535 | call itt_attach(SpKp,cur1=ispin,cur2=ikpt) |
2536 | |
2537 | @@ -311,10 +311,10 @@ |
2538 | end if |
2539 | |
2540 | ! Include spin factor and 1/(2\pi) |
2541 | - kpt(:) = ts_kpoint(:,ikpt) |
2542 | + kpt(:) = ts_kpoints_scf%k(:,ikpt) |
2543 | ! create the k-point in reciprocal space |
2544 | call kpoint_convert(ucell,kpt,bkpt,1) |
2545 | - kw = 0.5_dp / Pi * ts_kweight(ikpt) |
2546 | + kw = 0.5_dp / Pi * ts_kpoints_scf%w(ikpt) |
2547 | if ( nspin == 1 ) kw = kw * 2._dp |
2548 | |
2549 | #ifdef TRANSIESTA_TIMING |
2550 | @@ -685,7 +685,7 @@ |
2551 | ! Self-energy expansion |
2552 | use m_ts_elec_se |
2553 | |
2554 | - use m_ts_kpoints, only : ts_nkpnt, ts_kpoint, ts_kweight |
2555 | + use ts_kpoint_scf_m, only : ts_kpoints_scf |
2556 | |
2557 | use m_ts_sparse, only : ts_sp_uc, tsup_sp_uc |
2558 | use m_ts_sparse, only : ltsup_sp_sc, sc_off |
2559 | @@ -811,15 +811,15 @@ |
2560 | zDM => val(spuDM) |
2561 | call newdSpData2D(ltsup_sp_sc,1, sp_dist,spDM ,name='TS spDM') |
2562 | |
2563 | - call itt_init (SpKp,end1=nspin,end2=ts_nkpnt) |
2564 | + call itt_init (SpKp,end1=nspin,end2=ts_kpoints_scf%N) |
2565 | call itt_attach(SpKp,cur1=ispin,cur2=ikpt) |
2566 | |
2567 | call init_val(spDM) |
2568 | do while ( .not. itt_step(SpKp) ) |
2569 | |
2570 | - kpt(:) = ts_kpoint(:,ikpt) |
2571 | + kpt(:) = ts_kpoints_scf%k(:,ikpt) |
2572 | call kpoint_convert(ucell,kpt,bkpt,1) |
2573 | - kw = 0.5_dp / Pi * ts_kweight(ikpt) |
2574 | + kw = 0.5_dp / Pi * ts_kpoints_scf%w(ikpt) |
2575 | if ( nspin == 1 ) kw = kw * 2._dp |
2576 | |
2577 | #ifdef TRANSIESTA_TIMING |
2578 | |
2579 | === modified file 'Src/post_scf_work.F' |
2580 | --- Src/post_scf_work.F 2018-02-27 14:03:49 +0000 |
2581 | +++ Src/post_scf_work.F 2018-05-27 11:17:14 +0000 |
2582 | @@ -40,7 +40,7 @@ |
2583 | use m_steps, only : istp, inicoor |
2584 | use m_compute_dm, only : PreviousCallDiagon |
2585 | use m_eo |
2586 | - use Kpoint_grid |
2587 | + use kpoint_scf_m, only: kpoints_scf |
2588 | use m_gamma |
2589 | implicit none |
2590 | |
2591 | @@ -81,7 +81,8 @@ |
2592 | & no_l, maxnh, maxnh, no_u, |
2593 | & numh, listhptr, listh, numh, listhptr, listh, |
2594 | & H, S, qtot, fixspin, qtots, temp, 1.0_dp, -1.0_dp, |
2595 | - & gamma, xijo, indxuo, nkpnt, kpoint, kweight, |
2596 | + & gamma, xijo, indxuo, |
2597 | + & kpoints_scf%N, kpoints_scf%k, kpoints_scf%w, |
2598 | & eo, qo, Dscf, Escf, ef, efs, Entropy, no_u, |
2599 | & occtol, iscf, neigwanted) |
2600 | Ecorrec = 0.0_dp |
2601 | @@ -92,7 +93,8 @@ |
2602 | else |
2603 | call zminim(.true., .false., iscf, istp, no_l, nspin, no_u, |
2604 | & maxnh, numh, listhptr, listh, Escf, eta, qtots, |
2605 | - & no_s, xijo, indxuo, nkpnt, kpoint, kweight) |
2606 | + & no_s, xijo, indxuo, |
2607 | + & kpoints_scf%N, kpoints_scf%k, kpoints_scf%w) |
2608 | end if |
2609 | endif |
2610 | endif |
2611 | |
2612 | === modified file 'Src/projected_DOS.F' |
2613 | --- Src/projected_DOS.F 2018-01-04 18:48:03 +0000 |
2614 | +++ Src/projected_DOS.F 2018-05-27 11:17:14 +0000 |
2615 | @@ -15,15 +15,15 @@ |
2616 | |
2617 | public :: init_projected_DOS, projected_DOS |
2618 | |
2619 | - logical :: different_pdos_grid ! Indicates if the grid is the same as the SCF one or not |
2620 | - |
2621 | CONTAINS |
2622 | |
2623 | subroutine init_projected_DOS() |
2624 | |
2625 | USE siesta_options |
2626 | use fdf, only: fdf_block, block_fdf |
2627 | - use Kpoint_pdos |
2628 | + ! This is to get the reference kpoints in case PDOS.kgrid* has not |
2629 | + ! been specified |
2630 | + use kpoint_pdos_m, only: setup_kpoint_pdos |
2631 | use parallel, only: IOnode, Nodes |
2632 | use siesta_geom, only: ucell |
2633 | use m_spin, only: spin |
2634 | @@ -50,7 +50,7 @@ |
2635 | |
2636 | ! Determine whether the projected density of states is to be computed |
2637 | ! on a different grid to the SCF calculation |
2638 | - call setup_Kpoint_pdos( ucell, different_pdos_grid ) |
2639 | + call setup_kpoint_pdos( ucell ) |
2640 | |
2641 | !---------------------------------------------------------------------------END |
2642 | |
2643 | @@ -64,8 +64,8 @@ |
2644 | use atomlist, only : indxuo, no_s, no_u, no_l |
2645 | use fdf |
2646 | use sys, only : die |
2647 | - use Kpoint_grid |
2648 | - use Kpoint_pdos |
2649 | + use kpoint_scf_m, only: kpoints_scf |
2650 | + use Kpoint_pdos_m, only: kpoints_pdos, gamma_pdos |
2651 | use parallel, only: IOnode |
2652 | use m_eo |
2653 | use m_spin, only: h_spin_dim, spinor_dim |
2654 | @@ -108,32 +108,19 @@ |
2655 | write(6,'(a,3(f8.2,a),2x,i5)') |
2656 | $ 'siesta: e1, e2, sigma, nhist: ', |
2657 | $ e1/eV,' eV',e2/eV,' eV',sigma/eV,' eV', nhist |
2658 | + end if |
2659 | + |
2660 | + ! If the k points have been set specifically for the PDOS then use this set |
2661 | + if ( kpoints_pdos%N > kpoints_scf%N ) then |
2662 | + call re_alloc(eo,1,no_u,1,spinor_dim,1,kpoints_pdos%N,name="eo", |
2663 | + . routine="projected_dos") |
2664 | end if |
2665 | - |
2666 | -! If the k points have been set specifically for the PDOS then use this set |
2667 | - if (different_pdos_grid) then |
2668 | - |
2669 | -! If the number of k points has increased then reallocate eo and qo |
2670 | - if (maxk_pdos.gt.nkpnt) then |
2671 | - call re_alloc(eo,1,no_u,1,spinor_dim,1,maxk_pdos,name="eo", |
2672 | - . routine="projected_dos") |
2673 | - endif |
2674 | - |
2675 | - call pdos( no_s, h_spin_dim, spinor_dim, no_l, |
2676 | - . maxnh, |
2677 | - . no_u, numh, listhptr, listh, H, S, |
2678 | - . e1, e2, sigma, nhist, gamma_pdos, xijo, indxuo, |
2679 | - . nkpnt_pdos, kpoints_pdos, kweight_pdos, eo, |
2680 | - . no_u) |
2681 | - else |
2682 | -! otherwise use the SCF grid |
2683 | - call pdos( no_s, h_spin_dim, spinor_dim, no_l, |
2684 | - . maxnh, |
2685 | - . no_u, numh, listhptr, listh, H, S, |
2686 | - . e1, e2, sigma, nhist, |
2687 | - . gamma, xijo, indxuo, nkpnt, kpoint, kweight, eo, |
2688 | - . no_u) |
2689 | - endif |
2690 | + |
2691 | + call pdos( no_s, h_spin_dim, spinor_dim, no_l, |
2692 | + . maxnh, no_u, numh, listhptr, listh, H, S, |
2693 | + . e1, e2, sigma, nhist, gamma_pdos, xijo, indxuo, |
2694 | + . kpoints_pdos%N, kpoints_pdos%k, kpoints_pdos%w, eo, |
2695 | + . no_u) |
2696 | |
2697 | end subroutine projected_DOS |
2698 | |
2699 | |
2700 | === modified file 'Src/sankey_change_basis.F90' |
2701 | --- Src/sankey_change_basis.F90 2017-08-30 14:09:10 +0000 |
2702 | +++ Src/sankey_change_basis.F90 2018-05-27 11:17:14 +0000 |
2703 | @@ -1,236 +1,236 @@ |
2704 | -! |
2705 | -! Copyright (C) 1996-2016 The SIESTA group |
2706 | -! This file is distributed under the terms of the |
2707 | -! GNU General Public License: see COPYING in the top directory |
2708 | -! or http://www.gnu.org/copyleft/gpl.txt. |
2709 | -! See Docs/Contributors.txt for a list of contributors. |
2710 | -! |
2711 | -MODULE m_sankey_change_basis |
2712 | - |
2713 | - IMPLICIT NONE |
2714 | - PRIVATE |
2715 | - |
2716 | - PUBLIC :: sankey_change_basis |
2717 | - |
2718 | - CONTAINS |
2719 | -! ******************************************************************* |
2720 | - |
2721 | - SUBROUTINE sankey_change_basis ( istpmove ) |
2722 | - |
2723 | -!****************************************************************************** |
2724 | -! This subroutine transforms the TDKS wavefunctions into new-basis during |
2725 | -! Ehrenfest dynamics within TDDFT after atomic positions are changed. The |
2726 | -! TDKS are transformed according to the transformation proposed by Tomfohr and |
2727 | -! Sankey in Ref. phys. stat. sol. (b) 226 No.1, 115-123 (2001). |
2728 | -! |
2729 | -! After transforming TDKS states it calculates the density matrix in new basis set. |
2730 | -! We use MatrixSwitch to manipulate matrices. |
2731 | -! |
2732 | -! This subroutine is roughly based on D. Sanchez-Portal's chgbasis subroutine from, |
2733 | -! now absolete, serial version of tddft-siesta. |
2734 | -! |
2735 | -! Re-written for parallelization by Adiran Garaizar and Rafi Ullah, October 2015 |
2736 | -! Modified by Rafi Ullah, February 2017 |
2737 | -!******************************************************************************** |
2738 | - |
2739 | - use precision |
2740 | - use parallel, only : Node, Nodes,BlockSize, IONode |
2741 | - use parallelsubs, only : GlobalToLocalOrb, GetNodeOrbs, & |
2742 | - LocalToGlobalOrb |
2743 | - use m_diag_option, only : ParallelOverK |
2744 | - use fdf |
2745 | - use alloc |
2746 | - use sys, only: die |
2747 | -#ifdef MPI |
2748 | - use mpi_siesta, only : mpi_bcast, mpi_comm_world, mpi_logical |
2749 | -#endif |
2750 | - use m_spin, only: nspin |
2751 | - use m_gamma, only: gamma |
2752 | - use Kpoint_grid, only: nkpnt, kpoint, kweight |
2753 | - use atomlist, only: no_u, indxuo |
2754 | - use wavefunctions |
2755 | - use sparse_matrices, only : numh, listhptr, listh, S, xijo, Dscf |
2756 | - use MatrixSwitch |
2757 | - use matdiagon, only: geteigen |
2758 | - ! |
2759 | - implicit none |
2760 | - ! |
2761 | - integer, intent(in) :: istpmove |
2762 | - ! |
2763 | -#ifdef MPI |
2764 | - integer :: MPIerror,desch(9) |
2765 | - external :: diagkp |
2766 | -#endif |
2767 | - ! |
2768 | - logical, save :: frstme = .true. |
2769 | - integer :: io, iuo, juo, nuo, jo, ind, ispin |
2770 | - integer :: ik, j,ierror |
2771 | - real(dp) :: skxij,ckxij, kxij, qe |
2772 | - complex(dp) :: cvar1 |
2773 | - |
2774 | - type(matrix) :: Maux,invsqS,phi |
2775 | - type(matrix) :: Sauxms |
2776 | - type(matrix),allocatable,save :: sqrtS(:) |
2777 | - character(3) :: m_operation |
2778 | - character(5) :: m_storage |
2779 | - ! |
2780 | -#ifdef DEBUG |
2781 | - call write_debug( ' PRE sankey_change_basis' ) |
2782 | -#endif |
2783 | - ! |
2784 | -#ifdef MPI |
2785 | - call GetNodeOrbs(no_u,Node,Nodes,nuo) |
2786 | - if (frstme) then |
2787 | - if(ParallelOverK) then |
2788 | - call die ( "chgbasis: tddft-siesta not parallelized over k-points." ) |
2789 | - endif |
2790 | - call ms_scalapack_setup(mpi_comm_world,1,'c',BlockSize) |
2791 | - endif |
2792 | -#else |
2793 | - Node = 0 |
2794 | - Nodes = 1 |
2795 | - nuo = no_u |
2796 | -#endif |
2797 | - call timer( 'sankey_change_basis', 1 ) |
2798 | - ! |
2799 | -#ifdef MPI |
2800 | - m_storage='pzdbc' |
2801 | - m_operation='lap' |
2802 | -#else |
2803 | - m_storage='szden' |
2804 | - m_operation='lap' |
2805 | -#endif |
2806 | - ! |
2807 | - IF (nspin .eq. 4) THEN |
2808 | - call die ('chgbasis: ERROR: EID not yet prepared for non-collinear spin') |
2809 | - END IF |
2810 | - ! Allocate local arrays |
2811 | - if(frstme) then |
2812 | - allocate(sqrtS(nkpnt)) |
2813 | - do ik=1,nkpnt |
2814 | - call m_allocate(sqrtS(ik),no_u,no_u,m_storage) |
2815 | - end do |
2816 | - frstme=.false. |
2817 | - endif |
2818 | - call m_allocate(Maux,no_u,no_u,m_storage) |
2819 | - call m_allocate(invsqS,no_u,no_u,m_storage) |
2820 | - ! |
2821 | - do ik = 1,nkpnt |
2822 | - call m_allocate(Sauxms,no_u,no_u,m_storage) |
2823 | - do iuo = 1,nuo |
2824 | - call LocalToGlobalOrb(iuo, Node, Nodes, io) |
2825 | - do j = 1,numh(iuo) |
2826 | - ind = listhptr(iuo) + j |
2827 | - juo = listh(ind) |
2828 | - jo = indxuo (juo) |
2829 | - if(.not.gamma) then |
2830 | - kxij = kpoint(1,ik) * xijo(1,ind) +& |
2831 | - kpoint(2,ik) * xijo(2,ind) +& |
2832 | - kpoint(3,ik) * xijo(3,ind) |
2833 | - ckxij = cos(kxij) |
2834 | - skxij = -sin(kxij) |
2835 | - else |
2836 | - ckxij=1.0_dp |
2837 | - skxij=0.0_dp |
2838 | - endif |
2839 | - cvar1 = cmplx(S(ind)*ckxij,S(ind)*skxij,dp) |
2840 | - call m_set_element(Sauxms, jo, io, cvar1, complx_1, m_operation) |
2841 | - enddo |
2842 | - enddo |
2843 | - ! |
2844 | - if(istpmove.eq.1) then ! istpmove |
2845 | - ! If first step calculate S0^1/2 and save for next step. |
2846 | - call calculatesqrtS(Sauxms,invsqS,sqrtS(ik),nuo,m_storage,m_operation) |
2847 | - elseif(istpmove.gt.1) then |
2848 | - ! Calculate both Sn^1/2 and Sn^-1/2 where Sn^1/2 is used in n+1 step. |
2849 | - call calculatesqrtS(Sauxms,invsqS,Maux,nuo,m_storage,m_operation) |
2850 | - !Saux= Sn-1^1/2*Sn^-1/2 |
2851 | - call mm_multiply(invsqS,'n',sqrtS(ik),'n',& |
2852 | - Sauxms,cmplx(1.0_dp,0.0_dp,dp),cmplx(0.0_dp,0.0_dp,dp),m_operation) |
2853 | - ! Passing Sn^1/2 from Maux to sqrtS for next step usage. |
2854 | - call m_add ( Maux,'n',sqrtS(ik),cmplx(1.0_dp,0.0_dp,dp), & |
2855 | - cmplx(0.0_dp,0.0_dp,dp),m_operation ) |
2856 | - ! C1=S0^1/2*S1^1/2*C0 |
2857 | - qe=2.0d0*kweight(ik)/dble(nspin) |
2858 | - do ispin=1,nspin |
2859 | - ! Cn = Saux*Cn-1 where Saux= Sn-1^1/2*Sn^-1/2 |
2860 | - call m_allocate ( phi,wavef_ms(ik,ispin)%dim1, & |
2861 | - wavef_ms(ik,ispin)%dim2,m_storage ) |
2862 | - call m_add( wavef_ms(ik,ispin),'n',phi,cmplx(1.0,0.0,dp), & |
2863 | - cmplx(0.0_dp,0.0_dp,dp),m_operation ) |
2864 | - call mm_multiply(Sauxms,'n',phi,'n', & |
2865 | - wavef_ms(ik,ispin),cmplx(1.0_dp,0.0_dp,dp), & |
2866 | - cmplx(0.0_dp,0.0_dp,dp),m_operation) |
2867 | - call m_deallocate(phi) |
2868 | - enddo |
2869 | - endif !istpmove |
2870 | - call m_deallocate(Sauxms) |
2871 | - enddo ! ik |
2872 | - ! |
2873 | - IF(istpmove.gt.1) THEN ! istpmove |
2874 | - IF (IONode) THEN |
2875 | - WRITE(*,'(a)') 'chgbasis: Computing DM in new basis' |
2876 | - END IF |
2877 | - call compute_tddm (Dscf) |
2878 | - END IF |
2879 | - call m_deallocate(Maux) |
2880 | - call m_deallocate(invsqS) |
2881 | - |
2882 | - call timer('sankey_change_basis',2) |
2883 | -#ifdef DEBUG |
2884 | - call write_debug( ' POS sankey_change_basis' ) |
2885 | -#endif |
2886 | - END SUBROUTINE sankey_change_basis |
2887 | - |
2888 | - SUBROUTINE calculatesqrtS(S,invsqS,sqrtS,nu,m_storage,m_operation) |
2889 | - |
2890 | - use precision |
2891 | - use matdiagon |
2892 | - use MatrixSwitch |
2893 | - use parallelsubs, only: LocalToGlobalOrb |
2894 | - use parallel, only: Node, Nodes |
2895 | - use wavefunctions, only: complx_0 |
2896 | - ! |
2897 | - implicit none |
2898 | - ! |
2899 | - character(5), intent(in) :: m_storage |
2900 | - character(3), intent(in) :: m_operation |
2901 | - type(matrix), intent(inout) :: S,invsqS,sqrtS |
2902 | - type(matrix) :: SD01, SD02 |
2903 | - complex(dp) :: varaux |
2904 | - real(dp) :: eig01, eig02 |
2905 | - real(dp), allocatable :: eigen(:) |
2906 | - integer :: no,nu, info, i, j,jo |
2907 | - real(dp) tiny |
2908 | - data tiny /1.0d-10/ |
2909 | - ! |
2910 | - no=S%dim1 |
2911 | - allocate(eigen(no)) |
2912 | - call m_allocate(SD01,no,no,m_storage) |
2913 | - call m_allocate(SD02,no,no,m_storage) |
2914 | - ! Takes overlap matrix S in dense form and returns its eigenvalues |
2915 | - ! in eigen(*) and eigenvectors in S. |
2916 | - call geteigen(S,eigen,m_operation) |
2917 | - ! |
2918 | - do j=1,nu |
2919 | - call LocalToGlobalOrb(j,Node,Nodes,jo) |
2920 | - eig01=dsqrt(dabs(eigen(jo))) |
2921 | - eig02=1.0d0/(eig01+tiny) |
2922 | - do i=1,no |
2923 | - varaux = S%zval(i,j) |
2924 | - call m_set_element(SD01,i,jo,eig01*varaux,complx_0,m_operation) |
2925 | - call m_set_element(SD02,i,jo,eig02*varaux,complx_0,m_operation) |
2926 | - enddo |
2927 | - enddo |
2928 | - ! |
2929 | - deallocate(eigen) |
2930 | - |
2931 | - call mm_multiply(SD01,'n',S,'c',sqrtS,cmplx(1.0_dp,0.0_dp,dp),& |
2932 | - cmplx(0.0_dp,0.0_dp,dp),m_operation) |
2933 | - call mm_multiply(SD02,'n',S,'c',invsqS,cmplx(1.0_dp,0.0_dp,dp),& |
2934 | - cmplx(0.0_dp,0.0_dp,dp),m_operation) |
2935 | - call m_deallocate(SD01) |
2936 | - call m_deallocate(SD02) |
2937 | - ! |
2938 | - END SUBROUTINE calculatesqrtS |
2939 | -END MODULE m_sankey_change_basis |
2940 | +! |
2941 | +! Copyright (C) 1996-2016 The SIESTA group |
2942 | +! This file is distributed under the terms of the |
2943 | +! GNU General Public License: see COPYING in the top directory |
2944 | +! or http://www.gnu.org/copyleft/gpl.txt. |
2945 | +! See Docs/Contributors.txt for a list of contributors. |
2946 | +! |
2947 | +MODULE m_sankey_change_basis |
2948 | + |
2949 | + IMPLICIT NONE |
2950 | + PRIVATE |
2951 | + |
2952 | + PUBLIC :: sankey_change_basis |
2953 | + |
2954 | + CONTAINS |
2955 | +! ******************************************************************* |
2956 | + |
2957 | + SUBROUTINE sankey_change_basis ( istpmove ) |
2958 | + |
2959 | +!****************************************************************************** |
2960 | +! This subroutine transforms the TDKS wavefunctions into new-basis during |
2961 | +! Ehrenfest dynamics within TDDFT after atomic positions are changed. The |
2962 | +! TDKS are transformed according to the transformation proposed by Tomfohr and |
2963 | +! Sankey in Ref. phys. stat. sol. (b) 226 No.1, 115-123 (2001). |
2964 | +! |
2965 | +! After transforming TDKS states it calculates the density matrix in new basis set. |
2966 | +! We use MatrixSwitch to manipulate matrices. |
2967 | +! |
2968 | +! This subroutine is roughly based on D. Sanchez-Portal's chgbasis subroutine from, |
2969 | +! now absolete, serial version of tddft-siesta. |
2970 | +! |
2971 | +! Re-written for parallelization by Adiran Garaizar and Rafi Ullah, October 2015 |
2972 | +! Modified by Rafi Ullah, February 2017 |
2973 | +!******************************************************************************** |
2974 | + |
2975 | + use precision |
2976 | + use parallel, only : Node, Nodes,BlockSize, IONode |
2977 | + use parallelsubs, only : GlobalToLocalOrb, GetNodeOrbs, & |
2978 | + LocalToGlobalOrb |
2979 | + use m_diag_option, only : ParallelOverK |
2980 | + use fdf |
2981 | + use alloc |
2982 | + use sys, only: die |
2983 | +#ifdef MPI |
2984 | + use mpi_siesta, only : mpi_bcast, mpi_comm_world, mpi_logical |
2985 | +#endif |
2986 | + use m_spin, only: nspin |
2987 | + use m_gamma, only: gamma |
2988 | + use kpoint_scf_m, only: kpoints_scf |
2989 | + use atomlist, only: no_u, indxuo |
2990 | + use wavefunctions |
2991 | + use sparse_matrices, only : numh, listhptr, listh, S, xijo, Dscf |
2992 | + use MatrixSwitch |
2993 | + use matdiagon, only: geteigen |
2994 | + ! |
2995 | + implicit none |
2996 | + ! |
2997 | + integer, intent(in) :: istpmove |
2998 | + ! |
2999 | +#ifdef MPI |
3000 | + integer :: MPIerror,desch(9) |
3001 | + external :: diagkp |
3002 | +#endif |
3003 | + ! |
3004 | + logical, save :: frstme = .true. |
3005 | + integer :: io, iuo, juo, nuo, jo, ind, ispin |
3006 | + integer :: ik, j,ierror |
3007 | + real(dp) :: skxij,ckxij, kxij, qe |
3008 | + complex(dp) :: cvar1 |
3009 | + |
3010 | + type(matrix) :: Maux,invsqS,phi |
3011 | + type(matrix) :: Sauxms |
3012 | + type(matrix),allocatable,save :: sqrtS(:) |
3013 | + character(3) :: m_operation |
3014 | + character(5) :: m_storage |
3015 | + ! |
3016 | +#ifdef DEBUG |
3017 | + call write_debug( ' PRE sankey_change_basis' ) |
3018 | +#endif |
3019 | + ! |
3020 | +#ifdef MPI |
3021 | + call GetNodeOrbs(no_u,Node,Nodes,nuo) |
3022 | + if (frstme) then |
3023 | + if(ParallelOverK) then |
3024 | + call die ( "chgbasis: tddft-siesta not parallelized over k-points." ) |
3025 | + endif |
3026 | + call ms_scalapack_setup(mpi_comm_world,1,'c',BlockSize) |
3027 | + endif |
3028 | +#else |
3029 | + Node = 0 |
3030 | + Nodes = 1 |
3031 | + nuo = no_u |
3032 | +#endif |
3033 | + call timer( 'sankey_change_basis', 1 ) |
3034 | + ! |
3035 | +#ifdef MPI |
3036 | + m_storage='pzdbc' |
3037 | + m_operation='lap' |
3038 | +#else |
3039 | + m_storage='szden' |
3040 | + m_operation='lap' |
3041 | +#endif |
3042 | + ! |
3043 | + IF (nspin .eq. 4) THEN |
3044 | + call die ('chgbasis: ERROR: EID not yet prepared for non-collinear spin') |
3045 | + END IF |
3046 | + ! Allocate local arrays |
3047 | + if(frstme) then |
3048 | + allocate(sqrtS(kpoints_scf%N)) |
3049 | + do ik=1,kpoints_scf%N |
3050 | + call m_allocate(sqrtS(ik),no_u,no_u,m_storage) |
3051 | + end do |
3052 | + frstme=.false. |
3053 | + endif |
3054 | + call m_allocate(Maux,no_u,no_u,m_storage) |
3055 | + call m_allocate(invsqS,no_u,no_u,m_storage) |
3056 | + ! |
3057 | + do ik = 1,kpoints_scf%N |
3058 | + call m_allocate(Sauxms,no_u,no_u,m_storage) |
3059 | + do iuo = 1,nuo |
3060 | + call LocalToGlobalOrb(iuo, Node, Nodes, io) |
3061 | + do j = 1,numh(iuo) |
3062 | + ind = listhptr(iuo) + j |
3063 | + juo = listh(ind) |
3064 | + jo = indxuo (juo) |
3065 | + if(.not.gamma) then |
3066 | + kxij = kpoints_scf%k(1,ik) * xijo(1,ind) +& |
3067 | + kpoints_scf%k(2,ik) * xijo(2,ind) +& |
3068 | + kpoints_scf%k(3,ik) * xijo(3,ind) |
3069 | + ckxij = cos(kxij) |
3070 | + skxij = -sin(kxij) |
3071 | + else |
3072 | + ckxij=1.0_dp |
3073 | + skxij=0.0_dp |
3074 | + endif |
3075 | + cvar1 = cmplx(S(ind)*ckxij,S(ind)*skxij,dp) |
3076 | + call m_set_element(Sauxms, jo, io, cvar1, complx_1, m_operation) |
3077 | + enddo |
3078 | + enddo |
3079 | + ! |
3080 | + if(istpmove.eq.1) then ! istpmove |
3081 | + ! If first step calculate S0^1/2 and save for next step. |
3082 | + call calculatesqrtS(Sauxms,invsqS,sqrtS(ik),nuo,m_storage,m_operation) |
3083 | + elseif(istpmove.gt.1) then |
3084 | + ! Calculate both Sn^1/2 and Sn^-1/2 where Sn^1/2 is used in n+1 step. |
3085 | + call calculatesqrtS(Sauxms,invsqS,Maux,nuo,m_storage,m_operation) |
3086 | + !Saux= Sn-1^1/2*Sn^-1/2 |
3087 | + call mm_multiply(invsqS,'n',sqrtS(ik),'n',& |
3088 | + Sauxms,cmplx(1.0_dp,0.0_dp,dp),cmplx(0.0_dp,0.0_dp,dp),m_operation) |
3089 | + ! Passing Sn^1/2 from Maux to sqrtS for next step usage. |
3090 | + call m_add ( Maux,'n',sqrtS(ik),cmplx(1.0_dp,0.0_dp,dp), & |
3091 | + cmplx(0.0_dp,0.0_dp,dp),m_operation ) |
3092 | + ! C1=S0^1/2*S1^1/2*C0 |
3093 | + qe=2.0d0*kpoints_scf%w(ik)/dble(nspin) |
3094 | + do ispin=1,nspin |
3095 | + ! Cn = Saux*Cn-1 where Saux= Sn-1^1/2*Sn^-1/2 |
3096 | + call m_allocate ( phi,wavef_ms(ik,ispin)%dim1, & |
3097 | + wavef_ms(ik,ispin)%dim2,m_storage ) |
3098 | + call m_add( wavef_ms(ik,ispin),'n',phi,cmplx(1.0,0.0,dp), & |
3099 | + cmplx(0.0_dp,0.0_dp,dp),m_operation ) |
3100 | + call mm_multiply(Sauxms,'n',phi,'n', & |
3101 | + wavef_ms(ik,ispin),cmplx(1.0_dp,0.0_dp,dp), & |
3102 | + cmplx(0.0_dp,0.0_dp,dp),m_operation) |
3103 | + call m_deallocate(phi) |
3104 | + enddo |
3105 | + endif !istpmove |
3106 | + call m_deallocate(Sauxms) |
3107 | + enddo ! ik |
3108 | + ! |
3109 | + IF(istpmove.gt.1) THEN ! istpmove |
3110 | + IF (IONode) THEN |
3111 | + WRITE(*,'(a)') 'chgbasis: Computing DM in new basis' |
3112 | + END IF |
3113 | + call compute_tddm (Dscf) |
3114 | + END IF |
3115 | + call m_deallocate(Maux) |
3116 | + call m_deallocate(invsqS) |
3117 | + |
3118 | + call timer('sankey_change_basis',2) |
3119 | +#ifdef DEBUG |
3120 | + call write_debug( ' POS sankey_change_basis' ) |
3121 | +#endif |
3122 | + END SUBROUTINE sankey_change_basis |
3123 | + |
3124 | + SUBROUTINE calculatesqrtS(S,invsqS,sqrtS,nu,m_storage,m_operation) |
3125 | + |
3126 | + use precision |
3127 | + use matdiagon |
3128 | + use MatrixSwitch |
3129 | + use parallelsubs, only: LocalToGlobalOrb |
3130 | + use parallel, only: Node, Nodes |
3131 | + use wavefunctions, only: complx_0 |
3132 | + ! |
3133 | + implicit none |
3134 | + ! |
3135 | + character(5), intent(in) :: m_storage |
3136 | + character(3), intent(in) :: m_operation |
3137 | + type(matrix), intent(inout) :: S,invsqS,sqrtS |
3138 | + type(matrix) :: SD01, SD02 |
3139 | + complex(dp) :: varaux |
3140 | + real(dp) :: eig01, eig02 |
3141 | + real(dp), allocatable :: eigen(:) |
3142 | + integer :: no,nu, info, i, j,jo |
3143 | + real(dp) tiny |
3144 | + data tiny /1.0d-10/ |
3145 | + ! |
3146 | + no=S%dim1 |
3147 | + allocate(eigen(no)) |
3148 | + call m_allocate(SD01,no,no,m_storage) |
3149 | + call m_allocate(SD02,no,no,m_storage) |
3150 | + ! Takes overlap matrix S in dense form and returns its eigenvalues |
3151 | + ! in eigen(*) and eigenvectors in S. |
3152 | + call geteigen(S,eigen,m_operation) |
3153 | + ! |
3154 | + do j=1,nu |
3155 | + call LocalToGlobalOrb(j,Node,Nodes,jo) |
3156 | + eig01=dsqrt(dabs(eigen(jo))) |
3157 | + eig02=1.0d0/(eig01+tiny) |
3158 | + do i=1,no |
3159 | + varaux = S%zval(i,j) |
3160 | + call m_set_element(SD01,i,jo,eig01*varaux,complx_0,m_operation) |
3161 | + call m_set_element(SD02,i,jo,eig02*varaux,complx_0,m_operation) |
3162 | + enddo |
3163 | + enddo |
3164 | + ! |
3165 | + deallocate(eigen) |
3166 | + |
3167 | + call mm_multiply(SD01,'n',S,'c',sqrtS,cmplx(1.0_dp,0.0_dp,dp),& |
3168 | + cmplx(0.0_dp,0.0_dp,dp),m_operation) |
3169 | + call mm_multiply(SD02,'n',S,'c',invsqS,cmplx(1.0_dp,0.0_dp,dp),& |
3170 | + cmplx(0.0_dp,0.0_dp,dp),m_operation) |
3171 | + call m_deallocate(SD01) |
3172 | + call m_deallocate(SD02) |
3173 | + ! |
3174 | + END SUBROUTINE calculatesqrtS |
3175 | +END MODULE m_sankey_change_basis |
3176 | |
3177 | === modified file 'Src/siesta_analysis.F' |
3178 | --- Src/siesta_analysis.F 2018-04-15 21:36:51 +0000 |
3179 | +++ Src/siesta_analysis.F 2018-05-27 11:17:14 +0000 |
3180 | @@ -40,7 +40,7 @@ |
3181 | use files, only : slabel |
3182 | use files, only : filesOut_t ! derived type for output file names |
3183 | use zmatrix, only: lUseZmatrix, write_zmatrix |
3184 | - use Kpoint_grid |
3185 | + use kpoint_scf_m, only: kpoints_scf |
3186 | use parallel, only: IOnode |
3187 | use parallel, only: SIESTA_worker |
3188 | use files, only : label_length |
3189 | @@ -286,16 +286,17 @@ |
3190 | ! The user is responsible for using appropriate values. |
3191 | wfs_band_min = fdf_get("WFS.BandMin",1) |
3192 | wfs_band_max = fdf_get("WFS.BandMax",no_u) |
3193 | - call setup_wfs_list(nkpnt,no_u,wfs_band_min,wfs_band_max, |
3194 | + call setup_wfs_list(kpoints_scf%N,no_u, |
3195 | + & wfs_band_min,wfs_band_max, |
3196 | $ use_scf_weights=.true., |
3197 | $ use_energy_window=.true.) |
3198 | wfs_filename = trim(slabel)//".fullBZ.WFSX" |
3199 | if (IONode) print "(a)", "Writing WFSX for COOP/COHP in " |
3200 | $ // trim(wfs_filename) |
3201 | call wwave( no_s, h_spin_dim, spinor_dim, no_u, no_l, maxnh, |
3202 | - . nkpnt, |
3203 | + . kpoints_scf%N, |
3204 | . numh, listhptr, listh, H, S, Ef, xijo, indxuo, |
3205 | - . nkpnt, kpoint, no_u, gamma, occtol) |
3206 | + . kpoints_scf%N, kpoints_scf%k, no_u, gamma, occtol) |
3207 | endif |
3208 | |
3209 | ! Compute bands |
3210 | @@ -353,7 +354,7 @@ |
3211 | if ( h_spin_dim <= 2 ) then |
3212 | write(6,'(/,a,/,a4,a3,a7)') |
3213 | & 'siesta: Eigenvalues (eV):', 'ik', 'is', 'eps' |
3214 | - do ik = 1,nkpnt |
3215 | + do ik = 1,kpoints_scf%N |
3216 | do ispin = 1,spinor_dim |
3217 | write(6,'(i4,i3,10f7.2)') |
3218 | & ik,ispin,(eo(io,ispin,ik)/eV,io=1,min(10,neigwanted)) |
3219 | @@ -363,7 +364,7 @@ |
3220 | enddo |
3221 | else |
3222 | write(6,'(/,a)') 'siesta: Eigenvalues (eV):' |
3223 | - do ik = 1,nkpnt |
3224 | + do ik = 1,kpoints_scf%N |
3225 | write(6,'(a,i6)') 'ik =', ik |
3226 | write(6,'(10f7.2)') |
3227 | & ((eo(io,ispin,ik)/eV,io=1,neigwanted),ispin=1,2) |
3228 | @@ -376,8 +377,9 @@ |
3229 | if (((isolve.eq.SOLVE_DIAGON).or. |
3230 | & ((isolve.eq.SOLVE_MINIM).and.minim_calc_eigenvalues)) |
3231 | & .and.IOnode) |
3232 | - & call ioeig(eo,ef,neigwanted,nspin,nkpnt,no_u,spinor_dim, |
3233 | - & nkpnt,kpoint, kweight) |
3234 | + & call ioeig(eo,ef,neigwanted,nspin,kpoints_scf%N, |
3235 | + & no_u,spinor_dim, |
3236 | + & kpoints_scf%N, kpoints_scf%k, kpoints_scf%w) |
3237 | |
3238 | |
3239 | !** This uses H,S, and xa, as it diagonalizes them again |
3240 | |
3241 | === modified file 'Src/siesta_dicts.F90' |
3242 | --- Src/siesta_dicts.F90 2018-01-25 20:01:19 +0000 |
3243 | +++ Src/siesta_dicts.F90 2018-05-27 11:17:14 +0000 |
3244 | @@ -218,7 +218,7 @@ |
3245 | subroutine dict_populate_variables() |
3246 | |
3247 | use siesta_geom |
3248 | - use kpoint_grid, only: kscell, kdispl |
3249 | + use kpoint_scf_m, only: kpoints_scf |
3250 | use m_forces |
3251 | use m_energies |
3252 | use atomlist |
3253 | @@ -327,9 +327,9 @@ |
3254 | |
3255 | ! Add the k-point sampling |
3256 | variables = variables // & |
3257 | - ('BZ.k.Matrix'.kvp.kscell) |
3258 | + ('BZ.k.Matrix'.kvp.kpoints_scf%k_cell) |
3259 | variables = variables // & |
3260 | - ('BZ.k.Displacement'.kvp.kdispl) |
3261 | + ('BZ.k.Displacement'.kvp.kpoints_scf%k_displ) |
3262 | |
3263 | end subroutine dict_populate_variables |
3264 | |
3265 | |
3266 | === modified file 'Src/siesta_forces.F90' |
3267 | --- Src/siesta_forces.F90 2018-04-24 10:26:39 +0000 |
3268 | +++ Src/siesta_forces.F90 2018-05-27 11:17:14 +0000 |
3269 | @@ -99,7 +99,7 @@ |
3270 | use m_ts_charge, only: TS_RHOCORR_FERMI |
3271 | use m_ts_charge, only: TS_RHOCORR_FERMI_TOLERANCE |
3272 | use m_transiesta, only: transiesta |
3273 | - use kpoint_grid, only : gamma_scf |
3274 | + use kpoint_scf_m, only : gamma_scf |
3275 | use m_energies, only : Ef |
3276 | |
3277 | use m_initwf, only: initwf |
3278 | |
3279 | === modified file 'Src/siesta_init.F' |
3280 | --- Src/siesta_init.F 2018-05-15 13:01:22 +0000 |
3281 | +++ Src/siesta_init.F 2018-05-27 11:17:14 +0000 |
3282 | @@ -12,8 +12,9 @@ |
3283 | CONTAINS |
3284 | |
3285 | subroutine siesta_init() |
3286 | - use Kpoint_grid, only: setup_Kpoint_grid, gamma_scf, nkpnt |
3287 | - USE Kpoint_pdos, only: gamma_pdos |
3288 | + use kpoint_scf_m, only: setup_kpoint_scf, kpoints_scf |
3289 | + use kpoint_scf_m, only: gamma_scf |
3290 | + use kpoint_pdos_m, only: gamma_pdos |
3291 | use Band, only: gamma_bands, setup_bands |
3292 | use m_ksvinit, only: gamma_polarization, |
3293 | & estimate_pol_kpoints |
3294 | @@ -568,9 +569,16 @@ |
3295 | ! NOTE: We need to know whether gamma is .true. or |
3296 | ! not early, in order to decide whether to use an |
3297 | ! auxiliary supercell for the calculation of matrix elements. |
3298 | - call setup_Kpoint_grid( ucell ) |
3299 | + call setup_kpoint_scf( ucell ) |
3300 | gamma = gamma_scf |
3301 | |
3302 | +! Call initialisation of PDOS here since we need to check if |
3303 | +! the auxiliary supercell is needed for a non-gamma calculation |
3304 | + call init_projected_DOS( ) |
3305 | + if ( do_pdos ) then |
3306 | + gamma = gamma .and. gamma_pdos |
3307 | + endif |
3308 | + |
3309 | ! Read in diagonalization routines |
3310 | ! Note that only the sampled BZ is responsible for |
3311 | ! ParallelOverK option, the remaning options are |
3312 | @@ -578,17 +586,10 @@ |
3313 | call read_diag(Gamma_scf, spin%H) |
3314 | call print_diag() |
3315 | |
3316 | -! Call initialisation of PDOS here since we need to check if |
3317 | -! the auxiliary supercell is needed for a non-gamma calculation |
3318 | - call init_projected_DOS( ) |
3319 | - if (do_pdos) then |
3320 | - gamma = gamma .and. gamma_pdos |
3321 | - endif |
3322 | - |
3323 | nullify(eo,qo) |
3324 | - call re_alloc(eo, 1, no_u, 1, spin%spinor, 1, nkpnt, 'eo', |
3325 | + call re_alloc(eo, 1, no_u, 1, spin%spinor, 1, kpoints_scf%N, 'eo', |
3326 | & 'siesta_init') |
3327 | - call re_alloc(qo, 1, no_u, 1, spin%spinor, 1, nkpnt, 'qo', |
3328 | + call re_alloc(qo, 1, no_u, 1, spin%spinor, 1, kpoints_scf%N, 'qo', |
3329 | & 'siesta_init') |
3330 | |
3331 | call setup_bands( ) |
3332 | |
3333 | === modified file 'Src/siesta_tddft.F90' |
3334 | --- Src/siesta_tddft.F90 2017-08-29 14:04:45 +0000 |
3335 | +++ Src/siesta_tddft.F90 2018-05-27 11:17:14 +0000 |
3336 | @@ -35,7 +35,7 @@ |
3337 | use atomlist, only: no_s, no_l, no_u, indxuo |
3338 | use m_spin, only: nspin |
3339 | use m_gamma |
3340 | - use Kpoint_grid, only: nkpnt, kpoint, kweight |
3341 | + use kpoint_scf_m, only: kpoints_scf |
3342 | |
3343 | use m_compute_energies, only: compute_energies |
3344 | use m_state_analysis, only: state_analysis |
3345 | @@ -114,8 +114,8 @@ |
3346 | ! ms_scalapack_setup. Which is now implicit in changebasis. |
3347 | |
3348 | if ( istep == 1 ) then |
3349 | - allocate(wavef_ms(nkpnt,nspin)) |
3350 | - call iowavef('read',wavef_ms,no_u,nkpnt,nspin) |
3351 | + allocate(wavef_ms(kpoints_scf%N,nspin)) |
3352 | + call iowavef('read',wavef_ms,no_u,kpoints_scf%N,nspin) |
3353 | IF (IONode) THEN |
3354 | write(6,'(a)') 'Computing DM from initial KS wavefunctions' |
3355 | END IF |
3356 | @@ -127,7 +127,7 @@ |
3357 | ! The wavefunctions are saved after transforming into the current basis |
3358 | ! but before evolving them to future.This keeps the wavefunctions |
3359 | ! concurrent with atomic position. |
3360 | - if(fincoor .gt. 1) call iowavef('write',wavef_ms,no_u,nkpnt,nspin) |
3361 | + if(fincoor .gt. 1) call iowavef('write',wavef_ms,no_u,kpoints_scf%N,nspin) |
3362 | end if |
3363 | |
3364 | do itded = 1 , ntded ! TDED loop |
3365 | @@ -142,7 +142,7 @@ |
3366 | |
3367 | if (tdsavewf) then |
3368 | if (fincoor .eq. 1 .and. itded .eq. ntded) then |
3369 | - call iowavef('write',wavef_ms,no_u,nkpnt,nspin) |
3370 | + call iowavef('write',wavef_ms,no_u,kpoints_scf%N,nspin) |
3371 | endif |
3372 | end if |
3373 | |
3374 | @@ -155,7 +155,7 @@ |
3375 | |
3376 | call compute_energies (itded) |
3377 | call write_tddft(totime, istep, itded, ntded, rstart_time, & |
3378 | - etot, eo, no_u,nspin,nkpnt) |
3379 | + etot, eo, no_u,nspin,kpoints_scf%N) |
3380 | |
3381 | end do ! TDED loop |
3382 | call compute_tdEdm (Escf) |
3383 | |
3384 | === modified file 'Src/state_init.F' |
3385 | --- Src/state_init.F 2018-05-15 13:01:22 +0000 |
3386 | +++ Src/state_init.F 2018-05-27 11:17:14 +0000 |
3387 | @@ -13,7 +13,9 @@ |
3388 | CONTAINS |
3389 | |
3390 | subroutine state_init( istep ) |
3391 | - use Kpoint_grid, only: setup_Kpoint_grid, nkpnt |
3392 | + use kpoint_scf_m, only: setup_kpoint_scf, kpoints_scf |
3393 | + use kpoint_t_m, only: kpoint_delete, kpoint_nullify |
3394 | + |
3395 | use m_os, only: file_exist |
3396 | use m_new_dm, only: new_dm |
3397 | use m_proximity_check, only: proximity_check |
3398 | @@ -78,7 +80,7 @@ |
3399 | use sys, only: message, die |
3400 | use m_sparse, only : xij_offset |
3401 | |
3402 | - use m_ts_kpoints, only: setup_ts_kpoint_grid |
3403 | + use ts_kpoint_scf_m, only: setup_ts_kpoint_scf, ts_kpoints_scf |
3404 | use m_ts_charge, only : TS_RHOCORR_METHOD, TS_RHOCORR_FERMI |
3405 | use m_ts_options, only : BTD_method |
3406 | use m_ts_options, only : TS_Analyze |
3407 | @@ -263,14 +265,20 @@ |
3408 | & (istep.ne.inicoor) .and. (.not.gamma) ) then |
3409 | |
3410 | ! Will print k-points also |
3411 | - call setup_Kpoint_grid( ucell ) |
3412 | - |
3413 | - call setup_ts_kpoint_grid( ucell ) |
3414 | - |
3415 | - call re_alloc( eo, 1, no_u, 1, spin%spinor, 1, nkpnt, 'eo', |
3416 | - & 'state_init') |
3417 | - call re_alloc( qo, 1, no_u, 1, spin%spinor, 1, nkpnt, 'qo', |
3418 | - & 'state_init' ) |
3419 | + call kpoint_delete(kpoints_scf) |
3420 | + call setup_kpoint_scf( ucell ) |
3421 | + |
3422 | + if ( TSmode ) then |
3423 | + call kpoint_delete( ts_kpoints_scf ) |
3424 | + else |
3425 | + call kpoint_nullify( ts_kpoints_scf ) |
3426 | + end if |
3427 | + call setup_ts_kpoint_scf( ucell, kpoints_scf ) |
3428 | + |
3429 | + call re_alloc( eo, 1, no_u, 1, spin%spinor, 1, kpoints_scf%N, |
3430 | + & 'eo', 'state_init') |
3431 | + call re_alloc( qo, 1, no_u, 1, spin%spinor, 1, kpoints_scf%N, |
3432 | + & 'qo', 'state_init' ) |
3433 | |
3434 | ! Find required supercell |
3435 | if (gamma) then |
3436 | |
3437 | === modified file 'Src/ts_init.F90' |
3438 | --- Src/ts_init.F90 2017-11-19 20:18:39 +0000 |
3439 | +++ Src/ts_init.F90 2018-05-27 11:17:14 +0000 |
3440 | @@ -36,9 +36,9 @@ |
3441 | use m_ts_gf, only : do_Green, do_Green_Fermi |
3442 | use m_ts_electrode, only : init_Electrode_HS |
3443 | |
3444 | - use m_ts_kpoints, only : setup_ts_kpoint_grid |
3445 | - use m_ts_kpoints, only : ts_nkpnt, ts_kpoint, ts_kweight |
3446 | - use m_ts_kpoints, only : ts_kscell, ts_kdispl, ts_gamma |
3447 | + use kpoint_scf_m, only : kpoints_scf |
3448 | + use ts_kpoint_scf_m, only : setup_ts_kpoint_scf |
3449 | + use ts_kpoint_scf_m, only : ts_kpoints_scf, ts_Gamma_scf |
3450 | use m_ts_cctype |
3451 | use m_ts_electype |
3452 | use m_ts_options ! Just everything (easier) |
3453 | @@ -91,17 +91,17 @@ |
3454 | call read_ts_elec( ucell, na_u, xa, lasto ) |
3455 | |
3456 | ! Read in the k-points |
3457 | - call setup_ts_kpoint_grid( ucell ) |
3458 | + call setup_ts_kpoint_scf( ucell, kpoints_scf ) |
3459 | |
3460 | ! Read after electrode stuff |
3461 | call read_ts_after_Elec( ucell, nspin, na_u, xa, lasto, & |
3462 | - ts_kscell, ts_kdispl) |
3463 | + ts_kpoints_scf%k_cell, ts_kpoints_scf%k_displ) |
3464 | |
3465 | ! Print the options |
3466 | call print_ts_options( ucell ) |
3467 | |
3468 | ! Print all warnings |
3469 | - call print_ts_warnings( ts_Gamma, ucell, na_u, xa, Nmove ) |
3470 | + call print_ts_warnings( ts_Gamma_scf, ucell, na_u, xa, Nmove ) |
3471 | |
3472 | ! If we actually have a transiesta run we need to process accordingly! |
3473 | if ( .not. TSmode ) return |
3474 | @@ -188,13 +188,13 @@ |
3475 | call init_Electrode_HS(Elecs(i)) |
3476 | |
3477 | call do_Green(Elecs(i), & |
3478 | - ucell,ts_nkpnt,ts_kpoint,ts_kweight, & |
3479 | + ucell,ts_kpoints_scf%N,ts_kpoints_scf%k,ts_kpoints_scf%w, & |
3480 | Elecs_xa_Eps, .false. ) |
3481 | |
3482 | if ( TS_RHOCORR_METHOD == TS_RHOCORR_FERMI ) then |
3483 | |
3484 | call do_Green_Fermi(mean_kT, Elecs(i), & |
3485 | - ucell,ts_nkpnt,ts_kpoint,ts_kweight, & |
3486 | + ucell,ts_kpoints_scf%N,ts_kpoints_scf%k,ts_kpoints_scf%w, & |
3487 | Elecs_xa_Eps, .false. ) |
3488 | |
3489 | end if |
3490 | |
3491 | === added file 'Src/ts_kpoint_scf.F90' |
3492 | --- Src/ts_kpoint_scf.F90 1970-01-01 00:00:00 +0000 |
3493 | +++ Src/ts_kpoint_scf.F90 2018-05-27 11:17:14 +0000 |
3494 | @@ -0,0 +1,89 @@ |
3495 | +! --- |
3496 | +! Copyright (C) 1996-2016 The SIESTA group |
3497 | +! This file is distributed under the terms of the |
3498 | +! GNU General Public License: see COPYING in the top directory |
3499 | +! or http://www.gnu.org/copyleft/gpl.txt . |
3500 | +! See Docs/Contributors.txt for a list of contributors. |
3501 | +! --- |
3502 | +module ts_kpoint_scf_m |
3503 | + ! |
3504 | + ! Contains data structures and routines to deal with the kpoint-grid |
3505 | + ! for the self-consistent calculation |
3506 | + ! Other uses (bands, optical, polarization) have their own structures. |
3507 | + ! |
3508 | + use precision, only : dp |
3509 | + |
3510 | + ! The k-point-type |
3511 | + use kpoint_t_m |
3512 | + |
3513 | + implicit none |
3514 | + |
3515 | + public :: setup_ts_kpoint_scf |
3516 | + public :: ts_kpoints_scf |
3517 | + public :: ts_gamma_scf |
3518 | + |
3519 | + private |
3520 | + |
3521 | + logical, save :: ts_gamma_scf |
3522 | + type(kpoint_t), save :: ts_kpoints_scf |
3523 | + |
3524 | +contains |
3525 | + |
3526 | + subroutine setup_ts_kpoint_scf( ucell, kpoints_scf ) |
3527 | + use parallel, only: Node |
3528 | + use siesta_options, only: writek |
3529 | + use m_spin, only: TrSym |
3530 | + use m_ts_global_vars, only : TSmode |
3531 | + |
3532 | + real(dp), intent(in) :: ucell(3,3) |
3533 | + type(kpoint_t), intent(in) :: kpoints_scf |
3534 | + |
3535 | + call kpoint_read(ts_kpoints_scf, 'TS', ucell, TrSym, process_k_cell=process_k_cell_displ) |
3536 | + |
3537 | + if ( ts_kpoints_scf%method == K_METHOD_NONE ) then |
3538 | + |
3539 | + call kpoint_delete(ts_kpoints_scf) |
3540 | + |
3541 | + if ( TSmode ) then |
3542 | + ! The user hasn't specified anything. |
3543 | + ! This means that we will use the default setting from siesta |
3544 | + call kpoint_read(ts_kpoints_scf, '', ucell, TrSym, process_k_cell=process_k_cell_displ) |
3545 | + else |
3546 | + ! To limit memory usage for very high number of k-points |
3547 | + call kpoint_associate(ts_kpoints_scf, kpoints_scf) |
3548 | + end if |
3549 | + |
3550 | + end if |
3551 | + |
3552 | + ts_gamma_scf = (ts_kpoints_scf%N == 1 .and. & |
3553 | + dot_product(ts_kpoints_scf%k(:,1),ts_kpoints_scf%k(:,1)) < 1.0e-20_dp) |
3554 | + |
3555 | + ! Quick-return if non-IO or not a transiesta run |
3556 | + if ( .not. TSmode ) return |
3557 | + if ( Node /= 0 ) return |
3558 | + |
3559 | + call kpoint_write_stdout(ts_kpoints_scf, writek, 'transiesta') |
3560 | + call kpoint_write_xml(ts_kpoints_scf, 'TS') |
3561 | + call kpoint_write_file(ts_kpoints_scf, 'TS.KP') |
3562 | + |
3563 | + end subroutine setup_ts_kpoint_scf |
3564 | + |
3565 | + subroutine process_k_cell_displ(k_cell, k_displ) |
3566 | + use m_ts_global_vars, only : TSmode |
3567 | + use m_ts_tdir, only: ts_tidx |
3568 | + |
3569 | + integer, intent(inout) :: k_cell(3,3) |
3570 | + real(dp), intent(inout) :: k_displ(3) |
3571 | + integer :: i |
3572 | + |
3573 | + if ( TSmode .and. ts_tidx > 0 ) then |
3574 | + i = ts_tidx |
3575 | + k_cell(:,i) = 0 |
3576 | + k_cell(i,:) = 0 |
3577 | + k_cell(i,i) = 1 |
3578 | + k_displ(i) = 0._dp |
3579 | + end if |
3580 | + |
3581 | + end subroutine process_k_cell_displ |
3582 | + |
3583 | +end module ts_kpoint_scf_m |
3584 | |
3585 | === modified file 'Src/wavefunctions.F90' |
3586 | --- Src/wavefunctions.F90 2017-06-29 12:15:14 +0000 |
3587 | +++ Src/wavefunctions.F90 2018-05-27 11:17:14 +0000 |
3588 | @@ -1,333 +1,333 @@ |
3589 | -MODULE wavefunctions |
3590 | - USE precision |
3591 | - USE MatrixSwitch |
3592 | - ! |
3593 | - implicit none |
3594 | - ! |
3595 | - PRIVATE |
3596 | - PUBLIC :: iowavef, compute_tddm, compute_tdEdm |
3597 | - type(matrix), allocatable, save, public :: wavef_ms(:,:) |
3598 | - TYPE(matrix), ALLOCATABLE, SAVE, public :: Hsave(:,:) |
3599 | - ! |
3600 | - complex(kind=dp), parameter, public :: complx_1 = cmplx(1.0,0.0,dp) |
3601 | - complex(kind=dp), parameter, public :: complx_0 = cmplx(0.0,0.0,dp) |
3602 | - |
3603 | -CONTAINS |
3604 | - ! |
3605 | - subroutine iowavef(task,wavef_rw,nuotot,nk,nspin) |
3606 | - |
3607 | - ! To read and write the TDKS orbitals |
3608 | - ! |
3609 | - ! Written by Daniel Sanchez-Portal |
3610 | - ! Re-written by Rafi Ullah, CIC nanoGUNE, October 16, 2015 to work |
3611 | - ! with parallel TDDFT flavor of siesta using MatrixSwtich. |
3612 | - ! |
3613 | - ! Although it is prepared to work with parallel TDDFT-siesta the |
3614 | - ! reading/writing process itself is not parallel. |
3615 | - use precision |
3616 | - use parallel |
3617 | - use fdf |
3618 | - use MatrixSwitch |
3619 | -#ifdef MPI |
3620 | - use mpi_siesta |
3621 | -#endif |
3622 | - ! |
3623 | - implicit none |
3624 | - ! |
3625 | - integer, intent(in) :: nuotot, nk, nspin |
3626 | - character*(*), intent(in) :: task |
3627 | - type(matrix), intent(inout) :: wavef_rw(nk,nspin) |
3628 | - ! Internal variables and arrays |
3629 | - character :: fname*33, sname*30, m_storage*5 |
3630 | - logical :: exist1, frstme |
3631 | - integer :: unit1, ie,nuototread,nkread,nspinread,dim2read |
3632 | - integer :: nwf, ik, ispin, mxnwf, io, ix,i,j |
3633 | - external :: chkdim, io_assign, io_close, timer,memory |
3634 | - complex(kind=dp) :: varaux |
3635 | - save :: frstme, fname |
3636 | - data frstme /.true./ |
3637 | - ! |
3638 | -#ifdef MPI |
3639 | - INTEGER :: MPIerror |
3640 | -#endif |
3641 | - ! |
3642 | -#ifdef MPI |
3643 | - call MPI_Comm_Rank(MPI_Comm_World,Node,MPIerror) |
3644 | - call MPI_Comm_Size(MPI_Comm_World,Nodes,MPIerror) |
3645 | -#else |
3646 | - Node = 0 |
3647 | - Nodes = 1 |
3648 | -#endif |
3649 | - ! |
3650 | -#ifdef MPI |
3651 | - m_storage='pzdbc' |
3652 | -#else |
3653 | - m_storage='szden' |
3654 | -#endif |
3655 | - ! Find file name |
3656 | - if (frstme) then |
3657 | - if (Node.eq.0) then |
3658 | - sname = fdf_string('SystemLabel','siesta') |
3659 | - endif |
3660 | -#ifdef MPI |
3661 | - call MPI_Bcast(sname,30,MPI_character,0,MPI_Comm_World,MPIerror) |
3662 | -#endif |
3663 | - fname = trim(sname)//'.TDWF' |
3664 | - frstme = .false. |
3665 | - endif |
3666 | - ! |
3667 | - if (task.eq.'read' .or. task.eq.'READ') then ! task read |
3668 | - if (Node.eq.0) then |
3669 | - inquire (file=fname, exist=exist1) |
3670 | - if(exist1) then |
3671 | - write(6,'(/,a)') & |
3672 | - 'iowavef: reading initial KS wavefunctions from file' |
3673 | - else |
3674 | - write(6,'(/,a)') & |
3675 | - 'iowavef: file containing the KS orbitals not found' |
3676 | - write(6,'(a)') & |
3677 | - 'iowavef: simulation can not be started or restarted' |
3678 | - stop |
3679 | - endif |
3680 | - call io_assign(unit1) |
3681 | - open( unit1, file=fname, form='unformatted', & |
3682 | - status='old' ) |
3683 | - endif |
3684 | - if (Node.eq.0) then |
3685 | - read(unit1) nuototread, nkread, nspinread |
3686 | - if(nkread.ne.nk) stop 'iowavef: Nunber of K-points inconsistent ' |
3687 | - if(nuototread.ne.nuotot) stop 'iowavef: Number of KS orbitals inconsistent ' |
3688 | - if(nspinread.ne.nspin) stop 'iowavef: Spin inconsistent ' |
3689 | - endif |
3690 | - ! |
3691 | - do ispin=1,nspin |
3692 | - do ik=1,nk |
3693 | - if (Node.eq.0) read(unit1) dim2read |
3694 | -#ifdef MPI |
3695 | - call MPI_Bcast(dim2read,1,MPI_integer,0,MPI_Comm_World,MPIerror) |
3696 | -#endif |
3697 | - call m_allocate(wavef_rw(ik,ispin),nuotot,dim2read,m_storage) |
3698 | - enddo |
3699 | - enddo |
3700 | - ! |
3701 | - do ispin=1,nspin |
3702 | - do ik=1,nk |
3703 | - do i=1,nuotot |
3704 | - do j=1,wavef_rw(ik,ispin)%dim2 |
3705 | - if (Node==0) read(unit1) varaux |
3706 | -#ifdef MPI |
3707 | - call MPI_Bcast(varaux,1,MPI_double_complex,0,MPI_Comm_World,MPIerror) |
3708 | -#endif |
3709 | - call m_set_element(wavef_rw(ik,ispin),i,j,varaux,complx_0,'lap') |
3710 | - end do |
3711 | - end do |
3712 | - enddo |
3713 | - enddo |
3714 | - if (Node.eq.0) call io_close(unit1) |
3715 | - !...................................................................... |
3716 | - elseif(task.eq.'write'.or.task.eq.'WRITE') then ! task write |
3717 | - if (Node.eq.0) then |
3718 | - call io_assign(unit1) |
3719 | - open( unit1, file=fname, form='unformatted',status='replace' ) |
3720 | - rewind(unit1) |
3721 | - write(unit1) nuotot,nk,nspin |
3722 | - ! |
3723 | - do ispin=1,nspin |
3724 | - do ik=1,nk |
3725 | - write(unit1) (wavef_rw(ik,ispin)%dim2) |
3726 | - enddo |
3727 | - enddo |
3728 | - ! |
3729 | - end if |
3730 | - ! |
3731 | - do ispin=1,nspin |
3732 | - do ik=1,nk |
3733 | - do i=1,nuotot |
3734 | - do j=1,wavef_rw(ik,ispin)%dim2 |
3735 | - call m_get_element(wavef_rw(ik,ispin),i,j,varaux,'lap') |
3736 | - if (Node==0) write(unit1) varaux |
3737 | - enddo |
3738 | - enddo |
3739 | - enddo |
3740 | - enddo |
3741 | - ! |
3742 | - if (Node .eq. 0) then |
3743 | - call io_close(unit1) |
3744 | - endif |
3745 | - endif ! end task |
3746 | - ! |
3747 | - end subroutine iowavef |
3748 | - ! |
3749 | - subroutine compute_tddm (Dnew) |
3750 | - |
3751 | - ! To calculate the time-dependent density matrix from time-dependent |
3752 | - ! wavefunctions. |
3753 | - ! Written by Rafi Ullah January 2017 |
3754 | - !*********************************** |
3755 | - use sparse_matrices, only: numh, maxnh, listh, listhptr, & |
3756 | - xijo |
3757 | - use Kpoint_grid, only: nkpnt, kpoint, gamma_scf, kweight |
3758 | - use atomlist, only: no_l, no_u, indxuo |
3759 | - use m_spin, only: nspin |
3760 | - integer :: ispin, nuo, nuotot |
3761 | - integer :: io,jo, juo, j, ind, ik |
3762 | - real(dp) :: Dnew (maxnh, nspin), wk, kxij |
3763 | - real(dp) :: ckxij, skxij |
3764 | - complex(dp) :: varaux |
3765 | - type(matrix) :: Daux |
3766 | - character :: m_storage*5, m_operation*3 |
3767 | -#ifdef MPI |
3768 | - m_storage ='pzdbc' |
3769 | - m_operation = 'lap' |
3770 | -#else |
3771 | - m_storage='szden' |
3772 | - m_operation = 'lap' |
3773 | -#endif |
3774 | - Dnew(1:maxnh,1:nspin) = 0.0_dp |
3775 | - call m_allocate(Daux,no_u,no_u,m_storage) |
3776 | - Do ik = 1, nkpnt |
3777 | - Do ispin =1, nspin |
3778 | - wk = 2.00_dp*kweight(ik)/dble(nspin) |
3779 | - ! Calculating density matrix using MatrixSwitch. |
3780 | - call mm_multiply(wavef_ms(ik,ispin),'n',wavef_ms(ik,ispin),'c',Daux, & |
3781 | - cmplx(wk,0.0_dp,dp),cmplx(0.0_dp,0.0_dp,dp),m_operation) |
3782 | - ! Passing DM from dense to sparse form. |
3783 | - DO io=1,no_l |
3784 | - DO j=1,numh(io) |
3785 | - ind=listhptr(io) + j |
3786 | - juo = listh(ind) |
3787 | - jo = indxuo(juo) |
3788 | - IF (.NOT. gamma_scf) THEN |
3789 | - kxij = kpoint(1,ik) * xijo(1,ind) + & |
3790 | - kpoint(2,ik) * xijo(2,ind) + & |
3791 | - kpoint(3,ik) * xijo(3,ind) |
3792 | - ckxij = cos(kxij) |
3793 | - skxij = -sin(kxij) |
3794 | - ELSE |
3795 | - ckxij = 1.0_dp |
3796 | - skxij = 0.0_dp |
3797 | - END IF |
3798 | - varaux = real(Daux%zval(jo,io))*ckxij + & |
3799 | - aimag(Daux%zval(jo,io))*skxij |
3800 | - Dnew(ind,ispin) = Dnew(ind,ispin) + varaux |
3801 | - END DO |
3802 | - END DO |
3803 | - END DO |
3804 | - END DO |
3805 | - call m_deallocate (Daux) |
3806 | - end subroutine compute_tddm |
3807 | -!----------------------------------------------------------------------------------! |
3808 | - |
3809 | - |
3810 | -!----------------------------------------------------------------------------------! |
3811 | - subroutine compute_tdEdm(Enew) |
3812 | -!**********************************************************************************! |
3813 | -! Re-written by Rafi Ullah in June 2017. ! |
3814 | -! In this subroutine we calculate the energy density matrix in parallel using ! |
3815 | -! MatrixSwitch. ! |
3816 | -!**********************************************************************************! |
3817 | - use parallel |
3818 | - use precision |
3819 | - use parallelsubs, only: LocalToGlobalOrb |
3820 | - use sparse_matrices, only: numh, maxnh, listh, listhptr, xijo |
3821 | - use sparse_matrices, only: H, S |
3822 | - use Kpoint_grid, only: nkpnt, kpoint, kweight |
3823 | - use m_gamma, only: gamma |
3824 | - use atomlist, only: no_l, no_u, indxuo |
3825 | - use m_spin, only: nspin |
3826 | - use MatrixSwitch |
3827 | - use matswinversion, only: getinverse |
3828 | - ! |
3829 | - implicit none |
3830 | - ! |
3831 | - real(dp) :: Enew(maxnh, nspin) |
3832 | - real(dp) :: wk, kxij, ckxij, skxij |
3833 | - integer :: ik, ispin, i, j, io, jo, ind, juo, nocc |
3834 | - logical, save :: frstime = .true. |
3835 | - character :: m_storage*5, m_operation*3 |
3836 | - complex(dp) :: cvar1, cvar2 |
3837 | - ! |
3838 | - type(matrix) :: Sauxms, Hauxms,psi,Eaux |
3839 | - type(matrix) :: S_1 |
3840 | - ! |
3841 | -#ifdef MPI |
3842 | - m_storage='pzdbc' |
3843 | - m_operation='lap' |
3844 | -#else |
3845 | - m_storage='szden' |
3846 | - m_operation='lap' |
3847 | -#endif |
3848 | - Enew(1:maxnh,1:nspin) = 0.0_dp |
3849 | - call m_allocate(S_1,no_u,no_u,m_storage) |
3850 | - call m_allocate(Eaux,no_u,no_u,m_storage) |
3851 | - Do ik=1,nkpnt |
3852 | - Do ispin=1,nspin |
3853 | - wk = 2.00_dp*kweight(ik)/dble(nspin) |
3854 | - nocc = wavef_ms(ik,ispin)%dim2 |
3855 | - call m_allocate(psi,nocc,no_u,m_storage) |
3856 | - call m_allocate (Hauxms,no_u, no_u, m_storage) |
3857 | - call m_allocate (Sauxms,no_u, no_u, m_storage) |
3858 | - Do i = 1, no_l |
3859 | - call LocalToGlobalOrb(i, Node, Nodes, io) |
3860 | - Do j = 1, numh(i) |
3861 | - ind = listhptr(i) + j |
3862 | - juo = listh(ind) |
3863 | - jo = indxuo(juo) |
3864 | - if( .not. gamma ) then |
3865 | - kxij = kpoint(1,ik)*xijo(1,ind) + kpoint(2,ik)*xijo(2,ind) + & |
3866 | - kpoint(3,ik)*xijo(3,ind) |
3867 | - ckxij = cos(kxij) |
3868 | - skxij = -sin(kxij) |
3869 | - else |
3870 | - ckxij = 1.0_dp |
3871 | - skxij = 0.0_dp |
3872 | - end if |
3873 | - cvar1 = cmplx(H(ind,ispin)*ckxij,H(ind,ispin)*skxij,dp) |
3874 | - cvar2 = cmplx(S(ind)*ckxij,S(ind)*skxij,dp) |
3875 | - call m_set_element(Hauxms,jo,io,cvar1,complx_1,m_operation) |
3876 | - call m_set_element(Sauxms,jo,io,cvar2,complx_1,m_operation) |
3877 | - end do |
3878 | - end do |
3879 | - ! |
3880 | - if (ispin .eq. 1) then |
3881 | - ! copy Sauxms to S_1 |
3882 | - call m_add (Sauxms,'n',S_1,complx_1,complx_0,m_operation) |
3883 | - ! Invert the overlap matrix. |
3884 | - call getinverse(S_1,m_operation) |
3885 | - end if |
3886 | - call mm_multiply(Hauxms,'n',S_1,'n',Eaux,complx_1,complx_0,m_operation) |
3887 | - call mm_multiply(wavef_ms(ik,ispin),'c',Eaux,'n',psi,complx_1, & |
3888 | - complx_0,m_operation) |
3889 | - call mm_multiply(wavef_ms(ik,ispin),'n',psi,'n',Eaux,cmplx(wk,0.0,dp), & |
3890 | - complx_0,m_operation) |
3891 | - ! Passing Energy-DM from dense to sparse form. |
3892 | - DO io=1,no_l |
3893 | - DO j=1,numh(io) |
3894 | - ind=listhptr(io) + j |
3895 | - juo = listh(ind) |
3896 | - jo = indxuo(juo) |
3897 | - IF (.NOT. gamma) THEN |
3898 | - kxij = kpoint(1,ik) * xijo(1,ind) + & |
3899 | - kpoint(2,ik) * xijo(2,ind) + & |
3900 | - kpoint(3,ik) * xijo(3,ind) |
3901 | - ckxij = cos(kxij) |
3902 | - skxij = -sin(kxij) |
3903 | - ELSE |
3904 | - ckxij = 1.0_dp |
3905 | - skxij = 0.0_dp |
3906 | - END IF |
3907 | - cvar1 = real(Eaux%zval(jo,io))*ckxij + & |
3908 | - aimag(Eaux%zval(jo,io))*skxij |
3909 | - Enew(ind,ispin) = Enew(ind,ispin) + cvar1 |
3910 | - END DO |
3911 | - END DO |
3912 | - call m_deallocate(Sauxms) |
3913 | - call m_deallocate(Hauxms) |
3914 | - call m_deallocate(psi) |
3915 | - end do |
3916 | - end do |
3917 | - call m_deallocate(S_1) |
3918 | - call m_deallocate(Eaux) |
3919 | - end subroutine compute_tdEdm |
3920 | - ! |
3921 | -end module wavefunctions |
3922 | +MODULE wavefunctions |
3923 | + USE precision |
3924 | + USE MatrixSwitch |
3925 | + ! |
3926 | + implicit none |
3927 | + ! |
3928 | + PRIVATE |
3929 | + PUBLIC :: iowavef, compute_tddm, compute_tdEdm |
3930 | + type(matrix), allocatable, save, public :: wavef_ms(:,:) |
3931 | + TYPE(matrix), ALLOCATABLE, SAVE, public :: Hsave(:,:) |
3932 | + ! |
3933 | + complex(kind=dp), parameter, public :: complx_1 = cmplx(1.0,0.0,dp) |
3934 | + complex(kind=dp), parameter, public :: complx_0 = cmplx(0.0,0.0,dp) |
3935 | + |
3936 | +CONTAINS |
3937 | + ! |
3938 | + subroutine iowavef(task,wavef_rw,nuotot,nk,nspin) |
3939 | + |
3940 | + ! To read and write the TDKS orbitals |
3941 | + ! |
3942 | + ! Written by Daniel Sanchez-Portal |
3943 | + ! Re-written by Rafi Ullah, CIC nanoGUNE, October 16, 2015 to work |
3944 | + ! with parallel TDDFT flavor of siesta using MatrixSwtich. |
3945 | + ! |
3946 | + ! Although it is prepared to work with parallel TDDFT-siesta the |
3947 | + ! reading/writing process itself is not parallel. |
3948 | + use precision |
3949 | + use parallel |
3950 | + use fdf |
3951 | + use MatrixSwitch |
3952 | +#ifdef MPI |
3953 | + use mpi_siesta |
3954 | +#endif |
3955 | + ! |
3956 | + implicit none |
3957 | + ! |
3958 | + integer, intent(in) :: nuotot, nk, nspin |
3959 | + character*(*), intent(in) :: task |
3960 | + type(matrix), intent(inout) :: wavef_rw(nk,nspin) |
3961 | + ! Internal variables and arrays |
3962 | + character :: fname*33, sname*30, m_storage*5 |
3963 | + logical :: exist1, frstme |
3964 | + integer :: unit1, ie,nuototread,nkread,nspinread,dim2read |
3965 | + integer :: nwf, ik, ispin, mxnwf, io, ix,i,j |
3966 | + external :: chkdim, io_assign, io_close, timer,memory |
3967 | + complex(kind=dp) :: varaux |
3968 | + save :: frstme, fname |
3969 | + data frstme /.true./ |
3970 | + ! |
3971 | +#ifdef MPI |
3972 | + INTEGER :: MPIerror |
3973 | +#endif |
3974 | + ! |
3975 | +#ifdef MPI |
3976 | + call MPI_Comm_Rank(MPI_Comm_World,Node,MPIerror) |
3977 | + call MPI_Comm_Size(MPI_Comm_World,Nodes,MPIerror) |
3978 | +#else |
3979 | + Node = 0 |
3980 | + Nodes = 1 |
3981 | +#endif |
3982 | + ! |
3983 | +#ifdef MPI |
3984 | + m_storage='pzdbc' |
3985 | +#else |
3986 | + m_storage='szden' |
3987 | +#endif |
3988 | + ! Find file name |
3989 | + if (frstme) then |
3990 | + if (Node.eq.0) then |
3991 | + sname = fdf_string('SystemLabel','siesta') |
3992 | + endif |
3993 | +#ifdef MPI |
3994 | + call MPI_Bcast(sname,30,MPI_character,0,MPI_Comm_World,MPIerror) |
3995 | +#endif |
3996 | + fname = trim(sname)//'.TDWF' |
3997 | + frstme = .false. |
3998 | + endif |
3999 | + ! |
4000 | + if (task.eq.'read' .or. task.eq.'READ') then ! task read |
4001 | + if (Node.eq.0) then |
4002 | + inquire (file=fname, exist=exist1) |
4003 | + if(exist1) then |
4004 | + write(6,'(/,a)') & |
4005 | + 'iowavef: reading initial KS wavefunctions from file' |
4006 | + else |
4007 | + write(6,'(/,a)') & |
4008 | + 'iowavef: file containing the KS orbitals not found' |
4009 | + write(6,'(a)') & |
4010 | + 'iowavef: simulation can not be started or restarted' |
4011 | + stop |
4012 | + endif |
4013 | + call io_assign(unit1) |
4014 | + open( unit1, file=fname, form='unformatted', & |
4015 | + status='old' ) |
4016 | + endif |
4017 | + if (Node.eq.0) then |
4018 | + read(unit1) nuototread, nkread, nspinread |
4019 | + if(nkread.ne.nk) stop 'iowavef: Nunber of K-points inconsistent ' |
4020 | + if(nuototread.ne.nuotot) stop 'iowavef: Number of KS orbitals inconsistent ' |
4021 | + if(nspinread.ne.nspin) stop 'iowavef: Spin inconsistent ' |
4022 | + endif |
4023 | + ! |
4024 | + do ispin=1,nspin |
4025 | + do ik=1,nk |
4026 | + if (Node.eq.0) read(unit1) dim2read |
4027 | +#ifdef MPI |
4028 | + call MPI_Bcast(dim2read,1,MPI_integer,0,MPI_Comm_World,MPIerror) |
4029 | +#endif |
4030 | + call m_allocate(wavef_rw(ik,ispin),nuotot,dim2read,m_storage) |
4031 | + enddo |
4032 | + enddo |
4033 | + ! |
4034 | + do ispin=1,nspin |
4035 | + do ik=1,nk |
4036 | + do i=1,nuotot |
4037 | + do j=1,wavef_rw(ik,ispin)%dim2 |
4038 | + if (Node==0) read(unit1) varaux |
4039 | +#ifdef MPI |
4040 | + call MPI_Bcast(varaux,1,MPI_double_complex,0,MPI_Comm_World,MPIerror) |
4041 | +#endif |
4042 | + call m_set_element(wavef_rw(ik,ispin),i,j,varaux,complx_0,'lap') |
4043 | + end do |
4044 | + end do |
4045 | + enddo |
4046 | + enddo |
4047 | + if (Node.eq.0) call io_close(unit1) |
4048 | + !...................................................................... |
4049 | + elseif(task.eq.'write'.or.task.eq.'WRITE') then ! task write |
4050 | + if (Node.eq.0) then |
4051 | + call io_assign(unit1) |
4052 | + open( unit1, file=fname, form='unformatted',status='replace' ) |
4053 | + rewind(unit1) |
4054 | + write(unit1) nuotot,nk,nspin |
4055 | + ! |
4056 | + do ispin=1,nspin |
4057 | + do ik=1,nk |
4058 | + write(unit1) (wavef_rw(ik,ispin)%dim2) |
4059 | + enddo |
4060 | + enddo |
4061 | + ! |
4062 | + end if |
4063 | + ! |
4064 | + do ispin=1,nspin |
4065 | + do ik=1,nk |
4066 | + do i=1,nuotot |
4067 | + do j=1,wavef_rw(ik,ispin)%dim2 |
4068 | + call m_get_element(wavef_rw(ik,ispin),i,j,varaux,'lap') |
4069 | + if (Node==0) write(unit1) varaux |
4070 | + enddo |
4071 | + enddo |
4072 | + enddo |
4073 | + enddo |
4074 | + ! |
4075 | + if (Node .eq. 0) then |
4076 | + call io_close(unit1) |
4077 | + endif |
4078 | + endif ! end task |
4079 | + ! |
4080 | + end subroutine iowavef |
4081 | + ! |
4082 | + subroutine compute_tddm (Dnew) |
4083 | + |
4084 | + ! To calculate the time-dependent density matrix from time-dependent |
4085 | + ! wavefunctions. |
4086 | + ! Written by Rafi Ullah January 2017 |
4087 | + !*********************************** |
4088 | + use sparse_matrices, only: numh, maxnh, listh, listhptr, & |
4089 | + xijo |
4090 | + use kpoint_scf_m, only: kpoints_scf, gamma_scf |
4091 | + use atomlist, only: no_l, no_u, indxuo |
4092 | + use m_spin, only: nspin |
4093 | + integer :: ispin, nuo, nuotot |
4094 | + integer :: io,jo, juo, j, ind, ik |
4095 | + real(dp) :: Dnew (maxnh, nspin), wk, kxij |
4096 | + real(dp) :: ckxij, skxij |
4097 | + complex(dp) :: varaux |
4098 | + type(matrix) :: Daux |
4099 | + character :: m_storage*5, m_operation*3 |
4100 | +#ifdef MPI |
4101 | + m_storage ='pzdbc' |
4102 | + m_operation = 'lap' |
4103 | +#else |
4104 | + m_storage='szden' |
4105 | + m_operation = 'lap' |
4106 | +#endif |
4107 | + Dnew(1:maxnh,1:nspin) = 0.0_dp |
4108 | + call m_allocate(Daux,no_u,no_u,m_storage) |
4109 | + Do ik = 1, kpoints_scf%N |
4110 | + Do ispin =1, nspin |
4111 | + wk = 2.00_dp*kpoints_scf%w(ik)/dble(nspin) |
4112 | + ! Calculating density matrix using MatrixSwitch. |
4113 | + call mm_multiply(wavef_ms(ik,ispin),'n',wavef_ms(ik,ispin),'c',Daux, & |
4114 | + cmplx(wk,0.0_dp,dp),cmplx(0.0_dp,0.0_dp,dp),m_operation) |
4115 | + ! Passing DM from dense to sparse form. |
4116 | + DO io=1,no_l |
4117 | + DO j=1,numh(io) |
4118 | + ind=listhptr(io) + j |
4119 | + juo = listh(ind) |
4120 | + jo = indxuo(juo) |
4121 | + IF (.NOT. gamma_scf) THEN |
4122 | + kxij = kpoints_scf%k(1,ik) * xijo(1,ind) + & |
4123 | + kpoints_scf%k(2,ik) * xijo(2,ind) + & |
4124 | + kpoints_scf%k(3,ik) * xijo(3,ind) |
4125 | + ckxij = cos(kxij) |
4126 | + skxij = -sin(kxij) |
4127 | + ELSE |
4128 | + ckxij = 1.0_dp |
4129 | + skxij = 0.0_dp |
4130 | + END IF |
4131 | + varaux = real(Daux%zval(jo,io))*ckxij + & |
4132 | + aimag(Daux%zval(jo,io))*skxij |
4133 | + Dnew(ind,ispin) = Dnew(ind,ispin) + varaux |
4134 | + END DO |
4135 | + END DO |
4136 | + END DO |
4137 | + END DO |
4138 | + call m_deallocate (Daux) |
4139 | + end subroutine compute_tddm |
4140 | +!----------------------------------------------------------------------------------! |
4141 | + |
4142 | + |
4143 | +!----------------------------------------------------------------------------------! |
4144 | + subroutine compute_tdEdm(Enew) |
4145 | +!**********************************************************************************! |
4146 | +! Re-written by Rafi Ullah in June 2017. ! |
4147 | +! In this subroutine we calculate the energy density matrix in parallel using ! |
4148 | +! MatrixSwitch. ! |
4149 | +!**********************************************************************************! |
4150 | + use parallel |
4151 | + use precision |
4152 | + use parallelsubs, only: LocalToGlobalOrb |
4153 | + use sparse_matrices, only: numh, maxnh, listh, listhptr, xijo |
4154 | + use sparse_matrices, only: H, S |
4155 | + use kpoint_scf_m, only: kpoints_scf, gamma_scf |
4156 | + use m_gamma, only: gamma |
4157 | + use atomlist, only: no_l, no_u, indxuo |
4158 | + use m_spin, only: nspin |
4159 | + use MatrixSwitch |
4160 | + use matswinversion, only: getinverse |
4161 | + ! |
4162 | + implicit none |
4163 | + ! |
4164 | + real(dp) :: Enew(maxnh, nspin) |
4165 | + real(dp) :: wk, kxij, ckxij, skxij |
4166 | + integer :: ik, ispin, i, j, io, jo, ind, juo, nocc |
4167 | + logical, save :: frstime = .true. |
4168 | + character :: m_storage*5, m_operation*3 |
4169 | + complex(dp) :: cvar1, cvar2 |
4170 | + ! |
4171 | + type(matrix) :: Sauxms, Hauxms,psi,Eaux |
4172 | + type(matrix) :: S_1 |
4173 | + ! |
4174 | +#ifdef MPI |
4175 | + m_storage='pzdbc' |
4176 | + m_operation='lap' |
4177 | +#else |
4178 | + m_storage='szden' |
4179 | + m_operation='lap' |
4180 | +#endif |
4181 | + Enew(1:maxnh,1:nspin) = 0.0_dp |
4182 | + call m_allocate(S_1,no_u,no_u,m_storage) |
4183 | + call m_allocate(Eaux,no_u,no_u,m_storage) |
4184 | + Do ik=1,kpoints_scf%N |
4185 | + Do ispin=1,nspin |
4186 | + wk = 2.00_dp*kpoints_scf%w(ik)/dble(nspin) |
4187 | + nocc = wavef_ms(ik,ispin)%dim2 |
4188 | + call m_allocate(psi,nocc,no_u,m_storage) |
4189 | + call m_allocate (Hauxms,no_u, no_u, m_storage) |
4190 | + call m_allocate (Sauxms,no_u, no_u, m_storage) |
4191 | + Do i = 1, no_l |
4192 | + call LocalToGlobalOrb(i, Node, Nodes, io) |
4193 | + Do j = 1, numh(i) |
4194 | + ind = listhptr(i) + j |
4195 | + juo = listh(ind) |
4196 | + jo = indxuo(juo) |
4197 | + if( .not. gamma_scf ) then |
4198 | + kxij = kpoints_scf%k(1,ik)*xijo(1,ind) + kpoints_scf%k(2,ik)*xijo(2,ind) + & |
4199 | + kpoints_scf%k(3,ik)*xijo(3,ind) |
4200 | + ckxij = cos(kxij) |
4201 | + skxij = -sin(kxij) |
4202 | + else |
4203 | + ckxij = 1.0_dp |
4204 | + skxij = 0.0_dp |
4205 | + end if |
4206 | + cvar1 = cmplx(H(ind,ispin)*ckxij,H(ind,ispin)*skxij,dp) |
4207 | + cvar2 = cmplx(S(ind)*ckxij,S(ind)*skxij,dp) |
4208 | + call m_set_element(Hauxms,jo,io,cvar1,complx_1,m_operation) |
4209 | + call m_set_element(Sauxms,jo,io,cvar2,complx_1,m_operation) |
4210 | + end do |
4211 | + end do |
4212 | + ! |
4213 | + if (ispin .eq. 1) then |
4214 | + ! copy Sauxms to S_1 |
4215 | + call m_add (Sauxms,'n',S_1,complx_1,complx_0,m_operation) |
4216 | + ! Invert the overlap matrix. |
4217 | + call getinverse(S_1,m_operation) |
4218 | + end if |
4219 | + call mm_multiply(Hauxms,'n',S_1,'n',Eaux,complx_1,complx_0,m_operation) |
4220 | + call mm_multiply(wavef_ms(ik,ispin),'c',Eaux,'n',psi,complx_1, & |
4221 | + complx_0,m_operation) |
4222 | + call mm_multiply(wavef_ms(ik,ispin),'n',psi,'n',Eaux,cmplx(wk,0.0,dp), & |
4223 | + complx_0,m_operation) |
4224 | + ! Passing Energy-DM from dense to sparse form. |
4225 | + DO io=1,no_l |
4226 | + DO j=1,numh(io) |
4227 | + ind=listhptr(io) + j |
4228 | + juo = listh(ind) |
4229 | + jo = indxuo(juo) |
4230 | + IF (.NOT. gamma_scf) THEN |
4231 | + kxij = kpoints_scf%k(1,ik) * xijo(1,ind) + & |
4232 | + kpoints_scf%k(2,ik) * xijo(2,ind) + & |
4233 | + kpoints_scf%k(3,ik) * xijo(3,ind) |
4234 | + ckxij = cos(kxij) |
4235 | + skxij = -sin(kxij) |
4236 | + ELSE |
4237 | + ckxij = 1.0_dp |
4238 | + skxij = 0.0_dp |
4239 | + END IF |
4240 | + cvar1 = real(Eaux%zval(jo,io))*ckxij + & |
4241 | + aimag(Eaux%zval(jo,io))*skxij |
4242 | + Enew(ind,ispin) = Enew(ind,ispin) + cvar1 |
4243 | + END DO |
4244 | + END DO |
4245 | + call m_deallocate(Sauxms) |
4246 | + call m_deallocate(Hauxms) |
4247 | + call m_deallocate(psi) |
4248 | + end do |
4249 | + end do |
4250 | + call m_deallocate(S_1) |
4251 | + call m_deallocate(Eaux) |
4252 | + end subroutine compute_tdEdm |
4253 | + ! |
4254 | +end module wavefunctions |
4255 | |
4256 | === modified file 'Src/writewave.F' |
4257 | --- Src/writewave.F 2017-10-10 19:27:53 +0000 |
4258 | +++ Src/writewave.F 2018-05-27 11:17:14 +0000 |
4259 | @@ -693,7 +693,7 @@ |
4260 | use parallel, only : Node, Nodes |
4261 | use parallelsubs, only : GlobalToLocalOrb, WhichNodeOrb |
4262 | use units, only : eV |
4263 | - use kpoint_grid, only : kweight |
4264 | + use kpoint_scf_m, only: kpoints_scf |
4265 | |
4266 | #ifdef MPI |
4267 | use mpi_siesta |
4268 | @@ -788,7 +788,7 @@ |
4269 | $ // "wavefunction coefficients from WFSX file" |
4270 | endif |
4271 | if (scf_set) then |
4272 | - kpoint_weight = kweight(ik) |
4273 | + kpoint_weight = kpoints_scf%w(ik) |
4274 | else |
4275 | kpoint_weight = 1.0_dp |
4276 | endif |
4277 | |
4278 | === added file 'Tests/Reference/si_coop_kp_file.out' |
4279 | --- Tests/Reference/si_coop_kp_file.out 1970-01-01 00:00:00 +0000 |
4280 | +++ Tests/Reference/si_coop_kp_file.out 2018-05-27 11:17:14 +0000 |
4281 | @@ -0,0 +1,483 @@ |
4282 | +Siesta Version : trunk-697 |
4283 | +Architecture : x86_64-linux-gcc |
4284 | +Compiler version: GNU Fortran (GCC) 7.3.0 |
4285 | +Compiler flags : mpifort -m64 -fPIC -O3 -ftree-vectorize -fexpensive-optimizations -funroll-loops -fprefetch-loop-arrays -fgraphite -fipa-icf -fipa-pure-const -march=native -fschedule-fusion -fselective-scheduling -fstack-arrays -fmax-stack-var-size=10000 -fipa-sra -fipa-cp -fno-second-underscore |
4286 | +PP flags : -DSIESTA__FLOOK -DSIESTA__METIS -DSIESTA__FFTW -DSIESTA__MRRR -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DCDF -DGRID_DP -DMPI_TIMING -DTRANSIESTA_TIMING -DTBTRANS_TIMING -DSIESTA__MUMPS -DNCDF_PARALLEL -DNCDF -DNCDF_4 -DSCALAPACK_DEBUG -D_DIAG_WORK -DSIESTA__ELPA |
4287 | +Libraries : libncdf.a libfdict.a -lzmumps -lmumps_common -lpord -lparmetis -lmetis -lesmumps -lscotch -lscotcherr -L/opt/elpa/2017.05.003/gnu-7.3.0/lib -Wl,-rpath=/opt/elpa/2017.05.003/gnu-7.3.0/lib -lelpa -L/opt/scalapack/204/gnu-7.3.0/lib -Wl,-rpath=/opt/scalapack/204/gnu-7.3.0/lib -lscalapack -L/opt/openblas/0.2.20/gnu-7.3.0/lib -Wl,-rpath=/opt/openblas/0.2.20/gnu-7.3.0/lib -lopenblas -L/home/nicpa/codes/flook/obj -lflookall -ldl -lnetcdff -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -lz -m64 -fPIC -O3 -ftree-vectorize -fexpensive-optimizations -funroll-loops -fprefetch-loop-arrays -fgraphite -fipa-icf -fipa-pure-const -march=native -fschedule-fusion -fselective-scheduling -fstack-arrays -fmax-stack-var-size=10000 -fipa-sra -fipa-cp -fno-second-underscore -L/opt/fftw/3.3.7/gnu-7.3.0/lib -Wl,-rpath=/opt/fftw/3.3.7/gnu-7.3.0/lib -lfftw3 |
4288 | +PARALLEL version |
4289 | +NetCDF support |
4290 | +NetCDF-4 support |
4291 | +NetCDF-4 MPI-IO support |
4292 | +METIS ordering support |
4293 | + |
4294 | +* Running on 2 nodes in parallel |
4295 | +>> Start of run: 24-MAY-2018 21:57:34 |
4296 | + |
4297 | + *********************** |
4298 | + * WELCOME TO SIESTA * |
4299 | + *********************** |
4300 | + |
4301 | +reinit: Reading from ../si_coop_kp_file.fdf |
4302 | + |
4303 | +reinit: ----------------------------------------------------------------------- |
4304 | +reinit: System Name: Si chain for COOP curves calculation |
4305 | +reinit: ----------------------------------------------------------------------- |
4306 | +reinit: System Label: si_coop_kp_file |
4307 | +reinit: ----------------------------------------------------------------------- |
4308 | + |
4309 | +initatom: Reading input for the pseudopotentials and atomic orbitals ---------- |
4310 | +Species number: 1 Atomic number: 14 Label: Si |
4311 | + |
4312 | +Ground state valence configuration: 3s02 3p02 |
4313 | +Reading pseudopotential information in formatted form from Si.psf |
4314 | + |
4315 | +Valence configuration for pseudopotential generation: |
4316 | +3s( 2.00) rc: 1.89 |
4317 | +3p( 2.00) rc: 1.89 |
4318 | +3d( 0.00) rc: 1.89 |
4319 | +4f( 0.00) rc: 1.89 |
4320 | +For Si, standard SIESTA heuristics set lmxkb to 3 |
4321 | + (one more than the basis l, including polarization orbitals). |
4322 | +Use PS.lmax or PS.KBprojectors blocks to override. |
4323 | + |
4324 | +<basis_specs> |
4325 | +=============================================================================== |
4326 | +Si Z= 14 Mass= 28.090 Charge= 0.17977+309 |
4327 | +Lmxo=1 Lmxkb= 3 BasisType=split Semic=F |
4328 | +L=0 Nsemic=0 Cnfigmx=3 |
4329 | + n=1 nzeta=1 polorb=0 |
4330 | + splnorm: 0.15000 |
4331 | + vcte: 0.0000 |
4332 | + rinn: 0.0000 |
4333 | + qcoe: 0.0000 |
4334 | + qyuk: 0.0000 |
4335 | + qwid: 0.10000E-01 |
4336 | + rcs: 0.0000 |
4337 | + lambdas: 1.0000 |
4338 | +L=1 Nsemic=0 Cnfigmx=3 |
4339 | + n=1 nzeta=1 polorb=1 |
4340 | + splnorm: 0.15000 |
4341 | + vcte: 0.0000 |
4342 | + rinn: 0.0000 |
4343 | + qcoe: 0.0000 |
4344 | + qyuk: 0.0000 |
4345 | + qwid: 0.10000E-01 |
4346 | + rcs: 0.0000 |
4347 | + lambdas: 1.0000 |
4348 | +------------------------------------------------------------------------------- |
4349 | +L=0 Nkbl=1 erefs: 0.17977+309 |
4350 | +L=1 Nkbl=1 erefs: 0.17977+309 |
4351 | +L=2 Nkbl=1 erefs: 0.17977+309 |
4352 | +L=3 Nkbl=1 erefs: 0.17977+309 |
4353 | +=============================================================================== |
4354 | +</basis_specs> |
4355 | + |
4356 | +atom: Called for Si (Z = 14) |
4357 | + |
4358 | +read_vps: Pseudopotential generation method: |
4359 | +read_vps: ATM3 Troullier-Martins |
4360 | +Total valence charge: 4.00000 |
4361 | + |
4362 | +xc_check: Exchange-correlation functional: |
4363 | +xc_check: Ceperley-Alder |
4364 | +V l=0 = -2*Zval/r beyond r= 2.5494 |
4365 | +V l=1 = -2*Zval/r beyond r= 2.5494 |
4366 | +V l=2 = -2*Zval/r beyond r= 2.5494 |
4367 | +V l=3 = -2*Zval/r beyond r= 2.5494 |
4368 | +All V_l potentials equal beyond r= 1.8652 |
4369 | +This should be close to max(r_c) in ps generation |
4370 | +All pots = -2*Zval/r beyond r= 2.5494 |
4371 | +Using large-core scheme for Vlocal |
4372 | + |
4373 | +atom: Estimated core radius 2.54944 |
4374 | + |
4375 | +atom: Including non-local core corrections could be a good idea |
4376 | +atom: Maximum radius for 4*pi*r*r*local-pseudopot. charge 2.85303 |
4377 | +atom: Maximum radius for r*vlocal+2*Zval: 2.58151 |
4378 | + |
4379 | +KBgen: Kleinman-Bylander projectors: |
4380 | +GHOST: No ghost state for L = 0 |
4381 | + l= 0 rc= 1.936440 el= -0.796617 Ekb= 4.661340 kbcos= 0.299756 |
4382 | +GHOST: No ghost state for L = 1 |
4383 | + l= 1 rc= 1.936440 el= -0.307040 Ekb= 1.494238 kbcos= 0.301471 |
4384 | +GHOST: No ghost state for L = 2 |
4385 | + l= 2 rc= 1.936440 el= 0.002313 Ekb= -2.808672 kbcos= -0.054903 |
4386 | +GHOST: No ghost state for L = 3 |
4387 | + l= 3 rc= 1.936440 el= 0.003402 Ekb= -0.959059 kbcos= -0.005513 |
4388 | + |
4389 | +KBgen: Total number of Kleinman-Bylander projectors: 16 |
4390 | +atom: ------------------------------------------------------------------------- |
4391 | + |
4392 | +atom: SANKEY-TYPE ORBITALS: |
4393 | + |
4394 | +SPLIT: Orbitals with angular momentum L= 0 |
4395 | + |
4396 | +SPLIT: Basis orbitals for state 3s |
4397 | + |
4398 | +SPLIT: PAO cut-off radius determined from an |
4399 | +SPLIT: energy shift= 0.007350 Ry |
4400 | + |
4401 | + izeta = 1 |
4402 | + lambda = 1.000000 |
4403 | + rc = 5.674097 |
4404 | + energy = -0.790139 |
4405 | + kinetic = 0.533579 |
4406 | + potential(screened) = -1.323718 |
4407 | + potential(ionic) = -3.776962 |
4408 | + |
4409 | +SPLIT: Orbitals with angular momentum L= 1 |
4410 | + |
4411 | +SPLIT: Basis orbitals for state 3p |
4412 | + |
4413 | +SPLIT: PAO cut-off radius determined from an |
4414 | +SPLIT: energy shift= 0.007350 Ry |
4415 | + |
4416 | + izeta = 1 |
4417 | + lambda = 1.000000 |
4418 | + rc = 7.105845 |
4419 | + energy = -0.299565 |
4420 | + kinetic = 0.824289 |
4421 | + potential(screened) = -1.123854 |
4422 | + potential(ionic) = -3.348521 |
4423 | + |
4424 | +POLgen: Perturbative polarization orbital with L= 2 |
4425 | + |
4426 | +POLgen: Polarization orbital for state 3p |
4427 | + |
4428 | + izeta = 1 |
4429 | + rc = 7.105845 |
4430 | + energy = 0.366373 |
4431 | + kinetic = 1.162439 |
4432 | + potential(screened) = -0.796066 |
4433 | + potential(ionic) = -2.795335 |
4434 | +atom: Total number of Sankey-type orbitals: 9 |
4435 | + |
4436 | +atm_pop: Valence configuration (for local Pseudopot. screening): |
4437 | + 3s( 2.00) |
4438 | + 3p( 2.00) |
4439 | +Vna: chval, zval: 4.00000 4.00000 |
4440 | + |
4441 | +Vna: Cut-off radius for the neutral-atom potential: 7.105845 |
4442 | + |
4443 | +atom: _________________________________________________________________________ |
4444 | + |
4445 | +prinput: Basis input ---------------------------------------------------------- |
4446 | + |
4447 | +PAO.BasisType split |
4448 | + |
4449 | +%block ChemicalSpeciesLabel |
4450 | + 1 14 Si # Species index, atomic number, species label |
4451 | +%endblock ChemicalSpeciesLabel |
4452 | + |
4453 | +%block PAO.Basis # Define Basis set |
4454 | +Si 2 # Species label, number of l-shells |
4455 | + n=3 0 1 # n, l, Nzeta |
4456 | + 5.674 |
4457 | + 1.000 |
4458 | + n=3 1 1 P 1 # n, l, Nzeta, Polarization, NzetaPol |
4459 | + 7.106 |
4460 | + 1.000 |
4461 | +%endblock PAO.Basis |
4462 | + |
4463 | +prinput: ---------------------------------------------------------------------- |
4464 | + |
4465 | +Dumping basis to NetCDF file Si.ion.nc |
4466 | +coor: Atomic-coordinates input format = Cartesian coordinates |
4467 | +coor: (in Angstroms) |
4468 | + |
4469 | +siesta: Atomic coordinates (Bohr) and species |
4470 | +siesta: 0.00000 0.00000 0.00000 1 1 |
4471 | +siesta: 1.88973 0.00000 0.00000 1 2 |
4472 | +siesta: 3.77945 0.00000 0.00000 1 3 |
4473 | +siesta: 5.66918 0.00000 0.00000 1 4 |
4474 | + |
4475 | +siesta: System type = chain |
4476 | + |
4477 | +initatomlists: Number of atoms, orbitals, and projectors: 4 36 64 |
4478 | + |
4479 | +siesta: ******************** Simulation parameters **************************** |
4480 | +siesta: |
4481 | +siesta: The following are some of the parameters of the simulation. |
4482 | +siesta: A complete list of the parameters used, including default values, |
4483 | +siesta: can be found in file out.fdf |
4484 | +siesta: |
4485 | +redata: Spin configuration = none |
4486 | +redata: Number of spin components = 1 |
4487 | +redata: Time-Reversal Symmetry = T |
4488 | +redata: Spin-spiral = F |
4489 | +redata: Long output = F |
4490 | +redata: Number of Atomic Species = 1 |
4491 | +redata: Charge density info will appear in .RHO file |
4492 | +redata: Write Mulliken Pop. = NO |
4493 | +redata: Matel table size (NRTAB) = 1024 |
4494 | +redata: Mesh Cutoff = 150.0000 Ry |
4495 | +redata: Net charge of the system = 0.0000 |e| |
4496 | +redata: Min. number of SCF Iter = 0 |
4497 | +redata: Max. number of SCF Iter = 500 |
4498 | +redata: SCF convergence failure will abort job |
4499 | +redata: SCF mix quantity = Hamiltonian |
4500 | +redata: Mix DM or H after convergence = F |
4501 | +redata: Recompute H after scf cycle = F |
4502 | +redata: Mix DM in first SCF step = T |
4503 | +redata: Write Pulay info on disk = F |
4504 | +redata: New DM Mixing Weight = 0.1000 |
4505 | +redata: New DM Occupancy tolerance = 0.000000000001 |
4506 | +redata: No kicks to SCF |
4507 | +redata: DM Mixing Weight for Kicks = 0.5000 |
4508 | +redata: Require Harris convergence for SCF = F |
4509 | +redata: Harris energy tolerance for SCF = 0.000100 eV |
4510 | +redata: Require DM convergence for SCF = T |
4511 | +redata: DM tolerance for SCF = 0.000100 |
4512 | +redata: Require EDM convergence for SCF = F |
4513 | +redata: EDM tolerance for SCF = 0.001000 eV |
4514 | +redata: Require H convergence for SCF = T |
4515 | +redata: Hamiltonian tolerance for SCF = 0.001000 eV |
4516 | +redata: Require (free) Energy convergence for SCF = F |
4517 | +redata: (free) Energy tolerance for SCF = 0.000100 eV |
4518 | +redata: Using Saved Data (generic) = F |
4519 | +redata: Use continuation files for DM = F |
4520 | +redata: Neglect nonoverlap interactions = F |
4521 | +redata: Method of Calculation = Diagonalization |
4522 | +redata: Electronic Temperature = 290.1109 K |
4523 | +redata: Fix the spin of the system = F |
4524 | +redata: Max. number of TDED Iter = 1 |
4525 | +redata: Number of TDED substeps = 3 |
4526 | +redata: Dynamics option = Single-point calculation |
4527 | +mix.SCF: Pulay mixing = Pulay |
4528 | +mix.SCF: Variant = stable |
4529 | +mix.SCF: History steps = 3 |
4530 | +mix.SCF: Linear mixing weight = 0.100000 |
4531 | +mix.SCF: Mixing weight = 0.100000 |
4532 | +mix.SCF: SVD condition = 0.1000E-07 |
4533 | +redata: Save all siesta data in one NC = F |
4534 | +redata: *********************************************************************** |
4535 | + |
4536 | +%block SCF.Mixers |
4537 | + Pulay |
4538 | +%endblock SCF.Mixers |
4539 | + |
4540 | +%block SCF.Mixer.Pulay |
4541 | + # Mixing method |
4542 | + method pulay |
4543 | + variant stable |
4544 | + |
4545 | + # Mixing options |
4546 | + weight 0.1000 |
4547 | + weight.linear 0.1000 |
4548 | + history 3 |
4549 | +%endblock SCF.Mixer.Pulay |
4550 | + |
4551 | +DM_history_depth set to one: no extrapolation allowed by default for geometry relaxation |
4552 | +Size of DM history Fstack: 1 |
4553 | +Total number of electrons: 16.000000 |
4554 | +Total ionic charge: 16.000000 |
4555 | + |
4556 | +* ProcessorY, Blocksize: 1 19 |
4557 | + |
4558 | + |
4559 | +* Orbital distribution balance (max,min): 19 17 |
4560 | + |
4561 | + |
4562 | +siesta: k-grid: Number of k-points = 5 |
4563 | +siesta: k-points from user-defined list |
4564 | + |
4565 | +siesta: PDOS k-grid: Number of k-points = 5 |
4566 | +siesta: PDOS k-points from user-defined list |
4567 | + |
4568 | +diag: Algorithm = D&C |
4569 | +diag: Parallel over k = F |
4570 | +diag: Use parallel 2D distribution = F |
4571 | +diag: Parallel block-size = 19 |
4572 | +diag: Parallel distribution = 1 x 2 |
4573 | +diag: Used triangular part = Lower |
4574 | +diag: Absolute tolerance = 0.100E-15 |
4575 | +diag: Orthogonalization factor = 0.100E-05 |
4576 | +diag: Memory factor = 1.0000 |
4577 | + |
4578 | +superc: Internal auxiliary supercell: 5 x 1 x 1 = 5 |
4579 | +superc: Number of atoms, orbitals, and projectors: 20 180 320 |
4580 | + |
4581 | + |
4582 | +ts: ************************************************************** |
4583 | +ts: Save H and S matrices = F |
4584 | +ts: Save DM and EDM matrices = F |
4585 | +ts: Fix Hartree potential = F |
4586 | +ts: Only save the overlap matrix S = F |
4587 | +ts: ************************************************************** |
4588 | + |
4589 | +************************ Begin: TS CHECKS AND WARNINGS ************************ |
4590 | +************************ End: TS CHECKS AND WARNINGS ************************** |
4591 | + |
4592 | + |
4593 | + ==================================== |
4594 | + Single-point calculation |
4595 | + ==================================== |
4596 | + |
4597 | +superc: Internal auxiliary supercell: 5 x 1 x 1 = 5 |
4598 | +superc: Number of atoms, orbitals, and projectors: 20 180 320 |
4599 | + |
4600 | +outcell: Unit cell vectors (Ang): |
4601 | + 4.000000 0.000000 0.000000 |
4602 | + 0.000000 10.000000 0.000000 |
4603 | + 0.000000 0.000000 10.000000 |
4604 | + |
4605 | +outcell: Cell vector modules (Ang) : 4.000000 10.000000 10.000000 |
4606 | +outcell: Cell angles (23,13,12) (deg): 90.0000 90.0000 90.0000 |
4607 | +outcell: Cell volume (Ang**3) : 400.0000 |
4608 | +<dSpData1D:S at geom step 0 |
4609 | + <sparsity:sparsity for geom step 0 |
4610 | + nrows_g=36 nrows=19 sparsity=2.2431 nnzs=2907, refcount: 7> |
4611 | + <dData1D:(new from dSpData1D) n=2907, refcount: 1> |
4612 | +refcount: 1> |
4613 | +new_DM -- step: 1 |
4614 | +Initializing Density Matrix... |
4615 | +DM filled with atomic data: |
4616 | +<dSpData2D:DM initialized from atoms |
4617 | + <sparsity:sparsity for geom step 0 |
4618 | + nrows_g=36 nrows=19 sparsity=2.2431 nnzs=2907, refcount: 8> |
4619 | + <dData2D:DM n=2907 m=1, refcount: 1> |
4620 | +refcount: 1> |
4621 | +No. of atoms with KB's overlaping orbs in proc 0. Max # of overlaps: 11 81 |
4622 | +New grid distribution: 1 |
4623 | + 1 1: 15 1: 40 1: 20 |
4624 | + 2 1: 15 1: 40 21: 40 |
4625 | + |
4626 | +InitMesh: MESH = 30 x 80 x 80 = 192000 |
4627 | +InitMesh: (bp) = 15 x 40 x 40 = 24000 |
4628 | +InitMesh: Mesh cutoff (required, used) = 150.000 155.462 Ry |
4629 | +ExtMesh (bp) on 0 = 75 x 104 x 84 = 655200 |
4630 | +New grid distribution: 2 |
4631 | + 1 1: 15 1: 40 1: 13 |
4632 | + 2 1: 15 1: 40 14: 40 |
4633 | +New grid distribution: 3 |
4634 | + 1 1: 15 1: 40 1: 15 |
4635 | + 2 1: 15 1: 40 16: 40 |
4636 | +Setting up quadratic distribution... |
4637 | +ExtMesh (bp) on 0 = 75 x 104 x 77 = 600600 |
4638 | +PhiOnMesh: Number of (b)points on node 0 = 7800 |
4639 | +PhiOnMesh: nlist on node 0 = 242164 |
4640 | +cdiag-debug: jobz=V, algo= 1, Node= 1, work= 2090, rwork= 2161, iwork= 270 |
4641 | +cdiag-debug: jobz=V, algo= 1, Node= 0, work= 2090, rwork= 2377, iwork= 270 |
4642 | + |
4643 | +stepf: Fermi-Dirac step function |
4644 | + |
4645 | +siesta: Program's energy decomposition (eV): |
4646 | +siesta: Ebs = -226.878967 |
4647 | +siesta: Eions = 761.604247 |
4648 | +siesta: Ena = 338.976744 |
4649 | +siesta: Ekin = 265.845531 |
4650 | +siesta: Enl = 155.324530 |
4651 | +siesta: Eso = 0.000000 |
4652 | +siesta: Eldau = 0.000000 |
4653 | +siesta: DEna = -17.516845 |
4654 | +siesta: DUscf = 2.038399 |
4655 | +siesta: DUext = 0.000000 |
4656 | +siesta: Enegf = 0.000000 |
4657 | +siesta: Exc = -157.428404 |
4658 | +siesta: eta*DQ = 0.000000 |
4659 | +siesta: Emadel = 0.000000 |
4660 | +siesta: Emeta = 0.000000 |
4661 | +siesta: Emolmec = 0.000000 |
4662 | +siesta: Ekinion = 0.000000 |
4663 | +siesta: Eharris = -121.207230 |
4664 | +siesta: Etot = -174.364293 |
4665 | +siesta: FreeEng = -174.372957 |
4666 | + |
4667 | + iscf Eharris(eV) E_KS(eV) FreeEng(eV) dDmax Ef(eV) dHmax(eV) |
4668 | + scf: 1 -121.207230 -174.364293 -174.372957 6.055278 -7.994472 2.893698 |
4669 | +timer: Routine,Calls,Time,% = IterSCF 1 0.340 30.58 |
4670 | + scf: 2 -174.475630 -174.420592 -174.429257 0.109988 -7.666230 2.507378 |
4671 | + scf: 3 -174.625748 -174.566213 -174.581766 0.701077 -5.533050 0.190181 |
4672 | + scf: 4 -174.159092 -174.391369 -174.405428 0.352909 -4.746563 1.785466 |
4673 | + scf: 5 -174.678613 -174.581704 -174.592089 0.348919 -5.541164 0.027093 |
4674 | + scf: 6 -174.582277 -174.581998 -174.592127 0.006400 -5.561870 0.001956 |
4675 | + scf: 7 -174.581976 -174.581987 -174.592127 0.000454 -5.561077 0.000760 |
4676 | + scf: 8 -174.582000 -174.581993 -174.592127 0.000420 -5.561103 0.000663 |
4677 | + scf: 9 -174.582018 -174.582006 -174.592127 0.000331 -5.561216 0.000500 |
4678 | + scf: 10 -174.582041 -174.582023 -174.592128 0.000337 -5.561401 0.000441 |
4679 | + scf: 11 -174.582026 -174.582025 -174.592128 0.000019 -5.561412 0.000442 |
4680 | + |
4681 | +SCF Convergence by DM+H criterion |
4682 | +max |DM_out - DM_in| : 0.0000187439 |
4683 | +max |H_out - H_in| (eV) : 0.0004420538 |
4684 | +SCF cycle converged after 11 iterations |
4685 | + |
4686 | +Using DM_out to compute the final energy and forces |
4687 | +No. of atoms with KB's overlaping orbs in proc 0. Max # of overlaps: 11 81 |
4688 | + |
4689 | +siesta: E_KS(eV) = -174.5820 |
4690 | + |
4691 | +siesta: E_KS - E_eggbox = -174.5820 |
4692 | + |
4693 | +siesta: Atomic forces (eV/Ang): |
4694 | +---------------------------------------- |
4695 | + Tot 0.000000 -0.000000 0.000000 |
4696 | +---------------------------------------- |
4697 | + Max 0.000000 |
4698 | + Res 0.000000 sqrt( Sum f_i^2 / 3N ) |
4699 | +---------------------------------------- |
4700 | + Max 0.000000 constrained |
4701 | + |
4702 | +Stress-tensor-Voigt (kbar): -3042.14 -0.01 -0.01 0.00 0.00 -0.00 |
4703 | +(Free)E + p*V (eV/cell) 78.5732 |
4704 | +Target enthalpy (eV/cell) -174.5921 |
4705 | +Writing WFSX for COOP/COHP in si_coop_kp_file.fullBZ.WFSX |
4706 | +siesta: PDOS info: |
4707 | +siesta: e1, e2, sigma, nhist: -25.00 eV 5.00 eV 0.20 eV 500 |
4708 | + |
4709 | +siesta: Program's energy decomposition (eV): |
4710 | +siesta: Ebs = -236.953982 |
4711 | +siesta: Eions = 761.604247 |
4712 | +siesta: Ena = 338.976744 |
4713 | +siesta: Ekin = 261.043605 |
4714 | +siesta: Enl = 149.913747 |
4715 | +siesta: Eso = 0.000000 |
4716 | +siesta: Eldau = 0.000000 |
4717 | +siesta: DEna = -8.184581 |
4718 | +siesta: DUscf = 1.510262 |
4719 | +siesta: DUext = 0.000000 |
4720 | +siesta: Enegf = 0.000000 |
4721 | +siesta: Exc = -156.237555 |
4722 | +siesta: eta*DQ = 0.000000 |
4723 | +siesta: Emadel = 0.000000 |
4724 | +siesta: Emeta = 0.000000 |
4725 | +siesta: Emolmec = 0.000000 |
4726 | +siesta: Ekinion = 0.000000 |
4727 | +siesta: Eharris = -174.582026 |
4728 | +siesta: Etot = -174.582025 |
4729 | +siesta: FreeEng = -174.592128 |
4730 | + |
4731 | +siesta: Final energy (eV): |
4732 | +siesta: Band Struct. = -236.953982 |
4733 | +siesta: Kinetic = 261.043605 |
4734 | +siesta: Hartree = 829.334283 |
4735 | +siesta: Eldau = 0.000000 |
4736 | +siesta: Eso = 0.000000 |
4737 | +siesta: Ext. field = 0.000000 |
4738 | +siesta: Enegf = 0.000000 |
4739 | +siesta: Exch.-corr. = -156.237555 |
4740 | +siesta: Ion-electron = -1952.658160 |
4741 | +siesta: Ion-ion = 843.935803 |
4742 | +siesta: Ekinion = 0.000000 |
4743 | +siesta: Total = -174.582025 |
4744 | +siesta: Fermi = -5.561412 |
4745 | + |
4746 | +siesta: Stress tensor (static) (eV/Ang**3): |
4747 | +siesta: -1.898732 0.000000 0.000000 |
4748 | +siesta: 0.000000 -0.000004 -0.000000 |
4749 | +siesta: -0.000000 0.000000 -0.000004 |
4750 | + |
4751 | +siesta: Cell volume = 400.000000 Ang**3 |
4752 | + |
4753 | +siesta: Pressure (static): |
4754 | +siesta: Solid Molecule Units |
4755 | +siesta: 0.00689323 0.00689323 Ry/Bohr**3 |
4756 | +siesta: 0.63291323 0.63291323 eV/Ang**3 |
4757 | +siesta: 1014.04975274 1014.04975274 kBar |
4758 | +(Free)E+ p_basis*V_orbitals = -171.801899 |
4759 | +(Free)Eharris+ p_basis*V_orbitals = -171.801901 |
4760 | + |
4761 | +siesta: Electric dipole (a.u.) = -0.000000 0.000000 0.000000 |
4762 | +siesta: Electric dipole (Debye) = -0.000000 0.000000 0.000000 |
4763 | +>> End of run: 24-MAY-2018 21:57:38 |
4764 | +Job completed |
4765 | |
4766 | === added directory 'Tests/si_coop_kp_file' |
4767 | === added file 'Tests/si_coop_kp_file/makefile' |
4768 | --- Tests/si_coop_kp_file/makefile 1970-01-01 00:00:00 +0000 |
4769 | +++ Tests/si_coop_kp_file/makefile 2018-05-27 11:17:14 +0000 |
4770 | @@ -0,0 +1,7 @@ |
4771 | +# |
4772 | +# Single-test makefile |
4773 | +# |
4774 | +name=si_coop_kp_file |
4775 | +EXTRAFILES=si_coop_kp_file.KP.input |
4776 | +# |
4777 | +include ../test.mk |
4778 | |
4779 | === added file 'Tests/si_coop_kp_file/si_coop_kp_file.KP.input' |
4780 | --- Tests/si_coop_kp_file/si_coop_kp_file.KP.input 1970-01-01 00:00:00 +0000 |
4781 | +++ Tests/si_coop_kp_file/si_coop_kp_file.KP.input 2018-05-27 11:17:14 +0000 |
4782 | @@ -0,0 +1,6 @@ |
4783 | + 5 |
4784 | + 1 0.000000E+00 0.000000E+00 0.000000E+00 0.125000E+00 |
4785 | + 2 0.125000E+00 0.000000E+00 0.000000E+00 0.250000E+00 |
4786 | + 3 0.250000E+00 0.000000E+00 0.000000E+00 0.250000E+00 |
4787 | + 4 0.375000E+00 0.000000E+00 0.000000E+00 0.250000E+00 |
4788 | + 5 0.500000E+00 0.000000E+00 0.000000E+00 0.125000E+00 |
4789 | |
4790 | === added file 'Tests/si_coop_kp_file/si_coop_kp_file.fdf' |
4791 | --- Tests/si_coop_kp_file/si_coop_kp_file.fdf 1970-01-01 00:00:00 +0000 |
4792 | +++ Tests/si_coop_kp_file/si_coop_kp_file.fdf 2018-05-27 11:17:14 +0000 |
4793 | @@ -0,0 +1,41 @@ |
4794 | +SystemName Si chain for COOP curves calculation |
4795 | +SystemLabel si_coop_kp_file |
4796 | +NumberOfAtoms 4 |
4797 | +NumberOfSpecies 1 |
4798 | +%block ChemicalSpeciesLabel |
4799 | + 1 14 Si |
4800 | +%endblock ChemicalSpeciesLabel |
4801 | +#------------6.3 BASIS DEFINITION--------------------------------------- |
4802 | +PAO.BasisSize SZP |
4803 | +PAO.EnergyShift 100 meV |
4804 | +#------------6.4 LATTICE, COORDINATES ----------------------------------- |
4805 | +LatticeConstant 1.0000 Ang |
4806 | +%block LatticeVectors |
4807 | + 4.000 0.000 0.000 |
4808 | + 0.000 10.0 0.000 |
4809 | + 0.000 0.000 10.0 |
4810 | +%endblock LatticeVectors |
4811 | +AtomicCoordinatesFormat Ang |
4812 | +%block AtomicCoordinatesAndAtomicSpecies |
4813 | + 0.0000 0.0000 0.0000 1 |
4814 | + 1.0000 0.0000 0.0000 1 |
4815 | + 2.0000 0.0000 0.0000 1 |
4816 | + 3.0000 0.0000 0.0000 1 |
4817 | +%endblock AtomicCoordinatesAndAtomicSpecies |
4818 | + |
4819 | +# User-defined k-point |
4820 | +kgrid.File si_coop_kp_file.KP.input |
4821 | + |
4822 | +MeshCutoff 150.0 Ry |
4823 | +MaxSCFIterations 500 |
4824 | +DM.MixingWeight 0.1 |
4825 | +DM.NumberPulay 3 |
4826 | +DM.Tolerance 1.d-4 |
4827 | + |
4828 | +SolutionMethod diagon |
4829 | +ElectronicTemperature 25 meV |
4830 | + |
4831 | +COOP.write T |
4832 | +%block ProjectedDensityOfStates |
4833 | + -25. 5. 0.2 500 eV |
4834 | +%endblock ProjectedDensityOfStates |
4835 | |
4836 | === added file 'Tests/si_coop_kp_file/si_coop_kp_file.pseudos' |
4837 | --- Tests/si_coop_kp_file/si_coop_kp_file.pseudos 1970-01-01 00:00:00 +0000 |
4838 | +++ Tests/si_coop_kp_file/si_coop_kp_file.pseudos 2018-05-27 11:17:14 +0000 |
4839 | @@ -0,0 +1,1 @@ |
4840 | +Si |
4841 | |
4842 | === modified file 'Util/COOP/Makefile' |
4843 | --- Util/COOP/Makefile 2018-04-07 19:24:04 +0000 |
4844 | +++ Util/COOP/Makefile 2018-05-27 11:17:14 +0000 |
4845 | @@ -137,16 +137,17 @@ |
4846 | class_Sparsity.o: alloc.o |
4847 | coceri.o: files.o periodic_table.o precision.o units.o |
4848 | compute_dm.o: atomlist.o class_SpData1D.o compute_ebs_shift.o diagon.o |
4849 | -compute_dm.o: iodmhs_netcdf.o kpoint_grid.o local_sys.o m_chess.o m_dminim.o |
4850 | +compute_dm.o: iodmhs_netcdf.o kpoint_scf.o local_sys.o m_chess.o m_dminim.o |
4851 | compute_dm.o: m_energies.o m_eo.o m_gamma.o m_hsx.o m_pexsi_driver.o m_rmaxh.o |
4852 | compute_dm.o: m_spin.o m_steps.o m_transiesta.o m_ts_global_vars.o m_zminim.o |
4853 | compute_dm.o: normalize_dm.o ordern.o parallel.o precision.o siesta_geom.o |
4854 | compute_dm.o: siesta_options.o sparse_matrices.o units.o |
4855 | compute_ebs_shift.o: m_mpi_utils.o parallel.o precision.o |
4856 | -compute_energies.o: atomlist.o class_SpData1D.o class_SpData2D.o dhscf.o |
4857 | -compute_energies.o: files.o m_dipol.o m_energies.o m_mpi_utils.o m_ntm.o |
4858 | -compute_energies.o: m_rhog.o m_spin.o precision.o siesta_geom.o |
4859 | -compute_energies.o: siesta_options.o sparse_matrices.o |
4860 | +compute_energies.o: atomlist.o class_SpData1D.o class_SpData2D.o |
4861 | +compute_energies.o: class_SpData2D.o dhscf.o files.o m_dipol.o m_energies.o |
4862 | +compute_energies.o: m_mpi_utils.o m_ntm.o m_rhog.o m_spin.o parallel.o |
4863 | +compute_energies.o: precision.o siesta_geom.o siesta_options.o |
4864 | +compute_energies.o: sparse_matrices.o |
4865 | compute_max_diff.o: m_mpi_utils.o precision.o |
4866 | compute_norm.o: m_mpi_utils.o m_spin.o precision.o sparse_matrices.o |
4867 | compute_pw_matrix.o: alloc.o m_planewavematrix.o m_planewavematrixvar.o |
4868 | @@ -164,7 +165,7 @@ |
4869 | cranknic_evolg.o: m_inversemm.o m_matswinvers.o m_spin.o m_steps.o parallel.o |
4870 | cranknic_evolg.o: parallelsubs.o precision.o siesta_options.o sparse_matrices.o |
4871 | cranknic_evolg.o: units.o wavefunctions.o |
4872 | -cranknic_evolk.o: atomlist.o cranknic_evolg.o kpoint_grid.o m_energies.o m_eo.o |
4873 | +cranknic_evolk.o: atomlist.o cranknic_evolg.o kpoint_scf.o m_energies.o m_eo.o |
4874 | cranknic_evolk.o: m_spin.o parallel.o parallelsubs.o precision.o |
4875 | cranknic_evolk.o: siesta_options.o sparse_matrices.o units.o wavefunctions.o |
4876 | create_Sparsity_SC.o: class_Sparsity.o geom_helper.o intrinsic_missing.o |
4877 | @@ -178,9 +179,8 @@ |
4878 | denmatlomem.o: alloc.o globalise.o onmod.o precision.o |
4879 | densematrix.o: alloc.o precision.o |
4880 | detover.o: alloc.o linpack.o parallel.o parallelsubs.o precision.o |
4881 | -dfscf.o: alloc.o atm_types.o atmfuncs.o atomlist.o listsc.o local_sys.o |
4882 | -dfscf.o: m_spin.o mesh.o meshdscf.o meshphi.o parallel.o parallelsubs.o |
4883 | -dfscf.o: precision.o |
4884 | +dfscf.o: alloc.o atm_types.o atmfuncs.o atomlist.o listsc.o local_sys.o mesh.o |
4885 | +dfscf.o: meshdscf.o meshphi.o parallel.o parallelsubs.o precision.o |
4886 | dhscf.o: alloc.o atmfuncs.o bsc_xcmod.o cellxc_mod.o delk.o dfscf.o |
4887 | dhscf.o: doping_uniform.o files.o forhar.o iogrid_netcdf.o local_sys.o |
4888 | dhscf.o: m_charge_add.o m_efield.o m_hartree_add.o m_iorho.o m_iotddft.o |
4889 | @@ -236,15 +236,15 @@ |
4890 | fft.o: alloc.o fft1d.o local_sys.o m_timer.o mesh.o parallel.o parallelsubs.o |
4891 | fft.o: precision.o |
4892 | fft1d.o: local_sys.o parallel.o precision.o |
4893 | -final_H_f_stress.o: alloc.o atomlist.o class_SpData2D.o compute_max_diff.o |
4894 | -final_H_f_stress.o: dnaefs.o files.o grdsam.o kinefsm.o ldau.o ldau_specs.o |
4895 | -final_H_f_stress.o: local_sys.o m_dipol.o m_energies.o m_forces.o m_gamma.o |
4896 | -final_H_f_stress.o: m_hsx.o m_mpi_utils.o m_ncdf_siesta.o m_ntm.o m_spin.o |
4897 | -final_H_f_stress.o: m_steps.o m_stress.o m_ts_global_vars.o m_ts_io.o |
4898 | -final_H_f_stress.o: m_ts_kpoints.o m_ts_options.o metaforce.o |
4899 | -final_H_f_stress.o: molecularmechanics.o naefs.o nlefsm.o overfsm.o parallel.o |
4900 | -final_H_f_stress.o: siesta_geom.o siesta_options.o sparse_matrices.o |
4901 | -final_H_f_stress.o: spinorbit.o units.o |
4902 | +final_H_f_stress.o: alloc.o atomlist.o class_SpData2D.o class_SpData2D.o |
4903 | +final_H_f_stress.o: compute_max_diff.o dnaefs.o files.o grdsam.o kinefsm.o |
4904 | +final_H_f_stress.o: ldau.o ldau_specs.o local_sys.o m_dipol.o m_energies.o |
4905 | +final_H_f_stress.o: m_forces.o m_gamma.o m_hsx.o m_mpi_utils.o m_ncdf_siesta.o |
4906 | +final_H_f_stress.o: m_ntm.o m_spin.o m_steps.o m_stress.o m_ts_global_vars.o |
4907 | +final_H_f_stress.o: m_ts_io.o m_ts_options.o metaforce.o molecularmechanics.o |
4908 | +final_H_f_stress.o: naefs.o nlefsm.o overfsm.o parallel.o siesta_geom.o |
4909 | +final_H_f_stress.o: siesta_options.o sparse_matrices.o spinorbit.o |
4910 | +final_H_f_stress.o: ts_kpoint_scf.o units.o |
4911 | find_kgrid.o: alloc.o minvec.o parallel.o precision.o units.o |
4912 | fire_optim.o: alloc.o m_fire.o m_mpi_utils.o parallel.o precision.o |
4913 | fire_optim.o: siesta_options.o units.o |
4914 | @@ -263,8 +263,8 @@ |
4915 | grdsam.o: m_spin.o parallel.o precision.o siesta_geom.o siesta_options.o |
4916 | grdsam.o: units.o |
4917 | hsparse.o: alloc.o atm_types.o atmfuncs.o atomlist.o ldau_specs.o listsc.o |
4918 | -hsparse.o: local_sys.o mneighb.o parallel.o parallelsubs.o precision.o radial.o |
4919 | -hsparse.o: siesta_options.o sorting.o sparse_matrices.o |
4920 | +hsparse.o: mneighb.o parallel.o parallelsubs.o precision.o radial.o sorting.o |
4921 | +hsparse.o: sparse_matrices.o |
4922 | idiag.o: local_sys.o parallel.o |
4923 | init_output.o: files.o |
4924 | initatom.o: atm_types.o atmparams.o atom.o atom_options.o basis_io.o |
4925 | @@ -298,10 +298,10 @@ |
4926 | kinefsm.o: alloc.o atmfuncs.o mneighb.o new_matel.o parallel.o parallelsubs.o |
4927 | kinefsm.o: precision.o |
4928 | kpoint_convert.o: local_sys.o precision.o units.o |
4929 | -kpoint_grid.o: find_kgrid.o local_sys.o m_spin.o minvec.o parallel.o |
4930 | -kpoint_grid.o: precision.o siesta_cml.o siesta_options.o units.o |
4931 | -kpoint_pdos.o: find_kgrid.o local_sys.o m_spin.o minvec.o parallel.o |
4932 | -kpoint_pdos.o: precision.o siesta_options.o units.o |
4933 | +kpoint_pdos.o: kpoint_t.o m_spin.o parallel.o precision.o siesta_options.o |
4934 | +kpoint_scf.o: kpoint_t.o m_spin.o parallel.o precision.o siesta_options.o |
4935 | +kpoint_t.o: alloc.o files.o find_kgrid.o m_char.o m_io.o m_os.o minvec.o |
4936 | +kpoint_t.o: parallel.o precision.o siesta_cml.o units.o |
4937 | ksv.o: alloc.o atmfuncs.o densematrix.o ksvinit.o local_sys.o parallel.o |
4938 | ksv.o: precision.o |
4939 | ksvinit.o: alloc.o local_sys.o parallel.o precision.o |
4940 | @@ -312,7 +312,7 @@ |
4941 | ldau_specs.o: basis_specs.o basis_types.o interpolation.o local_sys.o m_cite.o |
4942 | ldau_specs.o: parallel.o precision.o pseudopotential.o radial.o units.o |
4943 | listsc.o: alloc.o |
4944 | -local_DOS.o: atomlist.o dhscf.o diagon.o files.o kpoint_grid.o local_sys.o |
4945 | +local_DOS.o: atomlist.o dhscf.o diagon.o files.o kpoint_scf.o local_sys.o |
4946 | local_DOS.o: m_energies.o m_eo.o m_forces.o m_gamma.o m_ntm.o m_spin.o |
4947 | local_DOS.o: parallel.o siesta_geom.o siesta_options.o sparse_matrices.o |
4948 | m_broyddj.o: alloc.o local_sys.o m_mpi_utils.o parallel.o precision.o |
4949 | @@ -362,7 +362,7 @@ |
4950 | m_hsx.o: atm_types.o atmfuncs.o atomlist.o files.o local_sys.o parallel.o |
4951 | m_hsx.o: parallelsubs.o precision.o siesta_geom.o |
4952 | m_initwf.o: alloc.o atomlist.o densematrix.o diag.o diag_option.o fermid.o |
4953 | -m_initwf.o: kpoint_grid.o local_sys.o m_eo.o m_gamma.o m_memory.o m_spin.o |
4954 | +m_initwf.o: kpoint_scf.o local_sys.o m_eo.o m_gamma.o m_memory.o m_spin.o |
4955 | m_initwf.o: parallel.o parallelsubs.o precision.o sparse_matrices.o |
4956 | m_initwf.o: wavefunctions.o |
4957 | m_integrate.o: precision.o |
4958 | @@ -395,19 +395,19 @@ |
4959 | m_ncdf_io.o: class_OrbitalDistribution.o class_SpData1D.o class_SpData2D.o |
4960 | m_ncdf_io.o: class_Sparsity.o m_io_s.o parallel.o precision.o |
4961 | m_ncdf_siesta.o: atm_types.o atmparams.o atomlist.o class_Sparsity.o files.o |
4962 | -m_ncdf_siesta.o: kpoint_grid.o m_energies.o m_forces.o m_gamma.o m_kinetic.o |
4963 | +m_ncdf_siesta.o: kpoint_scf.o m_energies.o m_forces.o m_gamma.o m_kinetic.o |
4964 | m_ncdf_siesta.o: m_ncdf_io.o m_ntm.o m_spin.o m_stress.o m_ts_electype.o |
4965 | -m_ncdf_siesta.o: m_ts_kpoints.o m_ts_options.o parallel.o precision.o radial.o |
4966 | -m_ncdf_siesta.o: siesta_geom.o siesta_options.o sparse_matrices.o timestamp.o |
4967 | +m_ncdf_siesta.o: m_ts_options.o parallel.o precision.o radial.o siesta_geom.o |
4968 | +m_ncdf_siesta.o: siesta_options.o sparse_matrices.o timestamp.o ts_kpoint_scf.o |
4969 | m_new_dm.o: alloc.o atomlist.o class_Data2D.o class_Fstack_Data1D.o |
4970 | m_new_dm.o: class_Fstack_Pair_Geometry_SpData2D.o class_Geometry.o |
4971 | m_new_dm.o: class_OrbitalDistribution.o class_Pair_Geometry_SpData2D.o |
4972 | m_new_dm.o: class_SpData2D.o class_Sparsity.o files.o local_sys.o m_energies.o |
4973 | -m_new_dm.o: m_handle_sparse.o m_iodm.o m_mixing.o m_mixing_scf.o m_mpi_utils.o |
4974 | -m_new_dm.o: m_spin.o m_spin.o m_steps.o m_svd.o m_ts_electype.o |
4975 | -m_new_dm.o: m_ts_global_vars.o m_ts_iodm.o m_ts_method.o m_ts_options.o |
4976 | -m_new_dm.o: parallel.o parsing.o precision.o restructSpData2D.o siesta_geom.o |
4977 | -m_new_dm.o: siesta_options.o sparse_matrices.o units.o |
4978 | +m_new_dm.o: m_handle_sparse.o m_iodm.o m_mixing.o m_mixing_scf.o m_spin.o |
4979 | +m_new_dm.o: m_spin.o m_steps.o m_svd.o m_ts_electype.o m_ts_global_vars.o |
4980 | +m_new_dm.o: m_ts_iodm.o m_ts_method.o m_ts_options.o parallel.o parsing.o |
4981 | +m_new_dm.o: precision.o restructSpData2D.o siesta_geom.o siesta_options.o |
4982 | +m_new_dm.o: sparse_matrices.o units.o |
4983 | m_noccbands.o: alloc.o atmfuncs.o local_sys.o m_spin.o parallel.o precision.o |
4984 | m_noccbands.o: siesta_geom.o |
4985 | m_options.o: precision.o |
4986 | @@ -449,7 +449,7 @@ |
4987 | m_sparsity_handling.o: class_SpData2D.o class_Sparsity.o geom_helper.o |
4988 | m_sparsity_handling.o: intrinsic_missing.o m_interpolate.o m_region.o |
4989 | m_sparsity_handling.o: precision.o |
4990 | -m_spin.o: alloc.o local_sys.o parallel.o precision.o units.o |
4991 | +m_spin.o: alloc.o files.o local_sys.o m_cite.o parallel.o precision.o units.o |
4992 | m_stress.o: precision.o |
4993 | m_supercell.o: atom_graph.o class_OrbitalDistribution.o class_SpData2D.o |
4994 | m_supercell.o: intrinsic_missing.o parallel.o parallelsubs.o precision.o |
4995 | @@ -463,9 +463,9 @@ |
4996 | m_transiesta.o: class_SpData2D.o class_Sparsity.o files.o m_interpolate.o |
4997 | m_transiesta.o: m_ts_charge.o m_ts_contour_eq.o m_ts_contour_neq.o |
4998 | m_transiesta.o: m_ts_electype.o m_ts_fullg.o m_ts_fullk.o m_ts_gf.o |
4999 | -m_transiesta.o: m_ts_kpoints.o m_ts_method.o m_ts_mumpsg.o m_ts_mumpsk.o |
5000 | -m_transiesta.o: m_ts_options.o m_ts_sparse.o m_ts_tri_common.o m_ts_tri_init.o |
Very good overall. Just a couple of points:
1. The documentation for the Kgrid.file format in the manual is missing the first (index) column.
2. Apart from the sum_i{weight_i} = 1 check for the contents of the user-provided file, it might be good to add a sanity check on the sampling quality. For example, simulate the integration over the whole BZ of a simple 3D periodic model function epsilon(k) of the type that comes out of a one-parameter tight-binding. If the function is f, Sum_i{f(k_i)} should be close to 0 if the average band position is at zero.
I have a patch for 1. above and two other minor comments in the code:
=== modified file 'Docs/siesta.tex' shellexample} shellexample}
--- Docs/siesta.tex 2018-05-24 19:58:35 +0000
+++ Docs/siesta.tex 2018-05-26 06:45:39 +0000
@@ -3474,14 +3474,14 @@
An example input may be (not physically justified in any sense):
\begin{
4
- 0.0 0.0 0.0 0.25
- 0.5 0.5 0,5 0.25
- 0.2 0.2 0,2 0.25
- 0.3 0.3 0,3 0.25
+ 1 0.0 0.0 0.0 0.25
+ 2 0.5 0.5 0,5 0.25
+ 3 0.2 0.2 0,2 0.25
+ 4 0.3 0.3 0,3 0.25
\end{
- The first 3 columns are the k-point specification for each of the
- reciprocal lattice vectors while the fourth number is the weight for
- the k-point.
+ The first column is an index; the next 3 columns are the k-point
+ specification for each of the reciprocal lattice vectors, and the
+ last number is the weight for the k-point.
\siesta\ checks whether the sum of weights equals 1. If not,
\siesta\ will die.
=== modified file 'Src/kpoint_ pdos.F90'
--- Src/kpoint_pdos.F90 2018-05-24 19:58:35 +0000
+++ Src/kpoint_pdos.F90 2018-05-26 06:44:10 +0000
@@ -42,7 +42,7 @@
if ( kpoints_pdos%method == K_METHOD_NONE ) then
! The user hasn't specified anything. delete( kpoints_ pdos) read(kpoints_ pdos, '', ucell, TrSym)
- ! This means that we will use the
+ ! This means that we will use the scf sampling grid
call kpoint_
call kpoint_
=== modified file 'Src/kpoint_t.F90' fdf_name( prefix, 'kgrid. MonkhorstPack' , name_fdf)
--- Src/kpoint_t.F90 2018-05-24 19:58:35 +0000
+++ Src/kpoint_t.F90 2018-05-26 06:44:03 +0000
@@ -152,7 +152,7 @@
call kpoint_
if ( fdf_block(name_fdf, bfdf) ) then
- ! The method is a k-point grid MONKHORST_ PACK
+ ! The method is a k-point MP grid
this%method = K_METHOD_
! Now read data