Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(history_stack_t) | :: | this | ||||
type(vec4), | intent(in) | :: | val |
subroutine histpush_sub(this, val) class(history_stack_t) :: this type(vec4), intent(in) :: val type(vec4), allocatable :: tmp(:) if(.not. allocated(this%data) .or. size(this%data) == 0)then !allocate space if not yet allocated allocate(this%data(block_size)) elseif(this%size == size(this%data))then allocate(tmp(size(this%data) + block_size)) tmp(1:this%size) = this%data call move_alloc(tmp, this%data) end if this%size = this%size + 1 this%data(this%size) = val end subroutine histpush_sub