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/interface/INIT_load.F b/src/interface/INIT_load.F index c2fb198625..4deeb471f6 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' diff --git a/src/modules/mod_frequency.F b/src/modules/mod_frequency.F index ffae67f692..9ad2d918c3 100644 --- a/src/modules/mod_frequency.F +++ b/src/modules/mod_frequency.F @@ -65,15 +65,27 @@ 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) + ! For MPA set default EnRngeXm to 2 Ha + case(5) + W%er=(/0._SP,2._SP/) + case default + W%er=(/0._SP,10._SP/)/HA2EV + end select + endif + ! W%ir=(/1._SP,1._SP/)!/HA2EV W%dr=(/local_damping,local_damping/)/HA2EV W%damp_reference=0._SP diff --git a/src/pol_function/X_dielectric_matrix.F b/src/pol_function/X_dielectric_matrix.F index eab77a26a5..7302e377f2 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)