expand_vector Interface

public interface expand_vector

Add elements to a vector in chunks.


Module Procedures

private subroutine item_expand_vector(vec, n, chunk_size, val, finished)

Arguments

Type IntentOptional Attributes Name
class(item), intent(inout), dimension(:), allocatable :: vec
integer, intent(inout) :: n

counter for last element added to vec. must be initialized to size(vec) (or 0 if not allocated) before first call

integer, intent(in) :: chunk_size

allocate vec in blocks of this size (>0)

class(item), intent(in), optional :: val

the value to add to vec

logical, intent(in), optional :: finished

set to true to return vec as its correct size (n)

private subroutine int32_expand_vector(vec, n, chunk_size, val, finished)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout), dimension(:), allocatable :: vec
integer, intent(inout) :: n

counter for last element added to vec. must be initialized to size(vec) (or 0 if not allocated) before first call

integer, intent(in) :: chunk_size

allocate vec in blocks of this size (>0)

integer(kind=int32), intent(in), optional :: val

the value to add to vec

logical, intent(in), optional :: finished

set to true to return vec as its correct size (n)

private subroutine int64_expand_vector(vec, n, chunk_size, val, finished)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout), dimension(:), allocatable :: vec
integer, intent(inout) :: n

counter for last element added to vec. must be initialized to size(vec) (or 0 if not allocated) before first call

integer, intent(in) :: chunk_size

allocate vec in blocks of this size (>0)

integer(kind=int64), intent(in), optional :: val

the value to add to vec

logical, intent(in), optional :: finished

set to true to return vec as its correct size (n)

private subroutine real64_expand_vector(vec, n, chunk_size, val, finished)

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), dimension(:), allocatable :: vec
integer, intent(inout) :: n

counter for last element added to vec. must be initialized to size(vec) (or 0 if not allocated) before first call

integer, intent(in) :: chunk_size

allocate vec in blocks of this size (>0)

real(kind=real64), intent(in), optional :: val

the value to add to vec

logical, intent(in), optional :: finished

set to true to return vec as its correct size (n)

private subroutine real32_expand_vector(vec, n, chunk_size, val, finished)

Arguments

Type IntentOptional Attributes Name
real(kind=real32), intent(inout), dimension(:), allocatable :: vec
integer, intent(inout) :: n

counter for last element added to vec. must be initialized to size(vec) (or 0 if not allocated) before first call

integer, intent(in) :: chunk_size

allocate vec in blocks of this size (>0)

real(kind=real32), intent(in), optional :: val

the value to add to vec

logical, intent(in), optional :: finished

set to true to return vec as its correct size (n)