From 3c820527aa8075df7861a031a772b1f06e916358 Mon Sep 17 00:00:00 2001 From: "matteo@corvina.fisica.unimo.it" <-> Date: Mon, 16 Feb 2026 18:17:42 +0000 Subject: [PATCH 1/4] EnRngeXm default set to 2 Ha in MPA input --- src/interface/INIT.F | 2 +- src/modules/mod_frequency.F | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/interface/INIT.F b/src/interface/INIT.F index cb0631e264..61eec71911 100644 --- a/src/interface/INIT.F +++ b/src/interface/INIT.F @@ -113,7 +113,7 @@ integer function INIT(en,q,k,X,Xw,Dip,instr,lnstr,CLOSE_Gs,FINALIZE) call W_reset(Xw(2),damping=0.001_SP) call W_reset(Xw(3)) call W_reset(Xw(4)) - call W_reset(Xw(5)) + call W_reset(Xw(5),type=5) call X_reset(X(1),type=1) call X_reset(X(2),type=2) call X_reset(X(3),type=3) diff --git a/src/modules/mod_frequency.F b/src/modules/mod_frequency.F index ffae67f692..f33da91d69 100644 --- a/src/modules/mod_frequency.F +++ b/src/modules/mod_frequency.F @@ -65,15 +65,28 @@ subroutine W_duplicate(Wi,Wo) Wo%grid_type=Wi%grid_type end subroutine W_duplicate ! - subroutine W_reset(W,damping) + subroutine W_reset(W,damping,type) type(w_samp)::W real(SP), optional, intent(in) :: damping + integer, optional, intent(in) :: type real :: local_damping local_damping=0.1_SP if(present(damping)) local_damping=damping W%n_freqs=100 W%per_memstps=100._SP W%er=(/0._SP,10._SP/)/HA2EV + ! + if (present(type)) then + select case (type) + ! + case(5) ! For MPA set default EnRngeXm to 2 Ha + W%er=(/0._SP,2._SP/) + case default + W%er=(/0._SP,10._SP/)/HA2EV + ! + end select + end if + ! W%ir=(/1._SP,1._SP/)!/HA2EV W%dr=(/local_damping,local_damping/)/HA2EV W%damp_reference=0._SP From 9be4fe68c382be64c68ff3d6a771022ac601a2fd Mon Sep 17 00:00:00 2001 From: "matteo@corvina.fisica.unimo.it" <-> Date: Wed, 25 Feb 2026 18:22:55 +0000 Subject: [PATCH 2/4] EnRngeXm second entry <0 in input to automatically set its value depending on BndsRnXm --- src/pol_function/X_dielectric_matrix.F | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pol_function/X_dielectric_matrix.F b/src/pol_function/X_dielectric_matrix.F index eab77a26a5..051ed2457d 100644 --- a/src/pol_function/X_dielectric_matrix.F +++ b/src/pol_function/X_dielectric_matrix.F @@ -116,6 +116,12 @@ integer function X_dielectric_matrix(Xen,Xk,q,X,Xw,Dip,SILENT_MODE,CHILD) if (mod(Xw%n_freqs,2)>0) Xw%n_freqs=Xw%n_freqs+1 X%mpa_npoles = Xw%n_freqs/2 X_MEM_n_freqs =2*X%mpa_npoles + ! + if (Xw%er(2)<=Xw%er(1)) then + Xw%er(1) = 0.0_SP + Xw%er(2) = ( maxval(Xen%E(X%ib(2),:,:)) - minval(Xen%E(X%ib(1),:,:)) ) / 2.0_SP + endif + ! X%ordering='t' Xw%grid_type="mp" if(Xw%dr(1) Date: Thu, 26 Feb 2026 09:49:05 +0000 Subject: [PATCH 3/4] updated EnRngeXm description in input file --- src/interface/INIT_load.F | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/interface/INIT_load.F b/src/interface/INIT_load.F index c2fb198625..976a656d77 100644 --- a/src/interface/INIT_load.F +++ b/src/interface/INIT_load.F @@ -848,6 +848,9 @@ subroutine Xload(X,wv) des(2) ='Frequency sampling in the complex plane ("1l" one line, "2l" two lines)' des(3) ='Partition along the real axis ("ho" homogeneous, "lP" linear, "qP" quadratic, "cP" cubic)' des(4) ='Energy range' + if (X%whoami==5) then + des(4) ='Energy range; if 0.0 | -1.0 | half the maximum e-h pair included in X is used' + endif des(5) ='Imaginary range' des(6) ='Damping range' des(7) ='[o/o] Coarse grid controller' From affc0dcadaab1944c821aed62656b0883ad3e3cd Mon Sep 17 00:00:00 2001 From: "matteo@corvina.fisica.unimo.it" <-> Date: Thu, 26 Feb 2026 14:37:31 +0000 Subject: [PATCH 4/4] cleanup --- src/interface/INIT_load.F | 4 ++-- src/modules/mod_frequency.F | 11 +++++------ src/pol_function/X_dielectric_matrix.F | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/interface/INIT_load.F b/src/interface/INIT_load.F index 976a656d77..4deeb471f6 100644 --- a/src/interface/INIT_load.F +++ b/src/interface/INIT_load.F @@ -848,9 +848,9 @@ subroutine Xload(X,wv) des(2) ='Frequency sampling in the complex plane ("1l" one line, "2l" two lines)' des(3) ='Partition along the real axis ("ho" homogeneous, "lP" linear, "qP" quadratic, "cP" cubic)' des(4) ='Energy range' - if (X%whoami==5) then + if (X%whoami==5) then des(4) ='Energy range; if 0.0 | -1.0 | half the maximum e-h pair included in X is used' - endif + endif des(5) ='Imaginary range' des(6) ='Damping range' des(7) ='[o/o] Coarse grid controller' diff --git a/src/modules/mod_frequency.F b/src/modules/mod_frequency.F index f33da91d69..9ad2d918c3 100644 --- a/src/modules/mod_frequency.F +++ b/src/modules/mod_frequency.F @@ -68,7 +68,7 @@ end subroutine W_duplicate subroutine W_reset(W,damping,type) type(w_samp)::W real(SP), optional, intent(in) :: damping - integer, optional, intent(in) :: type + integer, optional, intent(in) :: type real :: local_damping local_damping=0.1_SP if(present(damping)) local_damping=damping @@ -78,14 +78,13 @@ subroutine W_reset(W,damping,type) ! if (present(type)) then select case (type) - ! - case(5) ! For MPA set default EnRngeXm to 2 Ha + ! For MPA set default EnRngeXm to 2 Ha + case(5) W%er=(/0._SP,2._SP/) - case default + case default W%er=(/0._SP,10._SP/)/HA2EV - ! end select - end if + endif ! W%ir=(/1._SP,1._SP/)!/HA2EV W%dr=(/local_damping,local_damping/)/HA2EV diff --git a/src/pol_function/X_dielectric_matrix.F b/src/pol_function/X_dielectric_matrix.F index 051ed2457d..7302e377f2 100644 --- a/src/pol_function/X_dielectric_matrix.F +++ b/src/pol_function/X_dielectric_matrix.F @@ -118,8 +118,8 @@ integer function X_dielectric_matrix(Xen,Xk,q,X,Xw,Dip,SILENT_MODE,CHILD) X_MEM_n_freqs =2*X%mpa_npoles ! if (Xw%er(2)<=Xw%er(1)) then - Xw%er(1) = 0.0_SP - Xw%er(2) = ( maxval(Xen%E(X%ib(2),:,:)) - minval(Xen%E(X%ib(1),:,:)) ) / 2.0_SP + Xw%er(1) = 0.0_SP + Xw%er(2) = ( maxval(Xen%E(X%ib(2),:,:)) - minval(Xen%E(X%ib(1),:,:)) ) / 2.0_SP endif ! X%ordering='t'