20#define RESTART_FILE 'dipoles'
32 use,
intrinsic :: iso_fortran_env
64 class(*),
intent(inout) :: system
65 logical,
intent(in) :: from_scratch
71 message(1) =
"CalculationMode = static_pol not implemented for multi-system calculations"
84 type(electrons_t),
intent(inout) :: sys
85 logical,
intent(in) :: fromScratch
88 integer :: iunit, ios, i_start, ii, jj, is, isign, ierr, read_count, verbosity
89 real(real64) :: e_field, e_field_saved
90 real(real64),
allocatable :: Vpsl_save(:), trrho(:), dipole(:, :, :)
91 real(real64),
allocatable :: elf(:,:), lr_elf(:,:), elfd(:,:), lr_elfd(:,:)
92 real(real64),
allocatable :: lr_rho(:,:), lr_rho2(:,:), gs_rho(:,:), tmp_rho(:,:)
93 real(real64) :: center_dipole(1:sys%space%dim), diag_dipole(1:sys%space%dim), ionic_dipole(1:sys%space%dim), &
94 print_dipole(1:sys%space%dim)
95 type(born_charges_t) :: born_charges
96 logical :: calc_born, start_density_is_zero_field, write_restart_densities, calc_diagonal, verbose
97 logical :: diagonal_done, center_written, fromScratch_local, field_written
98 character(len=MAX_PATH_LEN) :: fname, dir_name
99 character(len=120) :: line(1)
100 character :: sign_char
101 type(restart_t) :: gs_restart, restart_load, restart_dump
105 if (sys%hm%pcm%run_pcm)
then
109 if (sys%kpoints%use_symmetries)
then
110 call messages_experimental(
"KPoints symmetries with CalculationMode = em_resp", namespace=sys%namespace)
118 call states_elec_load(gs_restart, sys%namespace, sys%space, sys%st, sys%gr, sys%kpoints, &
119 fixed_occ=.false., ierr=ierr)
122 message(1) =
"Unable to read wavefunctions."
127 if (sys%space%is_periodic())
then
128 message(1) =
"Electric field cannot be applied to a periodic system (currently)."
133 message(1) =
'Info: Setting up Hamiltonian.'
135 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, &
136 sys%hm, calc_eigenval = .false.)
139 safe_allocate(dipole(1:sys%space%dim, 1:sys%space%dim, 1:2))
143 center_written = .false.
144 diagonal_done = .false.
145 field_written = .false.
149 if (.not. fromscratch)
then
157 if (iunit /= -1)
then
161 read(iunit, fmt=*, iostat = ios) e_field_saved
162 field_written = (ios == 0)
164 read(iunit, fmt=*, iostat = ios) (center_dipole(jj), jj = 1, sys%space%dim)
165 center_written = (ios == 0)
167 do ii = 1, sys%space%dim
168 read(iunit, fmt=*, iostat = ios) ((dipole(ii, jj, isign), jj = 1, sys%space%dim), isign = 1, 2)
170 i_start = i_start + 1
173 read(iunit, fmt=*, iostat = ios) (diag_dipole(jj), jj = 1, sys%space%dim)
174 diagonal_done = (ios == 0)
180 if (field_written .and. abs(e_field_saved - e_field) >
m_epsilon)
then
181 message(1) =
"Saved dipoles are from a different electric field, cannot use them."
183 center_written = .false.
184 diagonal_done = .false.
188 read_count = (i_start - 1) * 2
189 if (center_written) read_count = read_count + 1
190 if (diagonal_done) read_count = read_count + 1
191 write(
message(1),
'(a,i5,a)')
"Using ", read_count,
" dipole(s) from file."
195 if (sys%outp%what(option__output__density) .or. &
196 sys%outp%what(option__output__pol_density))
then
197 if (i_start > 2 .and. calc_diagonal)
then
199 diagonal_done = .false.
204 if (i_start == 1)
then
206 iunit =
restart_open(restart_dump, restart_file, status=
'replace')
207 write(line(1), fmt=
'(e20.12)') e_field
210 message(1) =
"Unsuccessful write of electric field."
214 center_written = .false.
218 safe_allocate(vpsl_save(1:sys%gr%np))
219 vpsl_save = sys%hm%ep%Vpsl
222 safe_allocate(trrho(1:sys%gr%np))
223 safe_allocate(gs_rho(1:sys%gr%np, 1:sys%st%d%nspin))
224 safe_allocate(tmp_rho(1:sys%gr%np, 1:sys%st%d%nspin))
229 call scf_init(scfv, sys%namespace, sys%gr, sys%ions, sys%st, sys%mc, sys%hm, sys%space)
230 call born_charges_init(born_charges, sys%namespace, sys%ions%natoms, sys%st%val_charge, &
231 sys%st%qtot, sys%space%dim)
235 sys%hm%ep%vpsl(1:sys%gr%np) = vpsl_save(1:sys%gr%np)
236 call sys%hm%update(sys%gr, sys%namespace, sys%space, sys%ext_partners)
239 write(
message(2),
'(a)')
'Info: Calculating dipole moment for zero field.'
241 call scf_run(scfv, sys%namespace, sys%space, sys%mc, sys%gr, sys%ions, sys%ext_partners, sys%st, &
242 sys%ks, sys%hm, verbosity = verbosity)
244 gs_rho(1:sys%gr%np, 1:sys%st%d%nspin) = sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin)
246 do is = 1, sys%st%d%spin_channels
247 trrho(1:sys%gr%np) = trrho(1:sys%gr%np) + gs_rho(1:sys%gr%np, is)
251 do jj = 1, sys%space%dim
252 center_dipole(jj) =
dmf_moment(sys%gr, trrho, jj, 1)
256 if (.not. center_written)
then
257 iunit =
restart_open(restart_dump, restart_file, position=
'append')
258 write(line(1), fmt=
'(6e20.12)') (center_dipole(jj), jj = 1, sys%space%dim)
261 message(1) =
"Unsuccessful write of center dipole."
268 ionic_dipole(1:sys%space%dim) = sys%ions%dipole()
269 print_dipole(1:sys%space%dim) = center_dipole(1:sys%space%dim) + ionic_dipole(1:sys%space%dim)
270 call output_dipole(print_dipole, sys%space%dim, namespace=sys%namespace)
273 do ii = i_start, sys%space%dim
276 write(
message(2),
'(a,f6.4,5a)')
'Info: Calculating dipole moment for field ', &
283 sys%hm%ep%vpsl(1:sys%gr%np) = vpsl_save(1:sys%gr%np) + (-1)**isign * sys%gr%x(1:sys%gr%np, ii) * e_field
284 call sys%hm%update(sys%gr, sys%namespace, sys%space, sys%ext_partners)
292 write(dir_name,
'(a)')
"field_"//
index2axis(ii)//sign_char
293 fromscratch_local = fromscratch
295 if (.not. fromscratch)
then
298 call states_elec_load(restart_load, sys%namespace, sys%space, sys%st, sys%gr, sys%kpoints, &
299 fixed_occ=.false., ierr=ierr)
301 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, sys%hm)
302 if (ierr /= 0) fromscratch_local = .
true.
306 if (fromscratch_local)
then
307 if (start_density_is_zero_field)
then
308 sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin) = gs_rho(1:sys%gr%np, 1:sys%st%d%nspin)
309 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, sys%hm)
311 call lcao_run(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, &
312 sys%hm, lmm_r = scfv%lmm_r)
317 call scf_run(scfv, sys%namespace, sys%space, sys%mc, sys%gr, sys%ions, sys%ext_partners, sys%st, &
318 sys%ks, sys%hm, verbosity = verbosity)
321 do is = 1, sys%st%d%spin_channels
322 trrho(1:sys%gr%np) = trrho(1:sys%gr%np) + sys%st%rho(1:sys%gr%np, is)
326 do jj = 1, sys%space%dim
327 dipole(ii, jj, isign) =
dmf_moment(sys%gr, trrho, jj, 1)
331 print_dipole(1:sys%space%dim) = dipole(ii, 1:sys%space%dim, isign) + ionic_dipole(1:sys%space%dim)
332 call output_dipole(print_dipole, sys%space%dim, namespace=sys%namespace)
337 if (write_restart_densities)
then
340 call states_elec_dump(restart_dump, sys%space, sys%st, sys%gr, sys%kpoints, ierr)
344 message(1) =
'Unable to write states wavefunctions.'
351 iunit =
restart_open(restart_dump, restart_file, position=
'append')
352 write(line(1),
'(6e20.12)') ((dipole(ii, jj, isign), jj = 1, sys%space%dim), isign = 1, 2)
355 message(1) =
"Unsuccessful write of dipole."
361 if (.not. diagonal_done .and. calc_diagonal)
then
363 write(
message(2),
'(a,f6.4,3a, f6.4, 3a)')
'Info: Calculating dipole moment for field ', &
370 sys%hm%ep%vpsl(1:sys%gr%np) = vpsl_save(1:sys%gr%np) &
371 - (sys%gr%x(1:sys%gr%np, 2) + sys%gr%x(1:sys%gr%np, 3)) * e_field
372 call sys%hm%update(sys%gr, sys%namespace, sys%space, sys%ext_partners)
380 fromscratch_local = fromscratch
382 if (.not. fromscratch)
then
385 call states_elec_load(restart_load, sys%namespace, sys%space, sys%st, sys%gr, sys%kpoints, &
386 fixed_occ=.false., ierr=ierr)
388 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, sys%hm)
389 if (ierr /= 0) fromscratch_local = .
true.
393 if (fromscratch_local)
then
394 if (start_density_is_zero_field)
then
395 sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin) = gs_rho(1:sys%gr%np, 1:sys%st%d%nspin)
396 call v_ks_h_setup(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, sys%hm)
398 call lcao_run(sys%namespace, sys%space, sys%gr, sys%ions, sys%ext_partners, sys%st, sys%ks, &
399 sys%hm, lmm_r = scfv%lmm_r)
404 call scf_run(scfv, sys%namespace, sys%space, sys%mc, sys%gr, sys%ions, sys%ext_partners, sys%st, &
405 sys%ks, sys%hm, verbosity = verbosity)
408 do is = 1, sys%st%d%spin_channels
409 trrho(1:sys%gr%np) = trrho(1:sys%gr%np) + sys%st%rho(1:sys%gr%np, is)
413 do jj = 1, sys%space%dim
414 diag_dipole(jj) =
dmf_moment(sys%gr, trrho, jj, 1)
418 print_dipole(1:sys%space%dim) = diag_dipole(1:sys%space%dim) + ionic_dipole(1:sys%space%dim)
419 call output_dipole(print_dipole, sys%space%dim, namespace=sys%namespace)
423 iunit =
restart_open(restart_dump, restart_file, position=
'append')
424 write(line(1), fmt=
'(3e20.12)') (diag_dipole(jj), jj = 1, sys%space%dim)
427 message(1) =
"Unsuccessful write of dipole."
432 if (write_restart_densities)
then
435 call states_elec_dump(restart_dump, sys%space, sys%st, sys%gr, sys%kpoints, ierr)
439 message(1) =
'Unable to write states wavefunctions.'
446 if (.not. fromscratch)
call restart_end(restart_load)
451 safe_deallocate_a(vpsl_save)
452 safe_deallocate_a(trrho)
453 safe_deallocate_a(gs_rho)
454 safe_deallocate_a(tmp_rho)
455 safe_deallocate_a(dipole)
477 if (e_field <=
m_zero)
then
478 write(
message(1),
'(a,e14.6,a)')
"Input: '", e_field,
"' is not a valid EMStaticElectricField."
479 message(2) =
'(Must have EMStaticElectricField > 0)'
484 call parse_variable(sys%namespace,
'EMCalcbornCharges', .false., calc_born)
485 if (calc_born)
call messages_experimental(
"Calculation of born effective charges", namespace=sys%namespace)
498 call parse_variable(sys%namespace,
'EMStartDensityIsZeroField', .
true., start_density_is_zero_field)
519 call parse_variable(sys%namespace,
'EMWriteRestartDensities', .
true., write_restart_densities)
556 if (sys%outp%what(option__output__density) .or. &
557 sys%outp%what(option__output__pol_density))
then
558 safe_allocate(lr_rho(1:sys%gr%np, 1:sys%st%d%nspin))
559 safe_allocate(lr_rho2(1:sys%gr%np, 1:sys%st%d%nspin))
562 if (sys%outp%what(option__output__elf))
then
563 safe_allocate( elf(1:sys%gr%np, 1:sys%st%d%nspin))
564 safe_allocate( lr_elf(1:sys%gr%np, 1:sys%st%d%nspin))
565 safe_allocate( elfd(1:sys%gr%np, 1:sys%st%d%nspin))
566 safe_allocate(lr_elfd(1:sys%gr%np, 1:sys%st%d%nspin))
582 do iatom = 1, sys%ions%natoms
585 born_charges%charge(ii, 1:sys%space%dim, iatom) = sys%ions%tot_force(:, iatom)
587 born_charges%charge(ii, 1:sys%space%dim, iatom) = &
588 (sys%ions%tot_force(:, iatom) - born_charges%charge(ii, 1:sys%space%dim, iatom)) &
590 born_charges%charge(ii, ii, iatom) = born_charges%charge(ii, ii, iatom) + sys%ions%charge(iatom)
599 if (sys%outp%what(option__output__density) .or. &
600 sys%outp%what(option__output__pol_density))
then
602 if (isign == 1 .and. ii == 2)
then
603 tmp_rho(1:sys%gr%np, 1:sys%st%d%nspin) = sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin)
609 lr_rho(1:sys%gr%np, 1:sys%st%d%nspin) = sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin)
611 lr_rho2(1:sys%gr%np, 1:sys%st%d%nspin) = &
612 -(sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin) + lr_rho(1:sys%gr%np, 1:sys%st%d%nspin) - &
613 2 * gs_rho(1:sys%gr%np, 1:sys%st%d%nspin)) / e_field**2
615 lr_rho(1:sys%gr%np, 1:sys%st%d%nspin) = &
616 (sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin) - lr_rho(1:sys%gr%np, 1:sys%st%d%nspin)) / (
m_two*e_field)
619 do is = 1, sys%st%d%nspin
620 if (sys%outp%what(option__output__density))
then
622 write(fname,
'(a,i1,2a)')
'fd_density-sp', is,
'-',
index2axis(ii)
624 sys%namespace, sys%space, sys%gr, lr_rho(:, is), fn_unit, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
628 do jj = ii, sys%space%dim
631 sys%namespace, sys%space, sys%gr, lr_rho2(:, is), fn_unit, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
635 if (sys%outp%what(option__output__pol_density))
then
636 do jj = ii, sys%space%dim
640 sys%namespace, sys%space, sys%gr, -sys%gr%x(:, jj) * lr_rho(:, is), &
641 fn_unit, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
644 write(fname,
'(a,i1,6a)')
'beta_density-sp', is,
'-',
index2axis(ii), &
647 sys%namespace, sys%space, sys%gr, -sys%gr%x(:, jj) * lr_rho2(:, is), &
648 fn_unit, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
657 if (sys%outp%what(option__output__elf))
then
660 call elf_calc(sys%space, sys%st, sys%gr, sys%kpoints, elf, elfd)
662 call elf_calc(sys%space, sys%st, sys%gr, sys%kpoints, lr_elf, lr_elfd)
665 lr_elf(1:sys%gr%np, 1:sys%st%d%nspin) = &
666 ( lr_elf(1:sys%gr%np, 1:sys%st%d%nspin) - elf(1:sys%gr%np, 1:sys%st%d%nspin)) / (
m_two * e_field)
667 lr_elfd(1:sys%gr%np, 1:sys%st%d%nspin) = &
668 (lr_elfd(1:sys%gr%np, 1:sys%st%d%nspin) - elfd(1:sys%gr%np, 1:sys%st%d%nspin)) / (
m_two * e_field)
671 do is = 1, sys%st%d%nspin
672 write(fname,
'(a,i1,2a)')
'lr_elf-sp', is,
'-',
index2axis(ii)
674 sys%namespace, sys%space, sys%gr, lr_elf(:, is),
unit_one, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
675 write(fname,
'(a,i1,2a)')
'lr_elf_D-sp', is,
'-',
index2axis(ii)
677 sys%namespace, sys%space, sys%gr, lr_elfd(:, is),
unit_one, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
689 real(real64) :: alpha(sys%space%dim, sys%space%dim)
690 complex(real64) :: beta(sys%space%dim, sys%space%dim, sys%space%dim)
691 integer :: iunit, idir
693 real(real64) :: freq_factor(3)
699 if ((sys%outp%what(option__output__density) .or. &
700 sys%outp%what(option__output__pol_density)) .and. calc_diagonal)
then
701 lr_rho2(1:sys%gr%np, 1:sys%st%d%nspin) = &
702 -(sys%st%rho(1:sys%gr%np, 1:sys%st%d%nspin) - lr_rho(1:sys%gr%np, 1:sys%st%d%nspin) &
703 - tmp_rho(1:sys%gr%np, 1:sys%st%d%nspin) + gs_rho(1:sys%gr%np, 1:sys%st%d%nspin)) / e_field**2
705 do is = 1, sys%st%d%nspin
706 if (sys%outp%what(option__output__density))
then
708 write(fname,
'(a,i1,a)')
'fd2_density-sp', is,
'-y-z'
710 sys%namespace, sys%space, sys%gr, lr_rho2(:, is), fn_unit, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
713 if (sys%outp%what(option__output__pol_density))
then
715 write(fname,
'(a,i1,a)')
'beta_density-sp', is,
'-x-y-z'
717 sys%namespace, sys%space, sys%gr, -sys%gr%x(:, 1) * lr_rho2(:, is), &
718 fn_unit, ierr, pos=sys%ions%pos, atoms=sys%ions%atom)
727 alpha(1:sys%space%dim, 1:sys%space%dim) = (dipole(1:sys%space%dim, 1:sys%space%dim, 1) - &
728 dipole(1:sys%space%dim, 1:sys%space%dim, 2)) / (
m_two * e_field)
732 do idir = 1, sys%space%dim
733 beta(1:sys%space%dim, idir, idir) = &
734 -(dipole(idir, 1:sys%space%dim, 1) + dipole(idir, 1:sys%space%dim, 2) - &
735 m_two * center_dipole(1:sys%space%dim)) / e_field**2
736 beta(idir, 1:sys%space%dim, idir) = beta(1:sys%space%dim, idir, idir)
737 beta(idir, idir, 1:sys%space%dim) = beta(1:sys%space%dim, idir, idir)
740 assert(sys%space%dim == 3)
742 if (calc_diagonal)
then
743 beta(1, 2, 3) = -(diag_dipole(1) - dipole(2, 1, 1) - dipole(3, 1, 1) + center_dipole(1)) / e_field**2
748 beta(2, 3, 1) = beta(1, 2, 3)
749 beta(3, 1, 2) = beta(1, 2, 3)
750 beta(3, 2, 1) = beta(1, 2, 3)
751 beta(1, 3, 2) = beta(1, 2, 3)
752 beta(2, 1, 3) = beta(1, 2, 3)
766 if (sys%outp%what(option__output__density) .or. &
767 sys%outp%what(option__output__pol_density))
then
768 safe_deallocate_a(lr_rho)
769 safe_deallocate_a(lr_rho2)
772 if (sys%outp%what(option__output__elf))
then
773 safe_deallocate_a(lr_elf)
774 safe_deallocate_a(elf)
775 safe_deallocate_a(lr_elfd)
776 safe_deallocate_a(elfd)
subroutine init_(fromscratch)
subroutine, public born_charges_end(this)
subroutine, public born_output_charges(this, atom, charge, natoms, namespace, dim, dirname, write_real)
subroutine, public born_charges_init(this, namespace, natoms, val_charge, qtot, dim)
subroutine, public elf_calc(space, st, gr, kpoints, elf, de)
(time-dependent) electron localization function, (TD)ELF.
subroutine, public out_hyperpolarizability(box, beta, freq_factor, converged, dirname, namespace)
Ref: David M Bishop, Rev Mod Phys 62, 343 (1990) beta generalized to lack of Kleinman symmetry.
character(len= *), parameter, public em_resp_fd_dir
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_epsilon
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 io_close(iunit, grp)
subroutine, public io_mkdir(fname, namespace, parents)
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
subroutine, public lcao_run(namespace, space, gr, ions, ext_partners, st, ks, hm, st_start, lmm_r)
This module defines various routines, operating on mesh functions.
real(real64) function, public dmf_moment(mesh, ff, idir, order)
This function calculates the "order" moment of the function ff.
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_warning(no_lines, all_nodes, namespace)
subroutine, public messages_obsolete_variable(namespace, name, rep)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_experimental(name, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
logical function mpi_grp_is_root(grp)
Is the current MPI process of grpcomm, root.
type(mpi_grp_t), public mpi_world
This module implements the basic mulsisystem class, a container system for other systems.
subroutine, public restart_close(restart, iunit)
Close a file previously opened with restart_open.
integer, parameter, public restart_gs
integer, parameter, public restart_em_resp_fd
subroutine, public restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
Initializes a restart object.
integer, parameter, public restart_type_dump
subroutine, public restart_write(restart, iunit, lines, nlines, ierr)
integer function, public restart_open(restart, filename, status, position, silent)
Open file "filename" found inside the current restart directory. Depending on the type of restart,...
subroutine, public restart_open_dir(restart, dirname, ierr)
Change the restart directory to dirname, where "dirname" is a subdirectory of the base restart direct...
integer, parameter, public restart_type_load
subroutine, public restart_end(restart)
subroutine, public restart_close_dir(restart)
Change back to the base directory. To be called after restart_open_dir.
subroutine, public scf_mix_clear(scf)
integer, parameter, public verb_full
integer, parameter, public verb_compact
subroutine, public scf_init(scf, namespace, gr, ions, st, mc, hm, space)
subroutine, public scf_end(scf)
subroutine, public scf_run(scf, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, verbosity, iters_done, restart_dump)
Legacy version of the SCF code.
pure logical function, public states_are_real(st)
subroutine, public states_elec_deallocate_wfns(st)
Deallocates the KS wavefunctions defined within a states_elec_t structure.
subroutine, public states_elec_allocate_wfns(st, mesh, wfs_type, skip, packed)
Allocates the KS wavefunctions defined within a states_elec_t structure.
This module handles reading and writing restart information for the states_elec_t.
subroutine, public states_elec_dump(restart, space, st, mesh, kpoints, ierr, iter, lr, st_start_writing, verbose)
subroutine, public states_elec_load(restart, namespace, space, st, mesh, kpoints, fixed_occ, ierr, iter, lr, lowest_missing, label, verbose, skip)
returns in ierr: <0 => Fatal error, or nothing read =0 => read all wavefunctions >0 => could only rea...
subroutine static_pol_run_legacy(sys, fromScratch)
subroutine, public static_pol_run(system, from_scratch)
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
character(len=20) pure function, public units_abbrev(this)
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.
subroutine, public output_tensor(tensor, ndim, unit, write_average, iunit, namespace)
subroutine, public output_dipole(dipole, ndim, iunit, namespace)
character pure function, public index2axis(idir)
subroutine, public v_ks_h_setup(namespace, space, gr, ions, ext_partners, st, ks, hm, calc_eigenval, calc_current)
subroutine output_init_()
subroutine output_cycle_()
Class describing the electron system.
Container class for lists of system_oct_m::system_t.