ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
cubic_interp_1d.f90
Go to the documentation of this file.
1 subroutine cubic_interp_1d(x1, x1s, x2, x2s, s, x, xs)
2 !-----------------------------------------------------------------------
3 ! cubic hermite interpolation in one dimension
4 !-----------------------------------------------------------------------
5 
6  use itm_types
7 
8  implicit none
9 
10  real(r8), intent(in) :: x1, x1s, x2, x2s
11  real(r8), intent(in) :: s
12 
13  real(r8), intent(out) :: x, xs
14 
15  real(r8) :: h0m, h0p, h1m, h1p, h0ms, h0ps, h1ms, h1ps
16 
17  h0m = (s - 1._r8)**2 * (s + 2._r8) * 0.25_r8
18  h0ms = (s - 1._r8) * (s + 2._r8) / 2._r8 + (s - 1._r8)**2 &
19  * 0.25_r8
20  h0p = -(s + 1._r8)**2 * (s - 2._r8) * 0.25_r8
21  h0ps = -(s + 1._r8) * (s - 2._r8) / 2._r8 - (s + 1._r8)**2 &
22  * 0.25_r8
23  h1m = (s - 1._r8)**2 * (s + 1._r8) * 0.25_r8
24  h1ms = (s - 1._r8) * (s + 1._r8) / 2._r8 + (s - 1._r8)**2 &
25  * 0.25_r8
26  h1p = (s + 1._r8)**2 * (s - 1._r8) * 0.25_r8
27  h1ps = (s + 1._r8) * (s - 1._r8) / 2._r8 + (s + 1._r8)**2 &
28  * 0.25_r8
29 
30  x = x1 * h0m + x1s * h1m + x2 * h0p + x2s * h1p
31  xs = x1 * h0ms + x1s * h1ms + x2 * h0ps + x2s * h1ps
32 
33  return
34 end subroutine cubic_interp_1d
subroutine cubic_interp_1d(x1, x1s, x2, x2s, s, x, xs)