flatten_array Module Function

pure module function flatten_array(this) result(output)

Flatten the array

Arguments

Type IntentOptional Attributes Name
class(array_type), intent(in) :: this

Instance of the array type

Return Value real(kind=real32), dimension(this%size)

Flattened array


Source Code

  pure module function flatten_array(this) result(output)
    !! Flatten the array
    implicit none

    ! Arguments
    class(array_type), intent(in) :: this
    !! Instance of the array type
    real(real32), dimension(this%size) :: output
    !! Flattened array

    output = reshape(this%val, [this%size])
  end function flatten_array