Octopus
output.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
22module output_oct_m
23 use accel_oct_m
24 use basins_oct_m
25 use box_oct_m
26 use comm_oct_m
27 use cube_oct_m
30 use debug_oct_m
33 use dos_oct_m
35 use elf_oct_m
38 use fft_oct_m
41 use global_oct_m
42 use grid_oct_m
45 use io_oct_m
47 use ions_oct_m
48 use, intrinsic :: iso_fortran_env
52 use lasers_oct_m
53 use lda_u_oct_m
56 use loct_oct_m
57 use math_oct_m
59 use mesh_oct_m
62 use mpi_oct_m
70 use parser_oct_m
73 use smear_oct_m
74 use space_oct_m
79 use stress_oct_m
80 use string_oct_m
84 use unit_oct_m
86 use utils_oct_m
88 use v_ks_oct_m
89 use xc_oct_m
90 use xc_oep_oct_m
92 use xc_f03_lib_m
93 use xc_vxc_oct_m
95 implicit none
96
97 private
98 public :: &
100 output_init, &
104 output_all, &
106 doutput_lr, &
107 zoutput_lr, &
111
112contains
113
114 subroutine output_init(outp, namespace, space, st, gr, nst, ks)
115 type(output_t), intent(out) :: outp
116 type(namespace_t), intent(in) :: namespace
117 class(space_t), intent(in) :: space
118 type(states_elec_t), intent(in) :: st
119 type(grid_t), intent(in) :: gr
120 integer, intent(in) :: nst
121 type(v_ks_t), intent(inout) :: ks
122
123 type(block_t) :: blk
124 real(real64) :: norm
125 character(len=80) :: nst_string, default
126
127 push_sub(output_init)
128 outp%what = .false.
129
130 call io_function_read_what_how_when(namespace, space, outp%what, outp%how, outp%output_interval)
131
132 if (outp%what(option__output__wfs_fourier)) then
133 if (accel_is_enabled()) then
134 message(1) = "Wave functions in Fourier space not supported on GPUs."
135 call messages_fatal(1, namespace=namespace)
136 end if
137 call messages_experimental("Wave-functions in Fourier space", namespace=namespace)
138 end if
139
140 ! cannot calculate the ELF in 1D
141 if (outp%what(option__output__elf) .or. outp%what(option__output__elf_basins)) then
142 if (space%dim /= 2 .and. space%dim /= 3) then
143 outp%what(option__output__elf) = .false.
144 outp%what(option__output__elf_basins) = .false.
145 write(message(1), '(a)') 'Cannot calculate ELF except in 2D and 3D.'
146 call messages_warning(1, namespace=namespace)
147 end if
148 end if
149
150
151 if (outp%what(option__output__mmb_wfs)) then
152 call messages_experimental("Model many-body wfs", namespace=namespace)
153 end if
154
155 if (outp%what(option__output__xc_torque)) then
156 if (st%d%ispin /= spinors) then
157 write(message(1), '(a)') 'The output xc_torque can only be computed for spinors.'
158 call messages_fatal(1, namespace=namespace)
159 end if
160 if (space%dim /= 3) then
161 write(message(1), '(a)') 'The output xc_torque can only be computed in the 3D case.'
162 call messages_fatal(1, namespace=namespace)
163 end if
164 end if
165 if (outp%what(option__output__mmb_den)) then
166 call messages_experimental("Model many-body density matrix", namespace=namespace)
167 ! NOTES:
168 ! could be made into block to be able to specify which dimensions to trace
169 ! in principle all combinations are interesting, but this means we need to
170 ! be able to output density matrices for multiple particles or multiple
171 ! dimensions. The current 1D 1-particle case is simple.
172 end if
173
174 if (outp%what(option__output__energy_density)) call messages_experimental("'Output = energy_density'", namespace=namespace)
175 if (outp%what(option__output__heat_current)) call messages_experimental("'Output = heat_current'", namespace=namespace)
176
177 if (outp%what(option__output__wfs) .or. outp%what(option__output__wfs_sqmod) &
178 .or. outp%what(option__output__wfs_ae)) then
179
180 !%Variable OutputWfsNumber
181 !%Type string
182 !%Default all states
183 !%Section Output
184 !%Description
185 !% Which wavefunctions to print, in list form: <i>i.e.</i>, "1-5" to print the first
186 !% five states, "2,3" to print the second and the third state, etc.
187 !% If more states are specified than available, extra ones will be ignored.
188 !%End
189
190 write(nst_string,'(i6)') nst
191 write(default,'(a,a)') "1-", trim(adjustl(nst_string))
192 call parse_variable(namespace, 'OutputWfsNumber', default, outp%wfs_list)
193 end if
194
195 if (parse_block(namespace, 'CurrentThroughPlane', blk) == 0) then
196 if (.not. outp%what(option__output__j_flow)) then
197 outp%what(option__output__j_flow) = .true.
198 call parse_variable(namespace, 'OutputInterval', 50, outp%output_interval(option__output__j_flow))
199 end if
200
201 !%Variable CurrentThroughPlane
202 !%Type block
203 !%Section Output
204 !%Description
205 !% The code can calculate current
206 !% traversing a user-defined portion of a plane, as specified by this block.
207 !% A small plain-text file <tt>current-flow</tt> will be written containing this information.
208 !% Only available for 1D, 2D, or 3D.
209 !% In the format below, <tt>origin</tt> is a point in the plane.
210 !% <tt>u</tt> and <tt>v</tt> are the (dimensionless) vectors defining the plane;
211 !% they will be normalized. <tt>spacing</tt> is the fineness of the mesh
212 !% on the plane. Integers <tt>nu</tt> and <tt>mu</tt> are the length and
213 !% width of the portion of the plane, in units of <tt>spacing</tt>.
214 !% Thus, the grid points included in the plane are
215 !% <tt>x_ij = origin + i*spacing*u + j*spacing*v</tt>,
216 !% for <tt>nu <= i <= mu</tt> and <tt>nv <= j <= mv</tt>.
217 !% Analogously, in the 2D case, the current flow is calculated through a line;
218 !% in the 1D case, the current flow is calculated through a point. Note that the spacing
219 !% can differ from the one used in the main calculation; an interpolation will be performed.
220 !%
221 !% Example (3D):
222 !%
223 !% <tt>%CurrentThroughPlane
224 !% <br>&nbsp;&nbsp; 0.0 | 0.0 | 0.0 # origin
225 !% <br>&nbsp;&nbsp; 0.0 | 1.0 | 0.0 # u
226 !% <br>&nbsp;&nbsp; 0.0 | 0.0 | 1.0 # v
227 !% <br>&nbsp;&nbsp; 0.2 # spacing
228 !% <br>&nbsp;&nbsp; 0 | 50 # nu | mu
229 !% <br>&nbsp;&nbsp; -50 | 50 # nv | mv
230 !% <br>%</tt>
231 !%
232 !% Example (2D):
233 !%
234 !% <tt>%CurrentThroughPlane
235 !% <br>&nbsp;&nbsp; 0.0 | 0.0 # origin
236 !% <br>&nbsp;&nbsp; 1.0 | 0.0 # u
237 !% <br>&nbsp;&nbsp; 0.2 # spacing
238 !% <br>&nbsp;&nbsp; 0 | 50 # nu | mu
239 !% <br>%</tt>
240 !%
241 !% Example (1D):
242 !%
243 !% <tt>%CurrentThroughPlane
244 !% <br>&nbsp;&nbsp; 0.0 # origin
245 !% <br>%</tt>
246 !%
247 !%End
248
249 select case (space%dim)
250 case (3)
251
252 call parse_block_float(blk, 0, 0, outp%plane%origin(1), units_inp%length)
253 call parse_block_float(blk, 0, 1, outp%plane%origin(2), units_inp%length)
254 call parse_block_float(blk, 0, 2, outp%plane%origin(3), units_inp%length)
255 call parse_block_float(blk, 1, 0, outp%plane%u(1))
256 call parse_block_float(blk, 1, 1, outp%plane%u(2))
257 call parse_block_float(blk, 1, 2, outp%plane%u(3))
258 call parse_block_float(blk, 2, 0, outp%plane%v(1))
259 call parse_block_float(blk, 2, 1, outp%plane%v(2))
260 call parse_block_float(blk, 2, 2, outp%plane%v(3))
261 call parse_block_float(blk, 3, 0, outp%plane%spacing, units_inp%length)
262 call parse_block_integer(blk, 4, 0, outp%plane%nu)
263 call parse_block_integer(blk, 4, 1, outp%plane%mu)
264 call parse_block_integer(blk, 5, 0, outp%plane%nv)
265 call parse_block_integer(blk, 5, 1, outp%plane%mv)
266
267 norm = norm2(outp%plane%u(1:3))
268 if (norm < m_epsilon) then
269 write(message(1), '(a)') 'u-vector for CurrentThroughPlane cannot have norm zero.'
270 call messages_fatal(1, namespace=namespace)
271 end if
272 outp%plane%u(1:3) = outp%plane%u(1:3) / norm
273
274 norm = norm2(outp%plane%v(1:3))
275 if (norm < m_epsilon) then
276 write(message(1), '(a)') 'v-vector for CurrentThroughPlane cannot have norm zero.'
277 call messages_fatal(1, namespace=namespace)
278 end if
279 outp%plane%v(1:3) = outp%plane%v(1:3) / norm
280
281 outp%plane%n(1:3) = dcross_product(outp%plane%u(1:3), outp%plane%v(1:3))
282
283 case (2)
284
285 call parse_block_float(blk, 0, 0, outp%line%origin(1), units_inp%length)
286 call parse_block_float(blk, 0, 1, outp%line%origin(2), units_inp%length)
287 call parse_block_float(blk, 1, 0, outp%line%u(1))
288 call parse_block_float(blk, 1, 1, outp%line%u(2))
289 call parse_block_float(blk, 2, 0, outp%line%spacing, units_inp%length)
290 call parse_block_integer(blk, 3, 0, outp%line%nu)
291 call parse_block_integer(blk, 3, 1, outp%line%mu)
292
293 norm = norm2(outp%line%u(1:2))
294 if (norm < m_epsilon) then
295 write(message(1), '(a)') 'u-vector for CurrentThroughPlane cannot have norm zero.'
296 call messages_fatal(1, namespace=namespace)
297 end if
298 outp%line%u(1:2) = outp%line%u(1:2) / norm
299
300 outp%line%n(1) = -outp%line%u(2)
301 outp%line%n(2) = outp%line%u(1)
302
303 case (1)
304
305 call parse_block_float(blk, 0, 0, outp%line%origin(1), units_inp%length)
306
307 case default
308
309 call messages_not_implemented("CurrentThroughPlane for 4D or higher", namespace=namespace)
310
311 end select
312 call parse_block_end(blk)
313 end if
314
315 if (outp%what(option__output__matrix_elements)) then
316 call output_me_init(outp%me, namespace, space, st, gr, nst)
317 else
318 outp%me%what = .false.
319 end if
320
321 if (outp%what(option__output__berkeleygw)) then
322 if (accel_is_enabled()) then
323 message(1) = "BerkeleyGW is not compatible with GPUs."
324 call messages_fatal(1, namespace=namespace)
325 end if
326 call output_berkeleygw_init(nst, namespace, outp%bgw, space%periodic_dim)
327 end if
328
329 ! required for output_hamiltonian()
330 if (outp%what(option__output__potential_gradient) .and. .not. outp%what(option__output__potential)) then
331 outp%what(option__output__potential) = .true.
332 outp%output_interval(option__output__potential) = outp%output_interval(option__output__potential_gradient)
333 end if
334
335
336 !%Variable OutputDuringSCF
337 !%Type logical
338 !%Default no
339 !%Section Output
340 !%Description
341 !% During <tt>gs</tt> and <tt>unocc</tt> runs, if this variable is set to yes,
342 !% output will be written after every <tt>OutputInterval</tt> iterations.
343 !%End
344 call parse_variable(namespace, 'OutputDuringSCF', .false., outp%duringscf)
345
346 if (parse_is_defined(namespace, 'RestartWriteInterval')) then
347 write(message(1), '(a)') 'Input variable RestartWriteInterval is obsolete.'
348 write(message(2), '(a)') 'Restart files are now written in periods of the wallclock time'
349 write(message(3), '(a)') 'given by RestartWallTimePeriod, so you can simply delete this variable.'
350 call messages_fatal(3, only_root_writes=.true., namespace=namespace)
351 end if
352
353 !%Variable OutputIterDir
354 !%Default "output_iter"
355 !%Type string
356 !%Section Output
357 !%Description
358 !% The name of the directory where <tt>Octopus</tt> stores information
359 !% such as the density, forces, etc. requested by variable <tt>Output</tt>
360 !% in the format specified by <tt>OutputFormat</tt>.
361 !% This information is written while iterating <tt>CalculationMode = gs</tt>, <tt>unocc</tt>, or <tt>td</tt>,
362 !% according to <tt>OutputInterval</tt>, and has nothing to do with the restart information.
363 !%End
364 call parse_variable(namespace, 'OutputIterDir', "output_iter", outp%iter_dir)
365 if (any(outp%what) .and. any(outp%output_interval > 0)) then
366 call io_mkdir(outp%iter_dir, namespace)
367 end if
368 call add_last_slash(outp%iter_dir)
369
370 ! At this point, we don`t know whether the states will be real or complex.
371 ! We therefore pass .false. to states_are_real, and need to check for real states later.
372
373 if (output_needs_current(outp, .false.)) then
374 call v_ks_calculate_current(ks, .true.)
375 else
376 call v_ks_calculate_current(ks, .false.)
377 end if
378
379 if (outp%what(option__output__current_dia)) then
380 message(1) = "The diamagnetic current will be calculated only if CalculateDiamagneticCurrent = yes."
381 call messages_warning(1, namespace=namespace)
382 end if
383
384 pop_sub(output_init)
385 end subroutine output_init
386
387 ! ---------------------------------------------------------
400 subroutine output_check_generalized_overlap(outp, st, namespace, has_paw)
401 type(output_t), intent(in) :: outp
402 type(states_elec_t), intent(in) :: st
403 type(namespace_t), intent(in) :: namespace
404 logical, intent(in) :: has_paw
405
407
408 if (st%requires_generalized_overlap) then
409 ! The current density stays experimental. It carries the smooth current, the nonlocal
410 ! [r,V_nl] commutator and the Q_ij augmentation current, which is the correct current of the
411 ! *augmented* density and matches the macroscopic dipole velocity to O(q_ij) for ultrasoft.
412 ! For PAW the augmentation (overlap) charges are large, and the local current density is
413 ! missing the one-center partial-wave correction j^1 - jtilde^1, so the integrated current
414 ! density can differ substantially from the (rigorous) dipole velocity d<X^>/dt. Until that
415 ! one-center current is implemented, the current density is only qualitative for PAW.
416 if (outp%what(option__output__current) .or. outp%what(option__output__current_dia) .or. &
417 outp%what(option__output__current_kpt) .or. outp%what(option__output__j_flow)) then
418 call messages_experimental("Output of the current density with ultrasoft/PAW", namespace=namespace)
419 end if
420
421 ! The heat (energy) current is a different operator, which is not yet implemented for USPP.
422 if (outp%what(option__output__heat_current)) then
423 call messages_not_implemented("Output of the heat current with ultrasoft/PAW", namespace=namespace)
424 end if
425
426 ! For PAW the kinetic-energy density, ELF and energy density are reconstructed from the
427 ! one-center tau^1 - tautilde^1 (and the density / its gradient for ELF); see
428 ! nonlocal_pseudopotential_reconstruct_paw_field. For plain ultrasoft (no on-site engine)
429 ! that reconstruction is not available, so those outputs are still not correct there.
430 if (.not. has_paw) then
431 if (outp%what(option__output__elf) .or. outp%what(option__output__elf_basins) .or. &
432 outp%what(option__output__energy_density) .or. outp%what(option__output__kinetic_energy_density)) then
434 "Output of ELF / (kinetic-)energy-density with ultrasoft (non-PAW)", namespace=namespace)
435 end if
436 ! Plain ultrasoft pseudopotentials carry no all-electron partial waves, so density_ae and
437 ! wfs_ae would silently be the augmented density and the pseudo-wavefunctions.
438 if (outp%what(option__output__density_ae) .or. outp%what(option__output__wfs_ae)) then
440 "Output of the all-electron density / wavefunctions with ultrasoft (non-PAW)", namespace=namespace)
441 end if
442 end if
443 ! The electronic pressure is not reconstructed (neither for ultrasoft nor for PAW)
444 if (outp%what(option__output__el_pressure)) then
445 call messages_not_implemented("Output of the electronic pressure with ultrasoft/PAW", namespace=namespace)
446 end if
447 ! Matrix elements and orbital projections miss the augmentation (and the S-weighted projection)
448 if (outp%what(option__output__matrix_elements)) then
449 call messages_not_implemented("Output of matrix elements with ultrasoft/PAW", namespace=namespace)
450 end if
451 if (outp%what(option__output__pdos)) then
452 call messages_not_implemented("Output of the projected DOS (pdos) with ultrasoft/PAW", namespace=namespace)
453 end if
454 end if
455
458
459 ! ---------------------------------------------------------
460 subroutine output_all(outp, namespace, space, dir, gr, ions, iter, st, hm, ks)
461 type(output_t), intent(in) :: outp
462 type(namespace_t), intent(in) :: namespace
463 class(space_t), intent(in) :: space
464 character(len=*), intent(in) :: dir
465 type(grid_t), intent(in) :: gr
466 type(ions_t), intent(in) :: ions
467 integer, intent(in) :: iter
468 type(states_elec_t), intent(inout) :: st
469 type(hamiltonian_elec_t), intent(inout) :: hm
470 type(v_ks_t), intent(inout) :: ks
471
472 integer :: idir, ierr, iunit
473 character(len=MAX_PATH_LEN) :: fname
474
475 push_sub(output_all)
476 call profiling_in("OUTPUT_ALL")
477
478 if (any(outp%what)) then
479 message(1) = "Info: Writing output to " // trim(dir)
480 call messages_info(1, namespace=namespace)
481 call io_mkdir(dir, namespace)
482 end if
483
484 if (outp%what_now(option__output__mesh_r, iter)) then
485 do idir = 1, space%dim
486 write(fname, '(a,a)') 'mesh_r-', index2axis(idir)
487 call dio_function_output(outp%how(option__output__mesh_r), dir, fname, namespace, space, &
488 gr, gr%x_t(:,idir), units_out%length, ierr, pos=ions%pos, atoms=ions%atom)
489 end do
490 end if
491
492 call output_states(outp, namespace, space, dir, st, gr, ions, hm, iter)
493 call output_hamiltonian(outp, namespace, space, dir, hm, st, gr%der, ions, gr, iter, st%st_kpt_mpi_grp)
494
495 ! We can only test against the theory level here, as it is not set in the call of output_init().
496 if (outp%what_now(option__output__el_pressure, iter)) then
497 if(ks%theory_level /= kohn_sham_dft) then
498 call messages_not_implemented("el_pressure for TheoryLevel different from kohn_sham", namespace=namespace)
499 end if
500 if (st%d%spin_channels > 1) then
501 call messages_not_implemented("el_pressure for spin-polarized or spinors", namespace=namespace)
502 end if
503 end if
504
505 !hm not initialized yet when calling output_init()
506 if (outp%what(option__output__kanamoriu) .and. hm%lda_u_level /= dft_u_acbn0) then
507 message(1) = "kanamoriU output can only be computed for DFTULevel = dft_u_acbn0"
508 call messages_fatal(1, namespace=namespace)
509 end if
510
511
512 call output_localization_funct(outp, namespace, space, dir, st, hm, gr, ions, iter)
513
514 if (outp%what_now(option__output__j_flow, iter)) then
515 call output_current_flow(outp, namespace, space, dir, gr, st, hm%kpoints)
516 end if
517
518 if (outp%what_now(option__output__geometry, iter)) then
519 if (bitand(outp%how(option__output__geometry), option__outputformat__xcrysden) /= 0) then
520 call write_xsf_geometry_file(dir, "geometry", space, ions%latt, ions%pos, ions%atom, gr, ions%grp, namespace)
521 end if
522 if (bitand(outp%how(option__output__geometry), option__outputformat__xyz) /= 0) then
523 call ions%write_xyz(trim(dir)//'/geometry')
524 if (ions%space%is_periodic()) then
525 call ions%write_crystal(dir)
526 end if
527 end if
528 if (bitand(outp%how(option__output__geometry), option__outputformat__vtk) /= 0) then
529 call ions%write_vtk_geometry(trim(dir)//'/geometry')
530 end if
531 if (bitand(outp%how(option__output__geometry), option__outputformat__poscar) /= 0) then
532 call ions%write_poscar(trim(dir)//'/POSCAR')
533 end if
534 end if
535
536 if (outp%what_now(option__output__forces, iter)) then
537 if (bitand(outp%how(option__output__forces), option__outputformat__bild) /= 0) then
538 call ions%write_bild_forces_file(dir, "forces")
539 else
540 call write_xsf_geometry_file(dir, "forces", space, ions%latt, ions%pos, ions%atom, &
541 gr, st%system_grp, namespace, total_forces = ions%tot_force)
542 end if
543 end if
544
545 if (outp%what_now(option__output__matrix_elements, iter)) then
546 call output_me(outp%me, namespace, space, dir, st, gr, ions, hm)
547 end if
548
549 if (outp%what_now(option__output__berkeleygw, iter)) then
550 call output_berkeleygw(outp%bgw, namespace, space, dir, st, gr, ks, hm, ions)
551 end if
552
553 if (outp%what_now(option__output__energy_density, iter)) then
554 call output_energy_density(outp, namespace, space, dir, hm, ks, st, ions, gr)
555 end if
556
557 if (outp%what_now(option__output__stress, iter)) then
558 call io_mkdir(dir, namespace)
559 iunit = io_open(trim(dir)//'/stress', namespace, action='write')
560 call output_stress(iunit, space%periodic_dim, st%stress_tensors, st%system_grp)
561 call io_close(iunit)
562 end if
563
564 if (hm%lda_u_level /= dft_u_none) then
565 if (outp%what_now(option__output__occ_matrices, iter))&
566 call lda_u_write_occupation_matrices(dir, hm%lda_u, st, namespace)
567
568 if (outp%what_now(option__output__effectiveu, iter))&
569 call lda_u_write_effectiveu(dir, hm%lda_u, st, namespace)
570
571 if (outp%what_now(option__output__magnetization, iter))&
572 call lda_u_write_magnetization(dir, hm%lda_u, ions, gr, st, namespace)
573
574 if (outp%what_now(option__output__local_orbitals, iter))&
575 call output_dftu_orbitals(outp, dir, namespace, space, hm%lda_u, st, gr, ions, hm%phase%is_allocated())
576
577 if (outp%what_now(option__output__kanamoriu, iter))&
578 call lda_u_write_kanamoriu(dir, st, hm%lda_u, namespace)
579
580 if (ks%v_ks_photons%oep_full()) then
581 if (outp%what_now(option__output__photon_correlator, iter)) then
582 write(fname, '(a)') 'photon_correlator'
583 call dio_function_output(outp%how(option__output__photon_correlator), dir, trim(fname), namespace, space, &
584 gr, ks%v_ks_photons%correlator(), units_out%length, ierr, pos=ions%pos, atoms=ions%atom)
585 end if
586 end if
587 end if
588
589 ! We can only test against the theory level here, as it is not set in the call of output_init().
590 if (outp%what_now(option__output__xc_torque, iter)) then
591 if (ks%theory_level /= kohn_sham_dft .and. ks%theory_level /= generalized_kohn_sham_dft) then
592 write(message(1), '(a)') 'The output xc_torque can only be computed when there is a xc potential.'
593 call messages_fatal(1, namespace=namespace)
594 end if
595 end if
596
597 call output_xc_torque(outp, namespace, dir, gr, hm, st, ions, ions%space)
598
599 call profiling_out("OUTPUT_ALL")
600 pop_sub(output_all)
601 end subroutine output_all
602
603
604 ! ---------------------------------------------------------
605 subroutine output_localization_funct(outp, namespace, space, dir, st, hm, gr, ions, iter)
606 type(output_t), intent(in) :: outp
607 type(namespace_t), intent(in) :: namespace
608 class(space_t), intent(in) :: space
609 character(len=*), intent(in) :: dir
610 type(states_elec_t), intent(inout) :: st
611 type(hamiltonian_elec_t), intent(in) :: hm
612 type(grid_t), intent(in) :: gr
613 type(ions_t), intent(in) :: ions
614 integer, intent(in) :: iter
615
616 real(real64), allocatable :: f_loc(:,:)
617 real(real64), allocatable :: rho_paw(:,:), tau_paw(:,:)
618 character(len=MAX_PATH_LEN) :: fname
619 integer :: is, ierr, imax
620 type(mpi_grp_t) :: mpi_grp
621 logical :: paw_ae
622
624
625 mpi_grp = st%dom_st_kpt_mpi_grp
626
627 ! if SPIN_POLARIZED or SPINORS, the ELF contains one extra channel: the total ELF
628 imax = 1
629 if (st%d%ispin /= unpolarized) imax = 3
630
631 safe_allocate(f_loc(1:gr%np, 1:max(imax, st%d%nspin)))
632
633 paw_ae = st%requires_generalized_overlap .and. hm%ep%has_paw
634
635 ! First the ELF in real space
636 if (outp%what_now(option__output__elf, iter) .or. outp%what_now(option__output__elf_basins, iter)) then
637 assert(space%dim /= 1)
638
639 if (paw_ae) then
640 ! PAW: build the one-center density and kinetic-energy-density corrections, so that
641 ! elf_calc forms the all-electron ELF (the density gradient is taken there from the
642 ! all-electron density).
643 safe_allocate(rho_paw(1:gr%np, 1:st%d%nspin))
644 safe_allocate(tau_paw(1:gr%np, 1:st%d%nspin))
645 rho_paw = m_zero
646 tau_paw = m_zero
647 call paw_ae_reconstruct_field(hm%aug_overlap, hm%ep, gr, &
648 density = rho_paw, tau = tau_paw)
649 call elf_calc(space, st, gr, hm%kpoints, f_loc(:, 1:imax), &
650 rho_paw = rho_paw, tau_paw = tau_paw)
651 safe_deallocate_a(rho_paw)
652 safe_deallocate_a(tau_paw)
653 else
654 call elf_calc(space, st, gr, hm%kpoints, f_loc(:, 1:imax))
655 end if
656
657 ! output ELF in real space
658 if (outp%what_now(option__output__elf, iter)) then
659 write(fname, '(a)') 'elf_rs'
660 call dio_function_output(outp%how(option__output__elf), dir, trim(fname), namespace, space, gr, &
661 f_loc(:,imax), unit_one, ierr, pos=ions%pos, atoms=ions%atom, grp = mpi_grp)
662 ! this quantity is dimensionless
663
664 if (st%d%ispin /= unpolarized) then
665 do is = 1, 2
666 write(fname, '(a,i1)') 'elf_rs-sp', is
667 call dio_function_output(outp%how(option__output__elf), dir, trim(fname), namespace, space, gr, &
668 f_loc(:, is), unit_one, ierr, pos=ions%pos, atoms=ions%atom, grp = mpi_grp)
669 ! this quantity is dimensionless
670 end do
671 end if
672 end if
673
674 if (outp%what_now(option__output__elf_basins, iter)) then
675 call out_basins(f_loc(:,imax), "elf_rs_basins", outp%how(option__output__elf_basins))
676 end if
677 end if
678
679 ! Now Bader analysis
680 if (outp%what_now(option__output__bader, iter)) then
681 do is = 1, st%d%nspin
682 call dderivatives_lapl(gr%der, st%rho(:,is), f_loc(:,is))
683
684 fname = get_filename_with_spin('bader', st%d%nspin, is)
685
686 call dio_function_output(outp%how(option__output__bader), dir, trim(fname), namespace, space, gr, &
687 f_loc(:,is), units_out%length**(-2 - space%dim), ierr, &
688 pos=ions%pos, atoms=ions%atom, grp = mpi_grp)
689
690 fname = get_filename_with_spin('bader_basins', st%d%nspin, is)
691 call out_basins(f_loc(:, is), fname, outp%how(option__output__bader))
692 end do
693 end if
694
695 ! Now the pressure
696 if (outp%what_now(option__output__el_pressure, iter)) then
697 call calc_electronic_pressure(st, hm, gr, f_loc(:,1))
698 call dio_function_output(outp%how(option__output__el_pressure), dir, "el_pressure", namespace, space, gr, &
699 f_loc(:,1), unit_one, ierr, pos=ions%pos, atoms=ions%atom, grp = mpi_grp)
700 ! this quantity is dimensionless
701 end if
702
703 safe_deallocate_a(f_loc)
704
706
707 contains
708 ! ---------------------------------------------------------
709 subroutine out_basins(ff, filename, output_how)
710 real(real64), contiguous, intent(in) :: ff(:)
711 character(len=*), intent(in) :: filename
712 integer(int64), intent(in) :: output_how
713
714 character(len=MAX_PATH_LEN) :: fname
715 type(basins_t) :: basins
716 integer :: iunit
717
719
720 call basins_init(basins, namespace, gr)
721 call basins_analyze(basins, namespace, gr, ff(:), st%rho(:, 1:st%d%spin_channels), 0.01_real64)
722
723 call dio_function_output(output_how, dir, trim(filename), namespace, space, gr, &
724 real(basins%map, real64) , unit_one, ierr, pos=ions%pos, atoms=ions%atom, grp = mpi_grp)
725 ! this quantity is dimensionless
726
727 write(fname,'(4a)') trim(dir), '/', trim(filename), '.info'
728 iunit = io_open(trim(fname), namespace, action = 'write')
729 call basins_write(basins, gr, iunit)
730 call io_close(iunit)
731
732 call basins_end(basins)
733
735 end subroutine out_basins
736
737 end subroutine output_localization_funct
738
739
740 ! ---------------------------------------------------------
741 subroutine calc_electronic_pressure(st, hm, gr, pressure)
742 type(states_elec_t), intent(inout) :: st
743 type(hamiltonian_elec_t), intent(in) :: hm
744 type(grid_t), intent(in) :: gr
745 real(real64), contiguous, intent(out) :: pressure(:)
746
747 real(real64), allocatable :: rho(:,:), lrho(:), tau(:,:)
748 real(real64) :: p_tf, dens
749 integer :: is, ii
750
752
753 safe_allocate( rho(1:gr%np_part, 1:st%d%nspin))
754 safe_allocate(lrho(1:gr%np))
755 safe_allocate( tau(1:gr%np, 1:st%d%nspin))
756
757 rho = m_zero
758 call density_calc(st, gr, rho)
759 call states_elec_calc_quantities(gr, st, hm%kpoints, .false., kinetic_energy_density = tau)
760
761 pressure = m_zero
762 do is = 1, st%d%spin_channels
763 lrho = m_zero
764 call dderivatives_lapl(gr%der, rho(:, is), lrho)
765
766 pressure(:) = pressure(:) + &
767 tau(:, is)/m_three - lrho(:)/m_four
768 end do
769
770 do ii = 1, gr%np
771 dens = sum(rho(ii,1:st%d%spin_channels))
772
773 p_tf = m_two/m_five*(m_three*m_pi**2)**(m_two/m_three)* &
774 dens**(m_five/m_three)
775
776 ! add XC pressure
777 ! FIXME: Not correct for spinors and spin-polarized here
778 pressure(ii) = pressure(ii) + (dens*hm%ks_pot%vxc(ii,1) - hm%energy%exchange - hm%energy%correlation)
779
780 pressure(ii) = pressure(ii)/p_tf
781 pressure(ii) = m_half*(m_one + pressure(ii)/sqrt(m_one + pressure(ii)**2))
782 end do
783
785 end subroutine calc_electronic_pressure
786
787
788 ! ---------------------------------------------------------
789 subroutine output_energy_density(outp, namespace, space, dir, hm, ks, st, ions, gr)
790 type(output_t), intent(in) :: outp
791 type(namespace_t), intent(in) :: namespace
792 class(space_t), intent(in) :: space
793 character(len=*), intent(in) :: dir
794 type(hamiltonian_elec_t), intent(in) :: hm
795 type(v_ks_t), intent(inout) :: ks
796 type(states_elec_t), intent(in) :: st
797 type(ions_t), intent(in) :: ions
798 type(grid_t), intent(in) :: gr
799
800 integer :: is, ierr, ip
801 character(len=MAX_PATH_LEN) :: fname
802 type(unit_t) :: fn_unit
803 real(real64), allocatable :: energy_density(:, :)
804 real(real64), allocatable :: ex_density(:)
805 real(real64), allocatable :: ec_density(:)
806 real(real64), allocatable :: nhat(:,:)
807 real(real64) :: xc_energy
808
809 push_sub(output_energy_density)
810
811 fn_unit = units_out%energy*units_out%length**(-space%dim)
812 safe_allocate(energy_density(1:gr%np, 1:st%d%nspin))
814 ! the kinetic energy density
815 call states_elec_calc_quantities(gr, st, hm%kpoints, .true., kinetic_energy_density = energy_density)
816
817 ! PAW: reconstruct the all-electron kinetic-energy density (tau^1 - tautilde^1 one-center
818 ! correction). The potential/XC energy-density terms below stay on the smooth (grid) density,
819 ! which is how PAW represents them on the mesh (the one-center Hartree/XC energy is a separate
820 ! radial correction, not a mesh field), so only the kinetic term carries the one-center piece.
821 if (st%requires_generalized_overlap .and. hm%ep%has_paw) then
822 call paw_ae_reconstruct_field(hm%aug_overlap, hm%ep, gr, tau = energy_density)
823 end if
824
825 ! the external potential energy density
826 do is = 1, st%d%spin_channels
827 do ip = 1, gr%np
828 energy_density(ip, is) = energy_density(ip, is) + st%rho(ip, is)*hm%ep%vpsl(ip)
829 end do
830 end do
831
832 ! the hartree energy density
833 do is = 1, st%d%spin_channels
834 do ip = 1, gr%np
835 energy_density(ip, is) = energy_density(ip, is) + m_half*st%rho(ip, is)*hm%ks_pot%vhartree(ip)
836 end do
837 end do
838
839 ! the XC energy density
840 safe_allocate(ex_density(1:gr%np))
841 safe_allocate(ec_density(1:gr%np))
842
843 call hamiltonian_elec_xc_nhat(hm, gr, nhat)
844 call xc_get_vxc(gr, ks%xc, st, hm%kpoints, hm%psolver, namespace, space, st%rho, st%d%ispin, &
845 hm%ions%latt%rcell_volume, ex_density = ex_density, ec_density = ec_density, nhat = nhat)
846 safe_deallocate_a(nhat)
847 !$omp parallel do private(ip, is, xc_energy)
848 do ip = 1, gr%np
849 xc_energy = ex_density(ip) + ec_density(ip)
850 do is = 1, st%d%spin_channels
851 energy_density(ip, is) = energy_density(ip, is) + xc_energy
852 end do
853 end do
854
855 safe_deallocate_a(ex_density)
856 safe_deallocate_a(ec_density)
857
858 do is = 1, st%d%spin_channels
859 fname = get_filename_with_spin('energy_density', st%d%nspin, is)
860 call dio_function_output(outp%how(option__output__energy_density), dir, trim(fname), namespace, space, gr, &
861 energy_density(:, is), unit_one, ierr, pos=ions%pos, atoms=ions%atom, grp = st%dom_st_kpt_mpi_grp)
862 end do
863 safe_deallocate_a(energy_density)
864
865 pop_sub(output_energy_density)
866 end subroutine output_energy_density
867
868 !--------------------------------------------------------------
869
870 logical function output_need_exchange(outp) result(need_exx)
871 type(output_t), intent(in) :: outp
872
873 need_exx =(outp%what(option__output__berkeleygw) &
874 .or. outp%me%what(option__outputmatrixelements__two_body) &
875 .or. outp%me%what(option__outputmatrixelements__two_body_exc_k))
876 end function output_need_exchange
877
878
879 ! ---------------------------------------------------------
880 subroutine output_dftu_orbitals(outp, dir, namespace, space, this, st, mesh, ions, has_phase)
881 type(output_t), intent(in) :: outp
882 character(len=*), intent(in) :: dir
883 type(namespace_t), intent(in) :: namespace
884 class(space_t), intent(in) :: space
885 type(lda_u_t), intent(in) :: this
886 type(states_elec_t), intent(in) :: st
887 class(mesh_t), intent(in) :: mesh
888 type(ions_t), intent(in) :: ions
889 logical, intent(in) :: has_phase
890
891 integer :: ios, im, ik, idim, ierr
892 complex(real64), allocatable :: tmp(:)
893 real(real64), allocatable :: dtmp(:)
894 type(orbitalset_t), pointer :: os
895 type(unit_t) :: fn_unit
896 character(len=MAX_PATH_LEN) :: fname
897
898 push_sub(output_dftu_orbitals)
899
900 fn_unit = sqrt(units_out%length**(-space%dim))
901
902 if (this%basis%use_submesh) then
903 if (states_are_real(st)) then
904 safe_allocate(dtmp(1:mesh%np))
905 else
906 safe_allocate(tmp(1:mesh%np))
907 end if
908 end if
909
910 do ios = 1, this%norbsets
911 os => this%orbsets(ios)
912 do ik = st%d%kpt%start, st%d%kpt%end
913 do im = 1, this%orbsets(ios)%norbs
914 do idim = 1, min(os%ndim, st%d%dim)
915 if (st%nik > 1) then
916 if (min(os%ndim, st%d%dim) > 1) then
917 write(fname, '(a,i1,a,i3.3,a,i8.8,a,i1)') 'orb', im, '-os', ios, '-k', ik, '-sp', idim
918 else
919 write(fname, '(a,i1,a,i3.3,a,i8.8)') 'orb', im, '-os', ios, '-k', ik
920 end if
921 else
922 if (min(os%ndim, st%d%dim) > 1) then
923 write(fname, '(a,i1,a,i3.3,a,i1)') 'orb', im, '-os', ios, '-sp', idim
924 else
925 write(fname, '(a,i1,a,i3.3)') 'orb', im, '-os', ios
926 end if
927 end if
928 if (has_phase) then
929 if (.not. this%basis%use_submesh) then
930 call zio_function_output(outp%how(option__output__local_orbitals), dir, fname, namespace, space, &
931 mesh, os%eorb_mesh(1:mesh%np,im,idim,ik), fn_unit, ierr, pos=ions%pos, atoms=ions%atom)
932 else
933 tmp = m_z0
934 call submesh_add_to_mesh(os%sphere, os%eorb_submesh(1:os%sphere%np,idim,im,ik), tmp)
935 call zio_function_output(outp%how(option__output__local_orbitals), dir, fname, namespace, space, &
936 mesh, tmp, fn_unit, ierr, pos=ions%pos, atoms=ions%atom)
937 end if
938 else
939 if (.not. this%basis%use_submesh) then
940 if (states_are_real(st)) then
941 call dio_function_output(outp%how(option__output__local_orbitals), dir, fname, namespace, space, mesh, &
942 os%dorb(1:mesh%np,idim,im), fn_unit, ierr, pos=ions%pos, atoms=ions%atom)
943 else
944 call zio_function_output(outp%how(option__output__local_orbitals), dir, fname, namespace, space, mesh, &
945 os%zorb(1:mesh%np,idim,im), fn_unit, ierr, pos=ions%pos, atoms=ions%atom)
946 end if
947 else
948 if (states_are_real(st)) then
949 dtmp = m_zero
950 call submesh_add_to_mesh(os%sphere, os%dorb(1:os%sphere%np,idim,im), dtmp)
951 call dio_function_output(outp%how(option__output__local_orbitals), dir, fname, namespace, space, &
952 mesh, dtmp, fn_unit, ierr, pos=ions%pos, atoms=ions%atom)
953 else
954 tmp = m_z0
955 call submesh_add_to_mesh(os%sphere, os%zorb(1:os%sphere%np,idim,im), tmp)
956 call zio_function_output(outp%how(option__output__local_orbitals), dir, fname, namespace, space, &
957 mesh, tmp, fn_unit, ierr, pos=ions%pos, atoms=ions%atom)
958 end if
959 end if
960 end if
961 end do
962 end do
963 end do
964 end do
965
966 safe_deallocate_a(tmp)
967 safe_deallocate_a(dtmp)
968
969 pop_sub(output_dftu_orbitals)
970 end subroutine output_dftu_orbitals
971
972 ! ---------------------------------------------------------
973 logical function output_needs_current(outp, states_are_real)
974 type(output_t), intent(in) :: outp
975 logical, intent(in) :: states_are_real
976
977 output_needs_current = .false.
978
979 if (outp%what(option__output__current) &
980 .or. outp%what(option__output__current_dia) &
981 .or. outp%what(option__output__heat_current) &
982 .or. outp%what(option__output__j_flow) &
983 .or. outp%what(option__output__current_kpt)) then
984 if (.not. states_are_real) then
986 else
987 message(1) = 'No current density output for real states since it is identically zero.'
988 call messages_warning(1)
989 end if
990 end if
991
992
993 end function
994
995#include "output_states_inc.F90"
996
997#include "output_h_inc.F90"
998
999#include "undef.F90"
1000#include "complex.F90"
1001#include "output_linear_response_inc.F90"
1002
1003#include "undef.F90"
1004#include "real.F90"
1005#include "output_linear_response_inc.F90"
1006
1007end module output_oct_m
1008
1009!! Local Variables:
1010!! mode: f90
1011!! coding: utf-8
1012!! End:
pure logical function, public accel_is_enabled()
Definition: accel.F90:391
subroutine, public basins_write(this, mesh, iunit)
Definition: basins.F90:331
subroutine, public basins_init(this, namespace, mesh)
Definition: basins.F90:130
subroutine, public basins_analyze(this, namespace, mesh, f, rho, threshold)
Definition: basins.F90:167
subroutine, public basins_end(this)
Definition: basins.F90:149
This module implements a calculator for the density and defines related functions.
Definition: density.F90:99
subroutine, public density_calc(st, gr, density, istin, ep, vnl, phase)
Computes the density from the orbitals in st.
Definition: density.F90:839
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dderivatives_lapl(der, ff, op_ff, ghost_update, set_bc, factor)
apply the Laplacian to a mesh function
Module that handles computing and output of various density of states.
Definition: dos.F90:95
integer, parameter, public unpolarized
Parameters...
integer, parameter, public spinors
subroutine, public elf_calc(space, st, gr, kpoints, elf, de, rho_paw, tau_paw)
(time-dependent) electron localization function, (TD)ELF.
Definition: elf.F90:147
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
Definition: fft.F90:97
real(real64), parameter, public m_two
Definition: global.F90:175
real(real64), parameter, public m_zero
Definition: global.F90:173
real(real64), parameter, public m_four
Definition: global.F90:177
real(real64), parameter, public m_pi
some mathematical constants
Definition: global.F90:171
complex(real64), parameter, public m_z0
Definition: global.F90:183
integer, parameter, public generalized_kohn_sham_dft
Definition: global.F90:223
integer, parameter, public kohn_sham_dft
Definition: global.F90:223
real(real64), parameter, public m_epsilon
Definition: global.F90:189
real(real64), parameter, public m_half
Definition: global.F90:179
real(real64), parameter, public m_one
Definition: global.F90:174
real(real64), parameter, public m_three
Definition: global.F90:176
real(real64), parameter, public m_five
Definition: global.F90:178
This module implements the underlying real-space grid.
Definition: grid.F90:96
subroutine, public hamiltonian_elec_xc_nhat(this, mesh, nhat)
PAW with the Bloechl compensation scheme (usexcnhat = false): the compensation charge n^hat_s(r) = su...
This module defines classes and functions for interaction partners.
subroutine, public zio_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.
subroutine, public io_function_read_what_how_when(namespace, space, what, how, output_interval, what_tag_in, how_tag_in, output_interval_tag_in, ignore_error)
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.
subroutine, public write_xsf_geometry_file(dir, fname, space, latt, pos, atoms, mesh, mpi_grp, namespace, total_forces)
Definition: io.F90:93
subroutine, public io_close(iunit, grp)
Definition: io.F90:444
subroutine, public io_mkdir(fname, namespace, parents)
Definition: io.F90:338
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
Definition: io.F90:379
A module to handle KS potential, without the external potential.
subroutine, public lda_u_write_occupation_matrices(dir, this, st, namespace)
Prints the occupation matrices at the end of the scf calculation.
Definition: lda_u_io.F90:135
subroutine, public lda_u_write_kanamoriu(dir, st, this, namespace)
Definition: lda_u_io.F90:329
subroutine, public lda_u_write_effectiveu(dir, this, st, namespace)
Definition: lda_u_io.F90:243
subroutine, public lda_u_write_magnetization(dir, this, ions, mesh, st, namespace)
Definition: lda_u_io.F90:457
integer, parameter, public dft_u_none
Definition: lda_u.F90:188
integer, parameter, public dft_u_acbn0
Definition: lda_u.F90:188
System information (time, memory, sysname)
Definition: loct.F90:94
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:94
pure real(real64) function, dimension(1:3), public dcross_product(a, b)
Definition: math.F90:2053
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:97
subroutine, public messages_not_implemented(feature, namespace)
Definition: messages.F90:1048
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:501
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:138
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:386
subroutine, public messages_experimental(name, namespace)
Definition: messages.F90:1020
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:570
subroutine, public output_berkeleygw(bgw, namespace, space, dir, st, gr, ks, hm, ions)
subroutine, public output_berkeleygw_init(nst, namespace, bgw, periodic_dim)
this module contains the low-level part of the output system
Definition: output_low.F90:94
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:210
subroutine, public output_me_init(this, namespace, space, st, gr, nst)
Definition: output_me.F90:134
subroutine, public output_me(this, namespace, space, dir, st, gr, ions, hm)
Definition: output_me.F90:265
this module contains the output system
Definition: output.F90:94
subroutine calc_electronic_pressure(st, hm, gr, pressure)
Definition: output.F90:814
subroutine, public output_states(outp, namespace, space, dir, st, gr, ions, hm, iter)
Definition: output.F90:1088
subroutine, public output_scalar_pot(outp, namespace, space, dir, mesh, ions, ext_partners, grp, time)
Definition: output.F90:1805
logical function, public output_needs_current(outp, states_are_real)
Definition: output.F90:1046
subroutine, public output_hamiltonian(outp, namespace, space, dir, hm, st, der, ions, gr, iter, grp)
Definition: output.F90:1521
subroutine, public output_all(outp, namespace, space, dir, gr, ions, iter, st, hm, ks)
Definition: output.F90:533
logical function, public output_need_exchange(outp)
Definition: output.F90:943
subroutine, public output_init(outp, namespace, space, st, gr, nst, ks)
Definition: output.F90:187
subroutine output_xc_torque(outp, namespace, dir, mesh, hm, st, ions, space)
Definition: output.F90:1843
subroutine, public output_current_flow(outp, namespace, space, dir, gr, st, kpoints)
Definition: output.F90:1406
subroutine, public zoutput_lr(outp, namespace, space, dir, st, mesh, lr, idir, isigma, ions, pert_unit)
Definition: output.F90:1950
subroutine, public doutput_lr(outp, namespace, space, dir, st, mesh, lr, idir, isigma, ions, pert_unit)
Definition: output.F90:2188
subroutine output_energy_density(outp, namespace, space, dir, hm, ks, st, ions, gr)
Definition: output.F90:862
subroutine output_dftu_orbitals(outp, dir, namespace, space, this, st, mesh, ions, has_phase)
Definition: output.F90:953
subroutine, public output_check_generalized_overlap(outp, st, namespace, has_paw)
Fence the requested outputs that are not yet correct with a generalized overlap.
Definition: output.F90:473
subroutine output_localization_funct(outp, namespace, space, dir, st, hm, gr, ions, iter)
Definition: output.F90:678
logical function, public parse_is_defined(namespace, name)
Definition: parser.F90:440
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:600
All-electron reconstruction of mesh fields from the PAW one-center terms.
subroutine, public paw_ae_reconstruct_field(this, epot, mesh, density, tau, current)
Reconstruct all-electron mesh fields from the PAW one-center terms. Any subset of the supported quant...
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
Definition: profiling.F90:122
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
Definition: profiling.F90:672
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
Definition: profiling.F90:604
pure logical function, public states_are_real(st)
This module defines routines to write information about states.
subroutine, public states_elec_calc_quantities(gr, st, kpoints, nlcc, kinetic_energy_density, paramagnetic_current, density_gradient, density_laplacian, gi_kinetic_energy_density, st_end)
calculated selected quantities
This module implements the calculation of the stress tensor.
Definition: stress.F90:97
subroutine, public output_stress(iunit, space_dim, stress_tensors, mpi_grp, all_terms)
Definition: stress.F90:1377
subroutine, public add_last_slash(str)
Adds a '/' in the end of the string, only if it missing. Useful for directories.
Definition: string.F90:139
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:111
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
This module is intended to contain simple general-purpose utility functions and procedures.
Definition: utils.F90:99
character pure function, public index2axis(idir)
Definition: utils.F90:191
subroutine, public v_ks_calculate_current(this, calc_cur)
Definition: v_ks.F90:1565
Definition: xc.F90:97
subroutine, public xc_get_vxc(gr, xcs, st, kpoints, psolver, namespace, space, rho, ispin, rcell_volume, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc, force_orbitalfree, force_host, nhat)
Definition: xc_vxc.F90:168
subroutine out_basins(ff, filename, output_how)
Definition: output.F90:782
Description of the grid, containing information on derivatives, stencil, and symmetries.
Definition: grid.F90:148
Class to describe DFT+U parameters.
Definition: lda_u.F90:201
Describes mesh distribution to nodes.
Definition: mesh.F90:165
This is defined even when running serial.
Definition: mpi.F90:121
Output information for BerkeleyGW.
Definition: output_low.F90:124
output handler class
Definition: output_low.F90:143
The states_elec_t class contains all electronic wave functions.
int true(void)