Report Typos and Errors
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
data_structures
distribution_function
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
26
module
sll_m_scalar_field_initializers_base
27
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
28
#include "sll_working_precision.h"
29
30
implicit none
31
32
public
:: &
33
sll_p_cell_centered_field
, &
34
sll_p_node_centered_field
, &
35
sll_c_scalar_field_2d_initializer_base
, &
36
sll_c_scalar_field_4d_initializer_base
, &
37
sll_c_scalar_field_6d_initializer_base
38
39
private
40
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41
integer
,
parameter
::
sll_p_node_centered_field
= 0,
sll_p_cell_centered_field
= 1
42
43
! **************************************************************************
44
!
45
! 2D cases
46
!
47
! **************************************************************************
48
49
type
,
abstract
::
sll_c_scalar_field_2d_initializer_base
50
sll_int32 :: data_position
51
contains
52
procedure
(
scalar_field_2d_initializer
),
deferred
, pass :: f_of_x1x2
53
end type
sll_c_scalar_field_2d_initializer_base
54
55
abstract
interface
56
subroutine
scalar_field_2d_initializer
(init_obj, data_out)
57
use
sll_m_working_precision
58
import
sll_c_scalar_field_2d_initializer_base
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
70
type
,
abstract
::
sll_c_scalar_field_4d_initializer_base
71
sll_int32 :: data_position
72
contains
73
procedure
(
scalar_field_4d_initializer
),
deferred
, pass :: f_of_4args
74
end type
sll_c_scalar_field_4d_initializer_base
75
76
abstract
interface
77
subroutine
scalar_field_4d_initializer
(init_obj, data_out)
78
use
sll_m_working_precision
79
import
sll_c_scalar_field_4d_initializer_base
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
91
type
,
abstract
::
sll_c_scalar_field_6d_initializer_base
92
sll_int32 :: data_position
93
contains
94
procedure
(
scalar_field_6d_initializer
),
deferred
, pass :: f_of_6args
95
end type
sll_c_scalar_field_6d_initializer_base
96
97
abstract
interface
98
subroutine
scalar_field_6d_initializer
(init_obj, data_out)
99
use
sll_m_working_precision
100
import
sll_c_scalar_field_6d_initializer_base
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
106
end module
sll_m_scalar_field_initializers_base
sll_m_scalar_field_initializers_base::scalar_field_2d_initializer
Definition:
sll_m_scalar_field_initializers_base.F90:56
sll_m_scalar_field_initializers_base::scalar_field_4d_initializer
Definition:
sll_m_scalar_field_initializers_base.F90:77
sll_m_scalar_field_initializers_base::scalar_field_6d_initializer
Definition:
sll_m_scalar_field_initializers_base.F90:98
sll_m_scalar_field_initializers_base
Definition:
sll_m_scalar_field_initializers_base.F90:26
sll_m_scalar_field_initializers_base::sll_p_node_centered_field
integer, parameter, public sll_p_node_centered_field
Definition:
sll_m_scalar_field_initializers_base.F90:41
sll_m_scalar_field_initializers_base::sll_p_cell_centered_field
integer, parameter, public sll_p_cell_centered_field
Definition:
sll_m_scalar_field_initializers_base.F90:41
sll_m_working_precision
Module to select the kind parameter.
Definition:
sll_m_working_precision.F90:29
sll_m_scalar_field_initializers_base::sll_c_scalar_field_2d_initializer_base
Definition:
sll_m_scalar_field_initializers_base.F90:49
sll_m_scalar_field_initializers_base::sll_c_scalar_field_4d_initializer_base
Definition:
sll_m_scalar_field_initializers_base.F90:70
sll_m_scalar_field_initializers_base::sll_c_scalar_field_6d_initializer_base
Definition:
sll_m_scalar_field_initializers_base.F90:91
Report Typos and Errors
Generated on Mon Oct 23 2023 19:15:39 for Semi-Lagrangian Library by
1.9.1