From e3bcbdc09eba5f960c70e165d41e05aa3db406f1 Mon Sep 17 00:00:00 2001 From: "Nakib H. Protik" Date: Wed, 31 Jul 2024 14:30:05 +0200 Subject: [PATCH] Prevented precalculation of phases in V2 calculator as this approach has poor space scaling wrt q-mesh density. --- app/elphbolt.f90 | 3 +- fpm.toml | 9 +++-- src/interactions.f90 | 82 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 85 insertions(+), 9 deletions(-) diff --git a/app/elphbolt.f90 b/app/elphbolt.f90 index c46167c..dece8d1 100644 --- a/app/elphbolt.f90 +++ b/app/elphbolt.f90 @@ -34,8 +34,7 @@ program elphbolt use bz_sums, only: calculate_dos, calculate_qTF, calculate_el_dos_fermi, calculate_el_Ws use interactions, only: calculate_gReq, calculate_gkRp, calculate_3ph_interaction, & calculate_eph_interaction_ibzq, calculate_eph_interaction_ibzk, & - calculate_echimp_interaction_ibzk, calculate_coarse_grained_3ph_vertex, & - calculate_W_fromcgV2 + calculate_echimp_interaction_ibzk use phonon_defect_module, only: phonon_defect use Green_function, only: calculate_retarded_phonon_D0 use nano_module, only: nanostructure diff --git a/fpm.toml b/fpm.toml index 5da93e2..baf27de 100644 --- a/fpm.toml +++ b/fpm.toml @@ -50,11 +50,10 @@ name="superconda" source-dir="app" main="superconda.f90" -[[executable]] -name = "screening_comparison" -source-dir="test" -main = "screening_comparison.f90" - +#[[executable]] +#name = "screening_comparison" +#source-dir="test" +#main = "screening_comparison.f90" [[test]] name = "test_misc" diff --git a/src/interactions.f90 b/src/interactions.f90 index 8edc3ca..a430fd8 100644 --- a/src/interactions.f90 +++ b/src/interactions.f90 @@ -2806,8 +2806,6 @@ subroutine calculate_eph_interaction_ibzk(wann, crys, el, ph, num, key) close(1) end if - !TODO: Below we are saving the same istate_el and istate_ph data in two files. - !Need to change this wasteful behavior. if(key == 'X') then !Multiply constant factor, unit factor, etc. Xplus_istate(1:count) = const*Xplus_istate(1:count) !THz @@ -3473,6 +3471,86 @@ subroutine calculate_thinfilm_scatt_rates(prefix, finite_crys, ballistic_limit, !Write to file call write2file_rank2_real(prefix // '.W_rta_'//prefix//'thinfilm', thin_film_scatt_rates) end subroutine calculate_thinfilm_scatt_rates + +!!$ subroutine calculate_thinfilm_scatt_rates(prefix, finite_crys, ballistic_limit, & +!!$ height, normal, vels_fbz, indexlist_irred, other_scatt_rates, thin_film_scatt_rates) +!!$ !! Subroutine to calculate the phonon/electron-thin-film scattering rates. +!!$ !! +!!$ !! prefix Type of particle +!!$ !! finite_crys Is the crystal finite? +!!$ !! ballistic_limit Use ballistic limit of Fuchs-Sondheimer theory? +!!$ !! height Height of thin-film in mm +!!$ !! normal Normal direction to thin-film +!!$ !! vels Velocities on the FBZ +!!$ !! indexlist_irred List of muxed indices of the IBZ wedge +!!$ !! other_scatt_rates Sum of the non-thin-film scattering rates on the IBZ +!!$ !! thin_film_scatt_rates Thin-film scattering rates on the IBZ +!!$ +!!$ character(len = 2), intent(in) :: prefix +!!$ logical, intent(in) :: finite_crys +!!$ logical, intent(in) :: ballistic_limit +!!$ real(r64), intent(in) :: height +!!$ character(1), intent(in) :: normal +!!$ real(r64), intent(in) :: vels_fbz(:,:,:) +!!$ integer(i64), intent(in) :: indexlist_irred(:) +!!$ real(r64), allocatable, intent(in) :: other_scatt_rates(:,:) +!!$ real(r64), allocatable, intent(out) :: thin_film_scatt_rates(:,:) +!!$ +!!$ !Local variables +!!$ integer(i64) :: ik, ib, nk_irred, nb, dir +!!$ real(r64), allocatable :: Knudsen(:, :), suppression_FS(:, :) +!!$ +!!$ !Number of IBZ wave vectors and bands +!!$ nk_irred = size(indexlist_irred(:)) +!!$ nb = size(vels_fbz(1,:,1)) +!!$ +!!$ !Allocate boundary scattering rates and initialize to infinite crystal values +!!$ allocate(thin_film_scatt_rates(nk_irred, nb)) +!!$ thin_film_scatt_rates = 0.0_r64 +!!$ +!!$ if(normal == 'x') then +!!$ dir = 1_i64 +!!$ else if(normal == 'y') then +!!$ dir = 2_i64 +!!$ else if(normal == 'z') then +!!$ dir = 3_i64 +!!$ else +!!$ call exit_with_message("Bad thin-film normal direction in calculate_thinfilm_scattrates. Exiting.") +!!$ end if +!!$ +!!$ !Check finiteness of crystal +!!$ if(finite_crys) then +!!$ if(ballistic_limit) then !Large Knudsen number limit +!!$ do ik = 1, nk_irred +!!$ do ib = 1, nb +!!$ thin_film_scatt_rates(ik, ib) = abs(vels_fbz(indexlist_irred(ik), ib, dir)) & +!!$ /height*1.e-6_r64 !THz +!!$ end do +!!$ end do +!!$ thin_film_scatt_rates = 2.0_r64*thin_film_scatt_rates +!!$ else +!!$ allocate(Knudsen(nk_irred, nb), suppression_FS(nk_irred, nb)) +!!$ +!!$ !Knudsen number +!!$ do ib = 1, nb +!!$ do ik = 1, nk_irred +!!$ Knudsen(ik, ib) = abs(vels_fbz(indexlist_irred(ik), ib, dir)) & +!!$ /other_scatt_rates(ik, ib)/height*1.e-6_r64 !THz +!!$ end do +!!$ end do +!!$ Knudsen(1, 1:3) = 0.0_r64 !Deal with Gamma point acoustic phonons +!!$ +!!$ !Fuchs-Sondheimer supression function +!!$ suppression_FS = 1.0_r64 + expm1(-1.0_r64/Knudsen)*Knudsen +!!$ +!!$ thin_film_scatt_rates = other_scatt_rates/suppression_FS - other_scatt_rates +!!$ thin_film_scatt_rates(1, 1:3) = 0.0_r64 !Deal with Gamma point acoustic phonons +!!$ end if +!!$ end if +!!$ +!!$ !Write to file +!!$ call write2file_rank2_real(prefix // '.W_rta_'//prefix//'thinfilm', thin_film_scatt_rates) +!!$ end subroutine calculate_thinfilm_scatt_rates !!$ subroutine calculate_defect_scatt_rates(prefix, def_frac, indexlist_ibz, ens_fbz, diagT)!, scatt_rates) !!$ !! Subroutine to calculate the phonon-defect scattering rate given