48 use,
intrinsic :: iso_fortran_env
109 integer,
parameter,
public :: &
110 OUT_MULTIPOLES = 1, &
149 character(len=100) :: td_file_name(OUT_MAX) = [character(100) :: &
159 "magnetic_moments", &
174 "total_heat_current", &
175 "total_magnetization", &
177 "maxwell_dipole_field", &
178 "norm_wavefunctions", &
183 integer,
parameter :: &
184 OUT_DFTU_EFFECTIVE_U = 1, &
188 integer,
parameter :: &
189 OUT_MAXWELL_TOTAL_E_FIELD = 1, &
203 integer,
parameter,
public :: &
206 integer,
parameter :: &
211 integer,
parameter :: &
217 type(c_ptr) :: handle
218 type(c_ptr),
allocatable :: mult_handles(:)
220 integer :: hand_start
222 logical ::
write = .false.
223 logical :: resolve_states = .false.
235 real(real64) :: lmm_r
238 integer :: n_excited_states
240 integer :: compute_interval
246 subroutine td_write_kick(outp, namespace, space, mesh, kick, ions, iter)
250 class(
mesh_t),
intent(in) :: mesh
251 type(
kick_t),
intent(in) :: kick
252 type(
ions_t),
intent(in) :: ions
253 integer,
intent(in) :: iter
255 complex(real64),
allocatable :: kick_function(:)
256 character(len=256) :: filename
261 write(filename,
'(a,i7.7)')
"td.", iter
262 if (outp%what(option__output__delta_perturbation))
then
263 safe_allocate(kick_function(1:mesh%np))
265 call zio_function_output(outp%how(option__output__delta_perturbation), filename,
"kick_function", namespace, &
266 space, mesh, kick_function(:),
units_out%energy, err, pos=ions%pos, atoms=ions%atom)
267 safe_deallocate_a(kick_function)
283 subroutine td_write_init(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, ks, ions_move, &
284 with_gauge_field, kick, iter, max_iter, dt, mc, dmp)
288 type(
output_t),
intent(inout) :: outp
289 type(
grid_t),
intent(in) :: gr
292 type(
ions_t),
intent(in) :: ions
294 type(
v_ks_t),
intent(inout) :: ks
295 logical,
intent(in) :: ions_move
296 logical,
intent(in) :: with_gauge_field
297 type(
kick_t),
intent(in) :: kick
298 integer,
intent(in) :: iter
299 integer,
intent(in) :: max_iter
300 real(real64),
intent(in) :: dt
302 type(
dmp_t),
intent(in) :: dmp
305 integer :: ierr, first, ii, ist, jj, flags, iout, default, ifile
310 character(len=MAX_PATH_LEN) :: filename
311 type(restart_t) :: restart_gs
312 logical :: resolve_states
313 logical,
allocatable :: skip(:)
471 output_options = .false.
472 output_options(out_multipoles) = .
true.
490 writ%out(iout)%write = output_options(iout)
506 if (space%is_periodic() .and. writ%out(
out_angular)%write)
then
521 if (gr%np /= gr%np_global)
then
522 message(1) =
"TDOutput option td_kpoint_occup and td_floquet do not work with domain parallelization"
529 'Forces for systems periodic in 1D are not currently implemented and options that output the forces are not allowed.')
533 if (writ%out(
out_kp_proj)%write .and. hm%kpoints%nik_skip == 0)
then
534 message(1) =
"TDOutput option td_kpoint_occup only work with zero-weight k-points at the moment."
538 if (writ%out(
out_dm_proj_basis)%write .and. dmp%calculation_mode == option__tddmpropagation__no_propagation)
then
539 message(1) =
"TDOutput option dm_proj_basis only works with TDDMPROPAGATION calculations"
553 call parse_variable(namespace,
'TDOutputResolveStates', .false., resolve_states)
554 if (.not. writ%out(out_multipoles)%write .and. resolve_states)
then
555 write(
message(1),
'(a)')
"TDOutputResolveStates works only for TDOutput = multipoles."
568 if (writ%lmax < 0)
then
569 write(
message(1),
'(a,i6,a)')
"Input: '", writ%lmax,
"' is not a valid TDMultipoleLmax."
570 message(2) =
'(Must be TDMultipoleLmax >= 0 )'
576 if ((writ%out(
out_acc)%write) .and. ions_move)
then
577 message(1) =
'If harmonic spectrum is to be calculated, atoms should not be allowed to move.'
581 if ((writ%out(
out_q)%write) .and. .not.(ks%v_ks_photons%active()))
then
582 message(1) =
'If q(t) is to be calculated, you need to allow for photon modes.'
587 .or. hm%mxll%add_electric_dip))
then
588 message(1) =
'If the dipolar field has to be written, MaxwellCouplingMode has to be'
589 message(2) =
'"lenght_gauge_dipole" or "velocity_gauge_dipole" and at least one Maxwell system'
590 message(3) =
'must be present.'
594 rmin = ions%min_distance()
604 message(1) =
"Option TDOutput = populations is not implemented for parallel in states."
616 safe_deallocate_a(writ%gs_st%node)
624 writ%gs_st%st_end = writ%gs_st%nst
626 message(1) =
"Unable to read states information."
630 writ%gs_st%st_start = 1
646 call parse_variable(namespace,
'TDProjStateStart', 1, writ%gs_st%st_start)
648 if (st%parallel_in_states .and. writ%out(
out_proj)%write .and. writ%gs_st%st_start > 1)
then
654 writ%gs_st%lnst = writ%gs_st%st_end - writ%gs_st%st_start + 1
658 writ%gs_st%parallel_in_states = .false.
661 safe_allocate(writ%gs_st%occ(1:writ%gs_st%nst, 1:writ%gs_st%nik))
662 safe_allocate(writ%gs_st%eigenval(1:writ%gs_st%nst, 1:writ%gs_st%nik))
666 safe_allocate(writ%gs_st%node(1:writ%gs_st%nst))
667 writ%gs_st%node(:) = 0
669 writ%gs_st%eigenval = huge(writ%gs_st%eigenval)
671 if (writ%gs_st%d%ispin ==
spinors)
then
672 safe_deallocate_a(writ%gs_st%spin)
673 safe_allocate(writ%gs_st%spin(1:3, 1:writ%gs_st%nst, 1:writ%gs_st%nik))
676 safe_allocate(skip(1:writ%gs_st%nst))
678 skip(1:writ%gs_st%st_start-1) = .
true.
682 safe_deallocate_a(skip)
685 call states_elec_load(restart_gs, namespace, space, writ%gs_st, gr, hm%kpoints, &
686 fixed_occ=.
true., ierr=ierr, label =
': gs for TDOutput')
688 if (ierr /= 0 .and. ierr /= (writ%gs_st%st_end-writ%gs_st%st_start+1)*writ%gs_st%nik &
689 *writ%gs_st%d%dim*writ%gs_st%mpi_grp%size)
then
690 message(1) =
"Unable to read wavefunctions for TDOutput."
693 call restart_gs%end()
735 if (
parse_block(namespace,
'TDExcitedStatesToProject', blk) == 0)
then
737 safe_allocate(writ%excited_st(1:writ%n_excited_states))
738 do ist = 1, writ%n_excited_states
743 writ%n_excited_states = 0
757 call parse_variable(namespace,
'TDOutputComputeInterval', 50, writ%compute_interval)
758 if (writ%compute_interval < 0)
then
759 message(1) =
"TDOutputComputeInterval must be >= 0."
775 call io_mkdir(
'td.general', namespace)
782 writ%out(:)%mpi_grp = st%system_grp
783 writ%out_dftu(:)%mpi_grp = st%system_grp
785 if (st%system_grp%is_root())
then
787 do ifile = 1, out_max
791 if (writ%out(ifile)%write)
then
795 trim(
io_workpath(
"td.general/"//trim(td_file_name(ifile)), namespace)))
803 if (writ%out(out_multipoles)%write .and. .not. resolve_states)
then
806 trim(
io_workpath(
"td.general/multipoles", namespace)))
810 select case (kick%qkick_mode)
812 write(filename,
'(a)')
'td.general/ftchd.sin'
814 write(filename,
'(a)')
'td.general/ftchd.cos'
816 write(filename,
'(a, SP, I0.3, a, I0.3)')
'td.general/ftchd.l', kick%qbessel_l,
'_m', kick%qbessel_m
818 write(filename,
'(a)')
'td.general/ftchd'
830 call io_rm(
"td.general/laser", namespace=namespace)
848 if (writ%out(out_multipoles)%write .and. resolve_states)
then
850 writ%out(out_multipoles)%hand_start = st%st_start
851 writ%out(out_multipoles)%hand_end = st%st_end
852 writ%out(out_multipoles)%resolve_states = .
true.
853 writ%out(out_multipoles)%mpi_grp = gr%mpi_grp
855 safe_allocate(writ%out(out_multipoles)%mult_handles(st%st_start:st%st_end))
857 if (writ%out(out_multipoles)%mpi_grp%is_root())
then
858 do ist = st%st_start, st%st_end
859 write(filename,
'(a,i4.4)')
'td.general/multipoles-ist', ist
872 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, &
873 calc_eigenval=.false., time = iter*dt, calc_energy = .false.)
877 if (all(outp%how == 0) .and. writ%out(
out_n_ex)%write)
then
879 if (outp%how(option__output__current_kpt) + outp%how(option__output__density_kpt) /= 0)
then
880 call io_mkdir(outp%iter_dir, namespace)
902 if (hm%lda_u_level ==
dft_u_acbn0) default = default + 2**(out_dftu_effective_u - 1)
910 writ%out_dftu(iout)%write = (iand(flags, 2**(iout - 1)) /= 0)
913 if (st%system_grp%is_root())
then
914 if (writ%out_dftu(out_dftu_effective_u)%write)
then
917 trim(
io_workpath(
"td.general/effectiveU", namespace)))
935 if (writ%out(iout)%write)
then
936 if (writ%out(iout)%mpi_grp%is_root())
then
937 if (writ%out(iout)%resolve_states)
then
938 do ist = writ%out(iout)%hand_start, writ%out(iout)%hand_end
941 safe_deallocate_a(writ%out(iout)%mult_handles)
950 if (writ%out_dftu(iout)%write .and. writ%out_dftu(iout)%mpi_grp%is_root())
then
956 do ist = 1, writ%n_excited_states
959 writ%n_excited_states = 0
972 subroutine td_write_iter(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, kick, ks, dt, &
973 iter, mc, recalculate_gs, dmp_st)
976 class(
space_t),
intent(in) :: space
978 type(
grid_t),
intent(in) :: gr
981 type(
ions_t),
intent(inout) :: ions
983 type(
kick_t),
intent(in) :: kick
984 type(
v_ks_t),
intent(in) :: ks
985 real(real64),
intent(in) :: dt
986 integer,
intent(in) :: iter
988 logical,
intent(in) :: recalculate_gs
997 if (writ%out(out_multipoles)%write)
then
998 call td_write_multipole(writ%out(out_multipoles), space, gr, ions, st, writ%lmax, kick, iter)
1021 if (writ%out(
out_proj)%write .and. mod(iter, writ%compute_interval) == 0)
then
1030 if (writ%out(
out_kp_proj)%write .and. mod(iter, writ%compute_interval) == 0)
then
1036 ions%pos, ions%vel, ions%tot_force, iter)
1041 ions%natoms, ions%space, &
1042 ions%pos, ions%vel, ions%tot_force, iter, 1)
1047 ions%natoms, ions%space, &
1048 ions%pos, ions%vel, ions%tot_force, iter, 2)
1053 ions%natoms, ions%space, &
1054 ions%pos, ions%vel, ions%tot_force, iter, 3)
1065 if (writ%out(
out_acc)%write)
then
1066 call td_write_acc(writ%out(
out_acc)%handle, namespace, space, gr, ions, st, hm, ext_partners, dt, iter)
1069 if (writ%out(
out_vel)%write)
then
1082 if(
associated(gfield))
then
1113 if (writ%out(
out_n_ex)%write .and. mod(iter, writ%compute_interval) == 0)
then
1115 if (recalculate_gs)
then
1118 ierr=ierr, label =
': Houston states for TDOutput')
1122 call td_write_n_ex(writ%out(
out_n_ex)%handle, outp, namespace, gr, hm%kpoints, st, writ%gs_st, iter)
1134 if (writ%out_dftu(out_dftu_effective_u)%write)
then
1136 writ%out_dftu(out_dftu_effective_u)%mpi_grp, hm%lda_u, iter)
1139 if (writ%out(
out_q)%write .and. ks%v_ks_photons%active())
then
1143 if (writ%out(
out_mxll_field)%write .and. hm%mxll%calc_field_dip)
then
1145 space, hm, dt, iter)
1148 if (writ%out(
out_dm_proj_basis)%write .and. mod(iter, writ%compute_interval) == 0)
then
1149 if (st%system_grp%is_root())
then
1168 do iout = 1, out_max
1170 if (writ%out(iout)%write)
then
1171 if (writ%out(iout)%mpi_grp%is_root())
then
1172 if (writ%out(iout)%resolve_states)
then
1173 do ii = writ%out(iout)%hand_start, writ%out(iout)%hand_end
1184 if (writ%out_dftu(iout)%write .and. writ%out(
out_proj)%mpi_grp%is_root())
then
1194 subroutine td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, iter, dt)
1197 type(
grid_t),
intent(in) :: gr
1200 type(
v_ks_t),
intent(inout) :: ks
1202 type(
ions_t),
intent(in) :: ions
1204 integer,
intent(in) :: iter
1205 real(real64),
optional,
intent(in) :: dt
1207 character(len=256) :: filename
1213 if (st%modelmbparticles%nparticle > 0)
then
1218 write(filename,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
1220 call output_all(outp, namespace, space, filename, gr, ions, iter, st, hm, ks)
1222 call output_modelmb(outp, namespace, space, filename, gr, ions, iter, st)
1224 if (
present(dt))
then
1225 call output_scalar_pot(outp, namespace, space, filename, gr, ions, ext_partners, st%st_kpt_mpi_grp, iter*dt)
1227 if (iter == 0)
call output_scalar_pot(outp, namespace, space, filename, gr, ions, ext_partners, st%st_kpt_mpi_grp)
1236 type(c_ptr),
intent(inout) ::
out_spin
1238 class(
mesh_t),
intent(in) :: mesh
1240 integer,
intent(in) :: iter
1242 character(len=130) :: aux
1243 real(real64) :: spin(3)
1252 if (mpi_grp%is_root())
then
1259 if (st%d%ispin ==
spinors)
then
1260 write(aux,
'(a2,18x)')
'Sx'
1262 write(aux,
'(a2,18x)')
'Sy'
1265 write(aux,
'(a2,18x)')
'Sz'
1273 select case (st%d%ispin)
1290 type(
grid_t),
intent(in) :: gr
1292 type(
ions_t),
intent(in) :: ions
1293 real(real64),
intent(in) :: lmm_r
1294 integer,
intent(in) :: iter
1297 character(len=50) :: aux
1298 real(real64),
allocatable :: lmm(:,:)
1303 safe_allocate(lmm(1:3, 1:ions%natoms))
1306 if (st%system_grp%is_root())
then
1313 do ia = 1, ions%natoms
1314 if (st%d%ispin ==
spinors)
then
1315 write(aux,
'(a2,i2.2,16x)')
'mx', ia
1317 write(aux,
'(a2,i2.2,16x)')
'my', ia
1320 write(aux,
'(a2,i2.2,16x)')
'mz', ia
1329 do ia = 1, ions%natoms
1330 select case (st%d%ispin)
1340 safe_deallocate_a(lmm)
1347 type(c_ptr),
intent(inout) :: out_magnets
1348 class(
mesh_t),
intent(in) :: mesh
1350 type(
kick_t),
intent(in) :: kick
1351 integer,
intent(in) :: iter
1353 complex(real64),
allocatable :: tm(:,:)
1358 safe_allocate(tm(1:6,1:kick%nqvec))
1360 do iq = 1, kick%nqvec
1364 if (st%system_grp%is_root())
then
1390 do iq = 1, kick%nqvec
1399 safe_deallocate_a(tm)
1413 subroutine td_write_angular(out_angular, namespace, space, gr, ions, hm, st, kick, iter)
1414 type(c_ptr),
intent(inout) :: out_angular
1416 class(
space_t),
intent(in) :: space
1417 type(
grid_t),
intent(in) :: gr
1418 type(
ions_t),
intent(inout) :: ions
1421 type(
kick_t),
intent(in) :: kick
1422 integer,
intent(in) :: iter
1425 character(len=130) :: aux
1426 real(real64) :: angular(3)
1433 call angular_momentum%setup_dir(idir)
1436 m_two*real(angular_momentum%zstates_elec_expectation_value(namespace, space, gr, hm, st), real64)
1438 safe_deallocate_p(angular_momentum)
1440 if (st%system_grp%is_root())
then
1445 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
1453 write(aux,
'(a4,18x)')
'<Lx>'
1455 write(aux,
'(a4,18x)')
'<Ly>'
1457 write(aux,
'(a4,18x)')
'<Lz>'
1486 class(
space_t),
intent(in) :: space
1487 type(
grid_t),
intent(in) :: gr
1488 type(
ions_t),
intent(in) :: ions
1490 integer,
intent(in) :: lmax
1491 type(
kick_t),
intent(in) :: kick
1492 integer,
intent(in) :: iter
1495 real(real64),
allocatable :: rho(:,:)
1499 if (out_multip%resolve_states)
then
1500 safe_allocate(rho(1:gr%np_part, 1:st%d%nspin))
1503 do ist = st%st_start, st%st_end
1505 call td_write_multipole_r(out_multip%mult_handles(ist), space, gr, ions, st, lmax, kick, rho, iter, &
1506 mpi_grp = out_multip%mpi_grp)
1509 safe_deallocate_a(rho)
1512 if (
allocated(st%frozen_rho))
then
1513 safe_allocate(rho(1:gr%np, 1:st%d%nspin))
1514 call lalg_copy(gr%np, st%d%nspin, st%rho, rho)
1519 safe_deallocate_a(rho)
1531 subroutine td_write_multipole_r(out_multip, space, mesh, ions, st, lmax, kick, rho, iter, mpi_grp)
1532 type(c_ptr),
intent(inout) :: out_multip
1533 class(
space_t),
intent(in) :: space
1534 class(
mesh_t),
intent(in) :: mesh
1535 type(
ions_t),
intent(in) :: ions
1537 integer,
intent(in) :: lmax
1538 type(
kick_t),
intent(in) :: kick
1539 real(real64),
contiguous,
intent(in) :: rho(:,:)
1540 integer,
intent(in) :: iter
1541 type(
mpi_grp_t),
optional,
intent(in) :: mpi_grp
1544 integer :: is, idir, ll, mm, add_lm
1545 character(len=120) :: aux
1546 real(real64) :: ionic_dipole(ions%space%dim)
1547 real(real64),
allocatable :: multipole(:,:)
1553 assert(.not. (lmax > 1 .and. space%dim > 3))
1555 mpi_grp_ = st%system_grp
1556 if (
present(mpi_grp)) mpi_grp_ = mpi_grp
1558 if (mpi_grp_%is_root().and.iter == 0)
then
1561 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
1565 write(aux,
'(a15,i2)')
'# lmax ', lmax
1573 do is = 1, st%d%nspin
1574 write(aux,
'(a18,i1,a1)')
'Electronic charge(', is,
')'
1577 do idir = 1, space%dim
1578 write(aux,
'(4a1,i1,a1)')
'<',
index2axis(idir),
'>',
'(', is,
')'
1584 write(aux,
'(a2,i2,a4,i2,a2,i1,a1)')
'l=', ll,
', m=', mm,
' (', is,
')'
1595 do is = 1, st%d%nspin
1598 do idir = 1, space%dim
1614 if (space%dim > 3 .and. lmax == 1)
then
1616 safe_allocate(multipole(1:space%dim+1, 1:st%d%nspin))
1618 safe_allocate(multipole(1:(lmax + 1)**2, 1:st%d%nspin))
1622 do is = 1, st%d%nspin
1627 ionic_dipole = ions%dipole()
1628 multipole(2:space%dim+1, :) = -multipole(2:space%dim+1, :)
1630 do is = 1, st%d%spin_channels
1631 multipole(2:space%dim+1, is) = multipole(2:space%dim+1, is) - ionic_dipole(1:space%dim)/st%d%spin_channels
1635 if (mpi_grp_%is_root())
then
1637 do is = 1, st%d%nspin
1640 do idir = 1, space%dim
1644 add_lm = space%dim + 2
1655 safe_deallocate_a(multipole)
1660 subroutine td_write_ftchd(out_ftchd, space, mesh, st, kick, iter)
1661 type(c_ptr),
intent(inout) :: out_ftchd
1662 class(
space_t),
intent(in) :: space
1663 class(
mesh_t),
intent(in) :: mesh
1665 type(
kick_t),
intent(in) :: kick
1666 integer,
intent(in) :: iter
1668 integer :: is, ip, idir
1669 character(len=120) :: aux, aux2
1670 real(real64) :: ftchd_bessel
1671 complex(real64) :: ftchd
1673 real(real64),
allocatable :: integrand_bessel(:)
1674 complex(real64),
allocatable :: integrand(:)
1678 if (st%system_grp%is_root().and.iter == 0)
then
1681 write(aux,
'(a15, i2)')
'# qkickmode ', kick%qkick_mode
1686 write(aux,
'(a15, i0.3, 1x, i0.3)')
'# ll, mm ', kick%qbessel_l, kick%qbessel_m
1692 write(aux,
'(a15, f9.6)')
'# qlength ', kick%qlength
1694 write(aux,
'(a15)')
'# qvector '
1695 do idir = 1, space%dim
1696 write(aux2,
'(f9.5)') kick%qvector(idir,1)
1697 aux = trim(aux) // trim(aux2)
1703 write(aux,
'(a15,f18.12)')
'# kick strength', kick%delta_strength
1709 write(aux,
'(a17)')
'int(j_l*Y_lm*rho)'
1711 write(aux,
'(a12)')
'Real, Imag'
1728 safe_allocate(integrand(1:mesh%np))
1730 do is = 1, st%d%spin_channels
1732 integrand(ip) = integrand(ip) + st%rho(ip, is) *
exp(-
m_zi*sum(mesh%x(1:space%dim, ip)*kick%qvector(1:space%dim, 1)))
1736 safe_deallocate_a(integrand)
1739 safe_allocate(integrand_bessel(1:mesh%np))
1740 integrand_bessel =
m_zero
1741 do is = 1, st%d%spin_channels
1743 call ylmr_real(mesh%x(1:3, ip), kick%qbessel_l, kick%qbessel_m, ylm)
1744 integrand_bessel(ip) = integrand_bessel(ip) + st%rho(ip, is) * &
1745 loct_sph_bessel(kick%qbessel_l, kick%qlength*norm2(mesh%x(:, ip)))*ylm
1749 safe_deallocate_a(integrand_bessel)
1752 if (st%system_grp%is_root())
then
1768 type(c_ptr),
intent(inout) :: out_temperature
1770 type(
ions_t),
intent(in) :: ions
1771 integer,
intent(in) :: iter
1773 if (.not. mpi_grp%is_root())
return
1806 type(c_ptr),
intent(inout) :: out_populations
1808 class(
space_t),
intent(in) :: space
1809 class(
mesh_t),
intent(in) :: mesh
1812 real(real64),
intent(in) :: dt
1813 integer,
intent(in) :: iter
1816 character(len=6) :: excited_name
1817 complex(real64) :: gsp
1818 complex(real64),
allocatable :: excited_state_p(:)
1819 complex(real64),
allocatable :: dotprodmatrix(:, :, :)
1824 safe_allocate(dotprodmatrix(1:writ%gs_st%nst, 1:st%nst, 1:st%nik))
1829 assert(.not. space%is_periodic())
1834 if (writ%n_excited_states > 0)
then
1835 safe_allocate(excited_state_p(1:writ%n_excited_states))
1836 do ist = 1, writ%n_excited_states
1837 excited_state_p(ist) =
zstates_elec_mpdotp(namespace, mesh, writ%excited_st(ist), st, dotprodmatrix)
1841 if (st%system_grp%is_root())
then
1849 do ist = 1, writ%n_excited_states
1850 write(excited_name,
'(a2,i3,a1)')
'P(', ist,
')'
1869 do ist = 1, writ%n_excited_states
1876 if (writ%n_excited_states > 0)
then
1877 safe_deallocate_a(excited_state_p)
1879 safe_deallocate_a(dotprodmatrix)
1885 subroutine td_write_acc(out_acc, namespace, space, gr, ions, st, hm, ext_partners, dt, iter)
1886 type(c_ptr),
intent(inout) :: out_acc
1888 class(
space_t),
intent(in) :: space
1889 type(
grid_t),
intent(in) :: gr
1890 type(
ions_t),
intent(inout) :: ions
1894 real(real64),
intent(in) :: dt
1895 integer,
intent(in) :: iter
1898 character(len=7) :: aux
1899 real(real64) :: acc(space%dim)
1903 if (iter == 0 .and. st%system_grp%is_root())
then
1908 do idim = 1, space%dim
1909 write(aux,
'(a4,i1,a1)')
'Acc(', idim,
')'
1917 do idim = 1, space%dim
1924 call td_calc_tacc(namespace, space, gr, ions, ext_partners, st, hm, acc, dt*iter)
1926 if (st%system_grp%is_root())
then
1937 subroutine td_write_vel(out_vel, namespace, gr, st, space, hm, ions, iter)
1938 type(c_ptr),
intent(inout) :: out_vel
1940 type(
grid_t),
intent(in) :: gr
1942 type(
space_t),
intent(in) :: space
1944 type(
ions_t),
intent(in) :: ions
1945 integer,
intent(in) :: iter
1948 character(len=7) :: aux
1949 real(real64) :: vel(space%dim)
1953 if (iter == 0 .and. st%system_grp%is_root())
then
1958 do idim = 1, space%dim
1959 write(aux,
'(a4,i1,a1)')
'Vel(', idim,
')'
1967 do idim = 1, space%dim
1974 call td_calc_tvel(namespace, gr, st, space, hm, ions, vel)
1976 if (st%system_grp%is_root())
then
1988 subroutine td_write_laser(out_laser, mpi_grp, space, lasers, dt, iter)
1989 type(c_ptr),
intent(inout) :: out_laser
1991 class(
space_t),
intent(in) :: space
1992 type(
lasers_t),
intent(inout) :: lasers
1993 real(real64),
intent(in) :: dt
1994 integer,
intent(in) :: iter
1997 real(real64) :: field(space%dim)
1998 real(real64) :: ndfield(space%dim)
1999 character(len=80) :: aux
2001 if (.not. mpi_grp%is_root())
return
2015 do il = 1, lasers%no_lasers
2018 do idir = 1, space%dim
2019 write(aux,
'(a,i1,a)')
'E(', idir,
')'
2023 do idir = 1, space%dim
2024 write(aux,
'(a,i1,a)')
'B(', idir,
')'
2028 do idir = 1, space%dim
2029 write(aux,
'(a,i1,a)')
'A(', idir,
')'
2033 write(aux,
'(a,i1,a)')
'e(t)'
2039 do idir = 1, space%dim
2040 write(aux,
'(a,i1,a)')
'A^M(', idir,
')'
2052 do il = 1, lasers%no_lasers
2056 do idir = 1, space%dim
2061 do idir = 1, space%dim
2072 do idir = 1, space%dim
2085 do il = 1, lasers%no_lasers
2087 call laser_field(lasers%lasers(il), field(1:space%dim), iter*dt)
2112 type(c_ptr),
intent(inout) :: out_energy
2115 integer,
intent(in) :: iter
2116 real(real64),
intent(in) :: ke
2120 integer :: n_columns
2122 if (.not. mpi_grp%is_root())
return
2143 if (hm%pcm%run_pcm)
then
2145 n_columns = n_columns + 1
2150 n_columns = n_columns + 1
2160 do ii = 1, n_columns
2183 hm%energy%int_nn_pcm + hm%energy%int_ne_pcm), 1)
2196 type(c_ptr),
intent(inout) :: out_eigs
2198 integer,
intent(in) :: iter
2201 character(len=68) :: buf
2205 if (.not. st%system_grp%is_root())
then
2214 write(buf,
'(a15,i2)')
'# nst ', st%nst
2218 write(buf,
'(a15,i2)')
'# nspin ', st%d%nspin
2224 do is = 1, st%d%kpt%nglobal()
2226 write(buf,
'(a,i4)')
'Eigenvalue ',ii
2235 do is = 1, st%d%kpt%nglobal()
2245 do is = 1, st%d%kpt%nglobal()
2257 type(c_ptr),
intent(inout) :: out_ionch
2258 class(
mesh_t),
intent(in) :: mesh
2260 integer,
intent(in) :: iter
2262 integer :: ii, ist, Nch, ik, idim
2263 character(len=68) :: buf
2264 real(real64),
allocatable :: ch(:), occ(:)
2265 real(real64),
allocatable :: occbuf(:)
2270 nch = st%nst * st%d%kpt%nglobal() * st%d%dim
2271 safe_allocate(ch(0: nch))
2272 safe_allocate(occ(0: nch))
2278 do idim = 1, st%d%dim
2279 if (st%st_start <= ist .and. ist <= st%st_end .and. &
2280 st%d%kpt%start <= ik .and. ik <= st%d%kpt%end)
then
2281 occ(ii) = st%occ(ist, ik)
2289 if (st%parallel_in_states)
then
2290 safe_allocate(occbuf(0: nch))
2292 call st%mpi_grp%allreduce(occ(0), occbuf(0), nch+1, mpi_double_precision, mpi_sum)
2294 safe_deallocate_a(occbuf)
2301 if (.not. st%system_grp%is_root())
then
2302 safe_deallocate_a(ch)
2303 safe_deallocate_a(occ)
2316 if (occ(ii)>
m_zero .or. ii == 0)
then
2317 write(buf,
'(a,f4.1,a)')
'Pion(',occ(ii)*ii,
'+, t)'
2327 if (occ(ii)>
m_zero .or. ii == 0)
then
2337 if (occ(ii)>
m_zero .or. ii == 0)
then
2343 safe_deallocate_a(ch)
2344 safe_deallocate_a(occ)
2350 subroutine td_write_proj(out_proj, space, mesh, ions, st, gs_st, kick, iter)
2351 type(c_ptr),
intent(inout) :: out_proj
2352 class(
space_t),
intent(in) :: space
2353 class(
mesh_t),
intent(in) :: mesh
2354 type(
ions_t),
intent(in) :: ions
2357 type(
kick_t),
intent(in) :: kick
2358 integer,
intent(in) :: iter
2360 complex(real64),
allocatable :: projections(:,:,:)
2361 character(len=80) :: aux
2362 integer :: ik, ist, uist, idir
2367 if (st%system_grp%is_root())
then
2370 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
2379 write(aux,
'(a,i8)')
"# nik ", st%nik
2383 write(aux,
'(a,2i8)')
"# st ", gs_st%st_start, st%nst
2387 write(aux,
'(a,2i8)')
"# ust ", gs_st%st_start, gs_st%st_end
2393 do ist = gs_st%st_start, st%nst
2401 do ist = gs_st%st_start, st%nst
2402 do uist = gs_st%st_start, gs_st%st_end
2403 write(aux,
'(i4,a,i4)') ist,
' -> ', uist
2414 if (.not. space%is_periodic())
then
2416 safe_allocate(projections(1:st%nst, gs_st%st_start:gs_st%st_end, 1:st%nik))
2417 do idir = 1, space%dim
2422 if (st%system_grp%is_root())
then
2423 write(aux,
'(a,i1,a)')
"<i|x_", idir,
"|a>"
2427 do ist = gs_st%st_start, st%st_end
2428 do uist = gs_st%st_start, gs_st%st_end
2438 safe_deallocate_a(projections)
2442 if (st%system_grp%is_root())
then
2448 safe_allocate(projections(1:st%nst, gs_st%st_start:gs_st%st_end, 1:st%nik))
2449 projections(:,:,:) =
m_z0
2452 if (st%system_grp%is_root())
then
2455 do ist = gs_st%st_start, st%nst
2456 do uist = gs_st%st_start, gs_st%st_end
2465 safe_deallocate_a(projections)
2471 integer,
intent(in) :: dir
2473 integer :: uist, ist, ik, idim, ip
2474 real(real64) :: n_dip(space%dim)
2475 complex(real64),
allocatable :: xpsi(:,:)
2476 complex(real64),
allocatable :: psi(:, :), gspsi(:, :)
2480 safe_allocate(psi(1:mesh%np, 1:st%d%dim))
2481 safe_allocate(gspsi(1:mesh%np, 1:st%d%dim))
2482 safe_allocate(xpsi(1:mesh%np, 1:st%d%dim))
2484 do ik = st%d%kpt%start, st%d%kpt%end
2485 do ist = st%st_start, st%st_end
2487 do uist = gs_st%st_start, gs_st%st_end
2491 do idim = 1, st%d%dim
2494 xpsi(ip, idim) = mesh%x_t(ip, dir)*gspsi(ip, idim)
2498 projections(ist, uist, ik) = -
zmf_dotp(mesh, st%d%dim, psi, xpsi, reduce = .false.)
2504 safe_deallocate_a(xpsi)
2505 safe_deallocate_a(gspsi)
2506 safe_deallocate_a(psi)
2511 n_dip = ions%dipole()
2513 do ist = gs_st%st_start, st%nst
2514 do uist = gs_st%st_start, gs_st%st_end
2515 projections(ist, uist, ik) = projections(ist, uist, ik) - n_dip(dir)
2531 subroutine td_write_n_ex(out_nex, outp, namespace, mesh, kpoints, st, gs_st, iter)
2532 type(c_ptr),
intent(inout) :: out_nex
2535 class(
mesh_t),
intent(in) :: mesh
2539 integer,
intent(in) :: iter
2541 complex(real64),
allocatable :: projections(:,:)
2542 character(len=80) :: aux, dir
2543 integer :: ik, ikpt, ist, uist, err
2544 real(real64) :: Nex, weight
2546 real(real64),
allocatable :: Nex_kpt(:)
2552 if (st%system_grp%is_root())
then
2555 write(aux,
'(a15,i2)')
'# nspin ', st%d%nspin
2562 write(aux,
'(a,i8)')
"# nik ", st%nik
2566 write(aux,
'(a,2i8)')
"# st ", gs_st%st_start, st%nst
2570 write(aux,
'(a,2i8)')
"# ust ", gs_st%st_start, gs_st%st_end
2580 if (st%system_grp%is_root())
then
2589 do ist = 1, gs_st%nst
2590 if (gs_st%occ(ist, ik) >
m_min_occ .and. ist > gs_nst) gs_nst = ist
2594 safe_allocate(projections(1:gs_nst, 1:st%nst))
2596 safe_allocate(nex_kpt(1:st%nik))
2598 do ik = st%d%kpt%start, st%d%kpt%end
2599 ikpt = st%d%get_kpoint_index(ik)
2602 weight = st%kweights(ik) * gs_st%occ(ist, ik)/ st%smear%el_per_state
2603 do uist = st%st_start, st%st_end
2604 nex_kpt(ikpt) = nex_kpt(ikpt) - weight * st%occ(uist, ik) * abs(projections(ist, uist))**2
2607 nex_kpt(ikpt) = nex_kpt(ikpt) + sum(st%occ(st%st_start:st%st_end, ik))*st%kweights(ik)
2610 if (st%parallel_in_states .or. st%d%kpt%parallel)
then
2616 if (st%system_grp%is_root())
then
2622 write(dir,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
2625 + outp%how(option__output__density_kpt), dir,
"n_excited_el_kpt", namespace, &
2629 safe_deallocate_a(projections)
2630 safe_deallocate_a(nex_kpt)
2642 class(
mesh_t),
intent(in) :: mesh
2645 complex(real64),
intent(inout) :: projections(1:st%nst, gs_st%st_start:gs_st%nst, 1:st%nik)
2647 integer :: uist, ist, ik
2648 complex(real64),
allocatable :: psi(:, :), gspsi(:, :)
2651 safe_allocate(psi(1:mesh%np, 1:st%d%dim))
2652 safe_allocate(gspsi(1:mesh%np, 1:st%d%dim))
2654 projections(:,:,:) =
m_zero
2656 do ik = st%d%kpt%start, st%d%kpt%end
2657 do ist = st%st_start, st%st_end
2659 do uist = gs_st%st_start, gs_st%nst
2661 projections(ist, uist, ik) =
zmf_dotp(mesh, st%d%dim, psi, gspsi, reduce = .false.)
2666 safe_deallocate_a(psi)
2667 safe_deallocate_a(gspsi)
2676 class(
mesh_t),
intent(in) :: mesh
2681 integer,
intent(in) :: iter
2683 complex(real64),
allocatable :: proj(:,:), psi(:,:,:), gs_psi(:,:,:), temp_state(:,:)
2684 character(len=80) :: filename1, filename2
2685 integer :: ik,ist, jst, file, idim, nk_proj
2689 if (mesh%use_vol_pp)
then
2695 write(filename1,
'(I10)') iter
2696 filename1 =
'td.general/projections_iter_'//trim(adjustl(filename1))
2699 safe_allocate(proj(1:gs_st%nst, 1:gs_st%nst))
2700 safe_allocate(psi(1:gs_st%nst,1:gs_st%d%dim,1:mesh%np))
2701 safe_allocate(gs_psi(1:gs_st%nst,1:gs_st%d%dim,1:mesh%np))
2702 safe_allocate(temp_state(1:mesh%np,1:gs_st%d%dim))
2708 nk_proj = kpoints%nik_skip
2710 do ik = kpoints%reduced%npoints-nk_proj+1, kpoints%reduced%npoints
2712 psi(1:gs_st%nst, 1:gs_st%d%dim, 1:mesh%np)=
m_zero
2713 gs_psi(1:gs_st%nst, 1:gs_st%d%dim, 1:mesh%np)=
m_zero
2715 if (st%system_grp%is_root())
then
2716 write(filename2,
'(I10)') ik
2717 filename2 = trim(adjustl(filename1))//
'_ik_'//trim(adjustl(filename2))
2718 file =
io_open(filename2, namespace, action=
'write')
2721 do ist=gs_st%st_start,gs_st%st_end
2724 do idim = 1,gs_st%d%dim
2725 psi(ist,idim,1:mesh%np) = temp_state(1:mesh%np,idim)
2728 do idim = 1,gs_st%d%dim
2729 gs_psi(ist,idim,1:mesh%np) = temp_state(1:mesh%np,idim)
2738 assert(mesh%np_global*gs_st%d%dim < huge(0_int32))
2739 proj(1:gs_st%nst, 1:gs_st%nst) =
m_zero
2744 i8_to_i4(mesh%np_global*gs_st%d%dim), &
2745 cmplx(mesh%volume_element,
m_zero, real64) , &
2747 ubound(psi, dim = 1), &
2749 ubound(gs_psi, dim = 1), &
2752 ubound(proj, dim = 1))
2755 if (st%system_grp%is_root())
then
2756 do ist = 1, gs_st%nst
2757 do jst = 1, gs_st%nst
2758 write(file,
'(I3,1x,I3,1x,e13.6,1x,e13.6,2x)') ist, jst, proj(ist,jst)
2766 safe_deallocate_a(proj)
2767 safe_deallocate_a(psi)
2768 safe_deallocate_a(gs_psi)
2769 safe_deallocate_a(temp_state)
2775 subroutine td_write_floquet(namespace, space, hm, ext_partners, gr, st, iter)
2776 type(namespace_t),
intent(in) :: namespace
2777 class(space_t),
intent(in) :: space
2778 type(hamiltonian_elec_t),
intent(inout) :: hm
2779 type(partner_list_t),
intent(in) :: ext_partners
2780 type(grid_t),
intent(in) :: gr
2781 type(states_elec_t),
intent(inout) :: st
2782 integer,
intent(in) :: iter
2784 complex(real64),
allocatable :: hmss(:,:), psi(:,:,:), hpsi(:,:,:), temp_state1(:,:)
2785 complex(real64),
allocatable :: HFloquet(:,:,:), HFloq_eff(:,:), temp(:,:)
2786 real(real64),
allocatable :: eigenval(:), bands(:,:)
2787 character(len=80) :: filename
2788 integer :: it, nT, ik, ist, in, im, file, idim, nik, ik_count
2789 integer :: Forder, Fdim, m0, n0, n1, nst, ii, jj, lim_nst
2790 logical :: downfolding
2791 type(states_elec_t) :: hm_st
2793 real(real64) :: dt, Tcycle, omega
2797 downfolding = .false.
2800 if (.not. iter == 0)
then
2808 assert(gr%np == gr%np_global)
2811 call states_elec_copy(hm_st, st)
2822 call parse_variable(namespace,
'TDFloquetFrequency', m_zero, omega, units_inp%energy)
2823 call messages_print_var_value(
'Frequency used for Floquet analysis', omega, namespace=namespace)
2824 if (abs(omega) <= m_epsilon)
then
2825 message(1) =
"Please give a non-zero value for TDFloquetFrequency"
2826 call messages_fatal(1, namespace=namespace)
2830 tcycle = m_two * m_pi / omega
2840 call parse_variable(namespace,
'TDFloquetSample',20 ,nt)
2841 call messages_print_var_value(
'Number of Floquet time-sampling points', nt, namespace=namespace)
2842 dt = tcycle/real(nt, real64)
2851 call parse_variable(namespace,
'TDFloquetDimension',-1,forder)
2852 if (forder .ge. 0)
then
2853 call messages_print_var_value(
'Order of multiphoton Floquet-Hamiltonian', forder, namespace=namespace)
2855 fdim = 2 * forder + 1
2857 message(1) =
'Floquet-Hamiltonian is downfolded'
2858 call messages_info(1, namespace=namespace)
2859 downfolding = .
true.
2864 dt = tcycle/real(nt, real64)
2867 nik = hm%kpoints%nik_skip
2869 safe_allocate(hmss(1:nst,1:nst))
2870 safe_allocate( psi(1:nst,1:st%d%dim,1:gr%np))
2871 safe_allocate(hpsi(1:nst,1:st%d%dim,1:gr%np))
2872 safe_allocate(temp_state1(1:gr%np,1:st%d%dim))
2880 safe_allocate(hfloquet(1:nik,1:nst*fdim, 1:nst*fdim))
2881 hfloquet(1:nik,1:nst*fdim, 1:nst*fdim) = m_zero
2886 call hm%update(gr, namespace, space, ext_partners, time=tcycle+it*dt)
2888 call zhamiltonian_elec_apply_all(hm, namespace, gr, st, hm_st)
2893 do ik = hm%kpoints%reduced%npoints-nik+1, hm%kpoints%reduced%npoints
2894 ik_count = ik_count + 1
2896 psi(1:nst, 1:st%d%dim, 1:gr%np)= m_zero
2897 hpsi(1:nst, 1:st%d%dim, 1:gr%np)= m_zero
2899 do ist = st%st_start, st%st_end
2900 if (state_kpt_is_local(st, ist, ik))
then
2901 call states_elec_get_state(st, gr, ist, ik,temp_state1)
2902 do idim = 1, st%d%dim
2903 psi(ist, idim, 1:gr%np) = temp_state1(1:gr%np, idim)
2905 call states_elec_get_state(hm_st, gr, ist, ik,temp_state1)
2906 do idim = 1, st%d%dim
2907 hpsi(ist, idim, 1:gr%np) = temp_state1(1:gr%np, idim)
2911 call comm_allreduce(st%system_grp, psi)
2912 call comm_allreduce(st%system_grp, hpsi)
2913 assert(gr%np_global*st%d%dim < huge(0_int32))
2914 hmss(1:nst,1:nst) = m_zero
2919 i8_to_i4(gr%np_global*st%d%dim), &
2920 cmplx(gr%volume_element, m_zero, real64) , &
2922 ubound(hpsi, dim = 1), &
2924 ubound(psi, dim = 1), &
2927 ubound(hmss, dim = 1))
2929 hmss(1:nst,1:nst) = conjg(hmss(1:nst,1:nst))
2932 do in = -forder, forder
2933 do im = -forder, forder
2934 ii = (in+forder) * nst
2935 jj = (im+forder) * nst
2936 hfloquet(ik_count, ii+1:ii+nst, jj+1:jj+nst) = &
2937 hfloquet(ik_count, ii+1:ii+nst, jj+1:jj+nst) + hmss(1:nst, 1:nst) *
exp(-(in-im)*m_zi*omega*it*dt)
2941 hfloquet(ik_count, ii+ist, ii+ist) = hfloquet(ik_count, ii+ist, ii+ist) + in*omega
2950 hfloquet(:,:,:) = m_one/nt*hfloquet(:,:,:)
2953 if (downfolding)
then
2955 safe_allocate(hfloq_eff(1:nst,1:nst))
2956 safe_allocate(eigenval(1:nst))
2957 safe_allocate(bands(1:nik,1:nst))
2959 hfloq_eff(1:nst,1:nst) = m_zero
2965 hfloq_eff(1:nst, 1:nst) = hfloquet(ik, n0+1:n0+nst, m0+1:m0+nst) + &
2966 m_one/omega*(matmul(hfloquet(ik, 1:nst, m0+1:m0+nst), hfloquet(ik, n1+1:n1+nst, m0+1:m0+nst))- &
2967 matmul(hfloquet(ik, n1+1:n1+nst, m0+1:m0+nst), hfloquet(ik, 1:nst, m0+1:m0+nst)))
2969 call lalg_eigensolve(nst, hfloq_eff, eigenval)
2970 bands(ik,1:nst) = eigenval(1:nst)
2972 safe_deallocate_a(hfloq_eff)
2975 safe_allocate(eigenval(1:nst*fdim))
2976 safe_allocate(bands(1:nik,1:nst*fdim))
2977 safe_allocate(temp(1:nst*fdim, 1:nst*fdim))
2980 temp(1:nst*fdim, 1:nst*fdim) = hfloquet(ik, 1:nst*fdim, 1:nst*fdim)
2981 call lalg_eigensolve(nst*fdim, temp, eigenval)
2982 bands(ik, 1:nst*fdim) = eigenval(1:nst*fdim)
2987 if (downfolding)
then
2989 filename =
"downfolded_floquet_bands"
2992 filename =
"floquet_bands"
2995 if (st%system_grp%is_root())
then
2997 file = io_open(filename, namespace, action =
'write')
3000 write(file,
'(e13.6, 1x)',advance=
'no') bands(ik,ist)
3007 if (.not. downfolding)
then
3010 bands(1:nik, 1:nst*fdim) = m_zero
3012 temp(1:nst*fdim,1:nst*fdim) = m_zero
3015 temp(ii+1:ii+nst, ii+1:ii+nst) = hfloquet(ik, ii+1:ii+nst, ii+1:ii+nst)
3017 call lalg_eigensolve(nst*fdim, temp, eigenval)
3018 bands(ik, 1:nst*fdim) = eigenval(1:nst*fdim)
3021 if (st%system_grp%is_root())
then
3022 filename =
'trivial_floquet_bands'
3023 file = io_open(filename, namespace, action =
'write')
3026 write(file,
'(e13.6, 1x)', advance=
'no') bands(ik,ist)
3035 call hm%update(gr, namespace, space, ext_partners, time=m_zero)
3037 safe_deallocate_a(hmss)
3038 safe_deallocate_a(psi)
3039 safe_deallocate_a(hpsi)
3040 safe_deallocate_a(temp_state1)
3041 safe_deallocate_a(hfloquet)
3042 safe_deallocate_a(eigenval)
3043 safe_deallocate_a(bands)
3044 safe_deallocate_a(temp)
3045 call states_elec_end(hm_st)
3053 type(c_ptr),
intent(inout) :: out_total_current
3054 class(space_t),
intent(in) :: space
3055 class(mesh_t),
intent(in) :: mesh
3056 type(states_elec_t),
intent(in) :: st
3057 integer,
intent(in) :: iter
3059 integer :: idir, ispin
3060 character(len=50) :: aux
3061 real(real64) :: total_current(space%dim), abs_current(space%dim)
3065 if (st%system_grp%is_root() .and. iter == 0)
then
3066 call td_write_print_header_init(out_total_current)
3069 call write_iter_header_start(out_total_current)
3071 do idir = 1, space%dim
3072 write(aux,
'(a2,a1,a1)')
'I(', index2axis(idir),
')'
3073 call write_iter_header(out_total_current, aux)
3076 do idir = 1, space%dim
3077 write(aux,
'(a10,a1,a1)')
'IntAbs(j)(', index2axis(idir),
')'
3078 call write_iter_header(out_total_current, aux)
3081 do ispin = 1, st%d%nspin
3082 do idir = 1, space%dim
3083 write(aux,
'(a4,i1,a1,a1,a1)')
'I-sp', ispin,
'(', index2axis(idir),
')'
3084 call write_iter_header(out_total_current, aux)
3088 call write_iter_nl(out_total_current)
3090 call td_write_print_header_end(out_total_current)
3093 assert(
allocated(st%current))
3095 if (st%system_grp%is_root())
then
3096 call write_iter_start(out_total_current)
3099 total_current = 0.0_real64
3100 do idir = 1, space%dim
3101 do ispin = 1, st%d%spin_channels
3102 total_current(idir) = total_current(idir) + dmf_integrate(mesh, st%current(:, idir, ispin), reduce = .false.)
3104 total_current(idir) = units_from_atomic(units_out%length/units_out%time, total_current(idir))
3106 call mesh%allreduce(total_current, dim = space%dim)
3108 abs_current = 0.0_real64
3109 do idir = 1, space%dim
3110 do ispin = 1, st%d%spin_channels
3111 abs_current(idir) = abs_current(idir) + dmf_integrate(mesh, abs(st%current(:, idir, ispin)), reduce = .false.)
3113 abs_current(idir) = units_from_atomic(units_out%length/units_out%time, abs_current(idir))
3115 call mesh%allreduce(abs_current, dim = space%dim)
3117 if (st%system_grp%is_root())
then
3118 call write_iter_double(out_total_current, total_current, space%dim)
3119 call write_iter_double(out_total_current, abs_current, space%dim)
3122 do ispin = 1, st%d%nspin
3123 total_current = units_from_atomic(units_out%length/units_out%time, dmf_integrate(mesh, space%dim, st%current(:, :, ispin)))
3125 if (st%system_grp%is_root())
then
3126 call write_iter_double(out_total_current, total_current, space%dim)
3130 if (st%system_grp%is_root())
then
3131 call write_iter_nl(out_total_current)
3139 type(c_ptr),
intent(inout) :: out_ionic_current
3140 class(space_t),
intent(in) :: space
3141 class(ions_t),
intent(in) :: ions
3142 integer,
intent(in) :: iter
3145 character(len=50) :: aux
3146 real(real64) :: ionic_current(space%dim), abs_current(space%dim)
3150 if (ions%grp%is_root() .and. iter == 0)
then
3151 call td_write_print_header_init(out_ionic_current)
3154 call write_iter_header_start(out_ionic_current)
3156 do idir = 1, space%dim
3157 write(aux,
'(a2,a1,a1)')
'I(', index2axis(idir),
')'
3158 call write_iter_header(out_ionic_current, aux)
3161 do idir = 1, space%dim
3162 write(aux,
'(a10,a1,a1)')
'IntAbs(j)(', index2axis(idir),
')'
3163 call write_iter_header(out_ionic_current, aux)
3166 call write_iter_nl(out_ionic_current)
3168 call td_write_print_header_end(out_ionic_current)
3171 ionic_current = ions%current()
3172 abs_current = ions%abs_current()
3174 if (ions%grp%is_root())
then
3175 call write_iter_start(out_ionic_current)
3177 call write_iter_double(out_ionic_current, ionic_current, space%dim)
3178 call write_iter_double(out_ionic_current, abs_current, space%dim)
3180 call write_iter_nl(out_ionic_current)
3190 type(c_ptr),
intent(inout) :: write_obj
3191 class(space_t),
intent(in) :: space
3192 type(hamiltonian_elec_t),
intent(inout) :: hm
3193 type(grid_t),
intent(in) :: gr
3194 type(states_elec_t),
intent(in) :: st
3195 integer,
intent(in) :: iter
3197 integer :: idir, ispin
3198 character(len=50) :: aux
3199 real(real64),
allocatable :: heat_current(:, :, :)
3200 real(real64) :: total_current(space%dim)
3204 if (st%system_grp%is_root() .and. iter == 0)
then
3205 call td_write_print_header_init(write_obj)
3208 call write_iter_header_start(write_obj)
3210 do idir = 1, space%dim
3211 write(aux,
'(a2,i1,a1)')
'Jh(', idir,
')'
3212 call write_iter_header(write_obj, aux)
3215 call write_iter_nl(write_obj)
3217 call td_write_print_header_end(write_obj)
3220 safe_allocate(heat_current(1:gr%np, 1:space%dim, 1:st%d%nspin))
3222 call current_heat_calculate(space, gr%der, hm, st, heat_current)
3224 if (st%system_grp%is_root())
call write_iter_start(write_obj)
3226 total_current = 0.0_real64
3227 do idir = 1, space%dim
3228 do ispin = 1, st%d%spin_channels
3229 total_current(idir) = total_current(idir) + dmf_integrate(gr, heat_current(:, idir, ispin))
3231 total_current(idir) = units_from_atomic(units_out%energy*units_out%length/units_out%time, total_current(idir))
3234 safe_deallocate_a(heat_current)
3236 if (st%system_grp%is_root())
call write_iter_double(write_obj, total_current, space%dim)
3238 if (st%system_grp%is_root())
call write_iter_nl(write_obj)
3246 type(c_ptr),
intent(inout) :: out_partial_charges
3247 class(mesh_t),
intent(in) :: mesh
3248 type(states_elec_t),
intent(in) :: st
3249 type(ions_t),
intent(in) :: ions
3250 integer,
intent(in) :: iter
3253 character(len=50) :: aux
3254 real(real64),
allocatable :: hirshfeld_charges(:)
3258 safe_allocate(hirshfeld_charges(1:ions%natoms))
3260 call partial_charges_calculate(mesh, st, ions, hirshfeld_charges)
3262 if (st%system_grp%is_root())
then
3266 call td_write_print_header_init(out_partial_charges)
3269 call write_iter_header_start(out_partial_charges)
3271 do idir = 1, ions%natoms
3272 write(aux,
'(a13,i3,a1)')
'hirshfeld(atom=', idir,
')'
3273 call write_iter_header(out_partial_charges, aux)
3276 call write_iter_nl(out_partial_charges)
3278 call td_write_print_header_end(out_partial_charges)
3281 call write_iter_start(out_partial_charges)
3283 call write_iter_double(out_partial_charges, hirshfeld_charges, ions%natoms)
3285 call write_iter_nl(out_partial_charges)
3288 safe_deallocate_a(hirshfeld_charges)
3294 subroutine td_write_q(out_q, mpi_grp, space, ks, iter)
3295 type(c_ptr),
intent(inout) :: out_q
3296 type(mpi_grp_t),
intent(in) :: mpi_grp
3297 class(space_t),
intent(in) :: space
3298 type(v_ks_t),
intent(in) :: ks
3299 integer,
intent(in) :: iter
3301 integer :: ii, nmodes
3302 character(len=50) :: aux
3303 type(mf_t),
pointer :: pt_mx
3307 nmodes = ks%v_ks_photons%nmodes()
3308 pt_mx => ks%v_ks_photons%get_pt_mx()
3310 if (mpi_grp%is_root())
then
3312 call td_write_print_header_init(out_q)
3313 call write_iter_header_start(out_q)
3315 write(aux,
'(a1,i3,a3)')
'q', ii,
'(t)'
3316 call write_iter_header(out_q, aux)
3319 write(aux,
'(a1,i3,a3)')
'p', ii,
'(t)'
3320 call write_iter_header(out_q, aux)
3322 do ii = 1, space%dim
3323 write(aux,
'(a3,i3,a3)')
'f_pt', ii,
'(t)'
3324 call write_iter_header(out_q, aux)
3326 call write_iter_nl(out_q)
3327 call td_write_print_header_end(out_q)
3330 call write_iter_start(out_q)
3331 call write_iter_double(out_q, pt_mx%pt_q, nmodes)
3332 call write_iter_double(out_q, pt_mx%pt_p, nmodes)
3333 call write_iter_double(out_q, pt_mx%fmf, space%dim)
3334 call write_iter_nl(out_q)
3343 type(c_ptr),
intent(inout) :: out_mxll
3344 type(mpi_grp_t),
intent(in) :: mpi_grp
3345 class(space_t),
intent(in) :: space
3346 type(hamiltonian_elec_t),
intent(in) :: hm
3347 real(real64),
intent(in) :: dt
3348 integer,
intent(in) :: iter
3351 real(real64) :: field(space%dim)
3352 character(len=80) :: aux
3353 character(len=1) :: field_char
3357 if (.not. mpi_grp%is_root())
then
3367 call td_write_print_header_init(out_mxll)
3369 write(aux,
'(a7,e20.12,3a)')
'# dt = ', units_from_atomic(units_out%time, dt), &
3370 " [", trim(units_abbrev(units_out%time)),
"]"
3371 call write_iter_string(out_mxll, aux)
3372 call write_iter_nl(out_mxll)
3374 call write_iter_header_start(out_mxll)
3375 select case (hm%mxll%coupling_mode)
3376 case (length_gauge_dipole, multipolar_expansion)
3377 if (hm%mxll%add_electric_dip) field_char =
'E'
3378 if (hm%mxll%add_magnetic_dip) field_char =
'B'
3379 do idir = 1, space%dim
3380 write(aux,
'(a,i1,a)') field_char //
'(', idir,
')'
3381 call write_iter_header(out_mxll, aux)
3383 case (velocity_gauge_dipole)
3384 do idir = 1, space%dim
3385 write(aux,
'(a,i1,a)')
'A(', idir,
')'
3386 call write_iter_header(out_mxll, aux)
3389 call write_iter_nl(out_mxll)
3391 call write_iter_string(out_mxll,
'#[Iter n.]')
3392 call write_iter_header(out_mxll,
'[' // trim(units_abbrev(units_out%time)) //
']')
3396 select case (hm%mxll%coupling_mode)
3397 case (length_gauge_dipole, multipolar_expansion)
3398 if (hm%mxll%add_electric_dip) aux =
'[' // trim(units_abbrev(units_out%force)) //
']'
3399 if (hm%mxll%add_magnetic_dip) aux =
'[' // trim(units_abbrev(unit_one/units_out%length**2)) //
']'
3400 do idir = 1, space%dim
3401 call write_iter_header(out_mxll, aux)
3403 case (velocity_gauge_dipole)
3404 aux =
'[' // trim(units_abbrev(units_out%energy)) //
']'
3405 do idir = 1, space%dim
3406 call write_iter_header(out_mxll, aux)
3409 call write_iter_nl(out_mxll)
3410 call td_write_print_header_end(out_mxll)
3413 call write_iter_start(out_mxll)
3416 select case (hm%mxll%coupling_mode)
3417 case (length_gauge_dipole, multipolar_expansion)
3418 if (hm%mxll%add_electric_dip) field = units_from_atomic(units_out%force, hm%mxll%e_field_dip)
3419 if (hm%mxll%add_magnetic_dip) field = units_from_atomic(unit_one/units_out%length**2, hm%mxll%b_field_dip)
3420 call write_iter_double(out_mxll, field, space%dim)
3421 case (velocity_gauge_dipole)
3422 field = units_from_atomic(units_out%energy, hm%mxll%vec_pot_dip)
3423 call write_iter_double(out_mxll, field, space%dim)
3425 call write_iter_nl(out_mxll)
3433 type(c_ptr),
intent(inout) :: out_coords
3434 type(mpi_grp_t),
intent(in) :: mpi_grp
3435 type(lda_u_t),
intent(in) :: lda_u
3436 integer,
intent(in) :: iter
3439 character(len=50) :: aux
3441 if (.not. mpi_grp%is_root())
return
3446 call td_write_print_header_init(out_coords)
3449 call write_iter_header_start(out_coords)
3451 do ios = 1, lda_u%norbsets
3452 write(aux,
'(a2,i3,a1)')
'Ueff(', ios,
')'
3453 call write_iter_header(out_coords, aux)
3456 do ios = 1, lda_u%norbsets
3457 write(aux,
'(a2,i3,a1)')
'U(', ios,
')'
3458 call write_iter_header(out_coords, aux)
3461 do ios = 1, lda_u%norbsets
3462 write(aux,
'(a2,i3,a1)')
'J(', ios,
')'
3463 call write_iter_header(out_coords, aux)
3466 if (lda_u%intersite)
then
3467 do ios = 1, lda_u%norbsets
3468 do inn = 1, lda_u%orbsets(ios)%nneighbors
3469 write(aux,
'(a2,i3,a1,i3,a1)')
'V(', ios,
'-', inn,
')'
3470 call write_iter_header(out_coords, aux)
3476 call write_iter_nl(out_coords)
3479 call write_iter_string(out_coords,
'#[Iter n.]')
3480 call write_iter_header(out_coords,
'[' // trim(units_abbrev(units_out%time)) //
']')
3481 call write_iter_string(out_coords, &
3482 'Effective U ' // trim(units_abbrev(units_out%energy)) // &
3483 ', U in '// trim(units_abbrev(units_out%energy)) // &
3484 ', J in ' // trim(units_abbrev(units_out%energy)))
3485 call write_iter_nl(out_coords)
3487 call td_write_print_header_end(out_coords)
3490 call write_iter_start(out_coords)
3492 do ios = 1, lda_u%norbsets
3493 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3494 lda_u%orbsets(ios)%Ueff), 1)
3497 do ios = 1, lda_u%norbsets
3498 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3499 lda_u%orbsets(ios)%Ubar), 1)
3502 do ios = 1, lda_u%norbsets
3503 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3504 lda_u%orbsets(ios)%Jbar), 1)
3507 if (lda_u%intersite)
then
3508 do ios = 1, lda_u%norbsets
3509 do inn = 1, lda_u%orbsets(ios)%nneighbors
3510 call write_iter_double(out_coords, units_from_atomic(units_out%energy, &
3511 lda_u%orbsets(ios)%V_ij(inn,0)), 1)
3516 call write_iter_nl(out_coords)
3523 type(c_ptr),
intent(inout) :: file_handle
3524 type(grid_t),
intent(in) :: grid
3525 type(kpoints_t),
intent(in) :: kpoints
3526 type(states_elec_t),
intent(in) :: st
3527 integer,
intent(in) :: iter
3529 integer :: ik_ispin, ist
3530 character(len=7) :: nkpt_str, nst_str
3531 character(len=7) :: ik_str, ist_str
3532 real(real64),
allocatable :: norm_ks(:, :)
3533 real(real64) :: n_electrons
3537 safe_allocate(norm_ks(1:st%nst, 1:st%nik))
3538 call states_elec_calc_norms(grid, kpoints, st, norm_ks)
3540 if (st%system_grp%is_root())
then
3543 call td_write_print_header_init(file_handle)
3546 write(nkpt_str,
'(I7)') st%nik
3547 write(nst_str,
'(I7)') st%nst
3548 call write_iter_string(file_handle,
'# Dimensions. (nstates, nkpt * nspin):')
3549 call write_iter_string(file_handle, trim(adjustl(nst_str)) //
' ' // trim(adjustl(nkpt_str)))
3550 call write_iter_nl(file_handle)
3553 call write_iter_string(file_handle,
'# Norm ordering: (istate, ikpoint_spin)')
3554 call write_iter_nl(file_handle)
3557 call write_iter_header_start(file_handle)
3558 call write_iter_header(file_handle,
'N_electrons')
3559 do ik_ispin = 1, st%nik
3561 write(ik_str,
'(I7)') ik_ispin
3562 write(ist_str,
'(I7)') ist
3563 call write_iter_header(file_handle, &
3564 'Norm (' // trim(ist_str) //
',' // trim(ik_str) //
')')
3567 call write_iter_nl(file_handle)
3568 call td_write_print_header_end(file_handle)
3571 n_electrons = sum(st%occ * norm_ks**2)
3574 call write_iter_start(file_handle)
3575 call write_iter_double(file_handle, n_electrons, 1)
3576 do ik_ispin = 1, st%nik
3577 call write_iter_double(file_handle, norm_ks(:, ik_ispin),
size(norm_ks, 1))
3579 call write_iter_nl(file_handle)
3583 safe_deallocate_a(norm_ks)
3592 type(c_ptr),
intent(inout) :: file_handle
3593 type(ions_t),
intent(in) :: ions
3594 integer,
intent(in) :: iter
3597 real(real64) :: tmp(3)
3599 if (.not. ions%grp%is_root())
return
3603 assert(ions%space%dim == 3)
3606 call td_write_print_header_init(file_handle)
3609 call write_iter_header_start(file_handle)
3611 call write_iter_string(file_handle,
'# Iter, a, b, c, volume, alpha, beta, gamma, ' &
3612 //
'a_x, a_y, a_z, b_x, b_y, b_z, c_x, c_y, c_z')
3615 call write_iter_string(file_handle,
'#[Iter n.]')
3616 call write_iter_header(file_handle,
'[' // trim(units_abbrev(units_out%time)) //
']')
3617 call write_iter_string(file_handle, &
3618 'Lengths in ' // trim(units_abbrev(units_out%length)) // &
3619 ', Volume in ' // trim(units_abbrev(units_out%length**3)) // &
3620 ', Angles in degree, Lattice vectors in '// trim(units_abbrev(units_out%length)))
3621 call write_iter_nl(file_handle)
3623 call td_write_print_header_end(file_handle)
3626 call write_iter_start(file_handle)
3630 tmp(idir) = units_from_atomic(units_out%length, norm2(ions%latt%rlattice(1:3, idir)))
3632 call write_iter_double(file_handle, tmp, 3)
3635 tmp(1) = units_from_atomic(units_out%length**3, ions%latt%rcell_volume)
3636 call write_iter_double(file_handle, tmp(1), 1)
3639 call write_iter_double(file_handle, ions%latt%alpha, 1)
3640 call write_iter_double(file_handle, ions%latt%beta, 1)
3641 call write_iter_double(file_handle, ions%latt%gamma, 1)
3645 tmp(1:3) = units_from_atomic(units_out%length, ions%latt%rlattice(:, idir))
3646 call write_iter_double(file_handle, tmp, 3)
3648 call write_iter_nl(file_handle)
3657 type(namespace_t),
intent(in) :: namespace
3658 integer,
intent(in) :: iter
3659 real(real64),
intent(in) :: dt
3660 type(mpi_grp_t),
intent(in) :: grp
3662 integer :: default, flags, iout, first
3717 call parse_variable(namespace,
'MaxwellTDOutput', default, flags)
3719 if (.not. varinfo_valid_option(
'MaxwellTDOutput', flags, is_flag = .
true.))
then
3720 call messages_input_error(namespace,
'MaxwellTDOutput')
3724 writ%out(iout)%write = (iand(flags, 2**(iout - 1)) /= 0)
3725 if (writ%out(iout)%write)
then
3726 writ%out(iout + 1)%write = .
true.
3727 writ%out(iout + 2)%write = .
true.
3732 writ%out(iout)%write = (iand(flags, 2**(iout - 1)) /= 0)
3741 writ%out(:)%mpi_grp = grp
3743 call io_mkdir(
'td.general', namespace)
3748 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_e_field_x", namespace)))
3750 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_e_field_y", namespace)))
3752 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_e_field_z", namespace)))
3758 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_b_field_x", namespace)))
3760 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_b_field_y", namespace)))
3762 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/total_b_field_z", namespace)))
3768 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_e_field_x", namespace)))
3770 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_e_field_y", namespace)))
3772 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_e_field_z", namespace)))
3778 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_b_field_x", namespace)))
3780 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_b_field_y", namespace)))
3782 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/longitudinal_b_field_z", namespace)))
3788 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_e_field_x", namespace)))
3790 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_e_field_y", namespace)))
3792 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_e_field_z", namespace)))
3798 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_b_field_x", namespace)))
3800 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_b_field_y", namespace)))
3802 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/transverse_b_field_z", namespace)))
3808 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/maxwell_energy", namespace)))
3813 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/electric_field_surface-x", namespace)))
3818 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/electric_field_surface-y", namespace)))
3823 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/electric_field_surface-z", namespace)))
3828 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/magnetic_field_surface-x", namespace)))
3833 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/magnetic_field_surface-y", namespace)))
3838 units_from_atomic(units_out%time, dt), trim(io_workpath(
"td.general/magnetic_field_surface-z", namespace)))
3854 if (writ%out(iout)%write)
call write_iter_end(writ%out(iout)%handle)
3862 subroutine td_write_mxll_iter(writ, space, gr, st, hm, helmholtz, dt, iter, namespace)
3864 class(space_t),
intent(in) :: space
3865 type(grid_t),
intent(inout) :: gr
3866 type(states_mxll_t),
intent(inout) :: st
3867 type(hamiltonian_mxll_t),
intent(inout) :: hm
3868 type(helmholtz_decomposition_t),
intent(inout) :: helmholtz
3869 real(real64),
intent(in) :: dt
3870 integer,
intent(in) :: iter
3871 type(namespace_t),
intent(in) :: namespace
3876 call profiling_in(
"TD_WRITE_ITER_MAXWELL")
3879 call helmholtz%get_trans_field(namespace, st%rs_state_trans, total_field=st%rs_state)
3880 call get_rs_state_at_point(st%selected_points_rs_state_trans(:,:), st%rs_state_trans, &
3881 st%selected_points_coordinate(:,:), st, gr)
3884 hm%energy%energy_trans = m_zero
3888 call helmholtz%get_long_field(namespace, st%rs_state_long, total_field=st%rs_state)
3889 call get_rs_state_at_point(st%selected_points_rs_state_long(:,:), st%rs_state_long, &
3890 st%selected_points_coordinate(:,:), st, gr)
3893 hm%energy%energy_long = m_zero
3986 call profiling_out(
"TD_WRITE_ITER_MAXWELL")
3995 type(mpi_grp_t),
intent(in) :: mpi_grp
3996 type(hamiltonian_mxll_t),
intent(in) :: hm
3997 integer,
intent(in) :: iter
4001 integer :: n_columns
4003 if (.not. mpi_grp%is_root())
return
4028 call write_iter_header(
out_maxwell_energy,
'[' // trim(units_abbrev(units_out%time)) //
']')
4030 do ii = 1, n_columns
4031 call write_iter_header(
out_maxwell_energy,
'[' // trim(units_abbrev(units_out%energy)) //
']')
4039 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy), 1)
4040 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%e_energy), 1)
4041 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%b_energy), 1)
4043 hm%energy%energy+hm%energy%boundaries), 1)
4044 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%boundaries), 1)
4045 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy_trans), 1)
4046 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy_long), 1)
4047 call write_iter_double(
out_maxwell_energy, units_from_atomic(units_out%energy, hm%energy%energy_plane_waves), 1)
4056 type(c_ptr),
intent(inout) :: out_field_surf
4057 type(states_mxll_t),
intent(in) :: st
4058 integer,
intent(in) :: dim
4059 integer,
intent(in) :: iter
4063 integer :: n_columns
4065 if (.not. st%system_grp%is_root())
return
4072 call td_write_print_header_init(out_field_surf)
4075 call write_iter_header_start(out_field_surf)
4076 call write_iter_header(out_field_surf,
'- x direction')
4077 call write_iter_header(out_field_surf,
'+ x direction')
4078 call write_iter_header(out_field_surf,
'- y direction')
4079 call write_iter_header(out_field_surf,
'+ y direction')
4080 call write_iter_header(out_field_surf,
'- z direction')
4081 call write_iter_header(out_field_surf,
'+ z direction')
4082 call write_iter_header(out_field_surf,
'- x dir. p. w.')
4083 call write_iter_header(out_field_surf,
'+ x dir. p. w.')
4084 call write_iter_header(out_field_surf,
'- y dir. p. w.')
4085 call write_iter_header(out_field_surf,
'+ y dir. p. w.')
4086 call write_iter_header(out_field_surf,
'- z dir. p. w.')
4087 call write_iter_header(out_field_surf,
'+ z dir. p. w.')
4089 call write_iter_nl(out_field_surf)
4092 call write_iter_string(out_field_surf,
'#[Iter n.]')
4093 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(units_out%time)) //
']')
4095 do ii = 1, n_columns
4096 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(units_out%energy/units_out%length)) //
']')
4098 call write_iter_nl(out_field_surf)
4100 call td_write_print_header_end(out_field_surf)
4103 call write_iter_start(out_field_surf)
4104 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4105 st%electric_field_box_surface(1,1,dim)), 1)
4106 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4107 st%electric_field_box_surface(2,1,dim)), 1)
4108 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4109 st%electric_field_box_surface(1,2,dim)), 1)
4110 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4111 st%electric_field_box_surface(2,2,dim)), 1)
4112 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4113 st%electric_field_box_surface(1,3,dim)), 1)
4114 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4115 st%electric_field_box_surface(2,3,dim)), 1)
4116 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4117 st%electric_field_box_surface_plane_waves(1,1,dim)), 1)
4118 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4119 st%electric_field_box_surface_plane_waves(2,1,dim)), 1)
4120 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4121 st%electric_field_box_surface_plane_waves(1,2,dim)), 1)
4122 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4123 st%electric_field_box_surface_plane_waves(2,2,dim)), 1)
4124 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4125 st%electric_field_box_surface_plane_waves(1,3,dim)), 1)
4126 call write_iter_double(out_field_surf, units_from_atomic(units_out%energy/units_out%length, &
4127 st%electric_field_box_surface_plane_waves(2,3,dim)), 1)
4128 call write_iter_nl(out_field_surf)
4136 type(c_ptr),
intent(inout) :: out_field_surf
4137 type(states_mxll_t),
intent(in) :: st
4138 integer,
intent(in) :: dim
4139 integer,
intent(in) :: iter
4143 integer :: n_columns
4145 if (.not. st%system_grp%is_root())
return
4152 call td_write_print_header_init(out_field_surf)
4155 call write_iter_header_start(out_field_surf)
4156 call write_iter_header(out_field_surf,
'- x direction')
4157 call write_iter_header(out_field_surf,
'+ x direction')
4158 call write_iter_header(out_field_surf,
'- y direction')
4159 call write_iter_header(out_field_surf,
'+ y direction')
4160 call write_iter_header(out_field_surf,
'- z direction')
4161 call write_iter_header(out_field_surf,
'+ z direction')
4162 call write_iter_header(out_field_surf,
'- x dir. p. w.')
4163 call write_iter_header(out_field_surf,
'+ x dir. p. w.')
4164 call write_iter_header(out_field_surf,
'- y dir. p. w.')
4165 call write_iter_header(out_field_surf,
'+ y dir. p. w.')
4166 call write_iter_header(out_field_surf,
'- z dir. p. w.')
4167 call write_iter_header(out_field_surf,
'+ z dir. p. w.')
4169 call write_iter_nl(out_field_surf)
4172 call write_iter_string(out_field_surf,
'#[Iter n.]')
4173 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(units_out%time)) //
']')
4175 do ii = 1, n_columns
4176 call write_iter_header(out_field_surf,
'[' // trim(units_abbrev(unit_one/units_out%length**2)) //
']')
4178 call write_iter_nl(out_field_surf)
4180 call td_write_print_header_end(out_field_surf)
4183 call write_iter_start(out_field_surf)
4184 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4185 st%magnetic_field_box_surface(1,1,dim)), 1)
4186 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4187 st%magnetic_field_box_surface(2,1,dim)), 1)
4188 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4189 st%magnetic_field_box_surface(1,2,dim)), 1)
4190 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4191 st%magnetic_field_box_surface(2,2,dim)), 1)
4192 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4193 st%magnetic_field_box_surface(1,3,dim)), 1)
4194 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4195 st%magnetic_field_box_surface(2,3,dim)), 1)
4196 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4197 st%magnetic_field_box_surface_plane_waves(1,1,dim)), 1)
4198 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4199 st%magnetic_field_box_surface_plane_waves(2,1,dim)), 1)
4200 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4201 st%magnetic_field_box_surface_plane_waves(1,2,dim)), 1)
4202 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4203 st%magnetic_field_box_surface_plane_waves(2,2,dim)), 1)
4204 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4205 st%magnetic_field_box_surface_plane_waves(1,3,dim)), 1)
4206 call write_iter_double(out_field_surf, units_from_atomic(unit_one/units_out%length**2, &
4207 st%magnetic_field_box_surface_plane_waves(2,3,dim)), 1)
4208 call write_iter_nl(out_field_surf)
4214 subroutine td_write_fields(out_fields, space, st, iter, dt, e_or_b_field, field_type, idir)
4215 type(c_ptr),
intent(inout) :: out_fields
4216 class(space_t),
intent(in) :: space
4217 type(states_mxll_t),
intent(in) :: st
4218 integer,
intent(in) :: iter
4219 real(real64),
intent(in) :: dt
4220 integer,
intent(in) :: e_or_b_field
4221 integer,
intent(in) :: field_type
4222 integer,
intent(in) :: idir
4226 real(real64) :: field(space%dim), selected_field
4227 character(len=80) :: aux
4229 if (.not. st%system_grp%is_root())
return
4234 call td_write_print_header_init(out_fields)
4237 write(aux,
'(a7,e20.12,3a)')
'# dt = ', units_from_atomic(units_out%time, dt), &
4238 " [", trim(units_abbrev(units_out%time)),
"]"
4239 call write_iter_string(out_fields, aux)
4240 call write_iter_nl(out_fields)
4242 call write_iter_header_start(out_fields)
4244 do id = 1, st%selected_points_number
4245 select case (e_or_b_field)
4247 write(aux,
'(a,i1,a)')
'E(', id,
')'
4249 write(aux,
'(a,i1,a)')
'B(', id,
')'
4251 call write_iter_header(out_fields, aux)
4254 call write_iter_nl(out_fields)
4255 call write_iter_string(out_fields,
'#[Iter n.]')
4256 call write_iter_header(out_fields,
' [' // trim(units_abbrev(units_out%time)) //
']')
4261 aux =
' [' // trim(units_abbrev(units_out%force)) //
']'
4262 do id = 1, st%selected_points_number
4263 call write_iter_header(out_fields, aux)
4265 call write_iter_nl(out_fields)
4266 call td_write_print_header_end(out_fields)
4269 call write_iter_start(out_fields)
4271 do id = 1, st%selected_points_number
4272 select case (e_or_b_field)
4275 select case (field_type)
4277 call get_electric_field_vector(st%selected_points_rs_state(:,id), field(1:st%dim))
4279 call get_electric_field_vector(st%selected_points_rs_state_long(:,id), field(1:st%dim))
4281 call get_electric_field_vector(st%selected_points_rs_state_trans(:,id), field(1:st%dim))
4283 selected_field = units_from_atomic(units_out%energy/units_out%length, field(idir))
4286 select case (field_type)
4288 call get_magnetic_field_vector(st%selected_points_rs_state(:,id), st%rs_sign, field(1:st%dim))
4290 call get_magnetic_field_vector(st%selected_points_rs_state_long(:,id), st%rs_sign, field(1:st%dim))
4292 call get_magnetic_field_vector(st%selected_points_rs_state_trans(:,id), st%rs_sign, field(1:st%dim))
4294 selected_field = units_from_atomic(unit_one/units_out%length**2, field(idir))
4296 call write_iter_double(out_fields, selected_field, 1)
4299 call write_iter_nl(out_fields)
4307 type(namespace_t),
intent(in) :: namespace
4308 class(space_t),
intent(in) :: space
4309 type(grid_t),
intent(inout) :: gr
4310 type(states_mxll_t),
intent(inout) :: st
4311 type(hamiltonian_mxll_t),
intent(inout) :: hm
4312 type(helmholtz_decomposition_t),
intent(inout) :: helmholtz
4313 type(output_t),
intent(in) :: outp
4314 integer,
intent(in) :: iter
4315 real(real64),
intent(in) :: time
4317 character(len=256) :: filename
4319 push_sub(td_write_mxwll_free_data)
4320 call profiling_in(
"TD_WRITE_MAXWELL_DATA")
4323 write(filename,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
4325 call output_mxll(outp, namespace, space, gr, st, hm, helmholtz, time, filename)
4327 call profiling_out(
"TD_WRITE_MAXWELL_DATA")
4328 pop_sub(td_write_mxwll_free_data)
4333 type(c_ptr),
intent(inout) :: out_dm_proj_basis
4334 type(states_elec_t),
intent(in) :: dmp_st
4335 integer,
intent(in) :: iter
4337 character(len=80) :: aux
4343 call td_write_print_header_init(out_dm_proj_basis)
4345 write(aux,
'(a15,i8)')
"# nspin ", dmp_st%d%nspin
4346 call write_iter_string(out_dm_proj_basis, aux)
4347 call write_iter_nl(out_dm_proj_basis)
4349 write(aux,
'(a15,i8)')
"# nik ", dmp_st%nik
4350 call write_iter_string(out_dm_proj_basis, aux)
4351 call write_iter_nl(out_dm_proj_basis)
4353 write(aux,
'(a15,2i8)')
"# st ", 1, dmp_st%nst
4354 call write_iter_string(out_dm_proj_basis, aux)
4355 call write_iter_nl(out_dm_proj_basis)
4357 write(aux,
'(a15)')
"# w(ik) "
4358 call write_iter_string(out_dm_proj_basis, aux)
4359 do ik = 1, dmp_st%nik
4360 call write_iter_double(out_dm_proj_basis, dmp_st%kweights(ik), 1)
4362 call write_iter_nl(out_dm_proj_basis)
4364 call td_write_print_header_end(out_dm_proj_basis)
4366 call write_iter_string(out_dm_proj_basis,
"# ------------")
4367 call write_iter_start(out_dm_proj_basis)
4368 call write_iter_double(out_dm_proj_basis, dmp_st%qtot, 1)
4369 call write_iter_nl(out_dm_proj_basis)
4370 do ik = 1, dmp_st%nik
4371 call write_iter_double(out_dm_proj_basis, dmp_st%eigenval(:, ik), dmp_st%nst)
4372 call write_iter_nl(out_dm_proj_basis)
4373 call write_iter_double(out_dm_proj_basis, dmp_st%occ(:, ik), dmp_st%nst)
4374 call write_iter_nl(out_dm_proj_basis)
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__
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)
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.
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.
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_)
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
subroutine, public zstates_elec_matrix(st1, st2, mesh, aa)
subroutine, public zstates_elec_calc_projections(st, gs_st, namespace, mesh, ik, proj, gs_nst)
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
subroutine td_write_proj(out_proj, space, mesh, ions, st, gs_st, kick, iter)
integer, parameter, public out_q
integer, parameter, public out_mxll_field
subroutine calc_projections(mesh, st, gs_st, projections)
This subroutine calculates:
integer, parameter out_b_field_surface_y
subroutine td_write_ionch(out_ionch, mesh, st, iter)
integer, parameter, public out_tot_m
integer, parameter, public out_norm_ks
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 td_write_total_current(out_total_current, space, mesh, st, iter)
subroutine, public td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, iter, dt)
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
subroutine td_write_dm_proj_basis(out_dm_proj_basis, dmp_st, iter)
integer, parameter, public out_kp_proj
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
subroutine td_write_populations(out_populations, namespace, space, mesh, st, writ, dt, iter)
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_partial_charges(out_partial_charges, mesh, st, ions, 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)
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)
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
subroutine, public td_write_iter(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, kick, ks, dt, iter, mc, recalculate_gs, dmp_st)
integer, parameter, public out_n_ex
integer, parameter out_b_field_surface_z
subroutine td_write_temperature(out_temperature, mpi_grp, ions, iter)
subroutine td_write_proj_kp(mesh, kpoints, st, gs_st, namespace, iter)
integer, parameter, public out_temperature
subroutine td_write_norm_ks_orbitals(file_handle, grid, kpoints, st, iter)
Write the norm of the KS orbitals to file as a function of time step.
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_n_ex(out_nex, outp, namespace, mesh, kpoints, st, gs_st, iter)
This routine computes the total number of excited electrons based on projections on the GS orbitals T...
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)
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.
subroutine dipole_matrix_elements(dir)