base_util_setup_storage Subroutine

public subroutine base_util_setup_storage(self, n)

Checks the current size of a Swiftest against the requested size and resizes it if it is too small.

Type Bound

base_storage

Arguments

Type IntentOptional Attributes Name
class(base_storage), intent(inout) :: self

Storage object

integer(kind=I4B), intent(in) :: n

New size


Source Code

      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