Add frame to list(1:n) (growing the array).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(FramePointer), | intent(inout), | allocatable | :: | list(:) |
first n used (grown as needed) |
|
| integer, | intent(inout) | :: | n |
number of frames in list (incremented) |
||
| class(ReferenceFrame), | intent(in), | target | :: | frame |
the frame to add (not owned) |
subroutine append(list, n, frame) type(FramePointer), allocatable, intent(inout) :: list(:) !! first n used (grown as needed) integer, intent(inout) :: n !! number of frames in list (incremented) class(ReferenceFrame), intent(in), target :: frame !! the frame to add (not owned) type(FramePointer), allocatable :: tmp(:) if (.not. allocated(list)) allocate(list(4)) if (n == size(list)) then allocate(tmp(2 * n)) tmp(1:n) = list(1:n) call move_alloc(tmp, list) end if n = n + 1 list(n)%p => frame end subroutine append