grow_fb Subroutine

private subroutine grow_fb(fb, zcap)

Double cell capacity of field accumulation buffer, keeping contents.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), allocatable :: fb(:,:)

Value of each field (rows) and cell (columns).

integer(kind=int32), intent(inout) :: zcap

Cell capacity, doubled.


Source Code

   subroutine grow_fb(fb, zcap)
      !! Double cell capacity of field accumulation buffer, keeping contents.
      ! Arguments
      real(real64), allocatable, intent(inout) :: fb(:, :)
         !! Value of each field (rows) and cell (columns).
      integer(int32), intent(inout) :: zcap
         !! Cell capacity, doubled.
      real(real64), allocatable :: t(:, :)
      integer(int32) :: old
      old = zcap
      zcap = zcap*2
      allocate (t(size(fb, 1), zcap))
      t(:, 1:old) = fb
      call move_alloc(t, fb)
   end subroutine grow_fb