The Elk Code
 
Loading...
Searching...
No Matches
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
6pure subroutine mixlinear(iscl,beta,n,nu,mu,d)
7implicit none
8! arguments
9integer, intent(in) :: iscl
10real(8), intent(in) :: beta
11integer, intent(in) :: n
12real(8), intent(inout) :: nu(n),mu(n)
13real(8), intent(out) :: d
14! local variables
15integer i
16real(8) t0,t1
17if (n < 1) return
18! initialise mixer
19if (iscl < 1) then
20 mu(1:n)=nu(1:n)
21 d=1.d0
22 return
23end if
24t0=1.d0-beta
25d=0.d0
26do 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)
31end do
32d=sqrt(d/dble(n))
33end subroutine
34
pure subroutine mixlinear(iscl, beta, n, nu, mu, d)
Definition mixlinear.f90:7