52 use,
intrinsic :: iso_fortran_env
115 integer,
parameter,
public :: &
116 OUT_MULTIPOLES = 1, &
155 character(len=100) :: td_file_name(OUT_MAX) = [character(100) :: &
165 "magnetic_moments", &
180 "total_heat_current", &
181 "total_magnetization", &
183 "maxwell_dipole_field", &
184 "norm_wavefunctions", &
189 integer,
parameter :: &
194 integer,
parameter :: &
209 integer,
parameter,
public :: &
212 integer,
parameter :: &
217 integer,
parameter :: &
223 type(c_ptr) :: handle
224 type(c_ptr),
allocatable :: mult_handles(:)
226 integer :: hand_start
228 logical ::
write = .false.
229 logical :: resolve_states = .false.
241 real(real64) :: lmm_r
244 integer :: n_excited_states
246 integer :: compute_interval
252 subroutine td_write_kick(outp, namespace, space, mesh, kick, ions, iter)
256 class(
mesh_t),
intent(in) :: mesh
257 type(
kick_t),
intent(in) :: kick
258 type(
ions_t),
intent(in) :: ions
259 integer,
intent(in) :: iter
261 complex(real64),
allocatable :: kick_function(:)
262 character(len=256) :: filename
267 write(filename,
'(a,i7.7)')
"td.", iter
268 if (outp%what(option__output__delta_perturbation))
then
269 safe_allocate(kick_function(1:mesh%np))
271 call zio_function_output(outp%how(option__output__delta_perturbation), filename,
"kick_function", namespace, &
272 space, mesh, kick_function(:),
units_out%energy, err, pos=ions%pos, atoms=ions%atom)
273 safe_deallocate_a(kick_function)
289 subroutine td_write_init(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, ks, ions_move, &
290 with_gauge_field, kick, iter, max_iter, dt, mc, dmp)
294 type(output_t),
intent(inout) :: outp
301 logical,
intent(in) :: ions_move
302 logical,
intent(in) :: with_gauge_field
303 type(
kick_t),
intent(in) :: kick
304 integer,
intent(in) :: iter
305 integer,
intent(in) :: max_iter
306 real(real64),
intent(in) :: dt
307 type(multicomm_t),
intent(in) :: mc
308 type(dmp_t),
intent(in) :: dmp
311 integer :: ierr, first, ii, ist, jj, flags, iout, default, ifile
316 character(len=MAX_PATH_LEN) :: filename
318 logical :: resolve_states
319 logical,
allocatable :: skip(:)
477 output_options = .false.
478 output_options(out_multipoles) = .
true.
495 if (st%requires_generalized_overlap)
then
502 "TDOutput of the current (total_heat_current/dipole_acceleration) with ultrasoft/PAW", &
509 "TDOutput = populations/td_occup/td_kpoint_occup/n_excited_el" // &
510 "/norm_ks_orbitals with ultrasoft/PAW", namespace=namespace)
520 writ%out(iout)%write = output_options(iout)
536 if (space%is_periodic() .and. writ%out(
out_angular)%write)
then
551 if (gr%np /= gr%np_global)
then
552 message(1) =
"TDOutput option td_kpoint_occup and td_floquet do not work with domain parallelization"
559 'Forces for systems periodic in 1D are not currently implemented and options that output the forces are not allowed.')
563 if (writ%out(
out_kp_proj)%write .and. hm%kpoints%nik_skip == 0)
then
564 message(1) =
"TDOutput option td_kpoint_occup only work with zero-weight k-points at the moment."
568 if (writ%out(
out_dm_proj_basis)%write .and. dmp%calculation_mode == option__tddmpropagation__no_propagation)
then
569 message(1) =
"TDOutput option dm_proj_basis only works with TDDMPROPAGATION calculations"
583 call parse_variable(namespace,
'TDOutputResolveStates', .false., resolve_states)
584 if (.not. writ%out(out_multipoles)%write .and. resolve_states)
then
585 write(
message(1),
'(a)')
"TDOutputResolveStates works only for TDOutput = multipoles."
598 if (writ%lmax < 0)
then
599 write(
message(1),
'(a,i6,a)')
"Input: '", writ%lmax,
"' is not a valid TDMultipoleLmax."
600 message(2) =
'(Must be TDMultipoleLmax >= 0 )'
606 if ((writ%out(
out_acc)%write) .and. ions_move)
then
607 message(1) =
'If harmonic spectrum is to be calculated, atoms should not be allowed to move.'
611 if ((writ%out(
out_q)%write) .and. .not.(ks%v_ks_photons%active()))
then
612 message(1) =
'If q(t) is to be calculated, you need to allow for photon modes.'
617 .or. hm%mxll%add_electric_dip))
then
618 message(1) =
'If the dipolar field has to be written, MaxwellCouplingMode has to be'
619 message(2) =
'"lenght_gauge_dipole" or "velocity_gauge_dipole" and at least one Maxwell system'
620 message(3) =
'must be present.'
624 rmin = ions%min_distance()
634 message(1) =
"Option TDOutput = populations is not implemented for parallel in states."
646 safe_deallocate_a(writ%gs_st%node)
654 writ%gs_st%st_end = writ%gs_st%nst
656 message(1) =
"Unable to read states information."
660 writ%gs_st%st_start = 1
676 call parse_variable(namespace,
'TDProjStateStart', 1, writ%gs_st%st_start)
678 if (st%parallel_in_states .and. writ%out(
out_proj)%write .and. writ%gs_st%st_start > 1)
then
684 writ%gs_st%lnst = writ%gs_st%st_end - writ%gs_st%st_start + 1
688 writ%gs_st%parallel_in_states = .false.
691 safe_allocate(writ%gs_st%occ(1:writ%gs_st%nst, 1:writ%gs_st%nik))
692 safe_allocate(writ%gs_st%eigenval(1:writ%gs_st%nst, 1:writ%gs_st%nik))
696 safe_allocate(writ%gs_st%node(1:writ%gs_st%nst))
697 writ%gs_st%node(:) = 0
699 writ%gs_st%eigenval = huge(writ%gs_st%eigenval)
701 if (writ%gs_st%d%ispin ==
spinors)
then
702 safe_deallocate_a(writ%gs_st%spin)
703 safe_allocate(writ%gs_st%spin(1:3, 1:writ%gs_st%nst, 1:writ%gs_st%nik))
706 safe_allocate(skip(1:writ%gs_st%nst))
708 skip(1:writ%gs_st%st_start-1) = .
true.
712 safe_deallocate_a(skip)
716 fixed_occ=.
true., ierr=ierr, label =
': gs for TDOutput')
718 if (ierr /= 0 .and. ierr /= (writ%gs_st%st_end-writ%gs_st%st_start+1)*writ%gs_st%nik &
719 *writ%gs_st%d%dim*writ%gs_st%mpi_grp%size)
then
720 message(1) =
"Unable to read wavefunctions for TDOutput."
765 if (
parse_block(namespace,
'TDExcitedStatesToProject', blk) == 0)
then
767 safe_allocate(writ%excited_st(1:writ%n_excited_states))
768 do ist = 1, writ%n_excited_states
773 writ%n_excited_states = 0
787 call parse_variable(namespace,
'TDOutputComputeInterval', 50, writ%compute_interval)
788 if (writ%compute_interval < 0)
then
789 message(1) =
"TDOutputComputeInterval must be >= 0."
805 call io_mkdir(
'td.general', namespace)
812 writ%out(:)%mpi_grp = st%system_grp
813 writ%out_dftu(:)%mpi_grp = st%system_grp
815 if (st%system_grp%is_root())
then
817 do ifile = 1, out_max
821 if (writ%out(ifile)%write)
then
825 trim(
io_workpath(
"td.general/"//trim(td_file_name(ifile)), namespace)))
833 if (writ%out(out_multipoles)%write .and. .not. resolve_states)
then
836 trim(
io_workpath(
"td.general/multipoles", namespace)))
840 select case (kick%qkick_mode)
842 write(filename,
'(a)')
'td.general/ftchd.sin'
844 write(filename,
'(a)')
'td.general/ftchd.cos'
846 write(filename,
'(a, SP, I0.3, a, I0.3)')
'td.general/ftchd.l', kick%qbessel_l,
'_m', kick%qbessel_m
848 write(filename,
'(a)')
'td.general/ftchd'
860 call io_rm(
"td.general/laser", namespace=namespace)
878 if (writ%out(out_multipoles)%write .and. resolve_states)
then
880 writ%out(out_multipoles)%hand_start = st%st_start
881 writ%out(out_multipoles)%hand_end = st%st_end
882 writ%out(out_multipoles)%resolve_states = .
true.
883 writ%out(out_multipoles)%mpi_grp = gr%mpi_grp
885 safe_allocate(writ%out(out_multipoles)%mult_handles(st%st_start:st%st_end))
887 if (writ%out(out_multipoles)%mpi_grp%is_root())
then
888 do ist = st%st_start, st%st_end
889 write(filename,
'(a,i4.4)')
'td.general/multipoles-ist', ist
902 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, &
903 calc_eigenval=.false., time = iter*dt, calc_energy = .false.)
907 if (all(outp%how == 0) .and. writ%out(
out_n_ex)%write)
then
909 if (outp%how(option__output__current_kpt) + outp%how(option__output__density_kpt) /= 0)
then
910 call io_mkdir(outp%iter_dir, namespace)
940 writ%out_dftu(iout)%write = (iand(flags, 2**(iout - 1)) /= 0)
943 if (st%system_grp%is_root())
then
947 trim(
io_workpath(
"td.general/effectiveU", namespace)))
965 if (writ%out(iout)%write)
then
966 if (writ%out(iout)%mpi_grp%is_root())
then
967 if (writ%out(iout)%resolve_states)
then
968 do ist = writ%out(iout)%hand_start, writ%out(iout)%hand_end
971 safe_deallocate_a(writ%out(iout)%mult_handles)
980 if (writ%out_dftu(iout)%write .and. writ%out_dftu(iout)%mpi_grp%is_root())
then
986 do ist = 1, writ%n_excited_states
989 writ%n_excited_states = 0
1002 subroutine td_write_iter(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, kick, ks, dt, &
1003 iter, mc, recalculate_gs, dmp)
1006 class(
space_t),
intent(in) :: space
1008 type(
grid_t),
intent(in) :: gr
1011 type(
ions_t),
intent(inout) :: ions
1013 type(
kick_t),
intent(in) :: kick
1014 type(
v_ks_t),
intent(in) :: ks
1015 real(real64),
intent(in) :: dt
1016 integer,
intent(in) :: iter
1018 logical,
intent(in) :: recalculate_gs
1019 type(
dmp_t),
intent(in) :: dmp
1027 if (writ%out(out_multipoles)%write)
then
1051 if (writ%out(
out_proj)%write .and. mod(iter, writ%compute_interval) == 0)
then
1053 call td_write_proj(writ%out(
out_proj)%handle, namespace, space, gr, ions, hm, st, writ%gs_st, kick, iter)
1060 if (writ%out(
out_kp_proj)%write .and. mod(iter, writ%compute_interval) == 0)
then
1066 ions%pos, ions%vel, ions%tot_force, iter)
1071 ions%natoms, ions%space, &
1072 ions%pos, ions%vel, ions%tot_force, iter, 1)
1077 ions%natoms, ions%space, &
1078 ions%pos, ions%vel, ions%tot_force, iter, 2)
1083 ions%natoms, ions%space, &
1084 ions%pos, ions%vel, ions%tot_force, iter, 3)
1095 if (writ%out(
out_acc)%write)
then
1096 call td_write_acc(writ%out(
out_acc)%handle, namespace, space, gr, ions, st, hm, ext_partners, dt, iter)
1099 if (writ%out(
out_vel)%write)
then
1112 if(
associated(gfield))
then
1143 if (writ%out(
out_n_ex)%write .and. mod(iter, writ%compute_interval) == 0)
then
1145 if (recalculate_gs)
then
1148 ierr=ierr, label =
': Houston states for TDOutput')
1152 call td_write_n_ex(writ%out(
out_n_ex)%handle, outp, namespace, gr, hm, hm%kpoints, st, writ%gs_st, iter)
1169 if (writ%out(
out_q)%write .and. ks%v_ks_photons%active())
then
1173 if (writ%out(
out_mxll_field)%write .and. hm%mxll%calc_field_dip)
then
1175 space, hm, dt, iter)
1178 if (writ%out(
out_dm_proj_basis)%write .and. mod(iter, writ%compute_interval) == 0)
then
1196 do iout = 1, out_max
1198 if (writ%out(iout)%write)
then
1199 if (writ%out(iout)%mpi_grp%is_root())
then
1200 if (writ%out(iout)%resolve_states)
then
1201 do ii = writ%out(iout)%hand_start, writ%out(iout)%hand_end
1212 if (writ%out_dftu(iout)%write .and. writ%out(
out_proj)%mpi_grp%is_root())
then
1222 subroutine td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, iter, dt)
1225 type(
grid_t),
intent(in) :: gr
1228 type(
v_ks_t),
intent(inout) :: ks
1230 type(
ions_t),
intent(in) :: ions
1232 integer,
intent(in) :: iter
1233 real(real64),
optional,
intent(in) :: dt
1235 character(len=256) :: filename
1241 if (st%modelmbparticles%nparticle > 0)
then
1246 write(filename,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
1248 call output_all(outp, namespace, space, filename, gr, ions, iter, st, hm, ks)
1250 call output_modelmb(outp, namespace, space, filename, gr, ions, iter, st)
1252 if (
present(dt))
then
1253 call output_scalar_pot(outp, namespace, space, filename, gr, ions, ext_partners, st%st_kpt_mpi_grp, iter*dt)
1255 if (iter == 0)
call output_scalar_pot(outp, namespace, space, filename, gr, ions, ext_partners, st%st_kpt_mpi_grp)
1264 type(c_ptr),
intent(inout) ::
out_spin
1266 class(
mesh_t),
intent(in) :: mesh
1268 integer,
intent(in) :: iter
1270 character(len=130) :: aux
1271 real(real64) :: spin(3)
1280 if (mpi_grp%is_root())
then
1287 if (st%d%ispin ==
spinors)
then
1288 write(aux,
'(a2,18x)')
'Sx'
1290 write(aux,
'(a2,18x)')
'Sy'
1293 write(aux,
'(a2,18x)')
'Sz'
1301 select case (st%d%ispin)
1318 type(
grid_t),
intent(in) :: gr
1320 type(
ions_t),
intent(in) :: ions
1321 real(real64),
intent(in) :: lmm_r
1322 integer,
intent(in) :: iter
1325 character(len=50) :: aux
1326 real(real64),
allocatable :: lmm(:,:)
1331 safe_allocate(lmm(1:3, 1:ions%natoms))
1334 if (st%system_grp%is_root())
then
1341 do ia = 1, ions%natoms
1342 if (st%d%ispin ==
spinors)
then
1343 write(aux,
'(a2,i2.2,16x)')
'mx', ia
1345 write(aux,
'(a2,i2.2,16x)')
'my', ia
1348 write(aux,
'(a2,i2.2,16x)')
'mz', ia
1357 do ia = 1, ions%natoms
1358 select case (st%d%ispin)
1368 safe_deallocate_a(lmm)
1375 type(c_ptr),
intent(inout) :: out_magnets
1376 class(
mesh_t),
intent(in) :: mesh
1378 type(
kick_t),
intent(in) :: kick
1379 integer,
intent(in) :: iter
1381 complex(real64),
allocatable :: tm(:,:)
1386 safe_allocate(tm(1:6,1:kick%nqvec))
1388 do iq = 1, kick%nqvec
1392 if (st%system_grp%is_root())
then
1418 do iq = 1, kick%nqvec
1427 safe_deallocate_a(tm)
1441 subroutine td_write_angular(out_angular, namespace, space, gr, ions, hm, st, kick, iter)
1442 type(c_ptr),
intent(inout) :: out_angular
1444 class(
space_t),
intent(in) :: space
1445 type(
grid_t),
intent(in) :: gr
1449 type(
kick_t),
intent(in) :: kick
1450 integer,
intent(in) :: iter
1453 character(len=130) :: aux
1454 real(real64) :: angular(3)
1461 call angular_momentum%setup_dir(idir)
1464 m_two*real(angular_momentum%zstates_elec_expectation_value(namespace, space, gr, hm, st), real64)
1466 safe_deallocate_p(angular_momentum)
1468 if (st%system_grp%is_root())
then
1473 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
1481 write(aux,
'(a4,18x)')
'<Lx>'
1483 write(aux,
'(a4,18x)')
'<Ly>'
1485 write(aux,
'(a4,18x)')
'<Lz>'
1514 class(
space_t),
intent(in) :: space
1515 type(
grid_t),
intent(in) :: gr
1516 type(
ions_t),
intent(in) :: ions
1518 integer,
intent(in) :: lmax
1519 type(
kick_t),
intent(in) :: kick
1520 integer,
intent(in) :: iter
1523 real(real64),
allocatable :: rho(:,:)
1527 if (out_multip%resolve_states)
then
1528 safe_allocate(rho(1:gr%np_part, 1:st%d%nspin))
1531 do ist = st%st_start, st%st_end
1533 call td_write_multipole_r(out_multip%mult_handles(ist), space, gr, ions, st, lmax, kick, rho, iter, &
1534 mpi_grp = out_multip%mpi_grp)
1537 safe_deallocate_a(rho)
1540 if (
allocated(st%frozen_rho))
then
1541 safe_allocate(rho(1:gr%np, 1:st%d%nspin))
1542 call lalg_copy(gr%np, st%d%nspin, st%rho, rho)
1547 safe_deallocate_a(rho)
1559 subroutine td_write_multipole_r(out_multip, space, mesh, ions, st, lmax, kick, rho, iter, mpi_grp)
1560 type(c_ptr),
intent(inout) :: out_multip
1561 class(
space_t),
intent(in) :: space
1562 class(
mesh_t),
intent(in) :: mesh
1563 type(
ions_t),
intent(in) :: ions
1565 integer,
intent(in) :: lmax
1566 type(
kick_t),
intent(in) :: kick
1567 real(real64),
contiguous,
intent(in) :: rho(:,:)
1568 integer,
intent(in) :: iter
1569 type(
mpi_grp_t),
optional,
intent(in) :: mpi_grp
1572 integer :: is, idir, ll, mm, add_lm
1573 character(len=120) :: aux
1574 real(real64) :: ionic_dipole(ions%space%dim)
1575 real(real64),
allocatable :: multipole(:,:)
1581 assert(.not. (lmax > 1 .and. space%dim > 3))
1583 mpi_grp_ = st%system_grp
1584 if (
present(mpi_grp)) mpi_grp_ = mpi_grp
1586 if (mpi_grp_%is_root().and.iter == 0)
then
1589 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
1593 write(aux,
'(a15,i2)')
'# lmax ', lmax
1601 do is = 1, st%d%nspin
1602 write(aux,
'(a18,i1,a1)')
'Electronic charge(', is,
')'
1605 do idir = 1, space%dim
1606 write(aux,
'(4a1,i1,a1)')
'<',
index2axis(idir),
'>',
'(', is,
')'
1612 write(aux,
'(a2,i2,a4,i2,a2,i1,a1)')
'l=', ll,
', m=', mm,
' (', is,
')'
1623 do is = 1, st%d%nspin
1626 do idir = 1, space%dim
1642 if (space%dim > 3 .and. lmax == 1)
then
1644 safe_allocate(multipole(1:space%dim+1, 1:st%d%nspin))
1646 safe_allocate(multipole(1:(lmax + 1)**2, 1:st%d%nspin))
1650 do is = 1, st%d%nspin
1655 ionic_dipole = ions%dipole()
1656 multipole(2:space%dim+1, :) = -multipole(2:space%dim+1, :)
1658 do is = 1, st%d%spin_channels
1659 multipole(2:space%dim+1, is) = multipole(2:space%dim+1, is) - ionic_dipole(1:space%dim)/st%d%spin_channels
1663 if (mpi_grp_%is_root())
then
1665 do is = 1, st%d%nspin
1668 do idir = 1, space%dim
1672 add_lm = space%dim + 2
1683 safe_deallocate_a(multipole)
1688 subroutine td_write_ftchd(out_ftchd, space, mesh, st, kick, iter)
1689 type(c_ptr),
intent(inout) :: out_ftchd
1690 class(
space_t),
intent(in) :: space
1691 class(
mesh_t),
intent(in) :: mesh
1693 type(
kick_t),
intent(in) :: kick
1694 integer,
intent(in) :: iter
1696 integer :: is, ip, idir
1697 character(len=120) :: aux, aux2
1698 real(real64) :: ftchd_bessel
1699 complex(real64) :: ftchd
1701 real(real64),
allocatable :: integrand_bessel(:)
1702 complex(real64),
allocatable :: integrand(:)
1706 if (st%system_grp%is_root().and.iter == 0)
then
1709 write(aux,
'(a15, i2)')
'# qkickmode ', kick%qkick_mode
1714 write(aux,
'(a15, i0.3, 1x, i0.3)')
'# ll, mm ', kick%qbessel_l, kick%qbessel_m
1720 write(aux,
'(a15, f9.6)')
'# qlength ', kick%qlength
1722 write(aux,
'(a15)')
'# qvector '
1723 do idir = 1, space%dim
1724 write(aux2,
'(f9.5)') kick%qvector(idir,1)
1725 aux = trim(aux) // trim(aux2)
1731 write(aux,
'(a15,f18.12)')
'# kick strength', kick%delta_strength
1737 write(aux,
'(a17)')
'int(j_l*Y_lm*rho)'
1739 write(aux,
'(a12)')
'Real, Imag'
1756 safe_allocate(integrand(1:mesh%np))
1758 do is = 1, st%d%spin_channels
1760 integrand(ip) = integrand(ip) + st%rho(ip, is) *
exp(-
m_zi*sum(mesh%x(1:space%dim, ip)*kick%qvector(1:space%dim, 1)))
1764 safe_deallocate_a(integrand)
1767 safe_allocate(integrand_bessel(1:mesh%np))
1768 integrand_bessel =
m_zero
1769 do is = 1, st%d%spin_channels
1771 call ylmr_real(mesh%x(1:3, ip), kick%qbessel_l, kick%qbessel_m, ylm)
1772 integrand_bessel(ip) = integrand_bessel(ip) + st%rho(ip, is) * &
1773 loct_sph_bessel(kick%qbessel_l, kick%qlength*norm2(mesh%x(:, ip)))*ylm
1777 safe_deallocate_a(integrand_bessel)
1780 if (st%system_grp%is_root())
then
1796 type(c_ptr),
intent(inout) :: out_temperature
1798 type(
ions_t),
intent(in) :: ions
1799 integer,
intent(in) :: iter
1801 if (.not. mpi_grp%is_root())
return
1833 subroutine td_write_populations(out_populations, namespace, space, mesh, hm, st, writ, dt, iter)
1834 type(c_ptr),
intent(inout) :: out_populations
1836 class(
space_t),
intent(in) :: space
1837 class(
mesh_t),
intent(in) :: mesh
1841 real(real64),
intent(in) :: dt
1842 integer,
intent(in) :: iter
1845 character(len=6) :: excited_name
1846 complex(real64) :: gsp
1847 complex(real64),
allocatable :: excited_state_p(:)
1848 complex(real64),
allocatable :: dotprodmatrix(:, :, :)
1853 safe_allocate(dotprodmatrix(1:writ%gs_st%nst, 1:st%nst, 1:st%nik))
1854 if (st%requires_generalized_overlap)
then
1855 call zstates_elec_matrix(writ%gs_st, st, mesh, dotprodmatrix, aug_overlap=hm%aug_overlap, phase=hm%phase)
1862 assert(.not. space%is_periodic())
1867 if (writ%n_excited_states > 0)
then
1868 safe_allocate(excited_state_p(1:writ%n_excited_states))
1869 do ist = 1, writ%n_excited_states
1870 excited_state_p(ist) =
zstates_elec_mpdotp(namespace, mesh, writ%excited_st(ist), st, dotprodmatrix)
1874 if (st%system_grp%is_root())
then
1882 do ist = 1, writ%n_excited_states
1883 write(excited_name,
'(a2,i3,a1)')
'P(', ist,
')'
1902 do ist = 1, writ%n_excited_states
1909 if (writ%n_excited_states > 0)
then
1910 safe_deallocate_a(excited_state_p)
1912 safe_deallocate_a(dotprodmatrix)
1918 subroutine td_write_acc(out_acc, namespace, space, gr, ions, st, hm, ext_partners, dt, iter)
1919 type(c_ptr),
intent(inout) :: out_acc
1921 class(
space_t),
intent(in) :: space
1922 type(
grid_t),
intent(in) :: gr
1923 type(
ions_t),
intent(inout) :: ions
1927 real(real64),
intent(in) :: dt
1928 integer,
intent(in) :: iter
1931 character(len=7) :: aux
1932 real(real64) :: acc(space%dim)
1936 if (iter == 0 .and. st%system_grp%is_root())
then
1941 do idim = 1, space%dim
1942 write(aux,
'(a4,i1,a1)')
'Acc(', idim,
')'
1950 do idim = 1, space%dim
1957 call td_calc_tacc(namespace, space, gr, ions, ext_partners, st, hm, acc, dt*iter)
1959 if (st%system_grp%is_root())
then
1970 subroutine td_write_vel(out_vel, namespace, gr, st, space, hm, ions, iter)
1971 type(c_ptr),
intent(inout) :: out_vel
1973 type(
grid_t),
intent(in) :: gr
1975 type(
space_t),
intent(in) :: space
1977 type(
ions_t),
intent(in) :: ions
1978 integer,
intent(in) :: iter
1981 character(len=7) :: aux
1982 real(real64) :: vel(space%dim)
1986 if (iter == 0 .and. st%system_grp%is_root())
then
1991 do idim = 1, space%dim
1992 write(aux,
'(a4,i1,a1)')
'Vel(', idim,
')'
2000 do idim = 1, space%dim
2007 call td_calc_tvel(namespace, gr, st, space, hm, ions, vel)
2009 if (st%system_grp%is_root())
then
2021 subroutine td_write_laser(out_laser, mpi_grp, space, lasers, dt, iter)
2022 type(c_ptr),
intent(inout) :: out_laser
2024 class(
space_t),
intent(in) :: space
2025 type(
lasers_t),
intent(inout) :: lasers
2026 real(real64),
intent(in) :: dt
2027 integer,
intent(in) :: iter
2030 real(real64) :: field(space%dim)
2031 real(real64) :: ndfield(space%dim)
2032 character(len=80) :: aux
2034 if (.not. mpi_grp%is_root())
return
2048 do il = 1, lasers%no_lasers
2051 do idir = 1, space%dim
2052 write(aux,
'(a,i1,a)')
'E(', idir,
')'
2056 do idir = 1, space%dim
2057 write(aux,
'(a,i1,a)')
'B(', idir,
')'
2061 do idir = 1, space%dim
2062 write(aux,
'(a,i1,a)')
'A(', idir,
')'
2066 write(aux,
'(a,i1,a)')
'e(t)'
2072 do idir = 1, space%dim
2073 write(aux,
'(a,i1,a)')
'A^M(', idir,
')'
2085 do il = 1, lasers%no_lasers
2089 do idir = 1, space%dim
2094 do idir = 1, space%dim
2105 do idir = 1, space%dim
2118 do il = 1, lasers%no_lasers
2120 call laser_field(lasers%lasers(il), field(1:space%dim), iter*dt)
2145 type(c_ptr),
intent(inout) :: out_energy
2148 integer,
intent(in) :: iter
2149 real(real64),
intent(in) :: ke
2153 integer :: n_columns
2155 if (.not. mpi_grp%is_root())
return
2176 if (hm%pcm%run_pcm)
then
2178 n_columns = n_columns + 1
2183 n_columns = n_columns + 1
2193 do ii = 1, n_columns
2216 hm%energy%int_nn_pcm + hm%energy%int_ne_pcm), 1)
2229 type(c_ptr),
intent(inout) :: out_eigs
2231 integer,
intent(in) :: iter
2234 character(len=68) :: buf
2238 if (.not. st%system_grp%is_root())
then
2247 write(buf,
'(a15,i2)')
'# nst ', st%nst
2251 write(buf,
'(a15,i2)')
'# nspin ', st%d%nspin
2257 do is = 1, st%d%kpt%nglobal()
2259 write(buf,
'(a,i4)')
'Eigenvalue ',ii
2268 do is = 1, st%d%kpt%nglobal()
2278 do is = 1, st%d%kpt%nglobal()
2290 type(c_ptr),
intent(inout) :: out_ionch
2291 class(
mesh_t),
intent(in) :: mesh
2293 integer,
intent(in) :: iter
2295 integer :: ii, ist, Nch, ik, idim
2296 character(len=68) :: buf
2297 real(real64),
allocatable :: ch(:), occ(:)
2298 real(real64),
allocatable :: occbuf(:)
2303 nch = st%nst * st%d%kpt%nglobal() * st%d%dim
2304 safe_allocate(ch(0: nch))
2305 safe_allocate(occ(0: nch))
2311 do idim = 1, st%d%dim
2312 if (st%st_start <= ist .and. ist <= st%st_end .and. &
2313 st%d%kpt%start <= ik .and. ik <= st%d%kpt%end)
then
2314 occ(ii) = st%occ(ist, ik)
2322 if (st%parallel_in_states)
then
2323 safe_allocate(occbuf(0: nch))
2325 call st%mpi_grp%allreduce(occ(0), occbuf(0), nch+1, mpi_double_precision, mpi_sum)
2327 safe_deallocate_a(occbuf)
2334 if (.not. st%system_grp%is_root())
then
2335 safe_deallocate_a(ch)
2336 safe_deallocate_a(occ)
2349 if (occ(ii)>
m_zero .or. ii == 0)
then
2350 write(buf,
'(a,f4.1,a)')
'Pion(',occ(ii)*ii,
'+, t)'
2360 if (occ(ii)>
m_zero .or. ii == 0)
then
2370 if (occ(ii)>
m_zero .or. ii == 0)
then
2376 safe_deallocate_a(ch)
2377 safe_deallocate_a(occ)
2383 subroutine td_write_proj(out_proj, namespace, space, mesh, ions, hm, st, gs_st, kick, iter)
2384 type(c_ptr),
intent(inout) :: out_proj
2386 class(
space_t),
intent(in) :: space
2387 class(
mesh_t),
intent(in) :: mesh
2388 type(
ions_t),
intent(in) :: ions
2392 type(
kick_t),
intent(in) :: kick
2393 integer,
intent(in) :: iter
2395 complex(real64),
allocatable :: projections(:,:,:)
2396 character(len=80) :: aux
2397 integer :: ik, ist, uist, idir
2402 if (st%system_grp%is_root())
then
2405 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
2414 write(aux,
'(a,i8)')
"# nik ", st%nik
2418 write(aux,
'(a,2i8)')
"# st ", gs_st%st_start, st%nst
2422 write(aux,
'(a,2i8)')
"# ust ", gs_st%st_start, gs_st%st_end
2428 do ist = gs_st%st_start, st%nst
2436 do ist = gs_st%st_start, st%nst
2437 do uist = gs_st%st_start, gs_st%st_end
2438 write(aux,
'(i4,a,i4)') ist,
' -> ', uist
2449 if (.not. space%is_periodic())
then
2451 safe_allocate(projections(1:st%nst, gs_st%st_start:gs_st%st_end, 1:st%nik))
2452 do idir = 1, space%dim
2457 if (st%system_grp%is_root())
then
2458 write(aux,
'(a,i1,a)')
"<i|x_", idir,
"|a>"
2462 do ist = gs_st%st_start, st%st_end
2463 do uist = gs_st%st_start, gs_st%st_end
2473 safe_deallocate_a(projections)
2477 if (st%system_grp%is_root())
then
2483 safe_allocate(projections(1:st%nst, gs_st%st_start:gs_st%st_end, 1:st%nik))
2484 projections(:,:,:) =
m_z0
2487 if (st%system_grp%is_root())
then
2490 do ist = gs_st%st_start, st%nst
2491 do uist = gs_st%st_start, gs_st%st_end
2500 safe_deallocate_a(projections)
2506 integer,
intent(in) :: dir
2508 integer :: uist, ist, ik, idim, ip
2509 real(real64) :: n_dip(space%dim)
2510 complex(real64),
allocatable :: xpsi(:,:)
2511 complex(real64),
allocatable :: psi(:, :), gspsi(:, :)
2515 safe_allocate(psi(1:mesh%np, 1:st%d%dim))
2516 safe_allocate(gspsi(1:mesh%np, 1:st%d%dim))
2517 safe_allocate(xpsi(1:mesh%np, 1:st%d%dim))
2519 do ik = st%d%kpt%start, st%d%kpt%end
2520 do ist = st%st_start, st%st_end
2522 do uist = gs_st%st_start, gs_st%st_end
2526 do idim = 1, st%d%dim
2529 xpsi(ip, idim) = mesh%x_t(ip, dir)*gspsi(ip, idim)
2533 projections(ist, uist, ik) = -
zmf_dotp(mesh, st%d%dim, psi, xpsi, reduce = .false.)
2539 safe_deallocate_a(xpsi)
2540 safe_deallocate_a(gspsi)
2541 safe_deallocate_a(psi)
2546 n_dip = ions%dipole()
2548 do ist = gs_st%st_start, st%nst
2549 do uist = gs_st%st_start, gs_st%st_end
2550 projections(ist, uist, ik) = projections(ist, uist, ik) - n_dip(dir)
2566 subroutine td_write_n_ex(out_nex, outp, namespace, mesh, hm, kpoints, st, gs_st, iter)
2567 type(c_ptr),
intent(inout) :: out_nex
2570 class(
mesh_t),
intent(in) :: mesh
2575 integer,
intent(in) :: iter
2577 complex(real64),
allocatable :: projections(:,:)
2578 character(len=80) :: aux, dir
2579 integer :: ik, ikpt, ist, uist, err
2580 real(real64) :: Nex, weight
2582 real(real64),
allocatable :: Nex_kpt(:)
2588 if (st%system_grp%is_root())
then
2591 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
2598 write(aux,
'(a,i8)')
"# nik ", st%nik
2602 write(aux,
'(a,2i8)')
"# st ", gs_st%st_start, st%nst
2606 write(aux,
'(a,2i8)')
"# ust ", gs_st%st_start, gs_st%st_end
2616 if (st%system_grp%is_root())
then
2625 do ist = 1, gs_st%nst
2626 if (gs_st%occ(ist, ik) >
m_min_occ .and. ist > gs_nst) gs_nst = ist
2630 safe_allocate(projections(1:gs_nst, 1:st%nst))
2632 safe_allocate(nex_kpt(1:st%nik))
2634 do ik = st%d%kpt%start, st%d%kpt%end
2635 ikpt = st%d%get_kpoint_index(ik)
2636 if (st%requires_generalized_overlap)
then
2638 aug_overlap=hm%aug_overlap, phase=hm%phase)
2643 weight = st%kweights(ik) * gs_st%occ(ist, ik)/ st%smear%el_per_state
2644 do uist = st%st_start, st%st_end
2645 nex_kpt(ikpt) = nex_kpt(ikpt) - weight * st%occ(uist, ik) * abs(projections(ist, uist))**2
2648 nex_kpt(ikpt) = nex_kpt(ikpt) + sum(st%occ(st%st_start:st%st_end, ik))*st%kweights(ik)
2651 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
2657 if (st%system_grp%is_root())
then
2663 write(dir,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
2666 + outp%how(option__output__density_kpt), dir,
"n_excited_el_kpt", namespace, &
2670 safe_deallocate_a(projections)
2671 safe_deallocate_a(nex_kpt)
2683 class(
mesh_t),
intent(in) :: mesh
2688 complex(real64),
intent(inout) :: projections(1:st%nst, gs_st%st_start:gs_st%nst, 1:st%nik)
2690 integer :: ik, ib_st, ib_gs
2691 complex(real64),
allocatable :: dmat(:, :)
2698 do_aug = st%requires_generalized_overlap
2704 safe_allocate(dmat(1:st%nst, 1:gs_st%nst))
2705 projections(:,:,:) =
m_zero
2707 do ik = st%d%kpt%start, st%d%kpt%end
2709 do ib_gs = gs_st%group%block_start, gs_st%group%block_end
2710 call gs_st%group%psib(ib_gs, ik)%do_pack()
2712 do ib_st = st%group%block_start, st%group%block_end
2713 call st%group%psib(ib_st, ik)%do_pack()
2715 call st%group%psib(ib_st, ik)%copy_to(spsib)
2717 do ib_gs = gs_st%group%block_start, gs_st%group%block_end
2722 do ib_gs = gs_st%group%block_start, gs_st%group%block_end
2724 dmat, reduce = .false.)
2727 call st%group%psib(ib_st, ik)%do_unpack(copy = .false.)
2729 do ib_gs = gs_st%group%block_start, gs_st%group%block_end
2730 call gs_st%group%psib(ib_gs, ik)%do_unpack(copy = .false.)
2732 projections(1:st%nst, gs_st%st_start:gs_st%nst, ik) = dmat(1:st%nst, gs_st%st_start:gs_st%nst)
2735 safe_deallocate_a(dmat)
2744 class(
mesh_t),
intent(in) :: mesh
2750 integer,
intent(in) :: iter
2752 complex(real64),
allocatable :: proj(:,:), psi(:,:,:), gs_psi(:,:,:), temp_state(:,:), s_state(:,:)
2753 character(len=80) :: filename1, filename2
2754 integer :: ik,ist, jst, file, idim, nk_proj
2759 if (mesh%use_vol_pp)
then
2765 do_aug = st%requires_generalized_overlap
2767 write(filename1,
'(I10)') iter
2768 filename1 =
'td.general/projections_iter_'//trim(adjustl(filename1))
2771 safe_allocate(proj(1:gs_st%nst, 1:gs_st%nst))
2772 safe_allocate(psi(1:gs_st%nst,1:gs_st%d%dim,1:mesh%np))
2773 safe_allocate(gs_psi(1:gs_st%nst,1:gs_st%d%dim,1:mesh%np))
2774 safe_allocate(temp_state(1:mesh%np_part,1:gs_st%d%dim))
2776 safe_allocate(s_state(1:mesh%np,1:gs_st%d%dim))
2783 nk_proj = kpoints%nik_skip
2785 do ik = kpoints%reduced%npoints-nk_proj+1, kpoints%reduced%npoints
2787 psi(1:gs_st%nst, 1:gs_st%d%dim, 1:mesh%np)=
m_zero
2788 gs_psi(1:gs_st%nst, 1:gs_st%d%dim, 1:mesh%np)=
m_zero
2790 if (st%system_grp%is_root())
then
2791 write(filename2,
'(I10)') ik
2792 filename2 = trim(adjustl(filename1))//
'_ik_'//trim(adjustl(filename2))
2793 file =
io_open(filename2, namespace, action=
'write')
2796 do ist=gs_st%st_start,gs_st%st_end
2802 do idim = 1,gs_st%d%dim
2803 psi(ist,idim,1:mesh%np) = s_state(1:mesh%np,idim)
2806 do idim = 1,gs_st%d%dim
2807 psi(ist,idim,1:mesh%np) = temp_state(1:mesh%np,idim)
2811 do idim = 1,gs_st%d%dim
2812 gs_psi(ist,idim,1:mesh%np) = temp_state(1:mesh%np,idim)
2821 assert(mesh%np_global*gs_st%d%dim < huge(0_int32))
2822 proj(1:gs_st%nst, 1:gs_st%nst) =
m_zero
2827 i8_to_i4(mesh%np_global*gs_st%d%dim), &
2828 cmplx(mesh%volume_element,
m_zero, real64) , &
2830 ubound(psi, dim = 1), &
2832 ubound(gs_psi, dim = 1), &
2835 ubound(proj, dim = 1))
2838 if (st%system_grp%is_root())
then
2839 do ist = 1, gs_st%nst
2840 do jst = 1, gs_st%nst
2841 write(file,
'(I3,1x,I3,1x,e13.6,1x,e13.6,2x)') ist, jst, proj(ist,jst)
2849 safe_deallocate_a(proj)
2850 safe_deallocate_a(psi)
2851 safe_deallocate_a(gs_psi)
2852 safe_deallocate_a(temp_state)
2853 safe_deallocate_a(s_state)
2859 subroutine td_write_floquet(namespace, space, hm, ext_partners, gr, st, iter)
2860 type(namespace_t),
intent(in) :: namespace
2861 class(space_t),
intent(in) :: space
2862 type(hamiltonian_elec_t),
intent(inout) :: hm
2863 type(partner_list_t),
intent(in) :: ext_partners
2864 type(grid_t),
intent(in) :: gr
2865 type(states_elec_t),
intent(inout) :: st
2866 integer,
intent(in) :: iter
2868 complex(real64),
allocatable :: hmss(:,:), psi(:,:,:), hpsi(:,:,:), temp_state1(:,:)
2869 complex(real64),
allocatable :: HFloquet(:,:,:), HFloq_eff(:,:), temp(:,:)
2870 real(real64),
allocatable :: eigenval(:), bands(:,:)
2871 character(len=80) :: filename
2872 integer :: it, nT, ik, ist, in, im, file, idim, nik, ik_count
2873 integer :: Forder, Fdim, m0, n0, n1, nst, ii, jj, lim_nst
2874 logical :: downfolding
2875 type(states_elec_t) :: hm_st
2877 real(real64) :: dt, Tcycle, omega
2881 downfolding = .false.
2884 if (.not. iter == 0)
then
2892 assert(gr%np == gr%np_global)
2895 call states_elec_copy(hm_st, st)
2906 call parse_variable(namespace,
'TDFloquetFrequency', m_zero, omega, units_inp%energy)
2907 call messages_print_var_value(
'Frequency used for Floquet analysis', omega, namespace=namespace)
2908 if (abs(omega) <= m_epsilon)
then
2909 message(1) =
"Please give a non-zero value for TDFloquetFrequency"
2910 call messages_fatal(1, namespace=namespace)
2914 tcycle = m_two * m_pi / omega
2924 call parse_variable(namespace,
'TDFloquetSample',20 ,nt)
2925 call messages_print_var_value(
'Number of Floquet time-sampling points', nt, namespace=namespace)
2926 dt = tcycle/real(nt, real64)
2935 call parse_variable(namespace,
'TDFloquetDimension',-1,forder)
2936 if (forder .ge. 0)
then
2937 call messages_print_var_value(
'Order of multiphoton Floquet-Hamiltonian', forder, namespace=namespace)
2939 fdim = 2 * forder + 1
2941 message(1) =
'Floquet-Hamiltonian is downfolded'
2942 call messages_info(1, namespace=namespace)
2943 downfolding = .
true.
2948 dt = tcycle/real(nt, real64)
2951 nik = hm%kpoints%nik_skip
2953 safe_allocate(hmss(1:nst,1:nst))
2954 safe_allocate( psi(1:nst,1:st%d%dim,1:gr%np))
2955 safe_allocate(hpsi(1:nst,1:st%d%dim,1:gr%np))
2956 safe_allocate(temp_state1(1:gr%np,1:st%d%dim))
2964 safe_allocate(hfloquet(1:nik,1:nst*fdim, 1:nst*fdim))
2965 hfloquet(1:nik,1:nst*fdim, 1:nst*fdim) = m_zero
2970 call hm%update(gr, namespace, space, ext_partners, time=tcycle+it*dt)
2972 call zhamiltonian_elec_apply_all(hm, namespace, gr, st, hm_st)
2977 do ik = hm%kpoints%reduced%npoints-nik+1, hm%kpoints%reduced%npoints
2978 ik_count = ik_count + 1
2980 psi(1:nst, 1:st%d%dim, 1:gr%np)= m_zero
2981 hpsi(1:nst, 1:st%d%dim, 1:gr%np)= m_zero
2983 do ist = st%st_start, st%st_end
2984 if (state_kpt_is_local(st, ist, ik))
then
2985 call states_elec_get_state(st, gr, ist, ik,temp_state1)
2986 do idim = 1, st%d%dim
2987 psi(ist, idim, 1:gr%np) = temp_state1(1:gr%np, idim)
2989 call states_elec_get_state(hm_st, gr, ist, ik,temp_state1)
2990 do idim = 1, st%d%dim
2991 hpsi(ist, idim, 1:gr%np) = temp_state1(1:gr%np, idim)
2995 call comm_allreduce(st%system_grp, psi)
2996 call comm_allreduce(st%system_grp, hpsi)
2997 assert(gr%np_global*st%d%dim < huge(0_int32))
2998 hmss(1:nst,1:nst) = m_zero
3003 i8_to_i4(gr%np_global*st%d%dim), &
3004 cmplx(gr%volume_element, m_zero, real64) , &
3006 ubound(hpsi, dim = 1), &
3008 ubound(psi, dim = 1), &
3011 ubound(hmss, dim = 1))
3013 hmss(1:nst,1:nst) = conjg(hmss(1:nst,1:nst))
3016 do in = -forder, forder
3017 do im = -forder, forder
3018 ii = (in+forder) * nst
3019 jj = (im+forder) * nst
3020 hfloquet(ik_count, ii+1:ii+nst, jj+1:jj+nst) = &
3021 hfloquet(ik_count, ii+1:ii+nst, jj+1:jj+nst) + hmss(1:nst, 1:nst) *
exp(-(in-im)*m_zi*omega*it*dt)
3025 hfloquet(ik_count, ii+ist, ii+ist) = hfloquet(ik_count, ii+ist, ii+ist) + in*omega
3034 hfloquet(:,:,:) = m_one/nt*hfloquet(:,:,:)
3037 if (downfolding)
then
3039 safe_allocate(hfloq_eff(1:nst,1:nst))
3040 safe_allocate(eigenval(1:nst))
3041 safe_allocate(bands(1:nik,1:nst))
3043 hfloq_eff(1:nst,1:nst) = m_zero
3049 hfloq_eff(1:nst, 1:nst) = hfloquet(ik, n0+1:n0+nst, m0+1:m0+nst) + &
3050 m_one/omega*(matmul(hfloquet(ik, 1:nst, m0+1:m0+nst), hfloquet(ik, n1+1:n1+nst, m0+1:m0+nst))- &
3051 matmul(hfloquet(ik, n1+1:n1+nst, m0+1:m0+nst), hfloquet(ik, 1:nst, m0+1:m0+nst)))
3053 call lalg_eigensolve(nst, hfloq_eff, eigenval)
3054 bands(ik,1:nst) = eigenval(1:nst)
3056 safe_deallocate_a(hfloq_eff)
3059 safe_allocate(eigenval(1:nst*fdim))
3060 safe_allocate(bands(1:nik,1:nst*fdim))
3061 safe_allocate(temp(1:nst*fdim, 1:nst*fdim))
3064 temp(1:nst*fdim, 1:nst*fdim) = hfloquet(ik, 1:nst*fdim, 1:nst*fdim)
3065 call lalg_eigensolve(nst*fdim, temp, eigenval)
3066 bands(ik, 1:nst*fdim) = eigenval(1:nst*fdim)
3071 if (downfolding)
then
3073 filename =
"downfolded_floquet_bands"
3076 filename =
"floquet_bands"
3079 if (st%system_grp%is_root())
then
3081 file = io_open(filename, namespace, action =
'write')
3084 write(file,
'(e13.6, 1x)',advance=
'no') bands(ik,ist)
3091 if (.not. downfolding)
then
3094 bands(1:nik, 1:nst*fdim) = m_zero
3096 temp(1:nst*fdim,1:nst*fdim) = m_zero
3099 temp(ii+1:ii+nst, ii+1:ii+nst) = hfloquet(ik, ii+1:ii+nst, ii+1:ii+nst)
3101 call lalg_eigensolve(nst*fdim, temp, eigenval)
3102 bands(ik, 1:nst*fdim) = eigenval(1:nst*fdim)
3105 if (st%system_grp%is_root())
then
3106 filename =
'trivial_floquet_bands'
3107 file = io_open(filename, namespace, action =
'write')
3110 write(file,
'(e13.6, 1x)', advance=
'no') bands(ik,ist)
3119 call hm%update(gr, namespace, space, ext_partners, time=m_zero)
3121 safe_deallocate_a(hmss)
3122 safe_deallocate_a(psi)
3123 safe_deallocate_a(hpsi)
3124 safe_deallocate_a(temp_state1)
3125 safe_deallocate_a(hfloquet)
3126 safe_deallocate_a(eigenval)
3127 safe_deallocate_a(bands)
3128 safe_deallocate_a(temp)
3129 call states_elec_end(hm_st)
3137 type(c_ptr),
intent(inout) :: out_total_current
3138 class(space_t),
intent(in) :: space
3139 type(grid_t),
intent(in) :: gr
3140 type(states_elec_t),
intent(in) :: st
3141 integer,
intent(in) :: iter
3143 integer :: idir, ispin
3144 character(len=50) :: aux
3145 real(real64) :: total_current(space%dim), abs_current(space%dim)
3149 if (st%system_grp%is_root() .and. iter == 0)
then
3150 call td_write_print_header_init(out_total_current)
3153 call write_iter_header_start(out_total_current)
3155 do idir = 1, space%dim
3156 write(aux,
'(a2,a1,a1)')
'I(', index2axis(idir),
')'
3157 call write_iter_header(out_total_current, aux)
3160 do idir = 1, space%dim
3161 write(aux,
'(a10,a1,a1)')
'IntAbs(j)(', index2axis(idir),
')'
3162 call write_iter_header(out_total_current, aux)
3165 do ispin = 1, st%d%nspin
3166 do idir = 1, space%dim
3167 write(aux,
'(a4,i1,a1,a1,a1)')
'I-sp', ispin,
'(', index2axis(idir),
')'
3168 call write_iter_header(out_total_current, aux)
3172 call write_iter_nl(out_total_current)
3174 call td_write_print_header_end(out_total_current)
3177 assert(
allocated(st%current))
3179 if (st%system_grp%is_root())
then
3180 call write_iter_start(out_total_current)
3183 total_current = 0.0_real64
3184 do idir = 1, space%dim
3185 do ispin = 1, st%d%spin_channels
3186 total_current(idir) = total_current(idir) + dmf_integrate(gr, st%current(:, idir, ispin), reduce = .false.)
3188 total_current(idir) = units_from_atomic(units_out%length/units_out%time, total_current(idir))
3190 call gr%allreduce(total_current, dim = space%dim)
3192 abs_current = 0.0_real64
3193 do idir = 1, space%dim
3194 do ispin = 1, st%d%spin_channels
3195 abs_current(idir) = abs_current(idir) + dmf_integrate(gr, abs(st%current(:, idir, ispin)), reduce = .false.)
3197 abs_current(idir) = units_from_atomic(units_out%length/units_out%time, abs_current(idir))
3199 call gr%allreduce(abs_current, dim = space%dim)
3201 if (st%system_grp%is_root())
then
3202 call write_iter_double(out_total_current, total_current, space%dim)
3203 call write_iter_double(out_total_current, abs_current, space%dim)
3206 do ispin = 1, st%d%nspin
3207 total_current = units_from_atomic(units_out%length/units_out%time, dmf_integrate(gr, space%dim, st%current(:, :, ispin)))
3209 if (st%system_grp%is_root())
then
3210 call write_iter_double(out_total_current, total_current, space%dim)
3214 if (st%system_grp%is_root())
then
3215 call write_iter_nl(out_total_current)
3223 type(c_ptr),
intent(inout) :: out_ionic_current
3224 class(space_t),
intent(in) :: space
3225 class(ions_t),
intent(in) :: ions
3226 integer,
intent(in) :: iter
3229 character(len=50) :: aux
3230 real(real64) :: ionic_current(space%dim), abs_current(space%dim)
3234 if (ions%grp%is_root() .and. iter == 0)
then
3235 call td_write_print_header_init(out_ionic_current)
3238 call write_iter_header_start(out_ionic_current)
3240 do idir = 1, space%dim
3241 write(aux,
'(a2,a1,a1)')
'I(', index2axis(idir),
')'
3242 call write_iter_header(out_ionic_current, aux)
3245 do idir = 1, space%dim
3246 write(aux,
'(a10,a1,a1)')
'IntAbs(j)(', index2axis(idir),
')'
3247 call write_iter_header(out_ionic_current, aux)
3250 call write_iter_nl(out_ionic_current)
3252 call td_write_print_header_end(out_ionic_current)
3255 ionic_current = ions%current()
3256 abs_current = ions%abs_current()
3258 if (ions%grp%is_root())
then
3259 call write_iter_start(out_ionic_current)
3261 call write_iter_double(out_ionic_current, ionic_current, space%dim)
3262 call write_iter_double(out_ionic_current, abs_current, space%dim)
3264 call write_iter_nl(out_ionic_current)
3274 type(c_ptr),
intent(inout) :: write_obj
3275 class(space_t),
intent(in) :: space
3276 type(hamiltonian_elec_t),
intent(inout) :: hm
3277 type(grid_t),
intent(in) :: gr
3278 type(states_elec_t),
intent(in) :: st
3279 integer,
intent(in) :: iter
3281 integer :: idir, ispin
3282 character(len=50) :: aux
3283 real(real64),
allocatable :: heat_current(:, :, :)
3284 real(real64) :: total_current(space%dim)
3288 if (st%system_grp%is_root() .and. iter == 0)
then
3289 call td_write_print_header_init(write_obj)
3292 call write_iter_header_start(write_obj)
3294 do idir = 1, space%dim
3295 write(aux,
'(a2,i1,a1)')
'Jh(', idir,
')'
3296 call write_iter_header(write_obj, aux)
3299 call write_iter_nl(write_obj)
3301 call td_write_print_header_end(write_obj)
3304 safe_allocate(heat_current(1:gr%np, 1:space%dim, 1:st%d%nspin))
3306 call current_heat_calculate(space, gr%der, hm, st, heat_current)
3308 if (st%system_grp%is_root())
call write_iter_start(write_obj)
3310 total_current = 0.0_real64
3311 do idir = 1, space%dim
3312 do ispin = 1, st%d%spin_channels
3313 total_current(idir) = total_current(idir) + dmf_integrate(gr, heat_current(:, idir, ispin))
3315 total_current(idir) = units_from_atomic(units_out%energy*units_out%length/units_out%time, total_current(idir))
3318 safe_deallocate_a(heat_current)
3320 if (st%system_grp%is_root())
call write_iter_double(write_obj, total_current, space%dim)
3322 if (st%system_grp%is_root())
call write_iter_nl(write_obj)
3330 type(c_ptr),
intent(inout) :: out_partial_charges
3331 class(mesh_t),
intent(in) :: mesh
3332 type(states_elec_t),
intent(in) :: st
3333 type(ions_t),
intent(in) :: ions
3334 integer,
intent(in) :: iter
3337 character(len=50) :: aux
3338 real(real64),
allocatable :: hirshfeld_charges(:)
3342 safe_allocate(hirshfeld_charges(1:ions%natoms))
3344 call partial_charges_calculate(mesh, st, ions, hirshfeld_charges)
3346 if (st%system_grp%is_root())
then
3350 call td_write_print_header_init(out_partial_charges)
3353 call write_iter_header_start(out_partial_charges)
3355 do idir = 1, ions%natoms
3356 write(aux,
'(a13,i3,a1)')
'hirshfeld(atom=', idir,
')'
3357 call write_iter_header(out_partial_charges, aux)
3360 call write_iter_nl(out_partial_charges)
3362 call td_write_print_header_end(out_partial_charges)
3365 call write_iter_start(out_partial_charges)
3367 call write_iter_double(out_partial_charges, hirshfeld_charges, ions%natoms)
3369 call write_iter_nl(out_partial_charges)
3372 safe_deallocate_a(hirshfeld_charges)
3378 subroutine td_write_q(out_q, mpi_grp, space, ks, iter)
3379 type(c_ptr),
intent(inout) :: out_q
3380 type(mpi_grp_t),
intent(in) :: mpi_grp
3381 class(space_t),
intent(in) :: space
3382 type(v_ks_t),
intent(in) :: ks
3383 integer,
intent(in) :: iter
3385 integer :: ii, nmodes
3386 character(len=50) :: aux
3387 type(mf_t),
pointer :: pt_mx
3391 nmodes = ks%v_ks_photons%nmodes()
3392 pt_mx => ks%v_ks_photons%get_pt_mx()
3394 if (mpi_grp%is_root())
then
3396 call td_write_print_header_init(out_q)
3397 call write_iter_header_start(out_q)
3399 write(aux,
'(a1,i3,a3)')
'q', ii,
'(t)'
3400 call write_iter_header(out_q, aux)
3403 write(aux,
'(a1,i3,a3)')
'p', ii,
'(t)'
3404 call write_iter_header(out_q, aux)
3406 do ii = 1, space%dim
3407 write(aux,
'(a3,i3,a3)')
'f_pt', ii,
'(t)'
3408 call write_iter_header(out_q, aux)
3410 call write_iter_nl(out_q)
3411 call td_write_print_header_end(out_q)
3414 call write_iter_start(out_q)
3415 call write_iter_double(out_q, pt_mx%pt_q, nmodes)
3416 call write_iter_double(out_q, pt_mx%pt_p, nmodes)
3417 call write_iter_double(out_q, pt_mx%fmf, space%dim)
3418 call write_iter_nl(out_q)
3427 type(c_ptr),
intent(inout) :: out_mxll
3428 type(mpi_grp_t),
intent(in) :: mpi_grp
3429 class(space_t),
intent(in) :: space
3430 type(hamiltonian_elec_t),
intent(in) :: hm
3431 real(real64),
intent(in) :: dt
3432 integer,
intent(in) :: iter
3435 real(real64) :: field(space%dim)
3436 character(len=80) :: aux
3437 character(len=1) :: field_char
3441 if (.not. mpi_grp%is_root())
then
3451 call td_write_print_header_init(out_mxll)
3453 write(aux,
'(a7,e20.12,3a)')
'# dt = ', units_from_atomic(units_out%time, dt), &
3454 " [", trim(units_abbrev(units_out%time)),
"]"
3455 call write_iter_string(out_mxll, aux)
3456 call write_iter_nl(out_mxll)
3458 call write_iter_header_start(out_mxll)
3459 select case (hm%mxll%coupling_mode)
3460 case (length_gauge_dipole, multipolar_expansion)
3461 if (hm%mxll%add_electric_dip) field_char =
'E'
3462 if (hm%mxll%add_magnetic_dip) field_char =
'B'
3463 do idir = 1, space%dim
3464 write(aux,
'(a,i1,a)') field_char //
'(', idir,
')'
3465 call write_iter_header(out_mxll, aux)
3467 case (velocity_gauge_dipole)
3468 do idir = 1, space%dim
3469 write(aux,
'(a,i1,a)')
'A(', idir,
')'
3470 call write_iter_header(out_mxll, aux)
3473 call write_iter_nl(out_mxll)
3475 call write_iter_string(out_mxll,
'#[Iter n.]')
3476 call write_iter_header(out_mxll,
'[' // trim(units_abbrev(units_out%time)) //
']')
3480 select case (hm%mxll%coupling_mode)
3481 case (length_gauge_dipole, multipolar_expansion)
3482 if (hm%mxll%add_electric_dip) aux =
'[' // trim(units_abbrev(units_out%force)) //
']'
3483 if (hm%mxll%add_magnetic_dip) aux =
'[' // trim(units_abbrev(unit_one/units_out%length**2)) //
']'
3484 do idir = 1, space%dim
3485 call write_iter_header(out_mxll, aux)
3487 case (velocity_gauge_dipole)
3488 aux =
'[' // trim(units_abbrev(units_out%energy)) //
']'
3489 do idir = 1, space%dim
3490 call write_iter_header(out_mxll, aux)
3493 call write_iter_nl(out_mxll)
3494 call td_write_print_header_end(out_mxll)
3497 call write_iter_start(out_mxll)
3500 select case (hm%mxll%coupling_mode)
3501 case (length_gauge_dipole, multipolar_expansion)
3502 if (hm%mxll%add_electric_dip) field = units_from_atomic(units_out%force, hm%mxll%e_field_dip)
3503 if (hm%mxll%add_magnetic_dip) field = units_from_atomic(unit_one/units_out%length**2, hm%mxll%b_field_dip)
3504 call write_iter_double(out_mxll, field, space%dim)
3505 case (velocity_gauge_dipole)
3506 field = units_from_atomic(units_out%energy, hm%mxll%vec_pot_dip)
3507 call write_iter_double(out_mxll, field, space%dim)
3509 call write_iter_nl(out_mxll)
3517 type(c_ptr),
intent(inout) :: out_coords
3518 type(mpi_grp_t),
intent(in) :: mpi_grp
3519 type(lda_u_t),
intent(in) :: lda_u
3520 integer,
intent(in) :: iter
3523 character(len=50) :: aux
3525 if (.not. mpi_grp%is_root())
return
3530 call td_write_print_header_init(out_coords)
3533 call write_iter_header_start(out_coords)
3535 do ios = 1, lda_u%norbsets
3536 write(aux,
'(a2,i3,a1)')
'Ueff(', ios,
')'
3537 call write_iter_header(out_coords, aux)
3540 do ios = 1, lda_u%norbsets
3541 write(aux,
'(a2,i3,a1)')
'U(', ios,
')'
3542 call write_iter_header(out_coords, aux)
3545 do ios = 1, lda_u%norbsets
3546 write(aux,
'(a2,i3,a1)')
'J(', ios,
')'
3547 call write_iter_header(out_coords, aux)
3550 if (lda_u%intersite)
then
3551 do ios = 1, lda_u%norbsets
3552 do inn = 1, lda_u%orbsets(ios)%nneighbors
3553 write(aux,
'(a2,i3,a1,i3,a1)')
'V(', ios,
'-', inn,
')'
3554 call write_iter_header(out_coords, aux)
3560 call write_iter_nl(out_coords)
3563 call write_iter_string(out_coords,
'#[Iter n.]')
3564 call write_iter_header(out_coords,
'[' // trim(units_abbrev(units_out%time)) //
']')
3565 call write_iter_string(out_coords, &
3566 'Effective U ' // trim(units_abbrev(units_out%energy)) // &
3567 ', U in '// trim(units_abbrev(units_out%energy)) // &
3568 ', J in ' // trim(units_abbrev(units_out%energy)))
3569 call write_iter_nl(out_coords)
3571 call td_write_print_header_end(out_coords)
3574 call write_iter_start(out_coords)
3576 do ios = 1, lda_u%norbsets
3577 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3578 lda_u%orbsets(ios)%Ueff), 1)
3581 do ios = 1, lda_u%norbsets
3582 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3583 lda_u%orbsets(ios)%Ubar), 1)
3586 do ios = 1, lda_u%norbsets
3587 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3588 lda_u%orbsets(ios)%Jbar), 1)
3591 if (lda_u%intersite)
then
3592 do ios = 1, lda_u%norbsets
3593 do inn = 1, lda_u%orbsets(ios)%nneighbors
3594 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3595 lda_u%orbsets(ios)%V_ij(inn,0)), 1)
3600 call write_iter_nl(out_coords)
3607 type(c_ptr),
intent(inout) :: file_handle
3608 type(grid_t),
intent(in) :: grid
3609 type(hamiltonian_elec_t),
intent(in) :: hm
3610 type(kpoints_t),
intent(in) :: kpoints
3611 type(states_elec_t),
intent(in) :: st
3612 integer,
intent(in) :: iter
3614 integer :: ik_ispin, ist
3615 character(len=7) :: nkpt_str, nst_str
3616 character(len=7) :: ik_str, ist_str
3617 real(real64),
allocatable :: norm_ks(:, :)
3618 real(real64) :: n_electrons
3622 safe_allocate(norm_ks(1:st%nst, 1:st%nik))
3623 if (st%requires_generalized_overlap)
then
3624 call states_elec_calc_norms(grid, kpoints, st, norm_ks, aug_overlap=hm%aug_overlap, phase=hm%phase)
3626 call states_elec_calc_norms(grid, kpoints, st, norm_ks)
3629 if (st%system_grp%is_root())
then
3632 call td_write_print_header_init(file_handle)
3635 write(nkpt_str,
'(I7)') st%nik
3636 write(nst_str,
'(I7)') st%nst
3637 call write_iter_string(file_handle,
'# Dimensions. (nstates, nkpt * nspin):')
3638 call write_iter_string(file_handle, trim(adjustl(nst_str)) //
' ' // trim(adjustl(nkpt_str)))
3639 call write_iter_nl(file_handle)
3642 call write_iter_string(file_handle,
'# Norm ordering: (istate, ikpoint_spin)')
3643 call write_iter_nl(file_handle)
3646 call write_iter_header_start(file_handle)
3647 call write_iter_header(file_handle,
'N_electrons')
3648 do ik_ispin = 1, st%nik
3650 write(ik_str,
'(I7)') ik_ispin
3651 write(ist_str,
'(I7)') ist
3652 call write_iter_header(file_handle, &
3653 'Norm (' // trim(ist_str) //
',' // trim(ik_str) //
')')
3656 call write_iter_nl(file_handle)
3657 call td_write_print_header_end(file_handle)
3661 n_electrons = sum(st%occ * norm_ks**2)
3664 call write_iter_start(file_handle)
3665 call write_iter_double(file_handle, n_electrons, 1)
3666 do ik_ispin = 1, st%nik
3667 call write_iter_double(file_handle, norm_ks(:, ik_ispin),
size(norm_ks, 1))
3669 call write_iter_nl(file_handle)
3673 safe_deallocate_a(norm_ks)
3682 type(c_ptr),
intent(inout) :: file_handle
3683 type(ions_t),
intent(in) :: ions
3684 integer,
intent(in) :: iter
3687 real(real64) :: tmp(3)
3689 if (.not. ions%grp%is_root())
return
3693 assert(ions%space%dim == 3)
3696 call td_write_print_header_init(file_handle)
3699 call write_iter_header_start(file_handle)
3701 call write_iter_string(file_handle,
'# Iter, a, b, c, volume, alpha, beta, gamma, ' &
3702 //
'a_x, a_y, a_z, b_x, b_y, b_z, c_x, c_y, c_z')
3705 call write_iter_string(file_handle,
'#[Iter n.]')
3706 call write_iter_header(file_handle,
'[' // trim(units_abbrev(units_out%time)) //
']')
3707 call write_iter_string(file_handle, &
3708 'Lengths in ' // trim(units_abbrev(units_out%length)) // &
3709 ', Volume in ' // trim(units_abbrev(units_out%length**3)) // &
3710 ', Angles in degree, Lattice vectors in '// trim(units_abbrev(units_out%length)))
3711 call write_iter_nl(file_handle)
3713 call td_write_print_header_end(file_handle)
3716 call write_iter_start(file_handle)
3720 tmp(idir) = units_from_atomic(units_out%length, norm2(ions%latt%rlattice(1:3, idir)))
3722 call write_iter_double(file_handle, tmp, 3)
3725 tmp(1) = units_from_atomic(units_out%length**3, ions%latt%rcell_volume)
3726 call write_iter_double(file_handle, tmp(1), 1)
3729 call write_iter_double(file_handle, ions%latt%alpha, 1)
3730 call write_iter_double(file_handle, ions%latt%beta, 1)
3731 call write_iter_double(file_handle, ions%latt%gamma, 1)
3735 tmp(1:3) = units_from_atomic(units_out%length, ions%latt%rlattice(:, idir))
3736 call write_iter_double(file_handle, tmp, 3)
3738 call write_iter_nl(file_handle)
3747 type(namespace_t),
intent(in) :: namespace
3748 integer,
intent(in) :: iter
3749 real(real64),
intent(in) :: dt
3750 type(mpi_grp_t),
intent(in) :: grp
3752 integer :: default, flags, iout, first
3807 call parse_variable(namespace,
'MaxwellTDOutput', default, flags)
3809 if (.not. varinfo_valid_option(
'MaxwellTDOutput', flags, is_flag = .
true.))
then
3810 call messages_input_error(namespace,
'MaxwellTDOutput')
3814 writ%out(iout)%write = (iand(flags, 2**(iout - 1)) /= 0)
3815 if (writ%out(iout)%write)
then
3816 writ%out(iout + 1)%write = .
true.
3822 writ%out(iout)%write = (iand(flags, 2**(iout - 1)) /= 0)
3831 writ%out(:)%mpi_grp = grp
3833 call io_mkdir(
'td.general', namespace)
3838 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_e_field_x", namespace)))
3840 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_e_field_y", namespace)))
3842 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_e_field_z", namespace)))
3848 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_b_field_x", namespace)))
3850 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_b_field_y", namespace)))
3852 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_b_field_z", namespace)))
3858 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_e_field_x", namespace)))
3860 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_e_field_y", namespace)))
3862 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_e_field_z", namespace)))
3868 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_b_field_x", namespace)))
3870 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_b_field_y", namespace)))
3872 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_b_field_z", namespace)))
3878 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_e_field_x", namespace)))
3880 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_e_field_y", namespace)))
3882 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_e_field_z", namespace)))
3888 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_b_field_x", namespace)))
3890 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_b_field_y", namespace)))
3892 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_b_field_z", namespace)))
3898 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/maxwell_energy", namespace)))
3903 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/electric_field_surface-x", namespace)))
3908 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/electric_field_surface-y", namespace)))
3913 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/electric_field_surface-z", namespace)))
3918 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/magnetic_field_surface-x", namespace)))
3923 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/magnetic_field_surface-y", namespace)))
3928 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/magnetic_field_surface-z", namespace)))
3944 if (writ%out(iout)%write)
call write_iter_end(writ%out(iout)%handle)
3952 subroutine td_write_mxll_iter(writ, space, gr, st, hm, helmholtz, dt, iter, namespace)
3954 class(space_t),
intent(in) :: space
3955 type(grid_t),
intent(inout) :: gr
3956 type(states_mxll_t),
intent(inout) :: st
3957 type(hamiltonian_mxll_t),
intent(inout) :: hm
3958 type(helmholtz_decomposition_t),
intent(inout) :: helmholtz
3959 real(real64),
intent(in) :: dt
3960 integer,
intent(in) :: iter
3961 type(namespace_t),
intent(in) :: namespace
3966 call profiling_in(
"TD_WRITE_ITER_MAXWELL")
3969 call helmholtz%get_trans_field(namespace, st%rs_state_trans, total_field=st%rs_state)
3970 call get_rs_state_at_point(st%selected_points_rs_state_trans(:,:), st%rs_state_trans, &
3971 st%selected_points_coordinate(:,:), st, gr)
3974 hm%energy%energy_trans = m_zero
3978 call helmholtz%get_long_field(namespace, st%rs_state_long, total_field=st%rs_state)
3979 call get_rs_state_at_point(st%selected_points_rs_state_long(:,:), st%rs_state_long, &
3980 st%selected_points_coordinate(:,:), st, gr)
3983 hm%energy%energy_long = m_zero
4076 call profiling_out(
"TD_WRITE_ITER_MAXWELL")
4085 type(mpi_grp_t),
intent(in) :: mpi_grp
4086 type(hamiltonian_mxll_t),
intent(in) :: hm
4087 integer,
intent(in) :: iter
4091 integer :: n_columns
4093 if (.not. mpi_grp%is_root())
return
4118 call write_iter_header(
out_maxwell_energy,
'[' // trim(units_abbrev(units_out%time)) //
']')
4120 do ii = 1, n_columns
4121 call write_iter_header(
out_maxwell_energy,
'[' // trim(units_abbrev(units_out%energy)) //
']')
4129 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy), 1)
4130 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%e_energy), 1)
4131 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%b_energy), 1)
4133 hm%energy%energy+hm%energy%boundaries), 1)
4134 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%boundaries), 1)
4135 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy_trans), 1)
4136 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy_long), 1)
4137 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy_plane_waves), 1)
4146 type(c_ptr),
intent(inout) :: out_field_surf
4147 type(states_mxll_t),
intent(in) :: st
4148 integer,
intent(in) :: dim
4149 integer,
intent(in) :: iter
4153 integer :: n_columns
4155 if (.not. st%system_grp%is_root())
return
4162 call td_write_print_header_init(out_field_surf)
4165 call write_iter_header_start(out_field_surf)
4166 call write_iter_header(out_field_surf,
'- x direction')
4167 call write_iter_header(out_field_surf,
'+ x direction')
4168 call write_iter_header(out_field_surf,
'- y direction')
4169 call write_iter_header(out_field_surf,
'+ y direction')
4170 call write_iter_header(out_field_surf,
'- z direction')
4171 call write_iter_header(out_field_surf,
'+ z direction')
4172 call write_iter_header(out_field_surf,
'- x dir. p. w.')
4173 call write_iter_header(out_field_surf,
'+ x dir. p. w.')
4174 call write_iter_header(out_field_surf,
'- y dir. p. w.')
4175 call write_iter_header(out_field_surf,
'+ y dir. p. w.')
4176 call write_iter_header(out_field_surf,
'- z dir. p. w.')
4177 call write_iter_header(out_field_surf,
'+ z dir. p. w.')
4179 call write_iter_nl(out_field_surf)
4182 call write_iter_string(out_field_surf,
'#[Iter n.]')
4183 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(units_out%time)) //
']')
4185 do ii = 1, n_columns
4186 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(units_out%energy/units_out%length)) //
']')
4188 call write_iter_nl(out_field_surf)
4190 call td_write_print_header_end(out_field_surf)
4193 call write_iter_start(out_field_surf)
4194 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4195 st%electric_field_box_surface(1,1,dim)), 1)
4196 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4197 st%electric_field_box_surface(2,1,dim)), 1)
4198 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4199 st%electric_field_box_surface(1,2,dim)), 1)
4200 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4201 st%electric_field_box_surface(2,2,dim)), 1)
4202 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4203 st%electric_field_box_surface(1,3,dim)), 1)
4204 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4205 st%electric_field_box_surface(2,3,dim)), 1)
4206 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4207 st%electric_field_box_surface_plane_waves(1,1,dim)), 1)
4208 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4209 st%electric_field_box_surface_plane_waves(2,1,dim)), 1)
4210 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4211 st%electric_field_box_surface_plane_waves(1,2,dim)), 1)
4212 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4213 st%electric_field_box_surface_plane_waves(2,2,dim)), 1)
4214 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4215 st%electric_field_box_surface_plane_waves(1,3,dim)), 1)
4216 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4217 st%electric_field_box_surface_plane_waves(2,3,dim)), 1)
4218 call write_iter_nl(out_field_surf)
4226 type(c_ptr),
intent(inout) :: out_field_surf
4227 type(states_mxll_t),
intent(in) :: st
4228 integer,
intent(in) :: dim
4229 integer,
intent(in) :: iter
4233 integer :: n_columns
4235 if (.not. st%system_grp%is_root())
return
4242 call td_write_print_header_init(out_field_surf)
4245 call write_iter_header_start(out_field_surf)
4246 call write_iter_header(out_field_surf,
'- x direction')
4247 call write_iter_header(out_field_surf,
'+ x direction')
4248 call write_iter_header(out_field_surf,
'- y direction')
4249 call write_iter_header(out_field_surf,
'+ y direction')
4250 call write_iter_header(out_field_surf,
'- z direction')
4251 call write_iter_header(out_field_surf,
'+ z direction')
4252 call write_iter_header(out_field_surf,
'- x dir. p. w.')
4253 call write_iter_header(out_field_surf,
'+ x dir. p. w.')
4254 call write_iter_header(out_field_surf,
'- y dir. p. w.')
4255 call write_iter_header(out_field_surf,
'+ y dir. p. w.')
4256 call write_iter_header(out_field_surf,
'- z dir. p. w.')
4257 call write_iter_header(out_field_surf,
'+ z dir. p. w.')
4259 call write_iter_nl(out_field_surf)
4262 call write_iter_string(out_field_surf,
'#[Iter n.]')
4263 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(units_out%time)) //
']')
4265 do ii = 1, n_columns
4266 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(unit_one/units_out%length**2)) //
']')
4268 call write_iter_nl(out_field_surf)
4270 call td_write_print_header_end(out_field_surf)
4273 call write_iter_start(out_field_surf)
4274 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4275 st%magnetic_field_box_surface(1,1,dim)), 1)
4276 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4277 st%magnetic_field_box_surface(2,1,dim)), 1)
4278 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4279 st%magnetic_field_box_surface(1,2,dim)), 1)
4280 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4281 st%magnetic_field_box_surface(2,2,dim)), 1)
4282 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4283 st%magnetic_field_box_surface(1,3,dim)), 1)
4284 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4285 st%magnetic_field_box_surface(2,3,dim)), 1)
4286 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4287 st%magnetic_field_box_surface_plane_waves(1,1,dim)), 1)
4288 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4289 st%magnetic_field_box_surface_plane_waves(2,1,dim)), 1)
4290 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4291 st%magnetic_field_box_surface_plane_waves(1,2,dim)), 1)
4292 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4293 st%magnetic_field_box_surface_plane_waves(2,2,dim)), 1)
4294 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4295 st%magnetic_field_box_surface_plane_waves(1,3,dim)), 1)
4296 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4297 st%magnetic_field_box_surface_plane_waves(2,3,dim)), 1)
4298 call write_iter_nl(out_field_surf)
4304 subroutine td_write_fields(out_fields, space, st, iter, dt, e_or_b_field, field_type, idir)
4305 type(c_ptr),
intent(inout) :: out_fields
4306 class(space_t),
intent(in) :: space
4307 type(states_mxll_t),
intent(in) :: st
4308 integer,
intent(in) :: iter
4309 real(real64),
intent(in) :: dt
4310 integer,
intent(in) :: e_or_b_field
4311 integer,
intent(in) :: field_type
4312 integer,
intent(in) :: idir
4316 real(real64) :: field(space%dim), selected_field
4317 character(len=80) :: aux
4319 if (.not. st%system_grp%is_root())
return
4324 call td_write_print_header_init(out_fields)
4327 write(aux,
'(a7,e20.12,3a)')
'# dt = ', units_from_atomic(units_out%time, dt), &
4328 " [", trim(units_abbrev(units_out%time)),
"]"
4329 call write_iter_string(out_fields, aux)
4330 call write_iter_nl(out_fields)
4332 call write_iter_header_start(out_fields)
4334 do id = 1, st%selected_points_number
4335 select case (e_or_b_field)
4337 write(aux,
'(a,i1,a)')
'E(', id,
')'
4339 write(aux,
'(a,i1,a)')
'B(', id,
')'
4341 call write_iter_header(out_fields, aux)
4344 call write_iter_nl(out_fields)
4345 call write_iter_string(out_fields,
'#[Iter n.]')
4346 call write_iter_header(out_fields,
' [' // trim(units_abbrev(units_out%time)) //
']')
4351 aux =
' [' // trim(units_abbrev(units_out%force)) //
']'
4352 do id = 1, st%selected_points_number
4353 call write_iter_header(out_fields, aux)
4355 call write_iter_nl(out_fields)
4356 call td_write_print_header_end(out_fields)
4359 call write_iter_start(out_fields)
4361 do id = 1, st%selected_points_number
4362 select case (e_or_b_field)
4365 select case (field_type)
4367 call get_electric_field_vector(st%selected_points_rs_state(:,id), field(1:st%dim))
4369 call get_electric_field_vector(st%selected_points_rs_state_long(:,id), field(1:st%dim))
4371 call get_electric_field_vector(st%selected_points_rs_state_trans(:,id), field(1:st%dim))
4373 selected_field = units_from_atomic(units_out%energy/units_out%length, field(idir))
4376 select case (field_type)
4378 call get_magnetic_field_vector(st%selected_points_rs_state(:,id), st%rs_sign, field(1:st%dim))
4380 call get_magnetic_field_vector(st%selected_points_rs_state_long(:,id), st%rs_sign, field(1:st%dim))
4382 call get_magnetic_field_vector(st%selected_points_rs_state_trans(:,id), st%rs_sign, field(1:st%dim))
4384 selected_field = units_from_atomic(unit_one/units_out%length**2, field(idir))
4386 call write_iter_double(out_fields, selected_field, 1)
4389 call write_iter_nl(out_fields)
4397 type(namespace_t),
intent(in) :: namespace
4398 class(space_t),
intent(in) :: space
4399 type(grid_t),
intent(inout) :: gr
4400 type(states_mxll_t),
intent(inout) :: st
4401 type(hamiltonian_mxll_t),
intent(inout) :: hm
4402 type(helmholtz_decomposition_t),
intent(inout) :: helmholtz
4403 type(output_t),
intent(in) :: outp
4404 integer,
intent(in) :: iter
4405 real(real64),
intent(in) :: time
4407 character(len=256) :: filename
4409 push_sub(td_write_mxwll_free_data)
4410 call profiling_in(
"TD_WRITE_MAXWELL_DATA")
4413 write(filename,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
4415 call output_mxll(outp, namespace, space, gr, st, hm, helmholtz, time, filename)
4417 call profiling_out(
"TD_WRITE_MAXWELL_DATA")
4418 pop_sub(td_write_mxwll_free_data)
ssize_t ssize_t write(int __fd, const void *__buf, size_t __n) __attribute__((__access__(__read_only__
constant times a vector plus a vector
Copies a vector x, to a vector y.
Sets the iteration number to the C object.
Writes to the corresponding file and adds one to the iteration. Must be called after write_iter_init(...
double exp(double __x) __attribute__((__nothrow__
pure logical function, public accel_is_enabled()
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
This module contains interfaces for BLAS routines You should not use these routines directly....
This module implements a calculator for the density and defines related functions.
subroutine, public density_calc(st, gr, density, istin, ep, vnl, phase)
Computes the density from the orbitals in st.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
integer, parameter, public spinors
integer, parameter, public spin_polarized
subroutine, public excited_states_kill(excited_state)
Kills an excited_state structure.
subroutine, public excited_states_init(excited_state, ground_state, filename, namespace)
Fills in an excited_state structure, by reading a file called "filename". This file describes the "pr...
type(gauge_field_t) function, pointer, public list_get_gauge_field(partners)
logical function, public list_has_lasers(partners)
type(lasers_t) function, pointer, public list_get_lasers(partners)
subroutine, public gauge_field_output_write(this, out_gauge, mpi_grp, iter)
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
complex(real64), parameter, public m_z0
real(real64), parameter, public lmm_r_single_atom
Default local magnetic moments sphere radius for an isolated system.
complex(real64), parameter, public m_zi
integer, parameter, public max_output_types
real(real64), parameter, public m_half
real(real64), parameter, public m_one
real(real64), parameter, public m_min_occ
Minimal occupation that is considered to be non-zero.
This module implements the underlying real-space grid.
subroutine, public zhamiltonian_elec_apply_overlap_single(hm, namespace, mesh, psi, spsi, ist, ik, set_bc, set_phase, inverse)
Apply the overlap S (or its inverse) to a single state (wrapper around the batch routine).
subroutine, public zhamiltonian_elec_apply_overlap_batch(hm, namespace, mesh, psib, spsib, set_bc, inverse, set_phase)
Apply the generalized ultrasoft overlap operator S (or its inverse) to a batch.
The Helmholtz decomposition is intended to contain "only mathematical" functions and procedures to co...
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 io_close(iunit, grp)
character(len=max_path_len) function, public io_workpath(path, namespace)
construct path name from given name and namespace
subroutine, public io_rm(fname, namespace)
subroutine, public io_mkdir(fname, namespace, parents)
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
real(real64) function, public ion_dynamics_temperature(ions)
This function returns the ionic temperature in energy units.
integer, parameter, public qkickmode_cos
integer, parameter, public qkickmode_none
integer, parameter, public qkickmode_sin
subroutine, public kick_function_get(space, mesh, kick, kick_function, iq, to_interpolate)
subroutine, public kick_write(kick, iunit, out)
integer, parameter, public qkickmode_bessel
subroutine, public lasers_nondipole_laser_field_step(this, field, time)
Retrieves the NDSFA vector_potential correction. The nondipole field is obtained for consecutive time...
subroutine, public lasers_set_nondipole_parameters(this, ndfield, nd_integration_time)
Set parameters for nondipole SFA calculation.
logical function, public lasers_with_nondipole_field(lasers)
Check if a nondipole SFA correction should be computed for the given laser.
integer, parameter, public e_field_electric
integer, parameter, public e_field_vector_potential
integer, parameter, public e_field_scalar_potential
integer pure elemental function, public laser_kind(laser)
subroutine, public laser_field(laser, field, time)
Retrieves the value of either the electric or the magnetic field. If the laser is given by a scalar p...
integer, parameter, public e_field_magnetic
integer, parameter, public dft_u_none
integer, parameter, public dft_u_acbn0
subroutine, public magnetic_local_moments(mesh, st, ions, boundaries, rho, rr, lmm)
subroutine, public magnetic_moment(mesh, st, rho, mm)
subroutine, public magnetic_total_magnetization(mesh, st, qq, trans_mag)
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public ylmr_real(xx, li, mi, ylm)
This is a Numerical Recipes-based subroutine computes real spherical harmonics ylm at position (x,...
This module defines functions over batches of mesh functions.
subroutine, public zmesh_batch_dotp_matrix(mesh, aa, bb, dot, reduce)
Calculate the overlap matrix of two batches.
This module defines various routines, operating on mesh functions.
subroutine, public dmf_multipoles(mesh, ff, lmax, multipole, mask)
This routine calculates the multipoles of a function ff.
This module defines the meshes, which are used in Octopus.
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_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
subroutine, public modelmb_sym_all_states(space, mesh, st)
This module handles the communicators for the various parallelization strategies.
integer, parameter, public velocity_gauge_dipole
this module contains the low-level part of the output system
subroutine, public output_modelmb(outp, namespace, space, dir, gr, ions, iter, st)
this module contains the output system
subroutine, public output_scalar_pot(outp, namespace, space, dir, mesh, ions, ext_partners, grp, time)
subroutine, public output_all(outp, namespace, space, dir, gr, ions, iter, st, hm, ks)
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
integer, parameter, public restart_gs
integer, parameter, public restart_proj
integer, parameter, public restart_type_load
pure logical function, public states_are_complex(st)
subroutine, public zstates_elec_matrix(st1, st2, mesh, aa, aug_overlap, phase)
subroutine, public zstates_elec_calc_projections(st, gs_st, namespace, mesh, ik, proj, gs_nst, aug_overlap, phase)
This routine computes the projection between two set of states.
This module handles spin dimensions of the states and the k-point distribution.
logical function, public state_kpt_is_local(st, ist, ik)
check whether a given state (ist, ik) is on the local node
subroutine, public states_elec_end(st)
finalize the states_elec_t object
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.
subroutine, public states_elec_copy(stout, stin, exclude_wfns, exclude_eigenval, special, dest_type, copy_data)
make a (selective) copy of a states_elec_t object
subroutine, public states_elec_look(restart, nik, dim, nst, ierr)
Reads the 'states' file in the restart directory, and finds out the nik, dim, and nst contained in it...
This module handles reading and writing restart information for the states_elec_t.
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, public td_calc_tacc(namespace, space, gr, ions, ext_partners, st, hm, acc, time)
Electronic acceleration (to calculate harmonic spectrum...) It is calculated as:
subroutine, public td_calc_tvel(namespace, gr, st, space, hm, ions, vel)
Electronic velocity (to calculate harmonic spectrum...) It is calculated as:
subroutine, public td_calc_ionch(mesh, st, ch, Nch)
Multiple ionization probabilities calculated form the KS orbital densities C. Ullrich,...
subroutine, public td_write_sep_coordinates(out_coords, mpi_grp, natoms, space, pos, vel, tot_forces, iter, which)
subroutine, public td_write_coordinates(out_coords, mpi_grp, natoms, space, pos, vel, tot_forces, iter)
subroutine, public td_write_print_header_init(out)
subroutine, public td_write_print_header_end(out)
subroutine td_write_magnetic_field_box_surface(out_field_surf, st, dim, iter)
integer, parameter, public out_total_current
integer, parameter maxwell_b_field
integer, parameter, public out_maxwell_max
integer, parameter, public out_q
integer, parameter, public out_mxll_field
integer, parameter out_b_field_surface_y
subroutine, public td_write_iter(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, kick, ks, dt, iter, mc, recalculate_gs, dmp)
subroutine td_write_ionch(out_ionch, mesh, st, iter)
integer, parameter, public out_tot_m
integer, parameter, public out_norm_ks
subroutine td_write_populations(out_populations, namespace, space, mesh, hm, st, writ, dt, iter)
integer, parameter out_maxwell_trans_b_field
integer, parameter, public out_cell_parameters
subroutine td_write_multipole_r(out_multip, space, mesh, ions, st, lmax, kick, rho, iter, mpi_grp)
Write multipoles to the corresponding file.
integer, parameter, public out_proj
integer, parameter, public out_partial_charges
integer, parameter, public out_separate_coords
subroutine, public td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, iter, dt)
integer, parameter out_dftu_effective_u
integer, parameter maxwell_trans_field
subroutine td_write_energy(out_energy, mpi_grp, hm, iter, ke)
subroutine td_write_acc(out_acc, namespace, space, gr, ions, st, hm, ext_partners, dt, iter)
subroutine, public td_write_mxll_end(writ)
integer, parameter out_b_field_surface_x
integer, parameter out_maxwell_long_e_field
integer, parameter, public out_kp_proj
subroutine calc_projections(mesh, namespace, hm, st, gs_st, projections)
This subroutine calculates:
integer, parameter, public out_magnets
subroutine td_write_multipole(out_multip, space, gr, ions, st, lmax, kick, iter)
Top-level routine that write multipoles to file, or files depending on whether a state-resolved outpu...
subroutine td_write_electric_field_box_surface(out_field_surf, st, dim, iter)
subroutine td_write_floquet(namespace, space, hm, ext_partners, gr, st, iter)
integer, parameter out_e_field_surface_y
integer, parameter, public out_angular
integer, parameter, public out_max
subroutine td_write_mxll_field(out_mxll, mpi_grp, space, hm, dt, iter)
integer, parameter out_maxwell_long_b_field
integer, parameter, public out_energy
subroutine, public td_write_mxll_init(writ, namespace, iter, dt, grp)
integer, parameter, public out_spin
subroutine td_write_ftchd(out_ftchd, space, mesh, st, kick, iter)
subroutine td_write_norm_ks_orbitals(file_handle, grid, hm, kpoints, st, iter)
Write the norm of the KS orbitals to file as a function of time step.
subroutine td_write_partial_charges(out_partial_charges, mesh, st, ions, iter)
subroutine td_write_total_current(out_total_current, space, gr, st, iter)
integer, parameter out_dftu_max
For the Maxwell fields we increment in steps of 3 to leave room for x, y, and z output.
subroutine td_write_effective_u(out_coords, mpi_grp, lda_u, iter)
subroutine td_write_proj_kp(mesh, hm, kpoints, st, gs_st, namespace, iter)
integer, parameter out_maxwell_total_b_field
integer, parameter, public out_ftchd
subroutine, public td_write_init(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, ks, ions_move, with_gauge_field, kick, iter, max_iter, dt, mc, dmp)
Initialize files to write when prograting in time.
integer, parameter, public out_separate_velocity
subroutine td_write_tot_mag(out_magnets, mesh, st, kick, iter)
subroutine td_write_proj(out_proj, namespace, space, mesh, ions, hm, st, gs_st, kick, iter)
integer, parameter, public out_floquet
subroutine td_write_spin(out_spin, mpi_grp, mesh, st, iter)
subroutine, public td_write_mxll_free_data(namespace, space, gr, st, hm, helmholtz, outp, iter, time)
integer, parameter, public out_acc
integer, parameter, public out_ion_ch
integer, parameter maxwell_long_field
integer, parameter, public out_n_ex
integer, parameter out_b_field_surface_z
subroutine td_write_temperature(out_temperature, mpi_grp, ions, iter)
integer, parameter, public out_temperature
subroutine, public td_write_data(writ)
subroutine td_write_total_heat_current(write_obj, space, hm, gr, st, iter)
integer, parameter out_e_field_surface_z
subroutine td_write_laser(out_laser, mpi_grp, space, lasers, dt, iter)
integer, parameter maxwell_total_field
integer, parameter, public out_coords
integer, parameter out_maxwell_total_e_field
integer, parameter, public out_laser
integer, parameter, public out_eigs
integer, parameter, public out_total_heat_current
integer, parameter out_e_field_surface_x
subroutine, public td_write_kick(outp, namespace, space, mesh, kick, ions, iter)
subroutine td_write_q(out_q, mpi_grp, space, ks, iter)
subroutine td_write_maxwell_energy(out_maxwell_energy, mpi_grp, hm, iter)
integer, parameter, public out_ionic_current
subroutine, public td_write_end(writ)
subroutine td_write_angular(out_angular, namespace, space, gr, ions, hm, st, kick, iter)
Computes and outputs the orbital angular momentum defined by.
integer, parameter, public out_dm_proj_basis
subroutine td_write_eigs(out_eigs, st, iter)
subroutine td_write_fields(out_fields, space, st, iter, dt, e_or_b_field, field_type, idir)
integer, parameter, public out_vel
integer, parameter, public out_gauge_field
subroutine td_write_ionic_current(out_ionic_current, space, ions, iter)
subroutine td_write_n_ex(out_nex, outp, namespace, mesh, hm, kpoints, st, gs_st, iter)
This routine computes the total number of excited electrons based on projections on the GS orbitals T...
integer, parameter maxwell_e_field
integer, parameter, public out_populations
subroutine, public td_write_mxll_iter(writ, space, gr, st, hm, helmholtz, dt, iter, namespace)
subroutine td_write_cell_parameters(file_handle, ions, iter)
Write the cell parameters as a function of time.
subroutine td_write_local_magnetic_moments(out_magnets, gr, st, ions, lmm_r, iter)
subroutine td_write_vel(out_vel, namespace, gr, st, space, hm, ions, iter)
integer, parameter out_maxwell_energy
integer, parameter, public out_separate_forces
integer, parameter out_maxwell_trans_e_field
type(type_t), parameter, public type_cmplx
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_t), public unit_kelvin
For converting energies into temperatures.
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.
character pure function, public index2axis(idir)
subroutine, public v_ks_calculate_current(this, calc_cur)
subroutine, public v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval, time, calc_energy, calc_current, force_semilocal)
Explicit interfaces to C functions, defined in write_iter_low.cc.
subroutine, public write_iter_header(out, string)
subroutine, public write_iter_string(out, string)
subroutine, public write_iter_init(out, iter, factor, file)
Extension of space that contains the knowledge of the spin dimension.
Description of the grid, containing information on derivatives, stencil, and symmetries.
Describes mesh distribution to nodes.
This is defined even when running serial.
Stores all communicators and groups.
The states_elec_t class contains all electronic wave functions.
Time-dependent Write Properties.
batches of electronic states
subroutine dipole_matrix_elements(dir)