Changes the size of monitors arrays to add 1 element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(monitor_set), | intent(inout) | :: | this |
Set of monitor objects |
pure subroutine monitor_set_Expand(this) !> Changes the size of monitors arrays to add 1 element. implicit none class(monitor_set), intent(inout) :: this !! Set of monitor objects ! Work variables type(monitor_obj), & allocatable :: new(:) integer :: n if (.not.allocated(this%m)) then allocate(this%m(1)) else ! Create a larger array n=size(this%m) allocate(new(n+1)) ! Copy old entries new(1:n)=this%m(1:n) ! move allocation call move_alloc(new,this%m) end if return end subroutine monitor_set_Expand