Append points b to a (allocatable, (3, n)).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout), | allocatable | :: | a(:,:) |
(3, n) points (unallocated: none) |
|
| real(kind=wp), | intent(in) | :: | b(:,:) |
(3, m) points to append |
pure subroutine append(a, b) real(wp), allocatable, intent(inout) :: a(:,:) !! (3, n) points (unallocated: none) real(wp), intent(in) :: b(:,:) !! (3, m) points to append real(wp), allocatable :: tmp(:,:) if (.not. allocated(a)) allocate(a(3, 0)) allocate(tmp(3, size(a, 2) + size(b, 2))) tmp(:, 1:size(a, 2)) = a tmp(:, size(a, 2)+1:) = b call move_alloc(tmp, a) end subroutine append