assert_shape Interface

public interface assert_shape

This interface provides methods to assert that the shape of its input vector or matrix is the expected shape. It throws an error if not.


Module Procedures

private subroutine assert_shape_vector_rsp(v, size, vecname, module, procedure)

Utility function to assert the shape of a vector.

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: v(:)

Vector whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of v.

character(len=*), intent(in) :: vecname

Name of the asserted vector.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_matrix_rsp(A, size, matname, module, procedure)

Utility function to assert the shape of a matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: A(:,:)

Matrix whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of A.

character(len=*), intent(in) :: matname

Name of the asserted matrix.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_vector_rdp(v, size, vecname, module, procedure)

Utility function to assert the shape of a vector.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: v(:)

Vector whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of v.

character(len=*), intent(in) :: vecname

Name of the asserted vector.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_matrix_rdp(A, size, matname, module, procedure)

Utility function to assert the shape of a matrix.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: A(:,:)

Matrix whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of A.

character(len=*), intent(in) :: matname

Name of the asserted matrix.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_vector_csp(v, size, vecname, module, procedure)

Utility function to assert the shape of a vector.

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: v(:)

Vector whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of v.

character(len=*), intent(in) :: vecname

Name of the asserted vector.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_matrix_csp(A, size, matname, module, procedure)

Utility function to assert the shape of a matrix.

Arguments

Type IntentOptional Attributes Name
complex(kind=sp), intent(in) :: A(:,:)

Matrix whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of A.

character(len=*), intent(in) :: matname

Name of the asserted matrix.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_vector_cdp(v, size, vecname, module, procedure)

Utility function to assert the shape of a vector.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: v(:)

Vector whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of v.

character(len=*), intent(in) :: vecname

Name of the asserted vector.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.

private subroutine assert_shape_matrix_cdp(A, size, matname, module, procedure)

Utility function to assert the shape of a matrix.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: A(:,:)

Matrix whose dimension need to be asserted.

integer, intent(in) :: size(:)

Expected dimensions of A.

character(len=*), intent(in) :: matname

Name of the asserted matrix.

character(len=*), intent(in) :: module

Name of the module where assertion is done.

character(len=*), intent(in) :: procedure

Name of the routine where assertion is done.