Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_interpolators_2d_base.F90
Go to the documentation of this file.
1 !**************************************************************
2 ! Copyright INRIA
3 ! Authors :
4 ! CALVI project team
5 !
6 ! This code SeLaLib (for Semi-Lagrangian-Library)
7 ! is a parallel library for simulating the plasma turbulence
8 ! in a tokamak.
9 !
10 ! This software is governed by the CeCILL-B license
11 ! under French law and abiding by the rules of distribution
12 ! of free software. You can use, modify and redistribute
13 ! the software under the terms of the CeCILL-B license as
14 ! circulated by CEA, CNRS and INRIA at the following URL
15 ! "http://www.cecill.info".
16 !**************************************************************
17 
26 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27 #include "sll_working_precision.h"
28 
29  implicit none
30 
31  public :: &
33 
34  private
35 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
36 
37  !*************************************************************************
38  !
39  ! 2D Interpolators
40  !
41  !*************************************************************************
42 
44  type, abstract :: sll_c_interpolator_2d
45 
46  contains
47 
49  deferred, pass(interpolator) :: interpolate_from_interpolant_value
50 
53  deferred, pass(interpolator) :: interpolate_from_interpolant_derivative_eta1
54 
57  deferred, pass(interpolator) :: interpolate_from_interpolant_derivative_eta2
58 
60  procedure(interpolate_2d_array), &
61  pass, deferred :: interpolate_array
62 
65  pass, deferred :: interpolate_array_disp
66 
69  pass, deferred :: set_coefficients
70 
73  pass, deferred :: coefficients_are_set
74 
76  procedure(compute_coeffs_2d), &
77  pass, deferred :: compute_interpolants
78 
80  procedure(get_coeffs_2d), &
81  pass, deferred :: get_coefficients
82 
84  procedure(delete_interpolator_2d), &
85  pass, deferred :: delete
86 
87  ! generic, public :: delete => del !operator(delete) => del!
88 
89  end type sll_c_interpolator_2d
90 
92  abstract interface
93  function interpolator_two_arg_msg(interpolator, eta1, eta2) result(val)
94 
97  sll_real64 :: val
98  class(sll_c_interpolator_2d), intent(in) :: interpolator
99  sll_real64, intent(in) :: eta1
100  sll_real64, intent(in) :: eta2
101 
102  end function interpolator_two_arg_msg
103 
104  end interface
105 
107  abstract interface
108 
109  subroutine interpolate_2d_array(this, &
110  num_points1, &
111  num_points2, &
112  data_in, &
113  eta1, &
114  eta2, &
115  data_out)
116 
118  import sll_c_interpolator_2d
119  class(sll_c_interpolator_2d), intent(inout) :: this
120  sll_int32, intent(in) :: num_points1
121  sll_int32, intent(in) :: num_points2
122  sll_real64, intent(in) :: data_in(:, :)
123  sll_real64, intent(in) :: eta1(:, :)
124  sll_real64, intent(in) :: eta2(:, :)
125  sll_real64, intent(out) :: data_out(num_points1, num_points2)
126 
127  end subroutine interpolate_2d_array
128 
129  end interface
130 
132  abstract interface
133 
134  subroutine interpolate_2d_array_disp(this, &
135  num_points1, &
136  num_points2, &
137  data_in, &
138  alpha1, &
139  alpha2, &
140  data_out)
141 
143  import sll_c_interpolator_2d
144  class(sll_c_interpolator_2d), intent(inout) :: this
145  sll_int32, intent(in) :: num_points1
146  sll_int32, intent(in) :: num_points2
147  sll_real64, intent(in) :: data_in(:, :)
148  sll_real64, intent(in) :: alpha1(:, :)
149  sll_real64, intent(in) :: alpha2(:, :)
150  sll_real64, intent(out) :: data_out(num_points1, num_points2)
151 
152  end subroutine interpolate_2d_array_disp
153 
154  end interface
155 
157  abstract interface
159  interpolator, &
160  coeffs_1d, &
161  coeffs_2d, &
162  coeff2d_size1, &
163  coeff2d_size2, &
164  knots1, &
165  size_knots1, &
166  knots2, &
167  size_knots2)
169  import sll_c_interpolator_2d
170  class(sll_c_interpolator_2d), intent(inout) :: interpolator
171  ! We allow the coefficients to be passed as 1d or 2d arrays. This allows
172  ! for more flexibility for the children classes.
173  sll_real64, dimension(:), intent(in), optional :: coeffs_1d
174  sll_real64, dimension(:, :), intent(in), optional :: coeffs_2d
175  ! size coeffs 2D
176  sll_int32, intent(in), optional :: coeff2d_size1
177  sll_int32, intent(in), optional :: coeff2d_size2
178  sll_real64, dimension(:), intent(in), optional :: knots1
179  sll_real64, dimension(:), intent(in), optional :: knots2
180  sll_int32, intent(in), optional :: size_knots1
181  sll_int32, intent(in), optional :: size_knots2
182  end subroutine interpolator_2d_set_coeffs
183  end interface
184 
186  abstract interface
187  function interpolator_2d_logical_query(interpolator) result(res)
188  import sll_c_interpolator_2d
189  class(sll_c_interpolator_2d), intent(in) :: interpolator
190  logical :: res
191  end function interpolator_2d_logical_query
192  end interface
193 
195  abstract interface
196  subroutine compute_coeffs_2d(interpolator, &
197  data_array, &
198  eta1_coords, &
199  size_eta1_coords, &
200  eta2_coords, &
201  size_eta2_coords)
203  import sll_c_interpolator_2d
204  class(sll_c_interpolator_2d), intent(inout) :: interpolator
205  sll_real64, dimension(:, :), intent(in) :: data_array
206  sll_real64, dimension(:), intent(in), optional :: eta1_coords
207  sll_real64, dimension(:), intent(in), optional :: eta2_coords
208  sll_int32, intent(in), optional :: size_eta1_coords
209  sll_int32, intent(in), optional :: size_eta2_coords
210  end subroutine compute_coeffs_2d
211  end interface
212 
214  abstract interface
215  function get_coeffs_2d(interpolator)
217  import sll_c_interpolator_2d
218  class(sll_c_interpolator_2d), intent(in) :: interpolator
219  sll_real64, dimension(:, :), pointer :: get_coeffs_2d
220  end function get_coeffs_2d
221  end interface
222 
224  abstract interface
225  subroutine delete_interpolator_2d(interpolator)
226  import sll_c_interpolator_2d
227  class(sll_c_interpolator_2d), intent(inout) :: interpolator
228  end subroutine delete_interpolator_2d
229  end interface
230 
Signature of compute_interpolants (Compute splines coefficients)
Signature of delete (Deallocate the interpolator object)
Signature of get_coefficients (Get splines coefficients)
Signature of coefficients_are_set (Check interpolator is computed)
Signature of set_coefficients (Set the splines coefficients)
Signature of interpolate_from_interpolant_value.
abstract data type for 2d interpolation
Module to select the kind parameter.
Base class/basic interface for 2D interpolators.
    Report Typos and Errors