Resizes array to accomodate a new element.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bc_set), | intent(inout) | :: | this |
Boundary conditions utility |
pure subroutine bc_set_Expand(this) !> Resizes array to accomodate a new element. class(bc_set), intent(inout) :: this !! Boundary conditions utility ! Work bariables type(region_obj), allocatable :: tmp_array(:) if (.not.allocated(this%region)) then allocate(this%region(1)) this%count = 1 else ! New size this%count = size(this%region)+1 ! Allocate temporary array allocate(tmp_array(this%count)) ! Store old values tmp_array(1:this%count-1) = this%region(:) ! Move the allocation from the ! temporary array to the final one call move_alloc(tmp_array,this%region) end if return end subroutine bc_set_Expand