ndarray_oc_build Subroutine

public subroutine ndarray_oc_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_oc_build~~CalledByGraph proc~ndarray_oc_build ndarray_oc_build proc~ndarray_oc_create_single ndarray_oc_create_single proc~ndarray_oc_create_single->proc~ndarray_oc_build

Contents

Source Code


Source Code

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

    select type (q)
    class is (ndarray_oc)
       allocate(q%shape(size(shape)))
       allocate(q%yflatarray(product(shape)))
       allocate(q%pflatarray(product(shape)))
       q%dim   = size(shape)
       q%shape = shape
    class default
        print *, "wrong class in ndarray_oc_build!"
        stop
    end select
  end subroutine ndarray_oc_build