Octopus
dos.F90
Go to the documentation of this file.
1!! Copyright (C) 2017 N. Tancogne-Dejean
2!! Copyright (C) 2025 N. Tancogne-Dejean
3!!
4!! This program is free software; you can redistribute it and/or modify
5!! it under the terms of the GNU General Public License as published by
6!! the Free Software Foundation; either version 2, or (at your option)
7!! any later version.
8!!
9!! This program is distributed in the hope that it will be useful,
10!! but WITHOUT ANY WARRANTY; without even the implied warranty of
11!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12!! GNU General Public License for more details.
13!!
14!! You should have received a copy of the GNU General Public License
15!! along with this program; if not, write to the Free Software
16!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17!! 02110-1301, USA.
18!!
19
20#include "global.h"
21
23module dos_oct_m
24 use accel_oct_m
26 use box_oct_m
27 use comm_oct_m
28 use debug_oct_m
30 use global_oct_m
33 use io_oct_m
35 use ions_oct_m
36 use, intrinsic :: iso_fortran_env
39 use math_oct_m
40 use mesh_oct_m
42 use mpi_oct_m
47 use parser_oct_m
52 smear_cold, &
61 use types_oct_m
62 use unit_oct_m
65
66 implicit none
67
68 private
69 public :: &
70 dos_t, &
71 dos_init, &
76
77 type dos_t
78 private
79 real(real64) :: emin
80 real(real64) :: emax
81 integer :: epoints
82 real(real64) :: de
83
84 real(real64) :: gamma
85
86 integer :: ldos_nenergies = -1
87 real(real64), allocatable :: ldos_energies(:)
88
89 integer(int64) :: method
90 integer :: smear_func
91 contains
92 final :: dos_end
93 end type dos_t
94
95contains
96
98 subroutine dos_init(this, namespace, st, kpoints)
99 type(dos_t), intent(out) :: this
100 type(namespace_t), intent(in) :: namespace
101 type(states_elec_t), intent(in) :: st
102 type(kpoints_t), intent(in) :: kpoints
103
104 real(real64) :: evalmin, evalmax, eextend
105 integer :: npath, ie
106 type(block_t) :: blk
107
108 push_sub(dos_init)
109
110 !The range of the dos is only calculated for physical points,
111 !without the one from a k-point path
112 npath = kpoints%nkpt_in_path()
113 if (st%nik > npath) then
114 evalmin = minval(st%eigenval(1:st%nst, 1:(st%nik-npath)))
115 evalmax = maxval(st%eigenval(1:st%nst, 1:(st%nik-npath)))
116 else !In case we only have a path, e.g., a bandstructure calculation
117 evalmin = minval(st%eigenval(1:st%nst, 1:st%nik))
118 evalmax = maxval(st%eigenval(1:st%nst, 1:st%nik))
119 end if
120 ! we extend the energy mesh by this amount
121 eextend = (evalmax - evalmin) / m_four
122
123 !%Variable DOSMethod
124 !%Type integer
125 !%Default smear
126 !%Section Output
127 !%Description
128 !% Selects the method that is used to calculate the DOS.
129 !%Option smear 0
130 !% Smearing with the smearing function selected by <tt>DOSSmearingFunction</tt>.
131 !%Option tetrahedra
132 !% Linear tetrahedron method as in P. E. Bloechl, et al., <i>Phys. Rev. B</i> <b>49</b>, 16223 (1994).
133 !% Requires a regular Monkhorst-Pack generated by Octopus.
134 !%Option tetrahedra_opt
135 !% Improved tetrahedron method as in M. Kawamura, et al., <i>Phys. Rev. B</i> <b>89</b>, 094515 (2014).
136 !% Requires a regular Monkhorst-Pack generated by Octopus.
137 !%End
138 call parse_variable(namespace, 'DOSMethod', option__dosmethod__smear, this%method)
139
140 !%Variable DOSSmearingFunction
141 !%Type integer
142 !%Default lorentzian_smearing
143 !%Section Output
144 !%Description
145 !% This is the function used to smear the energy levels in the DOS calculation.
146 !%Option fermi_dirac 2
147 !% Simple Fermi-Dirac distribution. In this case, <tt>DOSGamma</tt> has
148 !% the meaning of an electronic temperature. DN Mermin, <i>Phys. Rev.</i> <b>137</b>, A1441 (1965).
149 !%Option cold_smearing 3
150 !% N Marzari, D Vanderbilt, A De Vita, and MC Payne, <i>Phys. Rev. Lett.</i> <b>82</b>, 3296 (1999).
151 !%Option methfessel_paxton 4
152 !% M Methfessel and AT Paxton, <i>Phys. Rev. B</i> <b>40</b>, 3616 (1989).
153 !% The expansion order of the polynomial is fixed to 1.
154 !% Occupations may be negative.
155 !%Option spline_smearing 5
156 !% Nearly identical to Gaussian smearing.
157 !% JM Holender, MJ Gillan, MC Payne, and AD Simpson, <i>Phys. Rev. B</i> <b>52</b>, 967 (1995).
158 !%Option gaussian_smearing
159 !% Gaussian smearing.
160 !%Option lorentzian_smearing
161 !% Lorentzian smearing.
162 !%End
163 call parse_variable(namespace, 'DOSSmearingFunction', smear_lorentzian, this%smear_func)
164
165 !%Variable DOSEnergyMin
166 !%Type float
167 !%Section Output
168 !%Description
169 !% Lower bound for the energy mesh of the DOS.
170 !% The default is the lowest eigenvalue, minus a quarter of the total range of eigenvalues.
171 !% This is ignored for the joint density of states, and the minimal energy is always set to zero.
172 !%End
173 call parse_variable(namespace, 'DOSEnergyMin', evalmin - eextend, this%emin, units_inp%energy)
175 !%Variable DOSEnergyMax
176 !%Type float
177 !%Section Output
178 !%Description
179 !% Upper bound for the energy mesh of the DOS.
180 !% The default is the highest eigenvalue, plus a quarter of the total range of eigenvalues.
181 !%End
182 call parse_variable(namespace, 'DOSEnergyMax', evalmax + eextend, this%emax, units_inp%energy)
183
184 !%Variable DOSEnergyPoints
185 !%Type integer
186 !%Default 500
187 !%Section Output
188 !%Description
189 !% Determines how many energy points <tt>Octopus</tt> should use for
190 !% the DOS energy grid.
191 !%End
192 call parse_variable(namespace, 'DOSEnergyPoints', 500, this%epoints)
194 !%Variable DOSGamma
195 !%Type float
196 !%Default 0.008 Ha
197 !%Section Output
198 !%Description
199 !% Determines the width of the Lorentzian which is used for the DOS sum.
200 !%End
201 call parse_variable(namespace, 'DOSGamma', 0.008_real64, this%gamma)
202
203 ! DOSComputePDOS = yes -> Output = pdos
204 call messages_obsolete_variable(namespace, 'DOSComputePDOS' , 'Output')
205
206 ! spacing for energy mesh
207 this%de = (this%emax - this%emin) / (this%epoints - 1)
208
209 !%Variable LDOSEnergies
210 !%Type block
211 !%Section Output
212 !%Description
213 !% Specifies the energies at which the LDOS is computed.
214 !%End
215 if (parse_block(global_namespace, 'LDOSEnergies', blk) == 0) then
216 ! There is one high symmetry k-point per line
217 this%ldos_nenergies = parse_block_cols(blk, 0)
218
219 safe_allocate(this%ldos_energies(1:this%ldos_nenergies))
220 do ie = 1, this%ldos_nenergies
221 call parse_block_float(blk, 0, ie-1, this%ldos_energies(ie))
222 end do
223 call parse_block_end(blk)
224 else
225 this%ldos_nenergies = -1
226 end if
227
228 pop_sub(dos_init)
229 end subroutine dos_init
230
232 subroutine dos_end(this)
233 type(dos_t), intent(inout) :: this
234
235 push_sub(dos_end)
236
237 safe_deallocate_a(this%ldos_energies)
238 this%ldos_nenergies = -1
239
240 pop_sub(dos_end)
241 end subroutine
242
243 ! ---------------------------------------------------------
245 subroutine dos_write_dos(this, dir, st, box, ions, mesh, hm, namespace)
246 type(dos_t), intent(in) :: this
247 character(len=*), intent(in) :: dir
248 type(states_elec_t), target, intent(in) :: st
249 class(box_t), intent(in) :: box
250 type(ions_t), target, intent(in) :: ions
251 class(mesh_t), intent(in) :: mesh
252 type(hamiltonian_elec_t), intent(in) :: hm
253 type(namespace_t), intent(in) :: namespace
254
255 integer :: ie, ik, ist, is, ns, maxdos, nvertices
256 integer, allocatable :: iunit(:)
257 real(real64) :: energy
258 real(real64), allocatable :: tdos(:)
259 real(real64), allocatable :: dos(:,:,:)
260 character(len=64) :: filename
261
262 integer :: ii, ll
263
264 type(smear_t) :: smear
265 type(simplex_t), pointer :: simplex
266 real(real64) :: e_simplex(20)
267 real(real64), allocatable :: energies(:), dos_simplex_batch(:,:), dos_thread(:,:)
268
269 push_sub(dos_write_dos)
270
271 ! shortcuts
272 ns = 1
273 if (st%d%nspin == 2) ns = 2
274
275 ! set up smearing parameters
276 smear%method = this%smear_func
277 smear%MP_n = 1
278
279 if (st%system_grp%is_root()) then
280 ! space for state-dependent DOS
281 safe_allocate(dos(1:this%epoints, 1:st%nst, 0:ns-1))
282 dos(:, :, :) = m_zero
283 safe_allocate(iunit(0:ns-1))
284
285 ! compute band/spin-resolved density of states
286 do ist = 1, st%nst
287
288 do is = 0, ns-1
289 if (ns > 1) then
290 write(filename, '(a,i5.5,a,i1.1,a)') 'dos-', ist, '-', is+1,'.dat'
291 else
292 write(filename, '(a,i5.5,a)') 'dos-', ist, '.dat'
293 end if
294 iunit(is) = io_open(trim(dir)//'/'//trim(filename), namespace, action='write')
295 ! write header
296 write(iunit(is), '(3a)') '# energy [', trim(units_abbrev(units_out%energy)), '], band-resolved DOS'
297 end do
298
299 select case (this%method)
300 case (option__dosmethod__smear)
301 do ie = 1, this%epoints
302 energy = this%emin + (ie - 1) * this%de
303 ! sum up Lorentzians
304 do ik = 1, st%nik, ns
305 do is = 0, ns-1
306 dos(ie, ist, is) = dos(ie, ist, is) + st%kweights(ik+is) / this%gamma * &
307 smear_delta_function(smear, (energy - st%eigenval(ist, ik+is)) / this%gamma)
308 end do
309 end do
310 end do
311
312 case (option__dosmethod__tetrahedra, option__dosmethod__tetrahedra_opt)
313 assert(associated(hm%kpoints%reduced%simplex))
314 simplex => hm%kpoints%reduced%simplex
315 nvertices = simplex%rdim + 1
316 assert(nvertices <= 4)
317 call profiling_in("DOS_WRITE_TETRAHEDRA")
318 safe_allocate(energies(1:this%epoints))
319 do ie = 1, this%epoints
320 energies(ie) = this%emin + (ie - 1) * this%de
321 end do
322 !$omp parallel private(ii, is, ll, ik, ie, e_simplex, dos_simplex_batch, dos_thread)
323 safe_allocate(dos_simplex_batch(1:nvertices, 1:this%epoints))
324 safe_allocate(dos_thread(1:this%epoints, 0:ns-1))
325 dos_thread = m_zero
326 !$omp do schedule(static)
327 do ii = 1, simplex%n_simplices
328 do is = 0, ns - 1
329 do ll = 1, simplex%sdim
330 ik = simplex%simplices(ii, ll)
331 ik = ns * (ik - 1) + 1
332 e_simplex(ll) = st%eigenval(ist, ik+is)
333 end do
334
335 call simplex_dos(simplex%rdim, e_simplex(1:simplex%sdim), energies, dos_simplex_batch)
336
337 do ie = 1, this%epoints
338 dos_thread(ie, is) = dos_thread(ie, is) + sum(dos_simplex_batch(1:nvertices, ie)) / simplex%n_points
339 end do
340 end do
341 end do
342 !$omp end do
343 !$omp critical
344 dos(:, ist, :) = dos(:, ist, :) + dos_thread
345 !$omp end critical
346 safe_deallocate_a(dos_thread)
347 safe_deallocate_a(dos_simplex_batch)
348 !$omp end parallel
349 safe_deallocate_a(energies)
350 call profiling_out("DOS_WRITE_TETRAHEDRA")
351
352 case default
353 assert(.false.)
354 end select
355
356 do ie = 1, this%epoints
357 energy = this%emin + (ie - 1) * this%de
358 do is = 0, ns-1
359 write(message(1), '(2es25.16E3)') units_from_atomic(units_out%energy, energy), &
360 units_from_atomic(unit_one / units_out%energy, dos(ie, ist, is))
361 call messages_info(1, iunit(is))
362 end do
363 end do
364
365 do is = 0, ns-1
366 call io_close(iunit(is))
367 end do
368 end do
369
370 safe_allocate(tdos(1))
371
372 ! for spin-polarized calculations also output spin-resolved tDOS
373 if (st%d%nspin == spin_polarized) then
374 do is = 0, ns-1
375 write(filename, '(a,i1.1,a)') 'total-dos-', is+1,'.dat'
376 iunit(is) = io_open(trim(dir)//'/'//trim(filename), namespace, action='write')
377 ! write header
378 write(iunit(is), '(3a)') '# energy [', trim(units_abbrev(units_out%energy)), '], total DOS (spin-resolved)'
379
380 do ie = 1, this%epoints
381 energy = this%emin + (ie - 1) * this%de
382 tdos(1) = m_zero
383 do ist = 1, st%nst
384 tdos(1) = tdos(1) + dos(ie, ist, is)
385 end do
386 write(message(1), '(2es25.16E3)') units_from_atomic(units_out%energy, energy), &
387 units_from_atomic(unit_one / units_out%energy, tdos(1))
388 call messages_info(1, iunit(is))
389 end do
390
391 call io_close(iunit(is))
392 end do
393 end if
394
395
396 iunit(0) = io_open(trim(dir)//'/'//'total-dos.dat', namespace, action='write')
397 write(iunit(0), '(3a)') '# energy [', trim(units_abbrev(units_out%energy)), '], total DOS'
398
399 ! compute total density of states
400 do ie = 1, this%epoints
401 energy = this%emin + (ie - 1) * this%de
402 tdos(1) = m_zero
403 do ist = 1, st%nst
404 do is = 0, ns-1
405 tdos(1) = tdos(1) + dos(ie, ist, is)
406 end do
407 end do
408 write(message(1), '(2es25.16E3)') units_from_atomic(units_out%energy, energy), &
409 units_from_atomic(unit_one / units_out%energy, tdos(1))
410 call messages_info(1, iunit(0))
411 end do
412
413 call io_close(iunit(0))
414
415 safe_deallocate_a(tdos)
416
417
418 ! write Fermi file
419 iunit(0) = io_open(trim(dir)//'/'//'total-dos-efermi.dat', namespace, action='write')
420 write(message(1), '(3a)') '# Fermi energy [', trim(units_abbrev(units_out%energy)), &
421 '] in a format compatible with total-dos.dat'
422
423 ! this is the maximum that tdos can reach
424 maxdos = st%smear%el_per_state * st%nst
425
426 write(message(2), '(2es25.16E3)') units_from_atomic(units_out%energy, st%smear%e_fermi), m_zero
427 write(message(3), '(es25.16E3,i7)') units_from_atomic(units_out%energy, st%smear%e_fermi), maxdos
428
429 call messages_info(3, iunit(0))
430 call io_close(iunit(0))
431
432 end if
433
434
435 safe_deallocate_a(iunit)
436 safe_deallocate_a(dos)
437
438 pop_sub(dos_write_dos)
439 end subroutine dos_write_dos
440
441 ! ---------------------------------------------------------
443 subroutine dos_write_pdos(this, dir, st, box, ions, mesh, hm, namespace)
444 type(dos_t), intent(in) :: this
445 character(len=*), intent(in) :: dir
446 type(states_elec_t), target, intent(in) :: st
447 class(box_t), intent(in) :: box
448 type(ions_t), target, intent(in) :: ions
449 class(mesh_t), intent(in) :: mesh
450 type(hamiltonian_elec_t), intent(in) :: hm
451 type(namespace_t), intent(in) :: namespace
452
453 integer :: ie, ik, ist, is, ns, ib, ind, nvertices
454 integer :: iunit
455 real(real64) :: energy, threshold
456 character(len=64) :: filename, format_str
457 logical :: normalize
458
459 integer :: ii, ll, mm, nn, work, norb, work2
460 integer :: ia, iorb, idim
461 real(real64), allocatable :: ddot(:,:,:)
462 complex(real64), allocatable :: zdot(:,:,:)
463 real(real64), allocatable :: weight(:,:,:)
464 type(orbitalset_t) :: os
465 type(wfs_elec_t), pointer :: epsib
466
467 type(smear_t) :: smear
468 type(simplex_t), pointer :: simplex
469 real(real64) :: e_simplex(20), a_simplex(4)
470 real(real64), allocatable :: energies(:), dos_simplex_batch(:,:), pdos(:,:), pdos_thread(:,:)
471
472 push_sub(dos_write_pdos)
473
474 ! shortcuts
475 ns = 1
476 if (st%d%nspin == 2) ns = 2
477
478 ! set up smearing parameters
479 smear%method = this%smear_func
480 smear%MP_n = 1
481
482 !These variables are defined in basis_set/orbitalbasis.F90
483 call parse_variable(namespace, 'AOThreshold', 0.01_real64, threshold)
484 call parse_variable(namespace, 'AONormalize', .true., normalize)
485
486 do ia = 1, ions%natoms
487 !We first count how many orbital set we have
488 work = orbitalset_utils_count(ions%atom(ia)%species)
489
490 !We loop over the orbital sets of the atom ia
491 do norb = 1, work
492 call orbitalset_init(os)
493 os%spec => ions%atom(ia)%species
494
495 !We count the orbitals
496 work2 = 0
497 do iorb = 1, os%spec%get_niwfs()
498 call os%spec%get_iwf_ilm(iorb, 1, ii, ll, mm)
499 call os%spec%get_iwf_n(iorb, 1, nn)
500 if (ii == norb) then
501 os%ll = ll
502 os%nn = nn
503 os%ii = ii
504 os%radius = atomic_orbital_get_radius(os%spec, mesh, iorb, 1, &
505 option__aotruncation__ao_full, threshold)
506 work2 = work2 + 1
507 end if
508 end do
509 os%norbs = work2
510 os%ndim = 1
511 os%use_submesh = .false.
512 os%allocated_on_mesh = .true.
513 os%spec => ions%atom(ia)%species
514
515 do work = 1, os%norbs
516 ! We obtain the orbital
517 if (states_are_real(st)) then
518 call dget_atomic_orbital(namespace, ions%space, ions%latt, ions%pos(:,ia), &
519 ions%atom(ia)%species, mesh, os%sphere, os%ii, os%ll, os%jj, &
520 os, work, os%radius, os%ndim, use_mesh=.not.os%use_submesh, &
521 normalize = normalize)
522 else
523 call zget_atomic_orbital(namespace, ions%space, ions%latt, ions%pos(:,ia), &
524 ions%atom(ia)%species, mesh, os%sphere, os%ii, os%ll, os%jj, &
525 os, work, os%radius, os%ndim, &
526 use_mesh = .not. hm%phase%is_allocated() .and. .not. os%use_submesh, &
527 normalize = normalize)
528 end if
529 end do
530
531 if (hm%phase%is_allocated()) then
532 ! In case of complex wavefunction, we allocate the array for the phase correction
533 safe_allocate(os%phase(1:os%sphere%np, st%d%kpt%start:st%d%kpt%end))
534 os%phase(:,:) = m_zero
535
536 if (.not. os%use_submesh) then
537 safe_allocate(os%eorb_mesh(1:mesh%np, 1:os%norbs, 1:os%ndim, st%d%kpt%start:st%d%kpt%end))
538 os%eorb_mesh(:,:,:,:) = m_zero
539 else
540 safe_allocate(os%eorb_submesh(1:os%sphere%np, 1:os%ndim, 1:os%norbs, st%d%kpt%start:st%d%kpt%end))
541 os%eorb_submesh(:,:,:,:) = m_zero
542 end if
543
544 if (accel_is_enabled() .and. st%d%dim == 1) then
545 os%ldorbs_eorb = max(pad_pow2(os%sphere%np), 1)
546 if(.not. os%use_submesh) os%ldorbs_eorb = max(pad_pow2(os%sphere%mesh%np), 1)
547
548 safe_allocate(os%buff_eorb(st%d%kpt%start:st%d%kpt%end))
549 do ik= st%d%kpt%start, st%d%kpt%end
550 call accel_create_buffer(os%buff_eorb(ik), accel_mem_read_only, type_cmplx, os%ldorbs_eorb*os%norbs)
551 end do
552 end if
553
554 call orbitalset_update_phase(os, box%dim, st%d%kpt, hm%kpoints, (st%d%ispin==spin_polarized), &
555 vec_pot = hm%hm_base%uniform_vector_potential, &
556 vec_pot_var = hm%hm_base%vector_potential)
557 else
558 if (states_are_real(st)) then
559 call dorbitalset_transfer_to_device(os, st%d%kpt, .not. os%use_submesh)
560 else
561 call zorbitalset_transfer_to_device(os, st%d%kpt, .not. os%use_submesh)
562 end if
563 end if
564
565 if (st%system_grp%is_root()) then
566 if (os%nn /= 0) then
567 write(filename,'(a, i4.4, a1, a, i1.1, a1,a)') 'pdos-at', ia, '-', trim(os%spec%get_label()), &
568 os%nn, l_notation(os%ll), '.dat'
569 else
570 write(filename,'(a, i4.4, a1, a, a1,a)') 'pdos-at', ia, '-', trim(os%spec%get_label()), &
571 l_notation(os%ll), '.dat'
572 end if
573
574 iunit = io_open(trim(dir)//'/'//trim(filename), namespace, action='write')
575 ! write header
576 write(iunit, '(3a)') '# energy [', trim(units_abbrev(units_out%energy)), &
577 '], projected DOS (total and orbital resolved)'
578 end if
579
580 if (states_are_real(st)) then
581 safe_allocate(ddot(1:st%d%dim, 1:os%norbs, 1:st%block_size))
582 else
583 safe_allocate(zdot(1:st%d%dim, 1:os%norbs, 1:st%block_size))
584 end if
585
586 safe_allocate(weight(1:os%norbs,1:st%nik,1:st%nst))
587 weight(1:os%norbs,1:st%nik,1:st%nst) = m_zero
588
589 do ik = st%d%kpt%start, st%d%kpt%end
590 do ib = st%group%block_start, st%group%block_end
591
592 if (hm%phase%is_allocated()) then
593 safe_allocate(epsib)
594 call st%group%psib(ib, ik)%copy_to(epsib)
595 call hm%phase%apply_to(mesh, mesh%np, .false., epsib, src = st%group%psib(ib, ik))
596 else
597 epsib => st%group%psib(ib, ik)
598 end if
599
600 if (states_are_real(st)) then
601 call dorbitalset_get_coeff_batch(os, st%d%dim, epsib, ddot(:, :, :))
602 do ist = 1, st%group%psib(ib, ik)%nst
603 ind = st%group%psib(ib, ik)%ist(ist)
604 do iorb = 1, os%norbs
605 do idim = 1, st%d%dim
606 weight(iorb, ik, ind) = weight(iorb, ik, ind) + st%kweights(ik) * abs(ddot(idim, iorb, ist))**2
607 end do
608 end do
609 end do
610 else
611 call zorbitalset_get_coeff_batch(os, st%d%dim, epsib, zdot(:, :, :))
612 do ist = 1, st%group%psib(ib, ik)%nst
613 ind = st%group%psib(ib, ik)%ist(ist)
614 do iorb = 1, os%norbs
615 do idim = 1, st%d%dim
616 weight(iorb, ik, ind) = weight(iorb, ik, ind) + st%kweights(ik) * abs(zdot(idim, iorb, ist))**2
617 end do
618 end do
619 end do
620 end if
621
622 if (hm%phase%is_allocated()) then
623 call epsib%end(copy=.false.)
624 safe_deallocate_p(epsib)
625 end if
626
627 end do
628 end do
629
630 if (st%parallel_in_states .or. st%d%kpt%parallel) then
631 call comm_allreduce(st%st_kpt_mpi_grp, weight)
632 end if
633
634 safe_deallocate_a(ddot)
635 safe_deallocate_a(zdot)
636
637 if (st%system_grp%is_root()) then
638 write(format_str,'(a,i5,a)') '(', os%norbs+2, 'es25.16E3)'
639 safe_allocate(pdos(1:os%norbs, 1:this%epoints))
640 pdos = m_zero
641 select case (this%method)
642 case (option__dosmethod__smear)
643 do iorb = 1, os%norbs
644 do ist = 1, st%nst
645 do ik = 1, st%nik
646 do ie = 1, this%epoints
647 energy = this%emin + (ie - 1) * this%de
648 pdos(iorb, ie) = pdos(iorb, ie) + weight(iorb,ik,ist) / this%gamma * &
649 smear_delta_function(smear, (energy - st%eigenval(ist, ik))/this%gamma)
650 end do
651 end do
652 end do
653 end do
654 case (option__dosmethod__tetrahedra, option__dosmethod__tetrahedra_opt)
655 assert(associated(hm%kpoints%reduced%simplex))
656 simplex => hm%kpoints%reduced%simplex
657 nvertices = simplex%rdim + 1
658 assert(nvertices <= 4)
659 safe_allocate(energies(1:this%epoints))
660 do ie = 1, this%epoints
661 energies(ie) = this%emin + (ie - 1) * this%de
662 end do
663 call profiling_in("DOS_WRITE_PDOS_TETRAHEDRA")
664 !$omp parallel private(ist, ii, is, ll, ik, iorb, ie, e_simplex, a_simplex, dos_simplex_batch, pdos_thread)
665 safe_allocate(dos_simplex_batch(1:nvertices, 1:this%epoints))
666 safe_allocate(pdos_thread(1:os%norbs, 1:this%epoints))
667 pdos_thread = m_zero
668 !$omp do collapse(2) schedule(static)
669 do ist = 1, st%nst
670 do ii = 1, simplex%n_simplices
671 do is = 0, ns - 1
672 do ll = 1, simplex%sdim
673 ik = simplex%simplices(ii, ll)
674 ik = ns * (ik - 1) + 1
675 e_simplex(ll) = st%eigenval(ist, ik+is)
676 end do
677 call simplex_dos(simplex%rdim, e_simplex(1:simplex%sdim), energies, dos_simplex_batch)
678 do iorb = 1, os%norbs
679 do ll = 1, nvertices
680 ik = simplex%simplices(ii, ll)
681 ik = ns * (ik - 1) + 1
682 if (st%kweights(ik+is) > m_epsilon) then
683 a_simplex(ll) = weight(iorb, ik+is, ist) / st%kweights(ik+is)
684 else
685 a_simplex(ll) = m_zero
686 end if
687 end do
688 do ie = 1, this%epoints
689 pdos_thread(iorb, ie) = pdos_thread(iorb, ie) + &
690 sum(a_simplex(1:nvertices) * dos_simplex_batch(1:nvertices, ie)) / simplex%n_points
691 end do
692 end do
693 end do
694 end do
695 end do
696 !$omp end do
697 !$omp critical
698 pdos(:,:) = pdos(:,:) + pdos_thread(:,:)
699 !$omp end critical
700 safe_deallocate_a(pdos_thread)
701 safe_deallocate_a(dos_simplex_batch)
702 !$omp end parallel
703 call profiling_out("DOS_WRITE_PDOS_TETRAHEDRA")
704 safe_deallocate_a(energies)
705 case default
706 assert(.false.)
707 end select
708 do ie = 1, this%epoints
709 energy = this%emin + (ie - 1) * this%de
710 write(iunit, trim(format_str)) units_from_atomic(units_out%energy, energy), &
711 units_from_atomic(unit_one / units_out%energy, sum(pdos(:,ie))), &
712 (units_from_atomic(unit_one / units_out%energy, pdos(iorb,ie)), iorb=1,os%norbs)
713 end do
714 safe_deallocate_a(pdos)
715 call io_close(iunit)
716 end if
717
718 call orbitalset_end(os)
719 safe_deallocate_a(weight)
720
721 end do
722
723 end do
724
725 pop_sub(dos_write_pdos)
726 end subroutine dos_write_pdos
727
728 ! ---------------------------------------------------------
730 subroutine dos_write_jdos(this, dir, st, ions, hm, namespace)
731 type(dos_t), intent(in) :: this
732 character(len=*), intent(in) :: dir
733 type(states_elec_t), intent(in) :: st
734 type(ions_t), target, intent(in) :: ions
735 type(hamiltonian_elec_t), intent(in) :: hm
736 type(namespace_t), intent(in) :: namespace
737
738 integer :: ie, ik, val, cond, is, ns, ll, ii, nvertices
739 integer, allocatable :: iunit(:)
740 real(real64) :: energy
741 real(real64) :: tjdos(1), e_simplex(20), occ_simplex(4)
742 real(real64), allocatable :: jdos(:,:), energies(:), dos_simplex(:,:)
743 character(len=64) :: filename
744
745 type(smear_t) :: smear
746 type(simplex_t), pointer :: simplex
747
748 push_sub(dos_write_jdos)
749
750 ! shortcuts
751 ns = 1
752 if (st%d%nspin == 2) ns = 2
753
754 ! set up smearing parameters
755 smear%method = this%smear_func
756 smear%MP_n = 1
757
758 if (st%system_grp%is_root()) then
759 ! space for state-dependent DOS
760 safe_allocate(jdos(1:this%epoints, 0:ns-1))
761 safe_allocate(iunit(0:ns-1))
762 jdos = m_zero
763
764 select case (this%method)
765 case (option__dosmethod__smear)
766 ! compute band/spin-resolved density of states
767 do val = 1, st%nst
768 do cond = val, st%nst
769 do ik = 1, st%nik, ns
770 do is = 0, ns-1
771 if(st%occ(val, ik+is) < m_epsilon) cycle
772 if(st%occ(cond, ik+is) > m_epsilon) cycle
773 do ie = 1, this%epoints
774 energy = (ie - 1) * this%de
775 ! sum up Lorentzians
776 jdos(ie, is) = jdos(ie, is) + st%kweights(ik+is) / this%gamma * &
777 smear_delta_function(smear, (energy - (st%eigenval(cond, ik+is)-st%eigenval(val, ik+is)))/this%gamma)
778 end do
779 end do
780 end do
781 end do
782 end do
783 case (option__dosmethod__tetrahedra, option__dosmethod__tetrahedra_opt)
784 assert(associated(hm%kpoints%reduced%simplex))
785 simplex => hm%kpoints%reduced%simplex
786 nvertices = simplex%rdim + 1
787 assert(nvertices <= 4)
788 call profiling_in("DOS_WRITE_JDOS_TETRAHEDRA")
789 safe_allocate(energies(1:this%epoints))
790 do ie = 1, this%epoints
791 energies(ie) = (ie - 1) * this%de
792 end do
793 !$omp parallel reduction(+:jdos) &
794 !$omp private(val, cond, ie, ii, is, ll, ik, e_simplex, occ_simplex, dos_simplex)
795 safe_allocate(dos_simplex(1:nvertices, 1:this%epoints))
796 !$omp do collapse(3) schedule(dynamic)
797 do val = 1, st%nst
798 do cond = 1, st%nst
799 do ii = 1, simplex%n_simplices
800 if (cond < val) cycle
801 do is = 0, ns - 1
802 do ll = 1, simplex%sdim
803 ik = simplex%simplices(ii, ll)
804 ik = ns * (ik - 1) + 1
805 e_simplex(ll) = st%eigenval(cond, ik+is) - st%eigenval(val, ik+is)
806 end do
807
808 do ll = 1, nvertices
809 ik = simplex%simplices(ii, ll)
810 ik = ns * (ik - 1) + 1
811 if (st%occ(val, ik+is) > m_epsilon .and. st%occ(cond, ik+is) < m_epsilon) then
812 occ_simplex(ll) = m_one
813 else
814 occ_simplex(ll) = m_zero
815 end if
816 end do
817
818 ! use bitwise comparison for exact zero because direct comparison is forbidden by -Wcompare-reals
819 if (all(transfer(occ_simplex(1:nvertices), [0_int64]) == 0_int64)) cycle
820
821 call simplex_dos(simplex%rdim, e_simplex(1:simplex%sdim), energies, dos_simplex)
822 do ie = 1, this%epoints
823 jdos(ie, is) = jdos(ie, is) + sum(occ_simplex(1:nvertices) * dos_simplex(1:nvertices, ie)) / &
824 simplex%n_points
825 end do
826 end do
827 end do
828 end do
829 end do
830 !$omp end do
831 safe_deallocate_a(dos_simplex)
832 !$omp end parallel
833 safe_deallocate_a(energies)
834 call profiling_out("DOS_WRITE_JDOS_TETRAHEDRA")
835 case default
836 assert(.false.)
837 end select
838
839 ! for spin-polarized calculations also output spin-resolved tDOS
840 if (st%d%nspin > 1) then
841 do is = 0, ns-1
842 write(filename, '(a,i1.1,a)') 'total-jdos-', is+1,'.dat'
843 iunit(is) = io_open(trim(dir)//'/'//trim(filename), namespace, action='write')
844 ! write header
845 write(iunit(is), '(3a)') '# energy [', trim(units_abbrev(units_out%energy)), '], total JDOS (spin-resolved)'
846
847 do ie = 1, this%epoints
848 energy = (ie - 1) * this%de
849 write(message(1), '(2es25.16E3)') units_from_atomic(units_out%energy, energy), &
850 units_from_atomic(unit_one / units_out%energy, jdos(ie, is))
851 call messages_info(1, iunit(is))
852 end do
853
854 call io_close(iunit(is))
855 end do
856 end if
857
858
859 iunit(0) = io_open(trim(dir)//'/'//'total-jdos.dat', namespace, action='write')
860 write(iunit(0), '(3a)') '# energy [', trim(units_abbrev(units_out%energy)), '], total JDOS'
861
862 ! compute total joint density of states
863 do ie = 1, this%epoints
864 energy = (ie - 1) * this%de
865 tjdos(1) = m_zero
866 do is = 0, ns-1
867 tjdos(1) = tjdos(1) + jdos(ie, is)
868 end do
869 write(message(1), '(2es25.16E3)') units_from_atomic(units_out%energy, energy), &
870 units_from_atomic(unit_one / units_out%energy, tjdos(1))
871 call messages_info(1, iunit(0))
872 end do
873
874 call io_close(iunit(0))
875 end if
876
877 safe_deallocate_a(iunit)
878 safe_deallocate_a(jdos)
879
880 pop_sub(dos_write_jdos)
881 end subroutine dos_write_jdos
882
883
884 ! ---------------------------------------------------------
886 subroutine dos_write_ldos(this, dir, st, ions, gr, hm, how, namespace)
887 type(dos_t), intent(in) :: this
888 character(len=*), intent(in) :: dir
889 type(states_elec_t), intent(in) :: st
890 type(ions_t), target, intent(in) :: ions
891 type(grid_t), intent(in) :: gr
892 type(hamiltonian_elec_t), intent(in) :: hm
893 integer(int64), intent(in) :: how
894 type(namespace_t), intent(in) :: namespace
895
896 integer :: ie, ik, ist, is, ns, ip, ifull, ierr, ii, ll, nvertices, ikpoint
897 integer :: iop, iiop, nops, nops_max
898 character(len=MAX_PATH_LEN) :: fname, name
899 logical :: has_local_corner
900 real(real64) :: weight, e_simplex(20)
901 real(real64), allocatable :: ldos(:,:,:), dpsi(:,:), abs_psi2(:), abs_psi2_symm(:), ldos_weights(:,:,:)
902 real(real64), allocatable :: dos_simplex(:,:)
903 complex(real64), allocatable :: zpsi(:,:)
904 type(unit_t) :: fn_unit
905
906 type(smear_t) :: smear
907 type(simplex_t), pointer :: simplex
908
909 push_sub(dos_write_ldos)
910
911 if (this%ldos_nenergies < 1) then
912 message(1) = "LDOSEnergies must be defined for Output=ldos"
913 call messages_fatal(1, namespace=namespace)
914 end if
915
916 ! shortcuts
917 ns = 1
918 if (st%d%nspin == 2) ns = 2
919
920 ! set up smearing parameters
921 smear%method = this%smear_func
922 smear%MP_n = 1
923
924 fn_unit = units_out%length**(-ions%space%dim) / units_out%energy
925
926 ! space for state-dependent DOS
927 safe_allocate(ldos(1:gr%np, 1:this%ldos_nenergies, 1:ns))
928 ldos = m_zero
929
930 safe_allocate(abs_psi2(1:gr%np))
931 if (states_are_real(st)) then
932 safe_allocate(dpsi(1:gr%np, 1:st%d%dim))
933 else
934 safe_allocate(zpsi(1:gr%np, 1:st%d%dim))
935 end if
936
937 select case (this%method)
938 case (option__dosmethod__smear)
939 nops_max = 1
940 safe_allocate(ldos_weights(1:this%ldos_nenergies, st%d%kpt%start:st%d%kpt%end, 1:nops_max))
941 case (option__dosmethod__tetrahedra, option__dosmethod__tetrahedra_opt)
942 assert(associated(hm%kpoints%full%simplex))
943 simplex => hm%kpoints%full%simplex
944 nvertices = simplex%rdim + 1
945 assert(nvertices <= 4)
946 nops_max = 1
947 do ifull = 1, hm%kpoints%full%npoints
948 nops_max = max(nops_max, hm%kpoints%get_full_symmetry_op_index(ifull))
949 end do
950 safe_allocate(ldos_weights(1:this%ldos_nenergies, st%d%kpt%start:st%d%kpt%end, 1:nops_max))
951 safe_allocate(abs_psi2_symm(1:gr%np))
952 case default
953 assert(.false.)
954 end select
955
956 do ist = st%st_start, st%st_end
957 ldos_weights(:, :, :) = m_zero
958
959 select case (this%method)
960 case (option__dosmethod__smear)
961 do ik = st%d%kpt%start, st%d%kpt%end
962 do ie = 1, this%ldos_nenergies
963 ldos_weights(ie, ik, 1) = st%kweights(ik) / this%gamma * &
964 smear_delta_function(smear, (this%ldos_energies(ie) - st%eigenval(ist, ik))/this%gamma)
965 end do
966 end do
967 case (option__dosmethod__tetrahedra, option__dosmethod__tetrahedra_opt)
968 call profiling_in('DOS_WRITE_LDOS_TETRAHEDRA')
969 !$omp parallel reduction(+:ldos_weights) &
970 !$omp private(ii, is, ll, ik, ie, e_simplex, dos_simplex, ifull, iiop, has_local_corner)
971 safe_allocate(dos_simplex(1:nvertices, 1:this%ldos_nenergies))
972 !$omp do schedule(dynamic)
973 do ii = 1, simplex%n_simplices
974 do is = 0, ns - 1
975 has_local_corner = .false.
976 do ll = 1, simplex%sdim
977 ik = hm%kpoints%get_equiv(simplex%simplices(ii, ll))
978 ik = ns * (ik - 1) + 1 + is
979 e_simplex(ll) = st%eigenval(ist, ik)
980 if (ik >= st%d%kpt%start .and. ik <= st%d%kpt%end) has_local_corner = .true.
981 end do
982 if (.not. has_local_corner) cycle
983
984 call simplex_dos(simplex%rdim, e_simplex(1:simplex%sdim), this%ldos_energies, &
985 dos_simplex(1:nvertices, 1:this%ldos_nenergies))
986 do ie = 1, this%ldos_nenergies
987 do ll = 1, nvertices
988 ifull = simplex%simplices(ii, ll)
989 iiop = hm%kpoints%get_full_symmetry_op_index(ifull)
990 ik = hm%kpoints%get_equiv(ifull)
991 ik = ns * (ik - 1) + 1 + is
992 if (ik >= st%d%kpt%start .and. ik <= st%d%kpt%end) then
993 ldos_weights(ie, ik, iiop) = ldos_weights(ie, ik, iiop) + dos_simplex(ll, ie) / simplex%n_points
994 end if
995 end do
996 end do
997 end do
998 end do
999 !$omp end do
1000 safe_deallocate_a(dos_simplex)
1001 !$omp end parallel
1002 call profiling_out('DOS_WRITE_LDOS_TETRAHEDRA')
1003 case default
1004 assert(.false.)
1005 end select
1006
1007 do ik = st%d%kpt%start, st%d%kpt%end
1008 is = st%d%get_spin_index(ik)
1009
1010 if (states_are_real(st)) then
1011 call states_elec_get_state(st, gr, ist, ik, dpsi)
1012 do ip = 1, gr%np
1013 abs_psi2(ip) = dpsi(ip, 1)**2
1014 end do
1015 if (st%d%dim > 1) then
1016 do ip = 1, gr%np
1017 abs_psi2(ip) = abs_psi2(ip) + dpsi(ip, 2)**2
1018 end do
1019 end if
1020 else
1021 call states_elec_get_state(st, gr, ist, ik, zpsi)
1022 do ip = 1, gr%np
1023 abs_psi2(ip) = real(conjg(zpsi(ip, 1)) * zpsi(ip, 1), real64)
1024 end do
1025 if (st%d%dim > 1) then
1026 do ip = 1, gr%np
1027 abs_psi2(ip) = abs_psi2(ip) + real(conjg(zpsi(ip, 2)) * zpsi(ip, 2), real64)
1028 end do
1029 end if
1030 end if
1031
1032 select case (this%method)
1033 case (option__dosmethod__smear)
1034 do ie = 1, this%ldos_nenergies
1035 weight = ldos_weights(ie, ik, 1)
1036 call lalg_axpy(gr%np, weight, abs_psi2, ldos(:, ie, is))
1037 end do
1038 case (option__dosmethod__tetrahedra, option__dosmethod__tetrahedra_opt)
1039 ikpoint = st%d%get_kpoint_index(ik)
1040 nops = kpoints_get_num_symmetry_ops(hm%kpoints, ikpoint)
1041 do iiop = 1, nops
1042 iop = abs(kpoints_get_symmetry_ops(hm%kpoints, ikpoint, iiop))
1043 call dgrid_symmetrize_single(gr, iop, abs_psi2, abs_psi2_symm, suppress_warning = .true.)
1044 do ie = 1, this%ldos_nenergies
1045 weight = ldos_weights(ie, ik, iiop)
1046 call lalg_axpy(gr%np, weight, abs_psi2_symm, ldos(:, ie, is))
1047 end do
1048 end do
1049 case default
1050 assert(.false.)
1051 end select
1052 end do
1053 end do
1054
1055 safe_deallocate_a(ldos_weights)
1056 safe_deallocate_a(dpsi)
1057 safe_deallocate_a(zpsi)
1058 safe_deallocate_a(abs_psi2)
1059 safe_deallocate_a(abs_psi2_symm)
1060
1061 if (st%parallel_in_states .or. st%d%kpt%parallel) then
1062 call comm_allreduce(st%st_kpt_mpi_grp, ldos)
1063 end if
1064
1065 do is = 1, ns
1066 do ie = 1, this%ldos_nenergies
1067 write(name, '(a,i5.5)') 'ldos_en-', ie
1068 fname = get_filename_with_spin(name, st%d%nspin, is)
1069
1070 if (hm%kpoints%use_symmetries .and. &
1071 .not. (this%method == option__dosmethod__tetrahedra .or. this%method == option__dosmethod__tetrahedra_opt)) then
1072 call dgrid_symmetrize_scalar_field(gr, ldos(:, ie, is), suppress_warning = .true.)
1073 end if
1074 call dio_function_output(how, dir, fname, namespace, ions%space, gr, &
1075 ldos(:, ie, is), fn_unit, ierr, pos=ions%pos, atoms=ions%atom, grp = st%dom_st_kpt_mpi_grp)
1076 end do
1077 end do
1078
1079 safe_deallocate_a(ldos)
1080
1081 pop_sub(dos_write_ldos)
1082 end subroutine dos_write_ldos
1083
1084
1085end module dos_oct_m
1086
1087!! Local Variables:
1088!! mode: f90
1089!! coding: utf-8
1090!! End:
constant times a vector plus a vector
Definition: lalg_basic.F90:173
pure logical function, public accel_is_enabled()
Definition: accel.F90:402
integer, parameter, public accel_mem_read_only
Definition: accel.F90:185
subroutine, public zget_atomic_orbital(namespace, space, latt, pos, species, mesh, sm, ii, ll, jj, os, orbind, radius, d_dim, use_mesh, normalize, index_shift)
This routine returns the atomic orbital basis – provided by the pseudopotential structure in geo.
character(len=1), dimension(0:3), parameter, public l_notation
real(real64) function, public atomic_orbital_get_radius(species, mesh, iorb, ispin, truncation, threshold)
subroutine, public dget_atomic_orbital(namespace, space, latt, pos, species, mesh, sm, ii, ll, jj, os, orbind, radius, d_dim, use_mesh, normalize, index_shift)
This routine returns the atomic orbital basis – provided by the pseudopotential structure in geo.
Module that handles computing and output of various density of states.
Definition: dos.F90:118
subroutine, public dos_write_pdos(this, dir, st, box, ions, mesh, hm, namespace)
Computes and output the projected DOS (PDOS)
Definition: dos.F90:539
subroutine dos_end(this)
Finalizer for the dos_t object.
Definition: dos.F90:328
subroutine, public dos_write_dos(this, dir, st, box, ions, mesh, hm, namespace)
Computes and output the DOS and the projected DOS (PDOS)
Definition: dos.F90:341
subroutine, public dos_write_jdos(this, dir, st, ions, hm, namespace)
Computes and output the joint DOS (JDOS)
Definition: dos.F90:826
subroutine, public dos_init(this, namespace, st, kpoints)
Initializes the dot_t object.
Definition: dos.F90:194
subroutine, public dos_write_ldos(this, dir, st, ions, gr, hm, how, namespace)
Computes and output the local DOS (LDOS)
Definition: dos.F90:982
integer, parameter, public spin_polarized
real(real64), parameter, public m_zero
Definition: global.F90:200
real(real64), parameter, public m_four
Definition: global.F90:204
real(real64), parameter, public m_epsilon
Definition: global.F90:216
real(real64), parameter, public m_one
Definition: global.F90:201
This module implements the underlying real-space grid.
Definition: grid.F90:119
subroutine, public dgrid_symmetrize_single(gr, iop, field, symm_field, suppress_warning)
Definition: grid.F90:726
subroutine, public dgrid_symmetrize_scalar_field(gr, field, suppress_warning)
Definition: grid.F90:672
subroutine, public dio_function_output(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
Top-level IO routine for functions defined on the mesh.
Definition: io.F90:116
subroutine, public io_close(iunit, grp)
Definition: io.F90:467
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
Definition: io.F90:402
integer pure function, public kpoints_get_num_symmetry_ops(this, ik)
Definition: kpoints.F90:1730
integer pure function, public kpoints_get_symmetry_ops(this, ik, index)
Definition: kpoints.F90:1743
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:117
integer pure function, public pad_pow2(size)
create array size, which is padded to powers of 2
Definition: math.F90:846
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
subroutine, public messages_obsolete_variable(namespace, name, rep)
Definition: messages.F90:1000
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:410
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:594
type(namespace_t), public global_namespace
Definition: namespace.F90:135
subroutine, public orbitalset_init(this)
Definition: orbitalset.F90:210
subroutine, public orbitalset_end(this)
Definition: orbitalset.F90:236
subroutine, public dorbitalset_transfer_to_device(os, kpt, use_mesh)
Allocate and transfer the orbitals to the device.
subroutine, public orbitalset_update_phase(os, dim, kpt, kpoints, spin_polarized, vec_pot, vec_pot_var, kpt_max)
Build the phase correction to the global phase in case the orbital crosses the border of the simulato...
Definition: orbitalset.F90:286
subroutine, public dorbitalset_get_coeff_batch(os, ndim, psib, dot, reduce)
Definition: orbitalset.F90:590
subroutine, public zorbitalset_get_coeff_batch(os, ndim, psib, dot, reduce)
subroutine, public zorbitalset_transfer_to_device(os, kpt, use_mesh)
Allocate and transfer the orbitals to the device.
integer function, public orbitalset_utils_count(species, iselect)
Count the number of orbital sets we have for a given atom.
this module contains the low-level part of the output system
Definition: output_low.F90:117
character(len=max_path_len) function, public get_filename_with_spin(output, nspin, spin_index)
Returns the filame as output, or output-spX is spin polarized.
Definition: output_low.F90:233
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:623
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
Definition: profiling.F90:631
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
Definition: profiling.F90:554
real(real64) function, public smear_delta_function(this, xx)
Definition: smear.F90:832
integer, parameter, public smear_fermi_dirac
Definition: smear.F90:176
integer, parameter, public smear_methfessel_paxton
Definition: smear.F90:176
integer, parameter, public smear_lorentzian
Definition: smear.F90:176
integer, parameter, public smear_spline
Definition: smear.F90:176
integer, parameter, public smear_cold
Definition: smear.F90:176
integer, parameter, public smear_gaussian
Definition: smear.F90:176
pure logical function, public states_are_real(st)
type(type_t), public type_cmplx
Definition: types.F90:136
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:134
character(len=20) pure function, public units_abbrev(this)
Definition: unit.F90:225
This module defines the unit system, used for input and output.
type(unit_system_t), public units_out
type(unit_system_t), public units_inp
the units systems for reading and writing
type(unit_t), public unit_one
some special units required for particular quantities
class to tell whether a point is inside or outside
Definition: box.F90:143
Description of the grid, containing information on derivatives, stencil, and symmetries.
Definition: grid.F90:171
Describes mesh distribution to nodes.
Definition: mesh.F90:187
The states_elec_t class contains all electronic wave functions.
batches of electronic states
Definition: wfs_elec.F90:141
int true(void)