private subroutine shared_alloc_int32_int64(this, sizes)
Type Bound
shared_ragged_array_int32_t
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
class(shared_ragged_array_int32_t),
|
intent(inout) |
|
|
:: |
this |
|
integer(kind=int64),
|
intent(in) |
|
|
:: |
sizes(:) |
|
Source Code
subroutine shared_alloc_int32_int64(this, sizes)
class(shared_ragged_array_int32_t), intent(inout) :: this
integer(int64), intent(in) :: sizes(:)
integer(int64) :: n_entries
! Allocate the shared resource
call this%data_array%shared_alloc(int(sum(sizes), int64))
! Assign the pointers
n_entries = size(sizes, kind=int64)
allocate(this%ptr(n_entries))
! Keep a local copy of sizes (fortran 2003 automatic allocation)
allocate(this%store_sizes(n_entries))
this%store_sizes(1:n_entries) = int(sizes(1:n_entries), int64)
! Set the internal pointers
call this%reassign_pointers()
end subroutine shared_alloc_int32_int64