ndarray_oc_destroy_array Subroutine

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

Subroutine to destroy an array of arrays

Arguments

Type IntentOptional AttributesName
class(ndarray_oc_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

  subroutine ndarray_oc_destroy_array(this, x, n, level, shape)
    class(ndarray_oc_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_oc)
       do i = 1,n
          deallocate(x(i)%pflatarray)
          deallocate(x(i)%yflatarray)
          deallocate(x(i)%shape)
       end do
    class default
      stop "TYPE ERROR in ndarray_oc_destroy_array"
    end select
    deallocate(x)
  end subroutine ndarray_oc_destroy_array