B.1.10 Error_Status Procedure

The main documentation of the Error_Status Procedure contains additional explanation of this code listing.

  function Error_Status (S) result(Error)

    ! Input variable.

    type(Status_type), intent(in) :: S  ! Status to be checked.

    ! Output variable.

    type(logical) :: Error              ! Error condition boolean.


    ! Verify requirements.

    VERIFY(Valid_State(S),1)   ! S is valid.

    ! Set error boolean.

    Error = status_flag(S%status)%severity == 'Error'

    ! Verify guarantees.

    ! Error should be what it was set to.
    VERIFY(Error .eqv. (status_flag(S%status)%severity == 'Error'),2)

  end function Error_Status

Michael L. Hall