The Elk Code
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 
6 pure subroutine splined(n,wc,f,df)
7 implicit none
8 ! arguments
9 integer, intent(in) :: n
10 real(8), intent(in) :: wc(12,n),f(n)
11 real(8), intent(out) :: df(n)
12 ! local variables
13 integer i
14 real(8) f1,f2,f3,f4
15 f1=f(1); f2=f(2); f3=f(3); f4=f(4)
16 df(1)=wc(1,1)*f1+wc(2,1)*f2+wc(3,1)*f3+wc(4,1)*f4
17 df(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)
19 do 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
22 end do
23 i=n-1
24 df(i)=wc(1,i)*f1+wc(2,i)*f2+wc(3,i)*f3+wc(4,i)*f4
25 df(n)=wc(1,n)*f1+wc(2,n)*f2+wc(3,n)*f3+wc(4,n)*f4
26 end subroutine
27 
pure subroutine splined(n, wc, f, df)
Definition: splined.f90:7