shared_ragged_array_bool_t Derived Type

type, public :: shared_ragged_array_bool_t

Shared memory 2-D array template with non-uniform 2nd dimension (“ragged”) of type bool


Contents


Components

Type Visibility Attributes Name Initial
type(shared_array_bool_t), private :: data_array
type(auxiliary_bool_t), private, allocatable :: ptr(:)
integer(kind=int64), private, allocatable :: store_sizes(:)

Type-Bound Procedures

generic, public, :: shared_alloc => shared_alloc_bool_int32

generic, public, :: sub => pos_1d_bool_int32, pos_2d_bool_int32

  • private function pos_1d_bool_int32(this, i) result(pt)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int32), intent(in) :: i

    Return Value logical, pointer, (:)

  • private function pos_2d_bool_int32(this, i, j) result(val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int32), intent(in) :: i
    integer(kind=int32), intent(in) :: j

    Return Value logical

generic, public, :: set_val => set_val_bool_int32

  • private subroutine set_val_bool_int32(this, i, j, val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int32), intent(in) :: i
    integer(kind=int32), intent(in) :: j
    logical, intent(in) :: val

procedure, public, :: shared_alloc_bool_int32

procedure, public, :: pos_1d_bool_int32

  • private function pos_1d_bool_int32(this, i) result(pt)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int32), intent(in) :: i

    Return Value logical, pointer, (:)

procedure, public, :: pos_2d_bool_int32

  • private function pos_2d_bool_int32(this, i, j) result(val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int32), intent(in) :: i
    integer(kind=int32), intent(in) :: j

    Return Value logical

procedure, public, :: set_val_bool_int32

  • private subroutine set_val_bool_int32(this, i, j, val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int32), intent(in) :: i
    integer(kind=int32), intent(in) :: j
    logical, intent(in) :: val

generic, public, :: shared_alloc => shared_alloc_bool_int64

generic, public, :: sub => pos_1d_bool_int64, pos_2d_bool_int64

  • private function pos_1d_bool_int64(this, i) result(pt)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: i

    Return Value logical, pointer, (:)

  • private function pos_2d_bool_int64(this, i, j) result(val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: i
    integer(kind=int64), intent(in) :: j

    Return Value logical

generic, public, :: set_val => set_val_bool_int64

  • private subroutine set_val_bool_int64(this, i, j, val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: i
    integer(kind=int64), intent(in) :: j
    logical, intent(in) :: val

procedure, public, :: shared_alloc_bool_int64

procedure, public, :: pos_1d_bool_int64

  • private function pos_1d_bool_int64(this, i) result(pt)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: i

    Return Value logical, pointer, (:)

procedure, public, :: pos_2d_bool_int64

  • private function pos_2d_bool_int64(this, i, j) result(val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: i
    integer(kind=int64), intent(in) :: j

    Return Value logical

procedure, public, :: set_val_bool_int64

  • private subroutine set_val_bool_int64(this, i, j, val)

    Arguments

    Type IntentOptional Attributes Name
    class(shared_ragged_array_bool_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: i
    integer(kind=int64), intent(in) :: j
    logical, intent(in) :: val

procedure, public, :: shared_dealloc => shared_dealloc_bool

procedure, public, :: sync => sync_bool

procedure, public, :: reassign_pointers => reassign_pointers_bool

Source Code

    type :: shared_ragged_array_bool_t
        private

        ! Actual shared resource
        type(shared_array_bool_t) :: data_array
        ! Indexing array to hold pointers to the sub-arrays
        type(auxiliary_bool_t), allocatable :: ptr(:)
        ! Sizes of the sub-arrays
        integer(int64), allocatable :: store_sizes(:)
    contains

        ! These functions work with different integer kinds as index values (index_types)

        ! Generic interfaces
        !
        generic :: shared_alloc => shared_alloc_bool_int32
        ! sub returns a pointer to a 1d subarray (sub1d) or a specific entry (sub2d)
        generic :: sub => pos_1d_bool_int32, pos_2d_bool_int32
        ! Set val sets a specific value of the array
        generic :: set_val => set_val_bool_int32

        ! Index kind-specific implementations
        procedure :: shared_alloc_bool_int32
        procedure :: pos_1d_bool_int32
        procedure :: pos_2d_bool_int32
        procedure :: set_val_bool_int32

        ! Generic interfaces
        !
        generic :: shared_alloc => shared_alloc_bool_int64
        ! sub returns a pointer to a 1d subarray (sub1d) or a specific entry (sub2d)
        generic :: sub => pos_1d_bool_int64, pos_2d_bool_int64
        ! Set val sets a specific value of the array
        generic :: set_val => set_val_bool_int64

        ! Index kind-specific implementations
        procedure :: shared_alloc_bool_int64
        procedure :: pos_1d_bool_int64
        procedure :: pos_2d_bool_int64
        procedure :: set_val_bool_int64
        procedure :: shared_dealloc => shared_dealloc_bool
        ! Sync synchronizes the content of the array within the inter-node communicator
        procedure :: sync => sync_bool
        ! For setting up the subarray pointers
        procedure :: reassign_pointers => reassign_pointers_bool
    end type shared_ragged_array_bool_t