This module defines the aggregator_t type and its extensions, which are
used to perform various types of time aggregations (e.g., mean, sum, min, max)
on source data arrays.
Aggregators are utilised by first initialising an aggregator via
new_aggregator which accepts as its argument a source data array to be
sampled. The source data array argument is then associated with a pointer
which is used to sample the source data array to compute the time aggregated
value. The source data array argument must be an allocated pointer or
allocatable array. The source data array argument is typically a CABLE working
variable whos memory remains allocated throughout the duration of the
simulation. Aggregator instances can be represented using a polymorphic
aggregator_t type or a concrete type corresponding to the data type and rank
of the source data array (e.g., aggregator_real32_2d_t for a 2D 32-bit real
source data array). For example:
real(kind=real32), dimension(:,:), allocatable :: source_data_array
class(aggregator_t), allocatable :: aggregator_polymorphic
type(aggregator_real32_2d_t) :: aggregator_concrete
allocate(source_data_array(42, 42))
aggregator_polymorphic = new_aggregator(source_data_array)
aggregator_concrete = new_aggregator(source_data_array)
Aggregator instances must then be initialised by calling their init
method, which will allocate the necessary memory for the aggregated data and
set the accumulation and reset methods according to the specified aggregation
method (e.g., mean, sum, min, max). For example:
call aggregator_polymorphic%init('mean')
call aggregator_concrete%init('sum')
Once initialised, the aggregator can be accumulated any number of times
throughout a simulation by calling its accumulate method, which will update
the aggregated data from the source data using the appropriate aggregation
method. Once the aggregator has accumulated enough values over the time
interval of interest, the aggregated data can then be accessed via the
aggregated_data component of the specific aggregator type (e.g.,
aggregator_real32_2d_t%aggregated_data). To reset the aggregator back to its
initial state for the next time interval, the reset method can be called,
which will reset the aggregator according to the specified aggregation method.
Resources allocated by the aggregator on initialisation will automatically be deallocated when the aggregator instance goes out of scope.
Factory interface for creating new aggregator instances. The specific type of aggregator created is determined by the type of the source data array provided.
Create a new 0D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 1D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | dimension(:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 2D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | dimension(:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 3D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | dimension(:,:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 0D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 1D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | dimension(:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 2D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | dimension(:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 3D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | dimension(:,:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 0D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 1D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 2D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 3D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:,:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Interfaces for the procedure pointers in the aggregator_t type to be
implemented by the specific aggregation methods (e.g., mean, sum, min, max).
Accumulate the aggregated data from the source data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
Interfaces for the procedure pointers in the aggregator_t type to be
implemented by the specific aggregation methods (e.g., mean, sum, min, max).
Reset the aggregated data to its initial state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this |
The aggregator_t type is an abstract base type for performing time
aggregations on source data arrays. Support for different data types and
array ranks is provided through extensions of this type.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
| procedure, private :: set_method => aggregator_set_method | Set the aggregation method. |
An aggregator for 0-dimensional (scalar) 32-bit integer data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| integer(kind=int32), | public, | allocatable | :: | aggregated_data | |||
| integer(kind=int32), | public, | pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 1-dimensional 32-bit integer data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| integer(kind=int32), | public, | dimension(:), allocatable | :: | aggregated_data | |||
| integer(kind=int32), | public, | dimension(:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 2-dimensional 32-bit integer data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| integer(kind=int32), | public, | dimension(:,:), allocatable | :: | aggregated_data | |||
| integer(kind=int32), | public, | dimension(:,:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 3-dimensional 32-bit integer data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| integer(kind=int32), | public, | dimension(:,:,:), allocatable | :: | aggregated_data | |||
| integer(kind=int32), | public, | dimension(:,:,:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 0-dimensional (scalar) 32-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | allocatable | :: | aggregated_data | |||
| real(kind=real32), | public, | pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 1-dimensional 32-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | dimension(:), allocatable | :: | aggregated_data | |||
| real(kind=real32), | public, | dimension(:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 2-dimensional 32-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | dimension(:,:), allocatable | :: | aggregated_data | |||
| real(kind=real32), | public, | dimension(:,:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 3-dimensional 32-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | dimension(:,:,:), allocatable | :: | aggregated_data | |||
| real(kind=real32), | public, | dimension(:,:,:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 0-dimensional (scalar) 64-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 1-dimensional 64-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | dimension(:), allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | dimension(:), allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | dimension(:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 2-dimensional 64-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | dimension(:,:), allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | dimension(:,:), allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | dimension(:,:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
An aggregator for 3-dimensional 64-bit real data.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | counter | = | 0 |
The number of times the source data has been accumulated. |
|
| procedure(accumulate_data), | public, | pointer | :: | accumulate |
A procedure pointer to the accumulation method used to compute the time
aggregated quantity. The specific method (e.g., mean, sum, min, max) is
set by the |
||
| procedure(reset_data), | public, | pointer | :: | reset |
A procedure pointer to the reset method used to reset the aggregated data. The
specific method (e.g., mean, sum, min, max) is set by the |
||
| real(kind=real32), | public, | dimension(:,:,:), allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | dimension(:,:,:), allocatable | :: | aggregated_data | |||
| real(kind=real64), | public, | dimension(:,:,:), pointer | :: | source_data | => | null() |
| procedure, public :: init => aggregator_init | Initialise the aggregator. |
| procedure, public :: type => aggregator_type | Return a string identifier of the aggregator type. |
| procedure, public :: rank => aggregator_rank | Return the rank of the aggregator. |
| procedure, public :: shape => aggregator_shape | Return the shape of the aggregator. |
| procedure, public :: scale => aggregator_scale | Scale the aggregated data by a specified factor. |
| procedure, public :: div => aggregator_div | Divide the aggregated data by a specified factor. |
| procedure, public :: offset => aggregator_offset | Add a specified offset to the aggregated data. |
Return a string identifier of the aggregator type (e.g., "int32", "real32", "real64").
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(in) | :: | this |
Return the rank of the aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(in) | :: | this |
Return the shape of the aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(in) | :: | this |
Create a new 0D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 1D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | dimension(:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 2D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | dimension(:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 3D integer aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(inout), | dimension(:,:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 0D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 1D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | dimension(:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 2D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | dimension(:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 3D 32-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(inout), | dimension(:,:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 0D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 1D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 2D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Create a new 3D 64-bit real aggregator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(inout), | dimension(:,:,:), target | :: | source_data |
The source data array to be sampled by the aggregator. |
Initialise the aggregator by allocating the aggregated data array and its aggregation method. The values in the aggregated data array are reset according to the specified aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | method |
The aggregation method to use (e.g., "mean", "sum", "point", "min", "max"). |
Set the aggregation method for the aggregator by assigning the appropriate accumulation and reset procedures based on the specified method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | method |
The aggregation method to use (e.g., "mean", "sum", "point", "min", "max"). |
Scale the aggregated data by a specified factor.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in) | :: | scale |
The factor by which to scale the aggregated data. |
Divide the aggregated data by a specified factor.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in) | :: | div |
The factor by which to divide the aggregated data. |
Offset the aggregated data by a specified value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in) | :: | offset |
The value by which to offset the aggregated data. |
Helper subroutine to get initialise optional scale, div, and offset arguments for accumulate procedures.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
|
| real | :: | scale_out | ||||
| real | :: | div_out | ||||
| real | :: | offset_out |
Accumulate the aggregated data from the source data using the mean aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
Accumulate the aggregated data from the source data using the sum aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
Accumulate the aggregated data from the source data using the point aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
Accumulate the aggregated data from the source data using the min aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
Accumulate the aggregated data from the source data using the max aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this | |||
| real, | intent(in), | optional | :: | scale |
An optional scaling factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | div |
An optional division factor to apply to the source data before accumulation. Defaults to 1.0 if not provided. |
|
| real, | intent(in), | optional | :: | offset |
An optional offset to add to the source data before accumulation. Defaults to 0.0 if not provided. |
Reset the aggregated data for the point aggregation method. This is a no-op since point aggregation always takes the value of the most recent data point.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this |
Reset the aggregated data for the min aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this |
Reset the aggregated data for the max aggregation method.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this |
Reset the aggregated data for aggregation methods other than point, min, and max.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aggregator_t), | intent(inout) | :: | this |