44 use,
intrinsic :: iso_fortran_env
108 integer,
parameter,
public :: &
114 type(propagator_base_t),
public :: tr
115 type(scf_t),
public :: scf
116 type(ion_dynamics_t),
public :: ions_dyn
117 real(real64),
public :: dt
118 integer,
public :: max_iter
119 integer,
public :: iter
120 logical,
public :: recalculate_gs
122 type(pes_t),
public :: pesv
124 integer,
public :: dynamics
125 integer,
public :: energy_update_iter
126 real(real64) :: scissor
128 logical :: freeze_occ
130 integer :: freeze_orbitals
132 logical :: from_scratch = .false.
134 type(td_write_t),
public :: write_handler
135 type(restart_t) :: restart_load
136 type(restart_t) :: restart_dump
153 subroutine td_init(td, namespace, space, gr, ions, st, ks, hm, ext_partners, outp)
154 type(td_t),
intent(inout) :: td
155 type(namespace_t),
intent(in) :: namespace
156 class(space_t),
intent(in) :: space
157 type(grid_t),
intent(in) :: gr
158 type(ions_t),
intent(inout) :: ions
159 type(states_elec_t),
intent(in) :: st
160 type(v_ks_t),
intent(in) :: ks
161 type(hamiltonian_elec_t),
intent(in) :: hm
162 type(partner_list_t),
intent(in) :: ext_partners
163 type(output_t),
intent(in) :: outp
166 real(real64) :: propagation_time
167 type(lasers_t),
pointer :: lasers
176 if (hm%kpoints%use_symmetries)
then
177 message(1) =
"KPoints symmetries cannot be used with moving ions."
178 message(2) =
"Please set KPointsSymmetries = no."
181 if (st%symmetrize_density)
then
182 message(1) =
"Symmetrization of the density cannot be used with moving ions."
183 message(2) =
"Please set SymmetrizeDensity = no."
205 write(
message(1),
'(a)')
'A positive value for TDTimeStep must be defined in the input file.'
213 call messages_write(
'You cannot set TDMaxSteps and TDPropagationTime at the same time')
242 if (propagation_time >
m_zero) default = nint(propagation_time/td%dt)
243 call parse_variable(namespace,
'TDMaxSteps', default, td%max_iter)
245 if (propagation_time <=
m_zero) propagation_time = td%dt*td%max_iter
250 if (td%max_iter < 1)
then
251 write(
message(1),
'(a,i6,a)')
"Input: '", td%max_iter,
"' is not a valid value for TDMaxSteps."
252 message(2) =
'(TDMaxSteps <= 1)'
263 call pes_init(td%pesv, namespace, space, gr, gr%box, st, outp%restart_write_interval, hm%kpoints, &
264 hm%abs_boundaries, ext_partners, td%max_iter, td%dt)
279 call parse_variable(namespace,
'TDDynamics', ehrenfest, td%dynamics)
282 if (td%dynamics .ne. ehrenfest)
then
302 call parse_variable(namespace,
'RecalculateGSDuringEvolution', .false., td%recalculate_gs)
303 if (hm%lda_u_level /=
dft_u_none .and. td%recalculate_gs)
then
325 call laser_write_info(lasers%lasers, dt=td%dt, max_iter=td%max_iter, namespace=namespace)
341 call parse_variable(namespace,
'TDEnergyUpdateIter', default, td%energy_update_iter)
343 if (gr%der%boundaries%spiralBC .and. hm%ep%reltype ==
spin_orbit)
then
344 message(1) =
"Generalized Bloch theorem cannot be used with spin-orbit coupling."
348 if (gr%der%boundaries%spiralBC)
then
349 if (any(abs(hm%kick%easy_axis(1:2)) >
m_epsilon))
then
350 message(1) =
"Generalized Bloch theorem cannot be used for an easy axis not along the z direction."
376 call parse_variable(namespace,
'TDFreezeOrbitals', 0, td%freeze_orbitals)
378 if (td%freeze_orbitals /= 0)
then
392 subroutine td_init_run(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, from_scratch)
393 type(
td_t),
intent(inout) :: td
396 type(
grid_t),
intent(inout) :: gr
397 type(
ions_t),
intent(inout) :: ions
399 type(
v_ks_t),
intent(inout) :: ks
402 type(
output_t),
intent(inout) :: outp
404 logical,
intent(inout) :: from_scratch
414 td%from_scratch = from_scratch
416 if (.not. td%from_scratch)
then
418 if (td%from_scratch)
then
419 message(1) =
"Unable to read time-dependent restart information: Starting from scratch"
424 if (td%iter >= td%max_iter)
then
425 message(1) =
"All requested iterations have already been done. Use FromScratch = yes if you want to redo them."
428 td%iter = td%iter + 1
434 if (td%from_scratch)
then
438 call td_init_with_wavefunctions(td, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, td%from_scratch)
445 type(
td_t),
intent(inout) :: td
448 type(
grid_t),
intent(inout) :: gr
449 type(
ions_t),
intent(inout) :: ions
452 class(
space_t),
intent(in) :: space
457 if (td%dynamics == ehrenfest)
then
463 call lda_u_init(hm%lda_u, namespace, space, hm%lda_u_level, gr, ions, st, mc, &
464 hm%kpoints, hm%phase%is_allocated())
471 call scf_init(td%scf, namespace, gr, ions, st, mc, hm, space)
479 type(
td_t),
intent(inout) :: td
481 type(
grid_t),
intent(inout) :: gr
483 type(
v_ks_t),
intent(inout) :: ks
486 class(
space_t),
intent(in) :: space
493 if(
associated(gfield))
then
500 call hm%update(gr, namespace, space, ext_partners, time = td%dt*td%iter)
510 type(
td_t),
intent(inout) :: td
518 if (td%dynamics ==
bo)
call scf_end(td%scf)
525 type(
td_t),
intent(inout) :: td
531 if (st%pack_states .and. hm%apply_packed())
call st%unpack()
544 subroutine td_run(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, from_scratch)
545 type(
td_t),
intent(inout) :: td
548 type(
grid_t),
intent(inout) :: gr
549 type(
ions_t),
intent(inout) :: ions
551 type(
v_ks_t),
intent(inout) :: ks
554 type(
output_t),
intent(inout) :: outp
556 logical,
intent(inout) :: from_scratch
559 integer :: iter, scsteps
560 real(real64) :: etime
568 propagation:
do iter = td%iter, td%max_iter
575 if (((iter-1)*td%dt <= hm%kick%time) .and. (iter*td%dt > hm%kick%time))
then
576 if (.not. hm%pcm%localf)
then
577 call kick_apply(space, gr, st, td%ions_dyn, ions, hm%kick, hm%psolver, hm%kpoints)
579 call kick_apply(space, gr, st, td%ions_dyn, ions, hm%kick, hm%psolver, hm%kpoints, pcm = hm%pcm)
581 call td_write_kick(outp, namespace, space, gr, hm%kick, ions, iter)
584 if (gr%der%boundaries%spiralBC) gr%der%boundaries%spiral = .
true.
589 select case (td%dynamics)
591 call propagator_elec_dt(ks, namespace, space, hm, gr, st, td%tr, iter*td%dt, td%dt, iter, td%ions_dyn, &
592 ions, ext_partners, outp, td%write_handler, scsteps = scsteps, &
593 update_energy = (mod(iter, td%energy_update_iter) == 0) .or. (iter == td%max_iter))
595 call propagator_elec_dt_bo(td%scf, namespace, space, gr, ks, st, hm, ions, ext_partners, mc, outp, iter, &
596 td%dt, td%ions_dyn, scsteps)
609 if (td%pesv%calc_spm .or. td%pesv%calc_mask .or. td%pesv%calc_flux)
then
610 call pes_calc(td%pesv, namespace, space, gr, st, td%dt, iter, gr%der, hm%kpoints, ext_partners, stopping)
613 call td_write_iter(td%write_handler, namespace, space, outp, gr, st, hm, ions, ext_partners, &
614 hm%kick, ks, td%dt, iter, mc, td%recalculate_gs)
617 call td_check_point(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, &
618 iter, scsteps, etime, stopping, from_scratch)
636 write(
message(1),
'(a7,1x,a14,a14,a10,a17)')
'Iter ',
'Time ',
'Energy ',
'SC Steps',
'Elapsed Time '
645 subroutine td_check_point(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, &
646 iter, scsteps, etime, stopping, from_scratch)
647 type(
td_t),
intent(inout) :: td
650 type(
grid_t),
intent(inout) :: gr
651 type(
ions_t),
intent(inout) :: ions
653 type(
v_ks_t),
intent(inout) :: ks
658 integer,
intent(in) :: iter
659 integer,
intent(in) :: scsteps
660 real(real64),
intent(inout) :: etime
661 logical,
intent(in) :: stopping
662 logical,
intent(inout) :: from_scratch
670 if (outp%anything_now(iter))
then
671 call td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, iter, td%dt)
674 if (mod(iter, outp%restart_write_interval) == 0 .or. iter == td%max_iter .or. stopping)
then
677 call td_dump(td, namespace, space, gr, st, hm, ks, ext_partners, iter, ierr)
679 message(1) =
"Unable to write time-dependent restart information."
683 call pes_output(td%pesv, namespace, space, gr, st, iter, outp, td%dt, ions)
687 from_scratch = .false.
689 call electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, from_scratch)
691 call td_load(td%restart_load, namespace, space, gr, st, hm, ext_partners, td, ks, ierr)
693 message(1) =
"Unable to load TD states."
697 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, &
698 calc_eigenval=.
true., time = iter*td%dt, calc_energy=.
true.)
699 call forces_calculate(gr, namespace, ions, hm, ext_partners, st, ks, t = iter*td%dt, dt = td%dt)
710 type(
td_t),
intent(inout) :: td
712 type(
ions_t),
intent(inout) :: ions
714 integer,
intent(in) :: iter
715 integer,
intent(in) :: scsteps
716 real(real64),
intent(inout) :: etime
731 real(real64),
intent(inout) :: etime
741 subroutine td_init_with_wavefunctions(td, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, from_scratch)
742 type(
td_t),
intent(inout) :: td
746 type(
grid_t),
intent(inout) :: gr
747 type(
ions_t),
intent(inout) :: ions
750 type(
v_ks_t),
intent(inout) :: ks
752 type(
output_t),
intent(inout) :: outp
753 logical,
intent(in) :: from_scratch
757 real(real64) :: ndinitial(space%dim)
758 logical :: freeze_hxc, freeze_occ, freeze_u
759 type(
restart_t) :: restart, restart_frozen
766 if (gr%der%boundaries%spiralBC)
then
767 if ((td%iter-1)*td%dt > hm%kick%time)
then
768 gr%der%boundaries%spiral = .
true.
770 hm%vnl%spin => st%spin
771 hm%phase%spin => st%spin
776 if (from_scratch)
then
783 if (td%freeze_orbitals > 0)
then
784 if (from_scratch)
then
787 td%freeze_orbitals, family_is_mgga(ks%xc_family))
795 message(1) =
"Unable to read frozen restart information."
800 write(
message(1),
'(a,i4,a,i4,a)')
'Info: The lowest', td%freeze_orbitals, &
801 ' orbitals have been frozen.', st%nst,
' will be propagated.'
805 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval=.
true., time = td%iter*td%dt)
806 else if (td%freeze_orbitals < 0)
then
809 write(
message(1),
'(a)')
'Info: The single-active-electron approximation will be used.'
811 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval=.
true., time = td%iter*td%dt)
812 if (from_scratch)
then
823 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval=.
true., time = td%iter*td%dt)
836 write(
message(1),
'(a)')
'Info: Freezing Hartree and exchange-correlation potentials.'
839 if (.not. from_scratch)
then
842 call states_elec_load(restart_frozen, namespace, space, st, gr, hm%kpoints, ierr, label =
": gs")
847 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval=.
true., time = td%iter*td%dt)
850 call states_elec_load(restart_frozen, namespace, space, st, gr, hm%kpoints, ierr, iter=td%iter, label =
": td")
852 call hm%ks_pot%run_zero_iter(td%tr%vks_old)
860 x = minval(st%eigenval(st%st_start, :))
861 if (st%parallel_in_states)
then
862 call st%mpi_grp%bcast(x, 1, mpi_double_precision, 0)
864 call hm%update_span(gr%spacing(1:space%dim), x, namespace)
866 call states_elec_fermi(st, namespace, gr, compute_spin = .not. gr%der%boundaries%spiralBC)
877 call parse_variable(namespace,
'TDFreezeDFTUOccupations', .false., freeze_occ)
879 write(
message(1),
'(a)')
'Info: Freezing DFT+U occupation matrices that enters in the DFT+U potential.'
884 if (hm%lda_u_level /=
dft_u_none .and. .not. from_scratch)
then
886 call lda_u_load(restart_frozen, hm%lda_u, st, hm%energy%dft_u, ierr, occ_only = .
true.)
900 write(
message(1),
'(a)')
'Info: Freezing the effective U of DFT+U.'
905 if (hm%lda_u_level ==
dft_u_acbn0 .and. .not. from_scratch)
then
907 call lda_u_load(restart_frozen, hm%lda_u, st, hm%energy%dft_u, ierr, u_only = .
true.)
909 write(
message(1),
'(a)')
'Loaded GS effective U of DFT+U'
918 call td_write_init(td%write_handler, namespace, space, outp, gr, st, hm, ions, ext_partners, &
924 if(
associated(lasers))
then
926 ndinitial(1:space%dim)=
m_zero
935 call scissor_init(hm%scissor, namespace, space, st, gr, hm%d, hm%kpoints, hm%phase, td%scissor, mc)
938 if (td%iter == 0)
call td_run_zero_iter(td, namespace, space, gr, ions, st, ks, hm, ext_partners, outp, mc)
941 if(
associated(gfield))
then
943 if(ks%xc%kernel_lrc_alpha >
m_epsilon)
then
953 td%iter = td%iter + 1
964 if (td%pesv%calc_spm .or. td%pesv%calc_mask .and. from_scratch)
then
968 if (st%pack_states .and. hm%apply_packed())
call st%pack()
975 type(
td_t),
intent(inout) :: td
978 type(
grid_t),
intent(inout) :: gr
979 type(
ions_t),
intent(inout) :: ions
982 type(
v_ks_t),
intent(inout) :: ks
984 type(
output_t),
intent(inout) :: outp
990 if (td%iter > 0)
then
997 call v_ks_calc(ks, namespace, space, hm, st, ions, ext_partners, calc_eigenval=.
true., time = td%iter*td%dt)
1000 call forces_calculate(gr, namespace, ions, hm, ext_partners, st, ks, t = td%iter*td%dt, dt = td%dt)
1002 call ions%update_kinetic_energy()
1004 if (outp%what(option__output__forces) .or. td%write_handler%out(
out_separate_forces)%write)
then
1005 call forces_calculate(gr, namespace, ions, hm, ext_partners, st, ks, t = td%iter*td%dt, dt = td%dt)
1009 if (outp%what(option__output__stress))
then
1018 type(
td_t),
intent(inout) :: td
1020 class(
space_t),
intent(in) :: space
1022 type(
grid_t),
intent(inout) :: gr
1025 type(
v_ks_t),
intent(inout) :: ks
1027 logical,
intent(inout) :: from_scratch
1035 if (td%freeze_orbitals > 0)
then
1041 call td_load(restart, namespace, space, gr, st, hm, ext_partners, td, ks, ierr)
1045 from_scratch = .
true.
1054 type(
td_t),
intent(inout) :: td
1056 class(
space_t),
intent(in) :: space
1058 type(
grid_t),
intent(inout) :: gr
1061 type(
v_ks_t),
intent(inout) :: ks
1071 if (.not. st%only_userdef_istates)
then
1073 call states_elec_load(restart, namespace, space, st, gr, hm%kpoints, ierr, label =
": gs")
1076 message(1) =
'Unable to read ground-state wavefunctions.'
1095 subroutine td_run_zero_iter(td, namespace, space, gr, ions, st, ks, hm, ext_partners, outp, mc)
1096 type(
td_t),
intent(inout) :: td
1099 type(
grid_t),
intent(inout) :: gr
1100 type(
ions_t),
intent(inout) :: ions
1102 type(
v_ks_t),
intent(inout) :: ks
1110 call td_write_iter(td%write_handler, namespace, space, outp, gr, st, hm, ions, ext_partners, &
1111 hm%kick, ks, td%dt, 0, mc, td%recalculate_gs)
1115 if (abs(hm%kick%time) <=
m_epsilon)
then
1116 if (.not. hm%pcm%localf)
then
1117 call kick_apply(space, gr, st, td%ions_dyn, ions, hm%kick, hm%psolver, hm%kpoints)
1119 call kick_apply(space, gr, st, td%ions_dyn, ions, hm%kick, hm%psolver, hm%kpoints, pcm = hm%pcm)
1121 call td_write_kick(outp, namespace, space, gr, hm%kick, ions, 0)
1124 if (gr%der%boundaries%spiralBC)
then
1125 gr%der%boundaries%spiral = .
true.
1128 call hm%ks_pot%run_zero_iter(td%tr%vks_old)
1130 if (any(outp%output_interval > 0))
then
1132 call td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, 0)
1142 type(
td_t),
intent(in) :: td
1144 type(
ions_t),
intent(inout) :: ions
1146 integer :: iatom, iter, iunit
1150 iunit =
io_open(
'td.general/coordinates', namespace, action=
'read', status=
'old', die=.false.)
1151 if (iunit == -1)
then
1152 message(1) =
"Could not open file '"//trim(
io_workpath(
'td.general/coordinates', namespace))//
"'."
1153 message(2) =
"Starting simulation from initial geometry."
1160 do iter = 0, td%iter - 1
1163 read(iunit,
'(32x)', advance=
'no')
1165 do iatom = 1, ions%natoms
1166 read(iunit,
'(3es24.16)', advance=
'no') ions%pos(:, iatom)
1169 do iatom = 1, ions%natoms
1170 read(iunit,
'(3es24.16)', advance=
'no') ions%vel(:, iatom)
1173 do iatom = 1, ions%natoms
1174 read(iunit,
'(3es24.16)', advance=
'no') ions%tot_force(:, iatom)
1184 subroutine td_dump(td, namespace, space, gr, st, hm, ks, ext_partners, iter, ierr)
1185 type(
td_t),
intent(in) :: td
1187 class(
space_t),
intent(in) :: space
1191 type(
v_ks_t),
intent(in) :: ks
1193 integer,
intent(in) :: iter
1194 integer,
intent(out) :: ierr
1197 integer :: err, err2
1208 message(1) =
"Debug: Writing td restart."
1212 call states_elec_dump(td%restart_dump, space, st, gr, hm%kpoints, err, iter=iter)
1213 if (err /= 0) ierr = ierr + 1
1216 if (err /= 0) ierr = ierr + 1
1219 call lda_u_dump(td%restart_dump, namespace, hm%lda_u, st, gr, ierr)
1220 if (err /= 0) ierr = ierr + 1
1224 if (err2 /= 0) ierr = ierr + 2
1226 call pes_dump(td%pesv, namespace, td%restart_dump, st, gr, err)
1227 if (err /= 0) ierr = ierr + 4
1231 if(
associated(gfield))
then
1235 if (gr%der%boundaries%spiralBC)
then
1237 if (err /= 0) ierr = ierr + 8
1240 if (ks%has_photons)
then
1241 call mf_photons_dump(td%restart_dump, ks%pt_mx, gr, td%dt, ks%pt, err)
1242 if (err /= 0) ierr = ierr + 16
1245 if (ks%xc_photon /= 0)
then
1247 call ks%xc_photons%mf_dump(td%restart_dump, err)
1248 if (err /= 0) ierr = ierr + 32
1251 if (
allocated(st%frozen_rho))
then
1254 if (err /= 0) ierr = ierr + 64
1259 if (err /= 0) ierr = ierr + 128
1261 message(1) =
"Debug: Writing td restart done."
1268 subroutine td_load(restart, namespace, space, gr, st, hm, ext_partners, td, ks, ierr)
1271 class(
space_t),
intent(in) :: space
1272 type(
grid_t),
intent(in) :: gr
1276 type(
td_t),
intent(inout) :: td
1278 integer,
intent(out) :: ierr
1280 integer :: err, err2
1292 message(1) =
"Debug: Reading td restart."
1296 call states_elec_load(restart, namespace, space, st, gr, hm%kpoints, err, iter=td%iter, label =
": td")
1303 if (err2 /= 0) ierr = ierr + 2
1306 call lda_u_load(restart, hm%lda_u, st, hm%energy%dft_u, ierr)
1307 if (err /= 0) ierr = ierr + 1
1312 if (td%pesv%calc_spm .or. td%pesv%calc_mask .or. td%pesv%calc_flux)
then
1313 call pes_load(td%pesv, namespace, restart, st, err)
1314 if (err /= 0) ierr = ierr + 4
1319 if (
associated(gfield))
then
1324 call hm%update(gr, namespace, space, ext_partners, time = td%dt*td%iter)
1329 if (ks%has_photons)
then
1332 if (err /= 0) ierr = ierr + 16
1334 if (ks%xc_photon /= 0)
then
1335 call ks%xc_photons%mf_load(restart, space, err)
1337 if (err /= 0) ierr = ierr + 32
1339 if (gr%der%boundaries%spiralBC)
then
1349 if (err /= 0) ierr = ierr + 64
1351 message(1) =
"Debug: Reading td restart done."
1358 subroutine td_load_frozen(namespace, restart, space, mesh, st, hm, ierr)
1362 class(
mesh_t),
intent(in) :: mesh
1365 integer,
intent(out) :: ierr
1377 message(1) =
"Debug: Reading td frozen restart."
1380 safe_allocate(st%frozen_rho(1:mesh%np, 1:st%d%nspin))
1381 if (family_is_mgga(hm%xc%family))
then
1382 safe_allocate(st%frozen_tau(1:mesh%np, 1:st%d%nspin))
1383 safe_allocate(st%frozen_gdens(1:mesh%np, 1:space%dim, 1:st%d%nspin))
1384 safe_allocate(st%frozen_ldens(1:mesh%np, 1:st%d%nspin))
1389 message(1) =
"Debug: Reading td frozen restart done."
1397 type(
td_t),
intent(in) :: td
1408 type(
td_t),
intent(inout) :: td
1409 logical,
intent(in) :: from_scratch
1413 td%from_scratch = from_scratch
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
integer, parameter, public mask_absorbing
Module implementing boundary conditions in Octopus.
This module handles the calculation mode.
type(calc_mode_par_t), public calc_mode_par
Singleton instance of parallel calculation mode.
integer, parameter, public p_strategy_states
parallelization in states
This module implements a calculator for the density and defines related functions.
subroutine, public states_elec_freeze_adjust_qtot(st)
subroutine, public states_elec_freeze_redistribute_states(st, namespace, mesh, mc, nn)
subroutine, public states_elec_freeze_orbitals(st, namespace, space, gr, mc, kpoints, n, family_is_mgga)
Calculate partial density for frozen orbitals.
subroutine, public density_calc(st, gr, density, istin)
Computes the density from the orbitals in st.
subroutine, public electrons_ground_state_run(namespace, mc, gr, ions, ext_partners, st, ks, hm, outp, space, fromScratch)
subroutine, public energy_calc_total(namespace, space, hm, gr, st, ext_partners, iunit, full)
This subroutine calculates the total energy of the system. Basically, it adds up the KS eigenvalues,...
integer, parameter, public spin_orbit
logical function, public list_has_gauge_field(partners)
type(gauge_field_t) function, pointer, public list_get_gauge_field(partners)
type(lasers_t) function, pointer, public list_get_lasers(partners)
subroutine, public forces_calculate(gr, namespace, ions, hm, ext_partners, st, ks, vhxc_old, t, dt)
subroutine, public gauge_field_load(restart, gfield, ierr)
subroutine, public gauge_field_get_force(this, gr, spin_channels, current, lrc_alpha)
subroutine, public gauge_field_dump(restart, gfield, ierr)
logical pure function, public gauge_field_is_propagated(this)
logical pure function, public gauge_field_is_used(this)
subroutine, public gauge_field_init_vec_pot(this, qtot)
real(real64), parameter, public m_zero
real(real64), parameter, public m_epsilon
real(real64), parameter, public m_one
This module implements the underlying real-space grid.
subroutine, public zvmask(mesh, hm, st)
subroutine, public hamiltonian_elec_epot_generate(this, namespace, space, gr, ions, ext_partners, st, time)
subroutine, public dvmask(mesh, hm, st)
This module defines classes and functions for interaction partners.
subroutine, public io_close(iunit, grp)
subroutine, public io_skip_header(iunit)
character(len=max_path_len) function, public io_workpath(path, namespace)
subroutine, public io_debug_on_the_fly(namespace)
check if debug mode should be enabled or disabled on the fly
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
subroutine, public ion_dynamics_dump(this, restart, ierr)
subroutine, public ion_dynamics_propagate(this, ions, time, dt, namespace)
logical pure function, public ion_dynamics_ions_move(this)
subroutine, public ion_dynamics_init(this, namespace, ions)
subroutine, public ion_dynamics_load(this, restart, ierr)
subroutine, public ion_dynamics_end(this)
logical pure function, public ion_dynamics_drive_ions(this)
subroutine, public kick_apply(space, mesh, st, ions_dyn, ions, kick, psolver, kpoints, pcm)
Applies the delta-function electric field where k = kick%delta_strength.
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.
subroutine, public laser_write_info(lasers, namespace, dt, max_iter, iunit)
subroutine, public lda_u_dump(restart, namespace, this, st, mesh, ierr)
subroutine, public lda_u_write_u(this, iunit, namespace)
subroutine, public lda_u_load(restart, this, st, dftu_energy, ierr, occ_only, u_only)
subroutine, public lda_u_write_v(this, iunit, namespace)
integer, parameter, public dft_u_none
subroutine, public lda_u_freeze_occ(this)
subroutine, public lda_u_freeze_u(this)
subroutine, public lda_u_end(this)
subroutine, public lda_u_init(this, namespace, space, level, gr, ions, st, mc, kpoints, has_phase)
integer, parameter, public dft_u_acbn0
subroutine, public lda_u_update_occ_matrices(this, namespace, mesh, st, hm_base, phase, energy)
This module implements fully polymorphic linked lists, and some specializations thereof.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
subroutine, public messages_not_implemented(feature, namespace)
character(len=512), private msg
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 messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
logical function mpi_grp_is_root(grp)
Is the current MPI process of grpcomm, root.
type(mpi_grp_t), public mpi_world
This module handles the communicators for the various parallelization strategies.
this module contains the low-level part of the output system
this module contains the output system
logical function, public parse_is_defined(namespace, name)
subroutine, public pes_calc(pes, namespace, space, mesh, st, dt, iter, der, kpoints, ext_partners, stopping)
subroutine, public pes_init(pes, namespace, space, mesh, box, st, save_iter, kpoints, abs_boundaries, ext_partners, max_iter, dt)
subroutine, public pes_output(pes, namespace, space, gr, st, iter, outp, dt, ions)
subroutine, public pes_init_write(pes, mesh, st, namespace)
subroutine, public pes_end(pes)
subroutine, public pes_load(pes, namespace, restart, st, ierr)
subroutine, public pes_dump(pes, namespace, restart, st, mesh, ierr)
subroutine, public mf_photons_load(restart, this, gr, ierr)
subroutine, public mf_photons_dump(restart, this, gr, dt, pt_mode, ierr)
subroutine, public potential_interpolation_load(potential_interpolation, namespace, space, restart, mesh, nspin, err2)
subroutine, public potential_interpolation_dump(potential_interpolation, space, restart, mesh, nspin, err2)
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.
subroutine, public propagator_elec_dt_bo(scf, namespace, space, gr, ks, st, hm, ions, ext_partners, mc, outp, iter, dt, ions_dyn, scsteps)
subroutine, public propagator_elec_init(gr, namespace, st, tr, ks_pot, have_fields, family_is_mgga_with_exc)
subroutine, public propagator_elec_dt(ks, namespace, space, hm, gr, st, tr, time, dt, nt, ions_dyn, ions, ext_partners, outp, write_handler, scsteps, update_energy, qcchi)
Propagates st from time - dt to t. If dt<0, it propagates backwards from t+|dt| to t.
subroutine, public propagator_elec_end(tr)
This module implements the basic propagator framework.
logical function, public clean_stop(comm)
returns true if a file named stop exists
integer, parameter, public restart_gs
subroutine, public restart_init(restart, namespace, data_type, type, mc, ierr, mesh, dir, exact)
Initializes a restart object.
integer, parameter, public restart_type_dump
logical pure function, public restart_skip(restart)
Returns true if the restart information should neither be read nor written. This might happen because...
integer, parameter, public restart_td
integer, parameter, public restart_type_load
subroutine, public restart_end(restart)
subroutine, public scf_init(scf, namespace, gr, ions, st, mc, hm, space)
subroutine, public scf_end(scf)
subroutine, public scissor_init(this, namespace, space, st, mesh, d, kpoints, phase, gap, mc)
pure logical function, public states_are_real(st)
subroutine, public states_elec_fermi(st, namespace, mesh, compute_spin)
calculate the Fermi level for the states in this 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.
This module handles reading and writing restart information for the states_elec_t.
subroutine, public states_elec_read_user_def_orbitals(mesh, namespace, space, st)
the routine reads formulas for user-defined wavefunctions from the input file and fills the respectiv...
subroutine, public states_elec_load_frozen(restart, space, st, mesh, ierr)
subroutine, public states_elec_dump(restart, space, st, mesh, kpoints, ierr, iter, lr, st_start_writing, verbose)
subroutine, public states_elec_transform(st, namespace, space, restart, mesh, kpoints, prefix)
subroutine, public states_elec_load(restart, namespace, space, st, mesh, kpoints, 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 states_elec_load_spin(restart, st, ierr)
returns in ierr: <0 => Fatal error, or nothing read =0 => read all wavefunctions >0 => could only rea...
subroutine, public states_elec_dump_frozen(restart, space, st, mesh, ierr)
subroutine, public states_elec_dump_rho(restart, space, st, mesh, ierr, iter)
subroutine, public states_elec_dump_spin(restart, st, ierr)
This module implements the calculation of the stress tensor.
subroutine, public stress_calculate(namespace, gr, hm, st, ions, ks, ext_partners)
This computes the total stress on the lattice.
subroutine, public td_check_point(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, iter, scsteps, etime, stopping, from_scratch)
subroutine, public td_end(td)
subroutine, public td_load_restart_from_gs(td, namespace, space, mc, gr, ext_partners, st, ks, hm)
subroutine td_print_message(td, namespace, ions, hm, iter, scsteps, etime)
subroutine, public td_run_init()
subroutine, public td_end_run(td, st, hm)
subroutine, public td_init(td, namespace, space, gr, ions, st, ks, hm, ext_partners, outp)
subroutine, public td_allocate_wavefunctions(td, namespace, mc, gr, ions, st, hm, space)
logical function, public td_get_from_scratch(td)
subroutine td_load_frozen(namespace, restart, space, mesh, st, hm, ierr)
subroutine td_print_header(namespace)
integer, parameter, public bo
subroutine td_load(restart, namespace, space, gr, st, hm, ext_partners, td, ks, ierr)
subroutine, public td_set_from_scratch(td, from_scratch)
subroutine, public td_dump(td, namespace, space, gr, st, hm, ks, ext_partners, iter, ierr)
subroutine td_read_coordinates(td, namespace, ions)
reads the pos and vel from coordinates file
subroutine, public td_run(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, from_scratch)
subroutine td_run_zero_iter(td, namespace, space, gr, ions, st, ks, hm, ext_partners, outp, mc)
subroutine, public td_init_gaugefield(td, namespace, gr, st, ks, hm, ext_partners, space)
subroutine td_update_elapsed_time(etime)
subroutine, public td_init_with_wavefunctions(td, namespace, space, mc, gr, ions, ext_partners, st, ks, hm, outp, from_scratch)
subroutine, public td_load_restart_from_td(td, namespace, space, mc, gr, ext_partners, st, ks, hm, from_scratch)
subroutine td_init_ions_and_forces(td, namespace, space, gr, ions, ext_partners, st, ks, hm, outp)
subroutine, public td_init_run(td, namespace, mc, gr, ions, st, ks, hm, ext_partners, outp, space, from_scratch)
subroutine, public td_write_output(namespace, space, gr, st, hm, ks, outp, ions, ext_partners, iter, dt)
subroutine, public td_write_data(writ)
subroutine, public td_write_kick(outp, namespace, space, mesh, kick, ions, iter)
subroutine, public td_write_end(writ)
subroutine, public td_write_iter(writ, namespace, space, outp, gr, st, hm, ions, ext_partners, kick, ks, dt, iter, mc, recalculate_gs)
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)
Initialize files to write when prograting in time.
integer, parameter, public out_separate_forces
type(type_t), public type_cmplx
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
type(unit_system_t), public units_out
type(unit_system_t), public units_inp
the units systems for reading and writing
subroutine, public v_ks_freeze_hxc(ks)
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)
This module provices a simple timer class which can be used to trigger the writing of a restart file ...
logical function, public walltimer_alarm(comm, print)
indicate whether time is up
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.
Stores all communicators and groups.
The states_elec_t class contains all electronic wave functions.