ndarray_create_nocopy Interface

public interface ndarray_create_nocopy

Create a ndarray wrapper for a Fortran array. NO copy is made, changes to the Fortran array affect the ndarray and vice versa.

Only pass contiguous Fortran arrays to this function. This is not checked!

The lifetime of the Fortran array must be at least as long as the ndarray is in use: beware of deallocation and compiler generated temporary arrays.

Since the Fortran array is used as underlying buffer for the ndarray, it can be indirectly modified by changing the ndarray. To avoid bugs related to certain compiler optimizations, declare the Fortran array with the 'asynchronous' attribute.



Module Procedures

private function ndarray_create_nocopy_int32_1d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int32), intent(in), dimension(:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int64_1d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int64), intent(in), dimension(:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real32_1d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real32), intent(in), dimension(:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real64_1d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real64), intent(in), dimension(:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real32_1d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real32), intent(in), dimension(:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real64_1d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real64), intent(in), dimension(:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int32_2d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int32), intent(in), dimension(:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int64_2d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int64), intent(in), dimension(:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real32_2d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real32), intent(in), dimension(:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real64_2d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real64), intent(in), dimension(:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real32_2d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real32), intent(in), dimension(:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real64_2d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real64), intent(in), dimension(:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int32_3d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int32), intent(in), dimension(:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int64_3d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int64), intent(in), dimension(:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real32_3d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real32), intent(in), dimension(:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real64_3d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real64), intent(in), dimension(:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real32_3d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real32), intent(in), dimension(:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real64_3d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real64), intent(in), dimension(:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int32_4d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int32), intent(in), dimension(:,:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_int64_4d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

integer(kind=int64), intent(in), dimension(:,:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real32_4d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real32), intent(in), dimension(:,:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_real64_4d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

real(kind=real64), intent(in), dimension(:,:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real32_4d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real32), intent(in), dimension(:,:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success

private function ndarray_create_nocopy_complex_real64_4d(res, array) result(ierror)

Arguments

Type IntentOptional AttributesName
type(ndarray), intent(out) :: res

The resulting ndarray (in Fortran storage order).

complex(kind=real64), intent(in), dimension(:,:,:,:), target:: array

The Fortran array to wrap as ndarray. NO copy is made. Changes to the ndarray affect the Fortran array and vice versa. MUST be a contiguous array (this is not checked).

Return Value integer(kind=C_INT)

Error code, 0 on success