assertion_utility Module

Contains a toggleable assertion utility - based on Figure 10.8 of Scientific Software Design by Rouson et al.



Interfaces

public interface assert

  • public module subroutine assertSingle(assertion, error)

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: assertion
    character(len=*), intent(in), optional :: error
  • public module subroutine assertVector(assertion, error)

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in), dimension(:) :: assertion
    character(len=*), intent(in), optional :: error

public interface assertPure

  • public pure module subroutine assertPureSingle(assertion, error)

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: assertion
    character(len=*), intent(in), optional :: error
  • public pure module subroutine assertPureVector(assertion, error)

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in), dimension(:) :: assertion
    character(len=*), intent(in), optional :: error

Subroutines

public module subroutine assertSingle(assertion, error)

Checks whether assertion is .false. and stops the program excecution with error text

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: assertion
character(len=*), intent(in), optional :: error

public module subroutine assertVector(assertion, error)

Checks whether any assertion is .false. and stops the program excecution with error text

Arguments

Type IntentOptional Attributes Name
logical, intent(in), dimension(:) :: assertion
character(len=*), intent(in), optional :: error

public module subroutine assertIdentical(integers, error)

Checks all integers are identical and if not stops the program excecution with error text

Arguments

Type IntentOptional Attributes Name
integer, intent(in), dimension(:) :: integers
character(len=*), intent(in), optional :: error

public pure module subroutine assertPureVector(assertion, error)

Pure version of assertVector routine, does not write separately to std out

Arguments

Type IntentOptional Attributes Name
logical, intent(in), dimension(:) :: assertion
character(len=*), intent(in), optional :: error

public pure module subroutine assertPureSingle(assertion, error)

Pure version of assertSingle routine, does not write separately to std out

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: assertion
character(len=*), intent(in), optional :: error