The Elk Code
 
Loading...
Searching...
No Matches
splined.f90
Go to the documentation of this file.
1
2! Copyright (C) 2019 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 splined(n,wc,f,df)
7implicit none
8! arguments
9integer, intent(in) :: n
10real(8), intent(in) :: wc(12,n),f(n)
11real(8), intent(out) :: df(n)
12! local variables
13integer i
14real(8) f1,f2,f3,f4
15f1=f(1); f2=f(2); f3=f(3); f4=f(4)
16df(1)=wc(1,1)*f1+wc(2,1)*f2+wc(3,1)*f3+wc(4,1)*f4
17df(2)=wc(1,2)*f1+wc(2,2)*f2+wc(3,2)*f3+wc(4,2)*f4
18!$OMP SIMD LASTPRIVATE(f1,f2,f3,f4) SIMDLEN(8)
19do i=3,n-2
20 f1=f(i-1); f2=f(i); f3=f(i+1); f4=f(i+2)
21 df(i)=wc(1,i)*f1+wc(2,i)*f2+wc(3,i)*f3+wc(4,i)*f4
22end do
23i=n-1
24df(i)=wc(1,i)*f1+wc(2,i)*f2+wc(3,i)*f3+wc(4,i)*f4
25df(n)=wc(1,n)*f1+wc(2,n)*f2+wc(3,n)*f3+wc(4,n)*f4
26end subroutine
27
pure subroutine splined(n, wc, f, df)
Definition splined.f90:7