Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_scalar_field_initializers_base.F90
Go to the documentation of this file.
1 ! Essentially, the 'initializer' has a single objective which is to provide
2 ! a uniform interface to a function of a given number of arguments (i.e.:
3 ! 4, for the 4D case). The object itself encapsulates any parameters that the
4 ! function might need. There is a choice to make. Either:
5 !
6 ! 1. The object is limited to encapsulating the function parameters. Thus
7 ! the caller needs to define the loops and thus to find out the index
8 ! limits to carry out the initialization of the data array. Or,
9 !
10 ! 2. the object also encapsulates information about the extent of the data
11 ! array to initialize. In the case of sequential initializers, this usually
12 ! means that the object must contain a reference to the underlying mesh.
13 ! In parallel cases, a reference to a layout object.
14 !
15 ! The choice here has been the second option, to reduce the amount of work
16 ! that the caller has to do. Hence the 'initializer' serves as the uniform
17 ! interface to a simple function and has knowledge of the domain of
18 ! definition (mesh or layout).
19 !
20 ! As mentioned above, whether sequential or parallel, initializers have
21 ! the same interface. The only difference among them being the dimensionality
22 ! of the data to be initialized. It is for this reason that we include all
23 ! the abstract types in the same file (this one).
24 
27 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28 #include "sll_working_precision.h"
29 
30  implicit none
31 
32  public :: &
38 
39  private
40 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
42 
43  ! **************************************************************************
44  !
45  ! 2D cases
46  !
47  ! **************************************************************************
48 
50  sll_int32 :: data_position
51  contains
52  procedure(scalar_field_2d_initializer), deferred, pass :: f_of_x1x2
54 
55  abstract interface
56  subroutine scalar_field_2d_initializer(init_obj, data_out)
59  class(sll_c_scalar_field_2d_initializer_base), intent(inout) :: init_obj
60  sll_real64, dimension(:, :), intent(out) :: data_out
61  end subroutine scalar_field_2d_initializer
62  end interface
63 
64  ! **************************************************************************
65  !
66  ! 4D cases
67  !
68  ! **************************************************************************
69 
71  sll_int32 :: data_position
72  contains
73  procedure(scalar_field_4d_initializer), deferred, pass :: f_of_4args
75 
76  abstract interface
77  subroutine scalar_field_4d_initializer(init_obj, data_out)
80  class(sll_c_scalar_field_4d_initializer_base), intent(inout) :: init_obj
81  sll_real64, dimension(:, :, :, :), intent(out) :: data_out
82  end subroutine scalar_field_4d_initializer
83  end interface
84 
85  ! **************************************************************************
86  !
87  ! 6D cases
88  !
89  ! **************************************************************************
90 
92  sll_int32 :: data_position
93  contains
94  procedure(scalar_field_6d_initializer), deferred, pass :: f_of_6args
96 
97  abstract interface
98  subroutine scalar_field_6d_initializer(init_obj, data_out)
101  class(sll_c_scalar_field_6d_initializer_base), intent(inout) :: init_obj
102  sll_real64, dimension(:, :, :, :, :, :), intent(out) :: data_out
103  end subroutine scalar_field_6d_initializer
104  end interface
105 
Module to select the kind parameter.
    Report Typos and Errors