@brief Set up the re-sizeable array (buffer) with a given start size and grow_factor.
@details Has to be called before first use and can be called any time.
if the capacity is not sufficient.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(buffer_int32_2D_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | rows |
Number of rows in the first dimension. |
||
| real, | intent(in), | optional | :: | grow_factor |
Factor about which to grow the buffer along the last dimension, |
|
| integer, | intent(in), | optional | :: | start_size |
Initial size of the buffer along the last dimension. |
pure subroutine init_int32_2D (this, rows, grow_factor, start_size) class(buffer_int32_2D_t), intent(inout) :: this integer, intent(in) :: rows real, optional, intent(in) :: grow_factor integer, optional, intent(in) :: start_size character(*), parameter :: this_routine = 'buffer::init' if (present(grow_factor)) this%grow_factor = grow_factor if (present(start_size)) this%start_size = start_size #ifdef DEBUG_ block use util_mod, only: stop_all if (.not. (this%grow_factor > 1.0_dp)) then call stop_all (this_routine, "Assert fail: this%grow_factor > 1.0_dp") end if end block #endif #ifdef DEBUG_ block use util_mod, only: stop_all if (.not. (this%start_size >= 0_int64)) then call stop_all (this_routine, "Assert fail: this%start_size >= 0_int64") end if end block #endif allocate(this%buf(rows, this%start_size)) this%pos = 0_int64 end subroutine init_int32_2D