Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_interpolators_1d_base.F90
Go to the documentation of this file.
1 
9 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10 #include "sll_working_precision.h"
11 
12  implicit none
13 
14  public :: &
16 
17  private
18 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 
21  type, abstract :: sll_c_interpolator_1d
22 
23  contains
24 
25  ! Procedure with precomputation of interpolant(s)
27  procedure(interpolator_1d_interpolant), deferred :: &
28  compute_interpolants
30  procedure(interpolator_1d_set_coeffs), deferred :: &
31  set_coefficients
33  procedure(interpolator_1d_get_coeffs), deferred :: &
34  get_coefficients
36  procedure(interpolator_one_arg_sub), deferred :: &
37  interpolate_from_interpolant_value
39  procedure(interpolator_one_arg_sub), deferred :: &
40  interpolate_from_interpolant_derivative_eta1
42  procedure(interpolator_1d_array_interpolant), deferred :: &
43  interpolate_from_interpolant_array
44 
45  ! Procedures including whole interpolation process
47  procedure(interpolator_1d_array), deferred :: &
48  interpolate_array
50  procedure(interpolator_1d_array_disp), deferred :: &
51  interpolate_array_disp
53  procedure(interpolator_1d_array_disp_inplace), deferred :: &
54  interpolate_array_disp_inplace
55 
56  end type sll_c_interpolator_1d
57 
59  abstract interface
61  interpolator, data_array, &
62  eta_coords, &
63  size_eta_coords)
65  import :: sll_c_interpolator_1d
66  class(sll_c_interpolator_1d), intent(inout) :: interpolator
67  sll_real64, intent(in) :: data_array(:)
68  sll_real64, intent(in), optional :: eta_coords(:)
69  sll_int32, intent(in), optional :: size_eta_coords
70  end subroutine interpolator_1d_interpolant
71  end interface
72 
74  abstract interface
75  function interpolator_1d_get_coeffs(interpolator)
77  import :: sll_c_interpolator_1d
78  class(sll_c_interpolator_1d), intent(in) :: interpolator
79  sll_real64, dimension(:), pointer :: interpolator_1d_get_coeffs
80  end function interpolator_1d_get_coeffs
81  end interface
82 
84  abstract interface
85  subroutine interpolator_1d_set_coeffs(interpolator, coeffs)
87  import :: sll_c_interpolator_1d
88  class(sll_c_interpolator_1d), intent(inout) :: interpolator
89  ! We allow the coefficients to be passed as 1d or 2d arrays. This allows
90  ! for more flexibility for the children classes.
91  sll_real64, dimension(:), intent(in), optional :: coeffs
92  end subroutine interpolator_1d_set_coeffs
93  end interface
94 
96  abstract interface
97  function interpolator_one_arg_sub(interpolator, eta1) result(val)
99  import :: sll_c_interpolator_1d
100  sll_real64 :: val
101  class(sll_c_interpolator_1d), intent(in) :: interpolator
102  sll_real64, intent(in) :: eta1
103  end function interpolator_one_arg_sub
104  end interface
105 
107  abstract interface
109  interpolator, &
110  num_pts, &
111  vals_to_interpolate, &
112  output_array)
113 
115  import :: sll_c_interpolator_1d
116  class(sll_c_interpolator_1d), intent(inout) :: interpolator
117  sll_int32, intent(in) :: num_pts
118  sll_real64, intent(in) :: vals_to_interpolate(num_pts)
119  sll_real64, intent(out):: output_array(num_pts)
120  end subroutine interpolator_1d_array_interpolant
121  end interface
122 
124  abstract interface
125  subroutine interpolator_1d_array(this, num_pts, data, coordinates, output_array)
127  import :: sll_c_interpolator_1d
128  class(sll_c_interpolator_1d), intent(inout) :: this
129  sll_int32, intent(in) :: num_pts
130  sll_real64, intent(in) :: data(:)
131  sll_real64, intent(in) :: coordinates(num_pts)
132  sll_real64, intent(out) :: output_array(num_pts)
133  end subroutine interpolator_1d_array
134  end interface
135 
137  abstract interface
139  this, &
140  num_pts, &
141  data, &
142  alpha, &
143  output_array)
144 
146  import :: sll_c_interpolator_1d
147  class(sll_c_interpolator_1d), intent(inout) :: this
148  sll_int32, intent(in) :: num_pts
149  sll_real64, intent(in) :: data(:)
150  sll_real64, intent(in) :: alpha
151  sll_real64, intent(out) :: output_array(num_pts)
152 
153  end subroutine interpolator_1d_array_disp
154  end interface
155 
157  abstract interface
159  this, &
160  num_pts, &
161  data, &
162  alpha)
163 
165  import :: sll_c_interpolator_1d
166  class(sll_c_interpolator_1d), intent(inout) :: this
167  sll_int32, intent(in) :: num_pts
168  sll_real64, intent(inout) :: data(num_pts)
169  sll_real64, intent(in) :: alpha
170 
172  end interface
173 
Signature of interpolate_from_interpolant_value and interpolate_from_interpolant_derivative_eta1.
Module for 1D interpolation and reconstruction.
Module to select the kind parameter.
Abstract class for 1D interpolation and reconstruction.
    Report Typos and Errors