The Elk Code
mixlinear.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2014 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 pure subroutine mixlinear(iscl,beta,n,nu,mu,d)
7 implicit none
8 ! arguments
9 integer, intent(in) :: iscl
10 real(8), intent(in) :: beta
11 integer, intent(in) :: n
12 real(8), intent(inout) :: nu(n),mu(n)
13 real(8), intent(out) :: d
14 ! local variables
15 integer i
16 real(8) t0,t1
17 if (n < 1) return
18 ! initialise mixer
19 if (iscl < 1) then
20  mu(1:n)=nu(1:n)
21  d=1.d0
22  return
23 end if
24 t0=1.d0-beta
25 d=0.d0
26 do i=1,n
27  t1=nu(i)-mu(i)
28  d=d+t1**2
29  nu(i)=beta*nu(i)+t0*mu(i)
30  mu(i)=nu(i)
31 end do
32 d=sqrt(d/dble(n))
33 end subroutine
34 
pure subroutine mixlinear(iscl, beta, n, nu, mu, d)
Definition: mixlinear.f90:7