ndarray_build Subroutine

public subroutine ndarray_build(q, shape)

Subroutine to allocate the array and set the size parameters

Arguments

Type IntentOptional AttributesName
class(pf_encap_t), intent(inout) :: q
integer, intent(in) :: shape(:)

Called by

proc~~ndarray_build~~CalledByGraph proc~ndarray_build ndarray_build proc~ndarray_create_single ndarray_create_single proc~ndarray_create_single->proc~ndarray_build

Contents

Source Code


Source Code

  subroutine ndarray_build(q, shape)
    class(pf_encap_t), intent(inout) :: q
    integer,           intent(in   ) :: shape(:)

    select type (q)
    class is (ndarray)
       allocate(q%shape(size(shape)))
       allocate(q%flatarray(product(shape)))
       q%dim   = size(shape)
       q%shape = shape
    end select
  end subroutine ndarray_build