Checks the current size of a Swiftest against the requested size and resizes it if it is too small.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(base_storage), | intent(inout) | :: | self | Storage object |
||
| integer(kind=I4B), | intent(in) | :: | n | New size |
subroutine base_util_setup_storage(self, n)
!! author: David A. Minton
!!
!! Checks the current size of a Swiftest against the requested size and resizes it if it is too small.
implicit none
! Arguments
class(base_storage), intent(inout) :: self
!! Storage object
integer(I4B), intent(in) :: n
!! New size
if (allocated(self%frame)) deallocate(self%frame)
allocate(self%frame(n))
self%nframes = n
return
end subroutine base_util_setup_storage