ndarray_destroy_array Subroutine

public subroutine ndarray_destroy_array(this, x, n, level, shape)

Subroutine to destroy an array of arrays

Arguments

Type IntentOptional AttributesName
class(ndarray_factory), intent(inout) :: this
class(pf_encap_t), intent(inout), allocatable:: x(:)
integer, intent(in) :: n
integer, intent(in) :: level
integer, intent(in) :: shape(:)

Contents

Source Code


Source Code

  subroutine ndarray_destroy_array(this, x, n, level,  shape)
    class(ndarray_factory), intent(inout)              :: this
    class(pf_encap_t),      intent(inout), allocatable :: x(:)
    integer,                intent(in   )              :: n, level, shape(:)
    integer                                            :: i

    select type(x)
    class is (ndarray)
       do i = 1,n
          deallocate(x(i)%shape)
          deallocate(x(i)%flatarray)
       end do
    end select
    deallocate(x)
  end subroutine ndarray_destroy_array