Commit 75d9cb3f authored by Nick R. Papior's avatar Nick R. Papior
Browse files

Small fixes in m_mixing according to lp:1611265

- Fixed OpenMP statement

- Fixed double naming of constants and routines

- Fixed history_init calls in transiesta
parent 63df7ad5
......@@ -1044,7 +1044,6 @@ contains
real(dp), pointer :: res(:), rres(:)
integer :: i, ns
integer :: rsave
real(dp) :: dnorm, dtmp
logical :: p_next, p_restart
......@@ -1806,16 +1805,16 @@ contains
select case ( mix%m )
case ( MIX_LINEAR )
call mix_linear()
call mixing_linear()
case ( MIX_PULAY )
call mix_pulay()
call mixing_pulay()
case ( MIX_BROYDEN )
call mix_broyden()
call mixing_broyden()
end select
contains
subroutine mix_linear()
subroutine mixing_linear()
integer :: i
real(dp) :: w
w = mix%w
......@@ -1829,9 +1828,9 @@ contains
end do
!$OMP end parallel do
end subroutine mix_linear
end subroutine mixing_linear
subroutine mix_pulay()
subroutine mixing_pulay()
integer :: ns, nh
integer :: i, j
logical :: lreturn
......@@ -1921,9 +1920,9 @@ contains
!$OMP end parallel
end subroutine mix_pulay
end subroutine mixing_pulay
subroutine mix_broyden()
subroutine mixing_broyden()
integer :: ns, nh
integer :: i, j
real(dp) :: G
......@@ -1993,7 +1992,7 @@ contains
!$OMP end parallel
end subroutine mix_broyden
end subroutine mixing_broyden
end subroutine mixing_calc_next
......@@ -2625,7 +2624,6 @@ contains
integer, intent(in) :: n
type(dData1D) :: dD1
integer :: in
if ( .not. stack_check(s_F,n) ) then
call die('mixing: history has changed size...')
......@@ -2801,7 +2799,7 @@ contains
norm = 0._dp
!$OMP parallel do default(shared), private(i) &
!$OMP& reduction(+,norm)
!$OMP& reduction(+:norm)
do i = 1 , n
norm = norm + x1(i) * x2(i)
end do
......
......@@ -372,7 +372,7 @@
use m_ts_options, only : ts_Dtol, ts_Htol
use siesta_options, only : dDtol, dHtol
use m_mixing, only: mixing_history_clear
use m_mixing, only: mixers_history_init
use m_mixing_scf, only: scf_mixs, scf_mix
#endif /* TRANSIESTA */
......@@ -575,13 +575,12 @@
! From now on, a new mixing cycle starts,
! Check in mixer.F for new mixing schemes.
! NP new mixing
if ( associated(ts_scf_mixs, target=scf_mixs) ) then
do i = 1 , size(scf_mix%stack)
call reset(scf_mix%stack(i), -ts_hist_keep)
end do
else
call mixing_history_clear(scf_mixs)
call mixers_history_init(scf_mixs)
end if
! Transfer scf_mixing to the transiesta mixing routine
scf_mix => ts_scf_mixs(1)
......
......@@ -315,9 +315,6 @@
if ( abs(Qcur - Qtot) > TS_RHOCORR_FERMI_TOLERANCE ) then
!call mixing_history_clear( scf_mixs )
!scf_mix => scf_mixs(1)
! Call transiesta with fermi-correct
call transiesta(iscf,nspin,
& block_dist, sparse_pattern, Gamma_Scf, ucell, nsc,
......@@ -556,9 +553,8 @@
use atomlist, only: lasto
use siesta_geom, only: nsc, isc_off, na_u, xa, ucell
use m_energies, only : Ef
! NP new mixing
use m_mixing_scf, only: scf_mixs, scf_mix
use m_mixing, only: mixing_history_clear
use m_mixing, only: mixers_history_init
use m_ts_global_vars, only: TSinit, TSrun
use m_ts_global_vars, only: ts_print_transiesta
......@@ -617,7 +613,7 @@
scf_mix%cur_itt = n_items(scf_mix%stack(iel))
end do
else
call mixing_history_clear(scf_mixs)
call mixers_history_init(scf_mixs)
end if
! Transfer scf_mixing to the transiesta mixing routine
scf_mix => ts_scf_mixs(1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment