Scientific tests usually compare real values with a tolerance instead of exact equality.

Program

Play the program to tighten or loosen the tolerance around the same measured value.

tolerance_check.f90
program tolerance_check_demo
    implicit none
    real :: expected
    real :: measured
    real :: tolerance
    real :: error
    logical :: passed
    character(len=5) :: status

    expected = 10.0
    measured = 9.98
    tolerance = 
    error = abs(measured - expected)
    passed = error <= tolerance
    if (passed) then
        status = 'pass'
    else
        status = 'fail'
    end if
    print '(A, 1X, F0.3)', trim(status), error
end program tolerance_check_demo
program tolerance_check_demo
    implicit none
    real :: expected
    real :: measured
    real :: tolerance
    real :: error
    logical :: passed
    character(len=5) :: status

    expected = 10.0
    measured = 9.98
    tolerance = 
    error = abs(measured - expected)
    passed = error <= tolerance
    if (passed) then
        status = 'pass'
    else
        status = 'fail'
    end if
    print '(A, 1X, F0.3)', trim(status), error
end program tolerance_check_demo
program tolerance_check_demo
    implicit none
    real :: expected
    real :: measured
    real :: tolerance
    real :: error
    logical :: passed
    character(len=5) :: status

    expected = 10.0
    measured = 9.98
    tolerance = 
    error = abs(measured - expected)
    passed = error <= tolerance
    if (passed) then
        status = 'pass'
    else
        status = 'fail'
    end if
    print '(A, 1X, F0.3)', trim(status), error
end program tolerance_check_demo
tolerance A tolerance defines how close a computed real value must be.
abs `abs(measured - expected)` turns signed difference into magnitude.
status label The trace carries a small pass/fail label instead of raising a runtime error.