B.1.18 Warning_Status Procedure

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

  function Warning_Status (S) result(Warning)

    ! Input variable.

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

    ! Output variable.

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

    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ! Verify requirements.

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

    ! Set warning boolean.

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

    ! Verify guarantees.

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

    return
  end function Warning_Status



Michael L. Hall