41 use,
intrinsic :: iso_fortran_env
92 integer :: nkpnts_start, nkpnts_end
94 integer :: nk_start, nk_end
97 integer :: nstepsthetak, nstepsphik
98 real(real64) :: thetak_rng(1:2)
99 real(real64) :: phik_rng(1:2)
100 integer :: nstepsomegak
101 integer :: nstepsomegak_start, nstepsomegak_end
102 real(real64) :: ktransf(1:3,1:3)
104 real(real64),
allocatable :: klinear(:,:)
109 real(real64),
allocatable :: kcoords_cub(:,:,:)
110 real(real64),
allocatable :: kcoords_sph(:,:,:)
114 integer,
public :: surf_shape
116 integer :: nsrfcpnts_start, nsrfcpnts_end
117 real(real64),
allocatable :: srfcnrml(:,:)
118 real(real64),
allocatable :: rcoords(:,:)
119 integer,
allocatable :: srfcpnt(:)
120 integer,
allocatable :: rankmin(:)
122 complex(real64),
allocatable :: ylm_r(:,:,:)
123 complex(real64),
allocatable :: ylm_k(:,:,:)
124 real(real64),
allocatable :: j_l(:,:)
125 real(real64) :: radius
126 integer,
allocatable :: face_idx_range(:,:)
130 complex(real64),
allocatable :: bvk_phase(:,:)
131 complex(real64),
allocatable :: expkr(:,:,:,:)
132 complex(real64),
allocatable :: expkr_perp(:,:)
134 real(real64),
allocatable :: LLr(:,:)
135 integer,
allocatable :: NN(:,:)
136 integer,
allocatable :: Lkpuvz_inv(:,:,:)
146 complex(real64),
allocatable :: wf(:,:,:,:,:)
147 complex(real64),
allocatable :: gwf(:,:,:,:,:,:)
148 real(real64),
allocatable :: veca(:,:)
149 complex(real64),
allocatable :: conjgphase_prev(:,:)
150 complex(real64),
allocatable :: spctramp_cub(:,:,:,:)
151 complex(real64),
allocatable :: spctramp_sph(:,:,:,:,:)
153 integer,
public :: ll(3)
156 type(mesh_interpolation_t) :: interp
158 logical :: parallel_in_momentum
159 logical :: arpes_grid
160 logical :: surf_interp
161 logical :: use_symmetry
162 logical :: runtime_output
163 logical :: anisotrpy_correction
165 integer :: par_strategy
182 integer,
parameter :: &
187 integer,
parameter :: &
196 subroutine pes_flux_init(this, namespace, space, mesh, st, ext_partners, kpoints, abb, save_iter, max_iter)
199 class(
space_t),
intent(in) :: space
200 type(
mesh_t),
intent(in) :: mesh
205 integer,
intent(in) :: save_iter
206 integer,
intent(in) :: max_iter
209 real(real64) :: border(space%dim)
210 real(real64) :: offset(space%dim)
211 integer :: stst, stend, kptst, kptend, sdim, mdim, pdim
216 integer :: nstepsphir, nstepsthetar
218 integer :: default_shape
219 real(real64) :: fc_ptdens
221 integer :: par_strategy
222 logical :: use_symmetry
230 kptst = st%d%kpt%start
231 kptend = st%d%kpt%end
234 pdim = space%periodic_dim
236 this%surf_interp = .false.
240 if(
associated(lasers))
then
241 do il = 1, lasers%no_lasers
243 message(1) =
't-surff only works in velocity gauge.'
249 message(1) =
'Info: Calculating PES using t-surff technique.'
274 if (space%is_periodic())
then
276 else if (mdim <= 2)
then
279 select type (box => mesh%box)
285 call parse_variable(namespace,
'PES_Flux_Shape', default_shape, this%surf_shape)
290 message(1) =
'Spherical grid works only in 3d.'
304 call parse_variable(namespace,
'PES_Flux_AnisotropyCorrection', .false., this%anisotrpy_correction)
307 this%anisotrpy_correction = .false.
322 if (
parse_block(namespace,
'PES_Flux_Offset', blk) == 0)
then
364 if (
parse_block(namespace,
'PES_Flux_Lsize', blk) == 0)
then
369 border(1:mdim) = int(border(1:mdim) / mesh%spacing(1:mdim)) * mesh%spacing(1:mdim)
373 border(mdim) = mesh%box%bounding_box_l(mdim) *
m_half
374 if (space%is_periodic())
then
376 border(1:pdim)= mesh%box%bounding_box_l(1:pdim) *
m_two
377 call parse_variable(namespace,
'PES_Flux_Lsize', border(mdim), border(mdim))
379 border(mdim) =
floor(border(mdim) / mesh%spacing(mdim)) * mesh%spacing(mdim)
381 call parse_variable(namespace,
'PES_Flux_Lsize', border(mdim), border(mdim))
382 border(1:mdim - 1) = border(mdim)
383 border(1:mdim) =
floor(border(1:mdim) / mesh%spacing(1:mdim)) * mesh%spacing(1:mdim)
386 select type (box => mesh%box)
390 border(1:mdim) = box%half_length(1:mdim) *
m_half
392 call messages_write(
'PES_Flux_Lsize not specified. No default values available for this box shape.')
394 call messages_write(
'Specify the location of the parallelepiped with block PES_Flux_Lsize.')
397 call messages_write(
'PES_Flux_Lsize not specified. Using default values.')
411 this%surf_interp = .
true.
418 this%surf_interp = .
true.
431 select type (box => mesh%box)
433 this%radius = box%radius
435 this%radius = minval(box%half_length(1:mdim))
437 message(1) =
'PES_Flux_Radius not specified. No default values available for this box shape.'
438 message(2) =
'Specify the radius of the sphere with variable PES_Flux_Radius.'
441 message(1) =
'PES_Flux_Radius not specified. Using default values.'
453 call parse_variable(namespace,
'PES_Flux_StepsThetaR', 2 * this%lmax + 1, nstepsthetar)
464 call parse_variable(namespace,
'PES_Flux_StepsPhiR', 2 * this%lmax + 1, nstepsphir)
511 this%par_strategy = option__pes_flux_parallelization__pf_none
512 if (mesh%parallel_in_domains)
then
515 this%par_strategy = option__pes_flux_parallelization__pf_time &
516 + option__pes_flux_parallelization__pf_surface
518 this%par_strategy = option__pes_flux_parallelization__pf_surface
519 if (space%dim == 1) this%par_strategy = option__pes_flux_parallelization__pf_time
521 par_strategy = this%par_strategy
522 call parse_variable(namespace,
'PES_Flux_Parallelization', par_strategy, this%par_strategy)
530 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0 .and. &
531 bitand(this%par_strategy, option__pes_flux_parallelization__pf_momentum) /= 0)
then
532 call messages_input_error(namespace,
'PES_Flux_Parallelization',
"Cannot combine pf_surface and pf_momentum")
535 write(
message(1),
'(a)')
'Input: [PES_Flux_Parallelization = '
536 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_none) /= 0)
then
539 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_time) /= 0)
then
542 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_momentum) /= 0)
then
545 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0)
then
555 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0)
then
557 call pes_flux_distribute(1, this%nsrfcpnts, this%nsrfcpnts_start, this%nsrfcpnts_end, mesh%mpi_grp%comm)
570 this%nsrfcpnts_start = 1
571 this%nsrfcpnts_end = this%nsrfcpnts
598 use_symmetry = .false.
602 call parse_variable(namespace,
'PES_Flux_UseSymmetries', use_symmetry, this%use_symmetry)
609 safe_allocate(this%ylm_r(this%nsrfcpnts_start:this%nsrfcpnts_end, 0:this%lmax, -this%lmax:this%lmax))
612 if (this%nsrfcpnts_start > 0)
then
615 do isp = this%nsrfcpnts_start, this%nsrfcpnts_end
616 call ylmr_cmplx(this%rcoords(1:3, isp), ll, mm, this%ylm_r(isp, ll, mm))
617 this%ylm_r(isp, ll, mm) = conjg(this%ylm_r(isp, ll, mm))
625 (2*this%lmax+1)*(this%lmax+1)*this%nsrfcpnts)
626 call accel_write_buffer(this%ylm_r_buff, this%nsrfcpnts_end-this%nsrfcpnts_start+1, this%lmax+1, &
627 2*this%lmax+1, this%ylm_r(this%nsrfcpnts_start:this%nsrfcpnts_end, 0:this%lmax, -this%lmax:this%lmax))
644 call parse_variable(namespace,
'PES_Flux_RuntimeOutput', .false., this%runtime_output)
652 this%max_iter = max_iter
653 this%save_iter = save_iter
657 if (mesh%parallel_in_domains .and.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_time) /= 0)
then
658 this%tdsteps = mesh%mpi_grp%size
665 safe_allocate(this%wf(0:this%nsrfcpnts, stst:stend, 1:sdim, kptst:kptend, 1:this%tdsteps))
668 safe_allocate(this%gwf(0:this%nsrfcpnts, stst:stend, 1:sdim, kptst:kptend, 1:this%tdsteps, 1:mdim))
671 safe_allocate(this%veca(1:mdim, 1:this%tdsteps))
675 safe_allocate(this%spctramp_sph(1:this%nstepsomegak, stst:stend, 1:sdim, kptst:kptend, 1:this%nk))
676 this%spctramp_sph =
m_z0
678 safe_allocate(this%conjgphase_prev(1:this%nstepsomegak, 1:this%nk))
681 safe_allocate(this%spctramp_cub(stst:stend, 1:sdim, kptst:kptend, 1:this%nkpnts))
682 this%spctramp_cub =
m_z0
684 safe_allocate(this%conjgphase_prev(1:this%nkpnts, kptst:kptend))
688 this%conjgphase_prev =
m_z1
708 safe_deallocate_a(this%kcoords_sph)
709 safe_deallocate_a(this%ylm_k)
710 safe_deallocate_a(this%j_l)
711 safe_deallocate_a(this%ylm_r)
712 safe_deallocate_a(this%conjgphase_prev)
713 safe_deallocate_a(this%spctramp_sph)
715 safe_deallocate_a(this%kcoords_cub)
716 safe_deallocate_a(this%conjgphase_prev)
717 safe_deallocate_a(this%spctramp_cub)
719 if (.not. this%surf_interp)
then
720 safe_deallocate_a(this%srfcpnt)
722 safe_deallocate_a(this%rankmin)
724 safe_deallocate_a(this%face_idx_range)
725 safe_deallocate_a(this%LLr)
726 safe_deallocate_a(this%NN)
728 safe_deallocate_a(this%expkr)
729 safe_deallocate_a(this%expkr_perp)
730 safe_deallocate_a(this%bvk_phase)
732 safe_deallocate_a(this%Lkpuvz_inv)
736 safe_deallocate_a(this%klinear)
738 safe_deallocate_a(this%srfcnrml)
739 safe_deallocate_a(this%rcoords)
741 safe_deallocate_a(this%wf)
742 safe_deallocate_a(this%gwf)
743 safe_deallocate_a(this%veca)
764 class(
space_t),
intent(in) :: space
767 type(mpi_comm),
intent(in) :: comm
768 logical,
optional,
intent(in) :: post
770 integer :: mdim, pdim
771 integer :: kptst, kptend
773 integer :: ll, mm, idim, idir, ispin, nspin
774 integer :: ikk, ith, iph, iomk,ie, ik1, ik2, ik3, kgrid_block_dim
775 real(real64) :: kmax(space%dim), kmin(space%dim), kact, thetak, phik
778 real(real64) :: emin, emax, de , kvec(1:3), xx(3)
779 integer :: nkp_out, nkmin, nkmax
782 real(real64),
allocatable :: gpoints(:,:), gpoints_reduced(:,:)
783 real(real64) :: dk(1:3), kpoint(1:3), dthetak, dphik
784 logical :: use_enegy_grid, arpes_grid
788 kptst = st%d%kpt%start
789 kptend = st%d%kpt%end
791 pdim = space%periodic_dim
813 select case (this%surf_shape)
827 call parse_variable(namespace,
'PES_Flux_Momenutum_Grid', kgrid, this%kgrid)
840 if (space%is_periodic())
then
849 if (space%is_periodic())
then
870 use_enegy_grid = .false.
872 if (
parse_block(namespace,
'PES_Flux_EnergyGrid', blk) == 0)
then
879 use_enegy_grid = .
true.
901 call parse_variable(namespace,
'PES_Flux_ARPES_grid', .false., this%arpes_grid)
902 if (.not. use_enegy_grid .or. this%arpes_grid)
then
913 if (
parse_block(namespace,
'PES_Flux_Kmax', blk) == 0)
then
918 kgrid_block_dim = mdim
920 message(1) =
'Wrong block format for PES_Flux_Kmax and non-cartesian grid'
937 if (
parse_block(namespace,
'PES_Flux_Kmin', blk) == 0)
then
942 kgrid_block_dim = mdim
944 message(1) =
'Wrong block format for PES_Flux_Kmin and non-cartesian grid'
960 call parse_variable(namespace,
'PES_Flux_DeltaK', 0.02_real64, this%dk)
965 do idim = 1, kgrid_block_dim
966 if (kgrid_block_dim == 1)
then
1008 this%nstepsthetak = 45
1010 if (
parse_block(namespace,
'PES_Flux_ThetaK', blk) == 0)
then
1016 if (this%thetak_rng(idim) <
m_zero .or. this%thetak_rng(idim) >
m_pi)
then
1030 call parse_variable(namespace,
'PES_Flux_StepsThetaK', 45, this%nstepsthetak)
1055 this%nstepsphik = 90
1057 if (mdim == 1) this%phik_rng(1:2) = (/
m_pi,
m_zero/)
1058 if (
parse_block(namespace,
'PES_Flux_PhiK', blk) == 0)
then
1064 if (this%phik_rng(idim) <
m_zero .or. this%phik_rng(idim) >
m_two *
m_pi)
then
1079 call parse_variable(namespace,
'PES_Flux_StepsPhiK', 90, this%nstepsphik)
1081 if (this%nstepsphik == 0) this%nstepsphik = 1
1086 if (mdim == 3) dthetak = abs(this%thetak_rng(2) - this%thetak_rng(1)) / (this%nstepsthetak)
1087 dphik = abs(this%phik_rng(2) - this%phik_rng(1)) / (this%nstepsphik)
1092 this%nstepsthetak = 0
1094 this%nstepsomegak = this%nstepsphik
1097 this%nstepsthetak = 0
1098 this%nstepsomegak = this%nstepsphik
1101 if (this%nstepsthetak <= 1)
then
1103 this%nstepsthetak = 1
1107 do ith = 0, this%nstepsthetak
1108 thetak = ith * dthetak + this%thetak_rng(1)
1109 do iph = 0, this%nstepsphik - 1
1110 phik = iph * dphik + this%phik_rng(1)
1115 this%nstepsomegak = iomk
1122 write(
message(1),
'(a)')
"Polar momentum grid:"
1125 write(
message(1),
'(a,f12.6,a,f12.6,a, i6)') &
1126 " Theta = (", this%thetak_rng(1),
",",this%thetak_rng(2), &
1127 "); n = ", this%nstepsthetak
1130 write(
message(1),
'(a,f12.6,a,f12.6,a, i6)') &
1131 " Phi = (", this%phik_rng(1),
",",this%phik_rng(2), &
1132 "); n = ", this%nstepsphik
1137 if (use_enegy_grid)
then
1138 this%nk = nint(abs(emax - emin) / de)
1140 this%nk = nint(abs(kmax(1) - kmin(1)) / this%dk)
1142 this%nkpnts = this%nstepsomegak * this%nk
1144 this%ll(1) = this%nk
1145 this%ll(2) = this%nstepsphik
1147 this%ll(3) = this%nstepsthetak + 1
1148 this%ll(mdim+1:3) = 1
1150 safe_allocate(this%klinear(1:this%nk, 1))
1156 dk(1:mdim) =
m_one/kpoints%nik_axis(1:mdim)
1158 this%arpes_grid = .false.
1159 if (space%is_periodic())
then
1170 arpes_grid = kpoints%have_zero_weight_path()
1171 call parse_variable(namespace,
'PES_Flux_ARPES_grid', arpes_grid, this%arpes_grid)
1180 if (kpoints%have_zero_weight_path())
then
1182 if (this%arpes_grid)
then
1183 nkmax =
floor(emax / de)
1184 nkmin =
floor(emin / de)
1187 nkmax =
floor(kmax(mdim) / this%dk)
1188 nkmin =
floor(kmin(mdim) / this%dk)
1192 this%ll(mdim) = abs(nkmax - nkmin) + 1
1194 this%nk = this%ll(mdim)
1199 if (.not. this%arpes_grid)
then
1200 this%ll(1:mdim) =
floor(abs(kmax(1:mdim) - kmin(1:mdim))/this%dk) + 1
1201 this%nk = maxval(this%ll(1:mdim))
1205 nkmax =
floor(emax / de)
1206 nkmin =
floor(emin / de)
1207 this%nk = abs(nkmax - nkmin) + 1
1209 this%ll(1:pdim) =
floor(abs(kmax(1:pdim) - kmin(1:pdim))/this%dk) + 1
1210 this%ll(mdim) = this%nk
1214 safe_allocate(this%klinear(1:maxval(this%ll(1:mdim)), 1:mdim))
1220 this%nkpnts = product(this%ll(1:mdim))
1229 this%parallel_in_momentum = .false.
1232 select case (this%kgrid)
1236 if (use_enegy_grid)
then
1238 this%klinear(ie, 1) =
sqrt(
m_two * (ie * de + emin))
1242 this%klinear(ikk, 1) = ikk * this%dk + kmin(1)
1256 if ((this%nk_end - this%nk_start + 1) < this%nk) this%parallel_in_momentum = .
true.
1257 call pes_flux_distribute(1, this%nstepsomegak, this%nstepsomegak_start, this%nstepsomegak_end, comm)
1269 safe_allocate(this%j_l(this%nk_start:this%nk_end, 0:this%lmax))
1272 safe_allocate(this%kcoords_sph(1:3, this%nk_start:this%nk_end, 1:this%nstepsomegak))
1273 this%kcoords_sph =
m_zero
1275 safe_allocate(this%ylm_k(this%nstepsomegak_start:this%nstepsomegak_end, -this%lmax:this%lmax, 0:this%lmax))
1280 do ith = 0, this%nstepsthetak
1281 thetak = ith * dthetak + this%thetak_rng(1)
1282 do iph = 0, this%nstepsphik - 1
1283 phik = iph * dphik + this%phik_rng(1)
1285 if (iomk >= this%nstepsomegak_start .and. iomk <= this%nstepsomegak_end)
then
1286 xx(1) =
cos(phik) *
sin(thetak)
1287 xx(2) =
sin(phik) *
sin(thetak)
1290 do ll = 0, this%lmax
1292 call ylmr_cmplx(xx, ll, mm, this%ylm_k(iomk, mm, ll))
1296 if (this%nk_start > 0)
then
1297 this%kcoords_sph(1, this%nk_start:this%nk_end, iomk) =
cos(phik) *
sin(thetak)
1298 this%kcoords_sph(2, this%nk_start:this%nk_end, iomk) =
sin(phik) *
sin(thetak)
1299 this%kcoords_sph(3, this%nk_start:this%nk_end, iomk) =
cos(thetak)
1305 if (this%nk_start > 0)
then
1307 do ikk = this%nk_start, this%nk_end
1308 kact = this%klinear(ikk,1)
1309 do ll = 0, this%lmax
1313 this%kcoords_sph(:, ikk, :) = kact * this%kcoords_sph(:, ikk, :)
1321 this%nkpnts_start = 1
1322 this%nkpnts_end = this%nkpnts
1325 safe_allocate(this%kcoords_cub(1:mdim, this%nkpnts_start:this%nkpnts_end, 1))
1327 this%kcoords_cub =
m_zero
1332 do ikk = -this%nk, this%nk
1335 kact = sign(1,ikk) * this%klinear(abs(ikk), 1)
1336 this%kcoords_cub(1, ikp, 1) = kact
1344 do ith = 0, this%nstepsthetak
1345 if (mdim == 3) thetak = ith * dthetak + this%thetak_rng(1)
1346 do iph = 0, this%nstepsphik - 1
1348 phik = iph * dphik + this%phik_rng(1)
1349 kact = this%klinear(ikk,1)
1350 this%kcoords_cub(1, ikp,1) = kact *
cos(phik) *
sin(thetak)
1351 this%kcoords_cub(2, ikp,1) = kact *
sin(phik) *
sin(thetak)
1352 if (mdim == 3) this%kcoords_cub(3, ikp,1) = kact *
cos(thetak)
1363 this%nkpnts_start = 1
1364 this%nkpnts_end = this%nkpnts
1366 if (kpoints%have_zero_weight_path())
then
1371 safe_allocate(this%kcoords_cub(1:mdim, this%nkpnts_start:this%nkpnts_end, kptst:kptend))
1372 this%kcoords_cub =
m_zero
1381 do ikpt = (kptst-1)+ispin, kptend, nspin
1383 do ikk = nkmin, nkmax
1384 kvec(1:mdim) = - kpoints%get_point(st%d%get_kpoint_index(ikpt))
1392 safe_allocate(this%kcoords_cub(1:mdim, this%nkpnts_start:this%nkpnts_end, 1))
1394 safe_allocate(this%Lkpuvz_inv(1:this%ll(1), 1:this%ll(2), 1:this%ll(3)))
1397 do ikk = 1, this%ll(idir)
1398 this%klinear(ikk, idir) = ikk * this%dk + kmin(idir)
1403 if (.not. this%arpes_grid)
then
1410 do ik3 = 1, this%ll(3)
1411 if (mdim>2) kvec(3) = this%klinear(ik3, 3)
1412 do ik2 = 1, this%ll(2)
1413 if (mdim>1) kvec(2) = this%klinear(ik2, 2)
1414 do ik1 = 1, this%ll(1)
1416 kvec(1) = this%klinear(ik1, 1)
1417 this%kcoords_cub(1:mdim, ikp, ikpt) = kvec(1:mdim)
1418 this%Lkpuvz_inv(ik1, ik2, ik3) = ikp
1430 do ikk = nkmin, nkmax
1436 do ik1 = 1, this%ll(1)
1437 kvec(1) = this%klinear(ik1,1)
1438 kvec(1:pdim) = matmul(kpoints%latt%klattice_primitive(1:pdim, 1:pdim), kvec(1:pdim))
1444 do ik2 = 1, this%ll(2)
1445 do ik1 = 1, this%ll(1)
1446 kvec(1:2) = (/this%klinear(ik1,1), this%klinear(ik2,2)/)
1447 kvec(1:pdim) = matmul(kpoints%latt%klattice_primitive(1:pdim, 1:pdim), kvec(1:pdim))
1450 this%Lkpuvz_inv(ik1, ik2, ikk - nkmin + 1) = ikp
1503 if (this%arpes_grid)
then
1512 safe_deallocate_a(gpoints)
1513 safe_deallocate_a(gpoints_reduced)
1534 this%ktransf(:,:) =
m_zero
1536 this%ktransf(idim,idim) =
m_one
1539 if (
parse_block(namespace,
'PES_Flux_GridTransformMatrix', blk) == 0)
then
1547 write(
message(1),
'(a)')
'Momentum grid transformation matrix :'
1548 do idir = 1, space%dim
1549 write(
message(1 + idir),
'(9f12.6)') ( this%ktransf(idim, idir), idim = 1, mdim)
1558 do ith = 0, this%nstepsthetak
1559 do iph = 0, this%nstepsphik - 1
1561 do ikk = this%nk_start, this%nk_end
1562 kvec(1:mdim) = this%kcoords_sph(1:mdim, ikk, iomk)
1563 this%kcoords_sph(1:mdim, ikk, iomk) = matmul(this%ktransf(1:mdim, 1:mdim), kvec(1:mdim))
1565 if (ith == 0 .or. ith == this%nstepsthetak)
exit
1571 do ikpt = kptst, kptend + 1
1572 if (ikpt == kptend + 1)
then
1573 kpoint(1:space%dim) =
m_zero
1575 kpoint(1:space%dim) = kpoints%get_point(st%d%get_kpoint_index(ikpt))
1578 do ikp = 1, this%nkpnts
1580 kvec(1:mdim) = this%kcoords_cub(1:mdim, ikp, ikpt) - kpoint(1:mdim)
1581 this%kcoords_cub(1:mdim, ikp, ikpt) = matmul(this%ktransf(1:mdim, 1:mdim), kvec(1:mdim)) &
1603 real(real64) :: kpar(1:pdim), val
1608 if (ikk /= 0) sign= ikk / abs(ikk)
1610 kpar(1:pdim) = kvec(1:pdim)
1611 val = abs(ikk) * de *
m_two - sum(kpar(1:pdim)**2)
1613 kvec(mdim) = sign *
sqrt(val)
1616 kvec(mdim) =
sqrt(val)
1617 nkp_out = nkp_out + 1
1620 this%kcoords_cub(1:mdim, ikp, ikpt) = kvec(1:mdim)
1630 subroutine pes_flux_calc(this, space, mesh, st, der, ext_partners, kpoints, iter, dt, stopping)
1632 class(
space_t),
intent(in) :: space
1633 type(
mesh_t),
intent(in) :: mesh
1638 integer,
intent(in) :: iter
1639 real(real64),
intent(in) :: dt
1640 logical,
intent(in) :: stopping
1642 integer :: stst, stend, kptst, kptend, sdim, mdim
1643 integer :: ist, ik, isdim, imdim
1645 integer :: il, ip_local
1646 integer :: ib, minst, maxst, nst_linear, ist_linear
1647 integer :: k_offset, n_boundary_points
1648 logical :: contains_isp
1650 complex(real64),
allocatable :: interp_values(:)
1651 complex(real64),
allocatable :: interp_values_accel(:, :)
1652 complex(real64),
allocatable :: wf_tmp_accel(:, :), gwf_tmp_accel(:, :, :)
1653 complex(real64),
allocatable :: gpsi(:, :), psi(:)
1662 if (iter == 0)
return
1668 kptst = st%d%kpt%start
1669 kptend = st%d%kpt%end
1673 safe_allocate(psi(1:mesh%np_part))
1674 safe_allocate(gpsi(1:mesh%np_part, 1:mdim))
1677 safe_allocate(interp_values(1:this%nsrfcpnts))
1680 this%itstep = this%itstep + 1
1684 if(
associated(lasers))
then
1685 do il = 1, lasers%no_lasers
1686 call laser_field(lasers%lasers(il), this%veca(1:mdim, this%itstep), iter*dt)
1689 this%veca(:, this%itstep) = - this%veca(:, this%itstep)
1694 call phase%init(mesh, st%d%kpt, kpoints, st%d, space)
1696 do ik = kptst, kptend
1697 do ib = st%group%block_start, st%group%block_end
1703 call st%group%psib(ib, ik)%copy_to(psib)
1705 call phase%apply_to(mesh, mesh%np_part, conjugate=.false., psib=psib, src=st%group%psib(ib, ik), async=.
true.)
1707 k_offset = psib%ik - kptst
1708 n_boundary_points = int(mesh%np_part - mesh%np)
1709 call boundaries_set(der%boundaries, mesh, psib, phase_correction=phase%phase_corr(:, psib%ik), &
1710 buff_phase_corr=phase%buff_phase_corr, offset=k_offset*n_boundary_points, async=.
true.)
1713 psib => st%group%psib(ib, ik)
1721 nst_linear = psib%nst_linear
1723 if(this%surf_interp)
then
1725 safe_allocate(interp_values_accel(1:this%nsrfcpnts, 1:nst_linear))
1728 this%rcoords(1:mdim, 1:this%nsrfcpnts), this%coords_buff, &
1729 interp_values_accel(1:this%nsrfcpnts, 1:nst_linear), this%interp_buff, this%spacing_buff, this%pt_buff)
1731 do ist = minst, maxst
1733 ist_linear = psib%ist_idim_to_linear((/ist - minst + 1, isdim/))
1734 this%wf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep) = &
1735 st%occ(ist, ik) * interp_values_accel(1:this%nsrfcpnts, ist_linear)
1741 gpsib(imdim), this%rcoords(1:mdim, 1:this%nsrfcpnts), this%coords_buff, &
1742 interp_values_accel(1:this%nsrfcpnts, 1:nst_linear), this%interp_buff, this%spacing_buff, this%pt_buff)
1743 do ist = minst, maxst
1745 ist_linear = psib%ist_idim_to_linear((/ist - minst + 1, isdim/))
1746 this%gwf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep, imdim) = &
1747 st%occ(ist, ik) * interp_values_accel(1:this%nsrfcpnts, ist_linear)
1752 safe_deallocate_a(interp_values_accel)
1756 call profiling_in(tostring(pes_flux_calc_cubic_reduction))
1758 safe_allocate(wf_tmp_accel(1:mesh%np_part, 1:nst_linear))
1759 safe_allocate(gwf_tmp_accel(1:mdim, 1:mesh%np_part, 1:nst_linear))
1761 call accel_read_buffer(psib%ff_device, mesh%np_part, nst_linear, wf_tmp_accel(:, :))
1763 call accel_read_buffer(gpsib(imdim)%ff_device, mesh%np_part, nst_linear, gwf_tmp_accel(imdim, :, :))
1766 do ist = minst, maxst
1767 contains_isp = .
true.
1768 do isp = 1, this%nsrfcpnts
1769 if (mesh%parallel_in_domains)
then
1770 contains_isp = mesh%mpi_grp%rank == this%rankmin(isp)
1773 if (.not. contains_isp) cycle
1775 ip_local = this%srfcpnt(isp)
1777 ist_linear = psib%ist_idim_to_linear((/ist - minst + 1, isdim/))
1778 this%wf(isp, ist, isdim, ik, this%itstep) = &
1779 st%occ(ist, ik) * wf_tmp_accel(ip_local, ist_linear)
1780 this%gwf(isp, ist, isdim, ik, this%itstep, 1:mdim) = &
1781 st%occ(ist, ik) * gwf_tmp_accel(1:mdim, ip_local, ist_linear)
1785 if (mesh%parallel_in_domains)
then
1787 call mesh%allreduce(this%wf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep))
1789 call mesh%allreduce(this%gwf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep, imdim))
1795 safe_deallocate_a(wf_tmp_accel)
1796 safe_deallocate_a(gwf_tmp_accel)
1804 do ist = minst, maxst
1810 call batch_get_state(gpsib(imdim), (/ist, isdim/), mesh%np_part, gpsi(:, imdim))
1813 if (this%surf_interp)
then
1816 this%rcoords(1:mdim, 1:this%nsrfcpnts), interp_values(1:this%nsrfcpnts))
1817 this%wf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep) = st%occ(ist, ik) * interp_values(1:this%nsrfcpnts)
1820 this%rcoords(1:mdim, 1:this%nsrfcpnts), interp_values(1:this%nsrfcpnts))
1821 this%gwf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep, imdim) = &
1822 st%occ(ist, ik) * interp_values(1:this%nsrfcpnts)
1827 contains_isp = .
true.
1828 do isp = 1, this%nsrfcpnts
1829 if (mesh%parallel_in_domains)
then
1830 contains_isp = mesh%mpi_grp%rank == this%rankmin(isp)
1833 if (.not. contains_isp) cycle
1835 ip_local = this%srfcpnt(isp)
1836 this%wf(isp, ist, isdim, ik, this%itstep) = st%occ(ist, ik) * psi(ip_local)
1837 this%gwf(isp, ist, isdim, ik, this%itstep, 1:mdim) = &
1838 st%occ(ist, ik) * gpsi(ip_local, 1:mdim)
1841 if (mesh%parallel_in_domains)
then
1842 call mesh%allreduce(this%wf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep))
1844 call mesh%allreduce(this%gwf(1:this%nsrfcpnts, ist, isdim, ik, this%itstep, imdim))
1855 call gpsib(imdim)%end(copy = .false.)
1859 call psib%end(copy = .false.)
1860 safe_deallocate_p(psib)
1865 if (this%surf_interp)
then
1866 safe_deallocate_a(interp_values)
1869 safe_deallocate_a(psi)
1870 safe_deallocate_a(gpsi)
1874 if (this%itstep == this%tdsteps .or. mod(iter, this%save_iter) == 0 .or. iter == this%max_iter .or. stopping)
then
1896 class(
space_t),
intent(in) :: space
1897 type(
mesh_t),
intent(in) :: mesh
1901 integer :: kptst, kptend, mdim
1902 integer :: ik, j1, j2, jvec(1:2)
1903 integer :: isp, ikp, ikp_start, ikp_end
1906 integer :: idir, pdim, nfaces, ifc, n_dir
1907 complex(real64) :: tmp
1908 real(real64) :: kpoint(1:3), vec(1:3), lvec(1:3)
1912 if (kpoints%have_zero_weight_path())
then
1913 kptst = st%d%kpt%start
1914 kptend = st%d%kpt%end
1921 pdim = space%periodic_dim
1923 ikp_start = this%nkpnts_start
1924 ikp_end = this%nkpnts_end
1930 this%srfcnrml(:, 1:this%nsrfcpnts) = this%srfcnrml(:, 1:this%nsrfcpnts) * mesh%coord_system%surface_element(3)
1933 if (.not. this%use_symmetry .or. kpoints%have_zero_weight_path())
then
1935 safe_allocate(this%expkr(1:this%nsrfcpnts,ikp_start:ikp_end,kptst:kptend,1))
1937 do ik = kptst, kptend
1938 do ikp = ikp_start, ikp_end
1939 do isp = 1, this%nsrfcpnts
1940 this%expkr(isp,ikp,ik,1) =
exp(-
m_zi * sum(this%rcoords(1:mdim,isp) &
1941 * this%kcoords_cub(1:mdim, ikp, ik))) &
1953 if (this%surf_shape ==
pes_plane) nfaces = 1
1956 safe_allocate(this%expkr(1:this%nsrfcpnts,maxval(this%ll(1:mdim)),kptst:kptend,1:mdim))
1957 this%expkr(:,:,:,:) =
m_z1
1959 do ik = kptst, kptend
1961 do ikp = 1, this%ll(idir)
1962 do isp = 1, this%nsrfcpnts
1963 this%expkr(isp,ikp,ik,idir) =
exp(-
m_zi * this%rcoords(idir,isp) &
1964 * this%klinear(ikp, idir)) &
1972 safe_allocate(this%expkr_perp(1:maxval(this%ll(1:mdim)), 1:nfaces))
1973 this%expkr_perp(:,:) =
m_z1
1976 if (this%face_idx_range(ifc, 1) < 0) cycle
1977 isp = this%face_idx_range(ifc, 1)
1979 if (abs(this%srfcnrml(idir, isp)) >=
m_epsilon) n_dir = idir
1982 do ikp = 1, this%ll(n_dir)
1983 this%expkr_perp(ikp, ifc) =
exp(-
m_zi * this%rcoords(n_dir,isp) &
1984 * this%klinear(ikp, n_dir)) &
1994 if (space%is_periodic())
then
1996 safe_allocate(this%bvk_phase(ikp_start:ikp_end,st%d%kpt%start:st%d%kpt%end))
1998 this%bvk_phase(:,:) =
m_z0
2001 do ik = st%d%kpt%start, st%d%kpt%end
2002 kpoint(1:mdim) = kpoints%get_point(st%d%get_kpoint_index(ik))
2003 if (kpoints%have_zero_weight_path())
then
2008 do ikp = ikp_start, ikp_end
2009 vec(1:pdim) = this%kcoords_cub(1:pdim, ikp, ik_map) + kpoint(1:pdim)
2010 do j1 = 0, kpoints%nik_axis(1) - 1
2011 do j2 = 0, kpoints%nik_axis(2) - 1
2012 jvec(1:2)=(/j1, j2/)
2013 lvec(1:pdim) = matmul(kpoints%latt%rlattice(1:pdim, 1:2), jvec(1:2))
2014 tmp = sum(lvec(1:pdim) * vec(1:pdim))
2015 this%bvk_phase(ikp, ik) = this%bvk_phase(ikp,ik) &
2023 this%bvk_phase(:,:) = this%bvk_phase(:,:) *
m_one / product(kpoints%nik_axis(1:pdim))
2045 pure function get_ikp(this, ikpu, ikpv, ikpz, n_dir)
result(ikp)
2047 integer,
intent(in) :: ikpu
2048 integer,
intent(in) :: ikpv
2049 integer,
intent(in) :: ikpz
2050 integer,
intent(in) :: n_dir
2055 ikp = this%Lkpuvz_inv(ikpz, ikpu, ikpv)
2057 ikp = this%Lkpuvz_inv(ikpu, ikpz, ikpv)
2059 ikp = this%Lkpuvz_inv(ikpu, ikpv, ikpz)
2071 type(
mesh_t),
intent(in) :: mesh
2074 integer :: mdim, nfaces, ifc, ifp_start, ifp_end
2081 if (this%surf_shape ==
pes_plane) nfaces = 1
2085 ifp_start = this%face_idx_range(ifc, 1)
2086 ifp_end = this%face_idx_range(ifc, 2)
2089 if (this%nsrfcpnts_start <= ifp_end)
then
2091 if (this%nsrfcpnts_start >= ifp_start)
then
2092 if (this%nsrfcpnts_start <= ifp_end)
then
2093 this%face_idx_range(ifc, 1) = this%nsrfcpnts_start
2095 this%face_idx_range(ifc, 1:2) = -1
2099 if (this%nsrfcpnts_end <= ifp_end)
then
2100 if (this%nsrfcpnts_end >= ifp_start)
then
2101 this%face_idx_range(ifc, 2) = this%nsrfcpnts_end
2103 this%face_idx_range(ifc, 1:2) = -1
2109 this%face_idx_range(ifc, 1:2) = -1
2128 class(
space_t),
intent(in) :: space
2129 type(
mesh_t),
intent(in) :: mesh
2132 real(real64),
intent(in) :: dt
2134 integer :: stst, stend, kptst, kptend, sdim, mdim
2135 integer :: ist, ik, isdim, imdim, ik_map
2136 integer :: ikp, itstep
2137 integer :: idir, n_dir, nfaces
2138 complex(real64),
allocatable :: jk_cub(:,:,:,:), spctramp_cub(:,:,:,:)
2139 integer :: ikp_start, ikp_end, isp_start, isp_end
2140 real(real64) :: vec, kpoint(1:3)
2142 complex(real64),
allocatable :: wfpw(:), gwfpw(:)
2143 complex(real64),
allocatable :: phase(:,:),vphase(:,:)
2145 integer :: tdstep_on_node
2149 integer :: ikpu, ikpv, ikpz, dir_on_face(1:2)
2150 complex(real64) :: face_int_gwf, face_int_wf
2159 call messages_write(
"Debug: calculating pes_flux cub surface integral (accelerated direct expression)")
2164 if (
bitand(this%par_strategy, option__pes_flux_parallelization__pf_time) /= 0)
then
2165 if (mesh%parallel_in_domains) tdstep_on_node = mesh%mpi_grp%rank + 1
2170 kptst = st%d%kpt%start
2171 kptend = st%d%kpt%end
2175 ikp_start = this%nkpnts_start
2176 ikp_end = this%nkpnts_end
2180 safe_allocate(jk_cub(stst:stend, 1:sdim, kptst:kptend, ikp_start:ikp_end))
2181 safe_allocate(spctramp_cub(stst:stend, 1:sdim, kptst:kptend, ikp_start:ikp_end))
2185 safe_allocate(vphase(ikp_start:ikp_end, kptst:kptend))
2186 safe_allocate(phase(ikp_start:ikp_end, kptst:kptend))
2192 if (this%surf_shape ==
pes_plane) nfaces = 1
2194 safe_allocate( wfpw(ikp_start:ikp_end))
2195 safe_allocate(gwfpw(ikp_start:ikp_end))
2200 if (this%face_idx_range(ifc, 1)<0) cycle
2203 isp_start = this%face_idx_range(ifc, 1)
2204 isp_end = this%face_idx_range(ifc, 2)
2207 nfp = isp_end - isp_start + 1
2215 if (abs(this%srfcnrml(idir, isp_start)) >=
m_epsilon)
then
2218 dir_on_face(imdim)=idir
2225 vphase(ikp_start:ikp_end,:) = this%conjgphase_prev(ikp_start:ikp_end,:)
2227 jk_cub(:, :, :, :) =
m_z0
2229 do itstep = 1, this%itstep
2231 do ik = kptst, kptend
2233 if (kpoints%have_zero_weight_path())
then
2239 kpoint(1:mdim) = kpoints%get_point(st%d%get_kpoint_index(ik))
2240 do ikp = ikp_start, ikp_end
2241 vec = sum((this%kcoords_cub(1:mdim, ikp, ik_map) - this%veca(1:mdim, itstep) /
p_c)**2)
2242 vphase(ikp, ik) = vphase(ikp, ik) *
exp(
m_zi * vec * dt /
m_two)
2245 if (space%is_periodic())
then
2246 phase(ikp, ik) = vphase(ikp, ik) * this%bvk_phase(ikp,ik)
2248 phase(ikp, ik) = vphase(ikp, ik)
2253 if (itstep /= tdstep_on_node) cycle
2255 do ist = stst, stend
2260 if (.not. this%use_symmetry .or. kpoints%have_zero_weight_path())
then
2262 do ikp = ikp_start , ikp_end
2265 sum(this%gwf(isp_start:isp_end, ist, isdim, ik, itstep, n_dir) &
2266 * this%expkr(isp_start:isp_end, ikp, ik_map, 1) &
2267 * this%srfcnrml(n_dir, isp_start:isp_end))
2271 sum(this%wf(isp_start:isp_end, ist, isdim, ik, itstep) &
2272 * this%expkr(isp_start:isp_end, ikp,ik_map, 1) &
2273 * this%srfcnrml(n_dir, isp_start:isp_end))
2278 do ikpu = 1, this%ll(dir_on_face(1))
2279 do ikpv = 1, this%ll(dir_on_face(2))
2282 face_int_gwf = sum(this%gwf(isp_start:isp_end, ist, isdim, ik, itstep, n_dir) &
2283 * this%expkr(isp_start:isp_end, ikpu, ik_map, dir_on_face(1)) &
2284 * this%expkr(isp_start:isp_end, ikpv, ik_map, dir_on_face(2)) &
2285 * this%srfcnrml(n_dir, isp_start:isp_end))
2287 face_int_wf = sum(this%wf(isp_start:isp_end, ist, isdim, ik, itstep) &
2288 * this%expkr(isp_start:isp_end, ikpu, ik_map, dir_on_face(1)) &
2289 * this%expkr(isp_start:isp_end, ikpv, ik_map, dir_on_face(2)) &
2290 * this%srfcnrml(n_dir, isp_start:isp_end))
2292 do ikpz = 1, this%ll(n_dir)
2294 gwfpw(
get_ikp(this, ikpu, ikpv, ikpz, n_dir)) = face_int_gwf &
2295 * this%expkr_perp(ikpz, ifc)
2296 wfpw(
get_ikp(this, ikpu, ikpv, ikpz, n_dir)) = face_int_wf &
2297 * this%expkr_perp(ikpz, ifc)
2309 jk_cub(ist, isdim, ik, ikp_start:ikp_end) = jk_cub(ist, isdim, ik, ikp_start:ikp_end) + &
2310 phase(ikp_start:ikp_end, ik) * (wfpw(ikp_start:ikp_end) * &
2311 (
m_two * this%veca(n_dir, itstep) /
p_c - this%kcoords_cub(n_dir, ikp_start:ikp_end, ik_map)) + &
2312 m_zi * gwfpw(ikp_start:ikp_end))
2322 spctramp_cub(:,:,:,:) = spctramp_cub(:,:,:,:) + jk_cub(:,:,:,:) *
m_half
2328 this%conjgphase_prev(ikp_start:ikp_end, :) = vphase(ikp_start:ikp_end, :)
2331 if (mesh%parallel_in_domains .and.(
bitand(this%par_strategy, option__pes_flux_parallelization__pf_time) /= 0 &
2332 .or.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0))
then
2333 call mesh%allreduce(spctramp_cub)
2338 this%spctramp_cub = this%spctramp_cub + spctramp_cub * dt
2340 safe_deallocate_a(gwfpw)
2341 safe_deallocate_a(wfpw)
2343 safe_deallocate_a(jk_cub)
2344 safe_deallocate_a(spctramp_cub)
2345 safe_deallocate_a(phase)
2346 safe_deallocate_a(vphase)
2358 type(
mesh_t),
intent(in) :: mesh
2360 real(real64),
intent(in) :: dt
2362 integer :: stst, stend, kptst, kptend, sdim
2363 integer :: ist, ik, isdim, imdim
2364 integer :: itstep, lmax
2365 integer :: ll, mm, ip
2366 complex(real64),
allocatable :: s1_node(:,:,:,:,:,:)
2367 complex(real64),
allocatable :: s2_node(:,:,:,:,:)
2368 complex(real64),
allocatable :: integ11_t(:,:,:), integ12_t(:,:,:)
2369 complex(real64),
allocatable :: integ21_t(:,:), integ22_t(:,:)
2370 complex(real64),
allocatable :: spctramp_sph(:,:,:,:,:)
2371 integer :: ikk, ikk_start, ikk_end, ikk2
2372 integer :: isp_start, isp_end
2373 integer :: iomk, iomk_start, iomk_end
2374 complex(real64),
allocatable :: phase_act(:,:)
2376 complex(real64) :: weight_x, weight_y, weight_z
2377 integer :: tdstep_on_node
2379 type(
accel_kernel_t),
save,
target :: pes_flux_sph_integrate_kernel
2380 type(
accel_kernel_t),
save,
target :: pes_flux_sph_integrate_xx_kernel
2381 type(
accel_kernel_t),
save,
target :: pes_flux_sph_integrate_xx_2_kernel
2383 type(
accel_mem_t) :: integ11_t_buff, integ21_t_buff
2384 type(
accel_mem_t) :: integ12_t_buff, integ22_t_buff
2386 complex(real64),
allocatable :: weight_x_host(:)
2387 integer(int64) :: n_buff_elements
2388 integer(int64) :: nkk
2389 integer :: nsrfcpnts
2390 integer(int64) :: gsx, bsize
2396 call messages_write(
"Debug: calculating pes_flux sph surface integral")
2400 if (mesh%parallel_in_domains) tdstep_on_node = mesh%mpi_grp%rank + 1
2404 kptst = st%d%kpt%start
2405 kptend = st%d%kpt%end
2409 ikk_start = this%nk_start
2410 ikk_end = this%nk_end
2411 isp_start = this%nsrfcpnts_start
2412 isp_end = this%nsrfcpnts_end
2413 iomk_start = this%nstepsomegak_start
2414 iomk_end = this%nstepsomegak_end
2417 safe_allocate(integ11_t(1:this%nstepsomegak, 1:3, 0:lmax))
2418 safe_allocate(integ21_t(1:this%nstepsomegak, 0:lmax))
2419 safe_allocate(integ12_t(1:this%nstepsomegak, 1:3, ikk_start:ikk_end))
2420 safe_allocate(integ22_t(1:this%nstepsomegak, ikk_start:ikk_end))
2422 safe_allocate(spctramp_sph(1:this%nstepsomegak, stst:stend, 1:sdim, kptst:kptend, 1:this%nk))
2427 safe_allocate(phase_act(1:this%nstepsomegak, ikk_start:ikk_end))
2428 if (ikk_start > 0)
then
2429 phase_act(:, ikk_start:ikk_end) = this%conjgphase_prev(:, ikk_start:ikk_end)
2431 phase_act(:, ikk_start:ikk_end) =
m_z0
2438 safe_allocate(s1_node(1:3, -lmax:lmax, 0:lmax, stst:stend, 1:sdim, kptst:kptend))
2439 safe_allocate(s2_node(-lmax:lmax, 0:lmax, stst:stend, 1:sdim, kptst:kptend))
2446 n_buff_elements = int((2*lmax+1)*(lmax+1)*(stend-stst+1)*sdim*(kptend-kptst+1), int64)
2447 nsrfcpnts = isp_end - isp_start + 1
2451 call accel_write_buffer(this%srfcnrml_buff, 3, nsrfcpnts, this%srfcnrml(1:3, isp_start:isp_end))
2458 nsrfcpnts*(stend-stst+1)*sdim*(kptend-kptst+1))
2460 3_int64*nsrfcpnts*(stend-stst+1)*sdim*(kptend-kptst+1))
2463 nkk = iomk_end - iomk_start + 1
2468 this%ylm_k(iomk_start:iomk_end, -lmax:lmax, 0:lmax))
2472 int((lmax+1)*3,int64)*this%nstepsomegak)
2474 int((lmax+1),int64)*this%nstepsomegak)
2481 this%j_l(ikk_start:ikk_end, 0:lmax))
2485 int((ikk_end-ikk_start+1)*3,int64)*this%nstepsomegak)
2487 int((ikk_end-ikk_start+1),int64)*this%nstepsomegak)
2492 do itstep = 1, this%itstep
2498 this%wf(isp_start:isp_end,stst:stend,:,kptst:kptend,itstep:itstep))
2499 call accel_write_buffer(gwf_buff, nsrfcpnts, stend-stst+1, sdim, kptend-kptst+1, 1, 3, &
2500 this%gwf(isp_start:isp_end,stst:stend,:,kptst:kptend, itstep:itstep, 1:3))
2523 if (mesh%parallel_in_domains .and.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0)
then
2524 call accel_read_buffer(s1_node_buff, 3, 2*lmax+1, lmax+1, stend-stst+1, sdim, kptend-kptst+1, &
2525 s1_node(1:3, -lmax:lmax, 0:lmax, stst:stend, 1:sdim, kptst:kptend), async=.
true.)
2526 call accel_read_buffer(s2_node_buff, 2*lmax+1, lmax+1, stend-stst+1, sdim, kptend-kptst+1, &
2527 s2_node(-lmax:lmax, 0:lmax, stst:stend, 1:sdim, kptst:kptend))
2532 do ik = kptst, kptend
2533 do ist = stst, stend
2537 s1_node(1:3, mm, ll, ist, isdim, ik) =
m_zero
2538 s2_node(mm, ll, ist, isdim, ik) =
m_zero
2540 do ip = isp_start, isp_end
2541 weight_x = this%ylm_r(ip, ll, mm) * this%srfcnrml(1, ip)
2542 weight_y = this%ylm_r(ip, ll, mm) * this%srfcnrml(2, ip)
2543 weight_z = this%ylm_r(ip, ll, mm) * this%srfcnrml(3, ip)
2544 s1_node(1, mm, ll, ist, isdim, ik) = s1_node(1, mm, ll, ist, isdim, ik) + &
2545 weight_x * this%wf(ip, ist, isdim, ik, itstep)
2546 s1_node(2, mm, ll, ist, isdim, ik) = s1_node(2, mm, ll, ist, isdim, ik) + &
2547 weight_y * this%wf(ip, ist, isdim, ik, itstep)
2548 s1_node(3, mm, ll, ist, isdim, ik) = s1_node(3, mm, ll, ist, isdim, ik) + &
2549 weight_z * this%wf(ip, ist, isdim, ik, itstep)
2551 s2_node(mm, ll, ist, isdim, ik) = s2_node(mm, ll, ist, isdim, ik) &
2552 + weight_x * this%gwf(ip, ist, isdim, ik, itstep, 1) &
2553 + weight_y * this%gwf(ip, ist, isdim, ik, itstep, 2) &
2554 + weight_z * this%gwf(ip, ist, isdim, ik, itstep, 3)
2564 if (mesh%parallel_in_domains .and.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0)
then
2565 call mesh%allreduce(s1_node)
2566 call mesh%allreduce(s2_node)
2570 call accel_write_buffer(s1_node_buff, 3, 2*lmax+1, lmax+1, stend-stst+1, sdim, kptend-kptst+1, &
2571 s1_node(1:3, -lmax:lmax, 0:lmax, stst:stend, 1:sdim, kptst:kptend), async=.
true.)
2572 call accel_write_buffer(s2_node_buff, 2*lmax+1, lmax+1, stend-stst+1, sdim, kptend-kptst+1, &
2573 s2_node(-lmax:lmax, 0:lmax, stst:stend, 1:sdim, kptst:kptend))
2583 do ikk = ikk_start, ikk_end
2584 do iomk = 1, this%nstepsomegak
2585 vec = sum((this%kcoords_sph(1:3, ikk, iomk) - this%veca(1:3, itstep) /
p_c)**2)
2586 phase_act(iomk, ikk) = phase_act(iomk, ikk) *
exp(
m_zi * vec * dt *
m_half)
2592 do ik = kptst, kptend
2593 do ist = stst, stend
2603 do ikk = 1, this%nstepsomegak
2604 integ11_t(ikk, imdim, ll) =
m_z0
2608 do ikk = 1, this%nstepsomegak
2609 integ21_t(ikk, ll) =
m_z0
2615 do ikk2 = ikk_start, ikk_end
2618 do ikk = 1, this%nstepsomegak
2619 integ12_t(ikk, imdim, ikk2) =
m_z0
2623 do ikk = 1, this%nstepsomegak
2624 integ22_t(ikk, ikk2) =
m_z0
2652 call accel_kernel_run(pes_flux_sph_integrate_xx_kernel, (/gsx/), (/bsize/))
2654 if (mesh%parallel_in_domains .and.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0)
then
2657 integ11_t(iomk_start:iomk_end, 1:3, 0:lmax), async=.
true.)
2659 integ21_t(iomk_start:iomk_end, 0:lmax))
2670 do ikk = iomk_start, iomk_end
2671 integ11_t(ikk, imdim, ll) = integ11_t(ikk, imdim, ll) + &
2672 s1_node(imdim, mm, ll, ist, isdim, ik) * this%ylm_k(ikk, mm, ll)
2676 do ikk = iomk_start, iomk_end
2677 integ21_t(ikk, ll) = integ21_t(ikk, ll) + &
2678 s2_node(mm, ll, ist, isdim, ik) * this%ylm_k(ikk, mm, ll)
2688 if (mesh%parallel_in_domains .and.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_surface) /= 0)
then
2690 call mesh%allreduce(integ11_t)
2691 call mesh%allreduce(integ21_t)
2697 integ11_t(1:this%nstepsomegak, 1:3, 0:lmax), async=.
true.)
2699 integ21_t(1:this%nstepsomegak, 0:lmax))
2710 safe_allocate(weight_x_host(0:lmax))
2712 weight_x_host(ll) = (-
m_zi)**ll
2718 safe_deallocate_a(weight_x_host)
2729 call accel_set_kernel_arg(pes_flux_sph_integrate_xx_2_kernel, 6, int(this%nstepsomegak, int64))
2730 call accel_set_kernel_arg(pes_flux_sph_integrate_xx_2_kernel, 7, int(ikk_end-ikk_start+1, int64))
2741 call accel_grid_size(int((ikk_end-ikk_start+1)*this%nstepsomegak, int64), bsize, gsx)
2743 call accel_kernel_run(pes_flux_sph_integrate_xx_2_kernel, (/gsx/), (/bsize/))
2745 call accel_read_buffer(integ12_t_buff, this%nstepsomegak, 3, int(ikk_end-ikk_start+1), &
2746 integ12_t(:, 1:3, ikk_start:ikk_end), async=.
true.)
2747 call accel_read_buffer(integ22_t_buff, this%nstepsomegak, int(ikk_end-ikk_start+1), &
2748 integ22_t(:, ikk_start:ikk_end))
2754 weight_x = ( -
m_zi)**ll
2757 do ikk = ikk_start, ikk_end
2759 integ12_t(:, imdim, ikk) = integ12_t(:, imdim, ikk) + this%j_l(ikk, ll) * weight_x * integ11_t(:, imdim, ll)
2761 integ22_t(:, ikk) = integ22_t(:, ikk) + this%j_l(ikk, ll) * weight_x * integ21_t(:, ll)
2774 do ikk = ikk_start, ikk_end
2777 spctramp_sph(:, ist, isdim, ik, ikk) = &
2778 spctramp_sph(:, ist, isdim, ik, ikk) + &
2779 phase_act(:, ikk) * (integ12_t(:, imdim, ikk) * &
2780 (
m_two * this%veca(imdim, itstep) /
p_c - this%kcoords_sph(imdim, ikk,:)))
2782 spctramp_sph(:, ist, isdim, ik, ikk) = &
2783 spctramp_sph(:, ist, isdim, ik, ikk) + phase_act(:, ikk) * integ22_t(:, ikk) *
m_zi
2804 safe_deallocate_a(s1_node)
2805 safe_deallocate_a(s2_node)
2807 safe_deallocate_a(integ11_t)
2808 safe_deallocate_a(integ12_t)
2809 safe_deallocate_a(integ21_t)
2810 safe_deallocate_a(integ22_t)
2813 this%conjgphase_prev =
m_z0
2815 if (ikk_start > 0)
then
2816 this%conjgphase_prev(:, ikk_start:ikk_end) = phase_act(:, ikk_start:ikk_end)
2818 safe_deallocate_a(phase_act)
2820 if (mesh%parallel_in_domains .and.
bitand(this%par_strategy, option__pes_flux_parallelization__pf_time) /= 0)
then
2821 call mesh%allreduce(this%conjgphase_prev)
2822 call mesh%allreduce(spctramp_sph)
2827 do ik = kptst, kptend
2828 call lalg_axpy(this%nstepsomegak, stend-stst+1, sdim, dt, spctramp_sph(:, :, :, ik, ikk), &
2829 this%spctramp_sph(:, :, :, ik, ikk))
2832 safe_deallocate_a(spctramp_sph)
2839 type(
mesh_t),
intent(in) :: mesh
2842 real(real64),
contiguous,
intent(in) :: border(:)
2843 real(real64),
contiguous,
intent(in) :: offset(:)
2844 real(real64),
intent(in) :: fc_ptdens
2846 integer,
allocatable :: which_surface(:)
2847 real(real64) :: xx(mesh%box%dim), dd, area, dS(mesh%box%dim, 2), factor
2848 integer :: mdim, imdim, idir, isp, pm,nface, idim, ndir, iu,iv, iuv(1:2)
2849 integer(int64) :: ip_global
2851 integer :: rankmin, nsurfaces
2853 integer :: ip_local, NN(mesh%box%dim, 2), idx(mesh%box%dim, 2)
2854 integer :: isp_end, isp_start, ifc, n_dir, nfaces, mindim
2855 real(real64) :: RSmax(2), RSmin(2), RS(2), dRS(2), weight
2867 safe_allocate(this%face_idx_range(1:mdim * 2, 1:2))
2868 safe_allocate(this%LLr(mdim, 1:2))
2869 safe_allocate(this%NN(mdim, 1:2))
2871 this%face_idx_range(:, :) = 0
2876 if (this%surf_interp)
then
2893 do ndir = mdim, mindim, -1
2896 if (idir == ndir) cycle
2897 area = area * border(idir) * factor
2900 npface = int(fc_ptdens * area)
2904 if (idir == ndir) cycle
2905 nn(ndir, idim) = int(
sqrt(npface * (border(idir) * factor)**2 / area))
2906 ds(ndir, idim) = border(idir) * factor / nn(ndir, idim)
2907 this%LLr(ndir, idim) = nn(ndir, idim) * ds(ndir, idim)
2908 idx(ndir, idim) = idir
2911 this%nsrfcpnts = this%nsrfcpnts + 2 * product(nn(ndir, 1:mdim - 1))
2914 this%NN(1:mdim, :) = nn(1:mdim, :)
2917 assert(this%nsrfcpnts > 0)
2920 safe_allocate(this%srfcnrml(1:mdim, 0:this%nsrfcpnts))
2921 safe_allocate(this%rcoords(1:mdim, 0:this%nsrfcpnts))
2923 this%srfcnrml(:, :) =
m_zero
2924 this%rcoords(:, :) =
m_zero
2929 do ndir = mdim, mindim, -1
2932 this%face_idx_range(ifc,1) = isp
2933 do iu = 1, nn(ndir,1)
2934 do iv = 1, nn(ndir,2)
2935 this%rcoords(ndir, isp) = border(ndir)
2936 this%srfcnrml(ndir, isp) = product(ds(ndir,1:mdim-1))
2939 this%rcoords(idx(ndir, idim), isp) = (-nn(ndir, idim) *
m_half -
m_half + iuv(idim)) * ds(ndir, idim)
2944 this%face_idx_range(ifc, 2) = isp-1
2949 this%face_idx_range(ifc, 1) = isp
2950 do iu = 1, nn(ndir, 1)
2951 do iv = 1, nn(ndir, 2)
2952 this%rcoords(ndir, isp) = -border(ndir)
2953 this%srfcnrml(ndir, isp) = -product(ds(ndir, 1:mdim - 1))
2956 this%rcoords(idx(ndir, idim), isp) = (-nn(ndir, idim) *
m_half -
m_half + iuv(idim)) * ds(ndir, idim)
2961 this%face_idx_range(ifc, 2) = isp-1
2966 do isp = 1, this%nsrfcpnts
2967 this%rcoords(1:mdim, isp) = mesh%coord_system%to_cartesian(this%rcoords(1:mdim, isp))
2974 if (this%surf_shape ==
pes_plane) nfaces = 2
2978 safe_allocate(which_surface(1:mesh%np_global))
2983 do ip_local = 1, mesh%np
2988 xx(1:mdim) = mesh%x(1:mdim, ip_local) - offset(1:mdim)
2991 select case (abb%abtype)
2995 in_ab = abs(abb%mf(ip_local)) >
m_epsilon
3001 if (all(abs(xx(1:mdim)) <= border(1:mdim)) .and. .not. in_ab)
then
3005 dd = border(imdim) - xx(imdim)
3007 dd = border(imdim) - abs(xx(imdim))
3009 if (dd < mesh%spacing(imdim) /
m_two)
then
3010 nsurfaces = nsurfaces + 1
3011 which_surface(ip_global) = int(sign(
m_one, xx(imdim))) * imdim
3016 if (nsurfaces == 1)
then
3017 this%nsrfcpnts = this%nsrfcpnts + 1
3019 which_surface(ip_global) = 0
3025 if (mesh%parallel_in_domains)
then
3026 assert(mesh%np_global < huge(0_int32))
3027 call mesh%allreduce(this%nsrfcpnts)
3028 call mesh%allreduce(which_surface)
3031 safe_allocate(this%srfcpnt(1:this%nsrfcpnts))
3032 safe_allocate(this%srfcnrml(1:mdim, 0:this%nsrfcpnts))
3033 safe_allocate(this%rcoords(1:mdim, 0:this%nsrfcpnts))
3034 safe_allocate(this%rankmin(1:this%nsrfcpnts))
3039 this%face_idx_range(:,:) = 0
3043 do idir = mdim, 1, -1
3046 this%face_idx_range(nface, 1) = isp + 1
3048 do ip_global = 1, mesh%np_global
3049 if (abs(which_surface(ip_global)) == idir .and. sign(1, which_surface(ip_global)) == pm)
then
3053 this%rcoords(1:mdim, isp) = xx(1:mdim)
3056 this%rankmin(isp) = rankmin
3058 this%srfcnrml(idir, isp) = sign(1, which_surface(ip_global))
3061 if (imdim == idir) cycle
3062 this%srfcnrml(idir, isp) = this%srfcnrml(idir, isp) * mesh%spacing(imdim)
3067 this%face_idx_range(nface,2) = isp
3074 do ifc = 1, nint((nfaces + 0.5) / 2)
3075 isp_start = this%face_idx_range(ifc, 1)
3076 isp_end = this%face_idx_range(ifc, 2)
3081 if (abs(this%srfcnrml(idir, isp_start)) >=
m_epsilon) n_dir = idir
3088 if (idir == n_dir) cycle
3089 drs(idim)= mesh%spacing(idir)
3097 do isp = isp_start, isp_end
3099 xx = mesh%coord_system%from_cartesian(this%rcoords(1:mdim, isp))
3102 if (idir == n_dir) cycle
3104 if (rs(idim) < rsmin(idim)) rsmin(idim) = rs(idim)
3105 if (rs(idim) > rsmax(idim)) rsmax(idim) = rs(idim)
3111 do idir = 1, mdim - 1
3112 this%LLr(n_dir, idir) = rsmax(idir) - rsmin(idir) + drs(idir)
3113 if (drs(idir) >
m_zero) this%NN(n_dir, idir) = int(this%LLr(n_dir, idir) / drs(idir))
3121 if (this%anisotrpy_correction)
then
3124 do isp = 1, this%nsrfcpnts
3125 weight = sum(this%rcoords(1:mdim, isp) * this%srfcnrml(1:mdim, isp))
3126 weight = weight/sum(this%rcoords(1:mdim, isp)**2) / sum(this%srfcnrml(1:mdim, isp)**2)
3127 this%srfcnrml(1:mdim, isp) = this%srfcnrml(1:mdim, isp) * abs(weight)
3133 safe_deallocate_a(which_surface)
3141 type(
mesh_t),
intent(in) :: mesh
3142 integer,
intent(inout) :: nstepsthetar, nstepsphir
3145 integer :: isp, ith, iph
3146 real(real64) :: thetar, phir
3147 real(real64) :: weight, dthetar
3153 if (nstepsphir == 0) nstepsphir = 1
3155 if (nstepsthetar <= 1)
then
3159 dthetar =
m_pi / nstepsthetar
3160 this%nsrfcpnts = nstepsphir * (nstepsthetar - 1) + 2
3162 safe_allocate(this%srfcnrml(1:mdim, 0:this%nsrfcpnts))
3163 safe_allocate(this%rcoords(1:mdim, 0:this%nsrfcpnts))
3170 do ith = 0, nstepsthetar
3171 thetar = ith * dthetar
3173 if (ith == 0 .or. ith == nstepsthetar)
then
3176 weight = abs(
cos(thetar - dthetar /
m_two) -
cos(thetar + dthetar /
m_two)) &
3180 do iph = 0, nstepsphir - 1
3183 this%srfcnrml(1, isp) =
cos(phir) *
sin(thetar)
3184 if (mdim >= 2) this%srfcnrml(2, isp) =
sin(phir) *
sin(thetar)
3185 if (mdim == 3) this%srfcnrml(3, isp) =
cos(thetar)
3186 this%rcoords(1:mdim, isp) = this%radius * this%srfcnrml(1:mdim, isp)
3188 this%srfcnrml(1:mdim, isp) = this%radius**2 * weight * this%srfcnrml(1:mdim, isp)
3189 if (ith == 0 .or. ith == nstepsthetar)
exit
3201 integer,
intent(in) :: istart_global
3202 integer,
intent(in) :: iend_global
3203 integer,
intent(inout) :: istart
3204 integer,
intent(inout) :: iend
3205 type(mpi_comm),
intent(in) :: comm
3207#if defined(HAVE_MPI)
3208 integer,
allocatable :: dimrank(:)
3209 integer :: mpisize, mpirank, irest, irank
3215#if defined(HAVE_MPI)
3216 call mpi_comm_size(comm, mpisize)
3217 call mpi_comm_rank(comm, mpirank)
3219 safe_allocate(dimrank(0:mpisize-1))
3221 inumber = iend_global - istart_global + 1
3222 irest = mod(inumber, mpisize)
3223 do irank = 0, mpisize - 1
3225 dimrank(irank) = int(inumber / mpisize) + 1
3228 dimrank(irank) = int(inumber / mpisize)
3232 iend = istart_global + sum(dimrank(:mpirank)) - 1
3233 istart = iend - dimrank(mpirank) + 1
3235 if (istart > iend)
then
3240 safe_deallocate_a(dimrank)
3243 istart = istart_global
3251#include "pes_flux_out_inc.F90"
constant times a vector plus a vector
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
double exp(double __x) __attribute__((__nothrow__
double sin(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
double floor(double __x) __attribute__((__nothrow__
integer, parameter, public imaginary_absorbing
integer, parameter, public mask_absorbing
integer function, public accel_kernel_block_size(kernel)
subroutine, public accel_free_buffer(this, async)
subroutine, public accel_kernel_start_call(this, file_name, kernel_name, flags)
subroutine, public accel_finish()
logical pure function, public accel_buffer_is_allocated(this)
integer, parameter, public accel_mem_read_write
pure logical function, public accel_is_enabled()
integer, parameter, public accel_mem_read_only
This module implements batches of mesh functions.
This module implements common operations on batches of mesh functions.
Module implementing boundary conditions in Octopus.
This module handles the calculation mode.
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public zderivatives_batch_grad(der, ffb, opffb, ghost_update, set_bc, to_cartesian, factor)
apply the gradient to a batch of mesh functions
integer, parameter, public spin_polarized
type(lasers_t) function, pointer, public list_get_lasers(partners)
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_pi
some mathematical constants
complex(real64), parameter, public m_z0
complex(real64), parameter, public m_zi
real(real64), parameter, public m_epsilon
complex(real64), parameter, public m_z1
real(real64), parameter, public m_half
real(real64), parameter, public p_c
Electron gyromagnetic ratio, see Phys. Rev. Lett. 130, 071801 (2023)
real(real64), parameter, public m_one
This module defines classes and functions for interaction partners.
integer pure function, public kpoints_number(this)
integer, parameter, public e_field_vector_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...
System information (time, memory, sysname)
This module is intended to contain "only mathematical" functions and procedures.
subroutine, public ylmr_cmplx(xx, li, mi, ylm)
Computes spherical harmonics ylm at position (x, y, z)
subroutine, public mesh_interpolation_init(this, mesh)
This module defines the meshes, which are used in Octopus.
integer function, public mesh_nearest_point(mesh, pos, dmin, rankmin)
Returns the index of the point which is nearest to a given vector position pos.
integer(int64) function, public mesh_local2global(mesh, ip)
This function returns the global mesh index for a given local index.
real(real64) function, dimension(1:mesh%box%dim), public mesh_x_global(mesh, ipg)
Given a global point index, this function returns the coordinates of the point.
subroutine, public messages_not_implemented(feature, namespace)
subroutine, public messages_new_line()
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_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
This module handles the communicators for the various parallelization strategies.
logical function, public parse_is_defined(namespace, name)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
subroutine, public pes_flux_map_from_states(this, restart, st, ll, pesP, krng, Lp, istin)
subroutine pes_flux_getcube(this, mesh, abb, border, offset, fc_ptdens)
subroutine, public pes_flux_calc(this, space, mesh, st, der, ext_partners, kpoints, iter, dt, stopping)
subroutine, public pes_flux_out_energy(this, pesK, file, namespace, ll, Ekin, dim)
subroutine pes_flux_getsphere(this, mesh, nstepsthetar, nstepsphir)
subroutine, public pes_flux_output(this, box, st, namespace)
subroutine, public pes_flux_pmesh(this, namespace, dim, kpoints, ll, pmesh, idxZero, krng, nspin, Lp, Ekin)
subroutine, public pes_flux_reciprocal_mesh_gen(this, namespace, space, st, kpoints, comm, post)
subroutine, public pes_flux_load(restart, this, st, ierr)
subroutine, public pes_flux_dump(restart, this, mesh, st, ierr)
integer, parameter pes_cubic
subroutine pes_flux_distribute_facepnts_cub(this, mesh)
subroutine pes_flux_integrate_sph(this, mesh, st, dt)
integer, parameter pes_cartesian
integer, parameter pes_polar
integer, parameter pes_plane
subroutine pes_flux_distribute(istart_global, iend_global, istart, iend, comm)
subroutine pes_flux_integrate_cub(this, space, mesh, st, kpoints, dt)
subroutine, public pes_flux_end(this)
pure integer function get_ikp(this, ikpu, ikpv, ikpz, n_dir)
subroutine pes_flux_integrate_cub_tabulate(this, space, mesh, st, kpoints)
subroutine, public pes_flux_init(this, namespace, space, mesh, st, ext_partners, kpoints, abb, save_iter, max_iter)
integer, parameter pes_spherical
subroutine, public pes_flux_out_vmap(this, pesK, file, namespace, ll, pmesh, dim)
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
This module handles spin dimensions of the states and the k-point distribution.
integer pure function, public states_elec_block_max(st, ib)
return index of last state in block ib
integer pure function, public states_elec_block_min(st, ib)
return index of first state in block ib
type(type_t), parameter, public type_cmplx
type(type_t), parameter, public type_float
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
This module is intended to contain simple general-purpose utility functions and procedures.
character pure function, public index2axis(idir)
subroutine fill_non_periodic_dimension(this)
Class implementing a parallelepiped box. Currently this is restricted to a rectangular cuboid (all th...
Class implementing a spherical box.
class representing derivatives
Describes mesh distribution to nodes.
A container for the phase.
The states_elec_t class contains all electronic wave functions.
batches of electronic states