A quality flag can combine several validation checks into one report decision.

Program

Play the program to choose how many warnings are tolerated before the report changes state.

tolerance
quality_flag_summary.f90
Replay: real traced execution (multi-file project)
program quality_flag_summary_demo
    implicit none
    integer :: warning_count
    integer :: missing_count
    integer :: tolerance
    logical :: report_ok
    character(len=8) :: status

    warning_count = 2
    missing_count = 1
    tolerance = 3
    report_ok = warning_count + missing_count <= tolerance
    if (report_ok) then
        status = 'accept'
    else
        status = 'review'
    end if
    print '(A, 1X, I0)', trim(status), warning_count + missing_count
end program quality_flag_summary_demo
program quality_flag_summary_demo
    implicit none
    integer :: warning_count
    integer :: missing_count
    integer :: tolerance
    logical :: report_ok
    character(len=8) :: status

    warning_count = 2
    missing_count = 1
    tolerance = 1
    report_ok = warning_count + missing_count <= tolerance
    if (report_ok) then
        status = 'accept'
    else
        status = 'review'
    end if
    print '(A, 1X, I0)', trim(status), warning_count + missing_count
end program quality_flag_summary_demo
program quality_flag_summary_demo
    implicit none
    integer :: warning_count
    integer :: missing_count
    integer :: tolerance
    logical :: report_ok
    character(len=8) :: status

    warning_count = 2
    missing_count = 1
    tolerance = 4
    report_ok = warning_count + missing_count <= tolerance
    if (report_ok) then
        status = 'accept'
    else
        status = 'review'
    end if
    print '(A, 1X, I0)', trim(status), warning_count + missing_count
end program quality_flag_summary_demo
  1. warning_count ← 2

    9warning_count = 210missing_count = 1
    values this step2warning_count
  2. missing_count ← 1

    9warning_count = 210missing_count = 111tolerance = 3
    values this step1missing_count
  3. tolerance ← 3

    10missing_count = 111tolerance = 312report_ok = warning_count + missing_count <= tolerance
    values this step3tolerance
  4. report_ok ← .true.

    11tolerance = 312report_ok = warning_count + missing_count <= tolerance13if (report_ok) then
    values this step.true.report_ok2warning_count1missing_count3tolerance
  5. status ← accept

    13if (report_ok) then14    status = 'accept'15else
    values this stepacceptstatus
  6. print '(A, 1X, I0)', trim(status), warning_count + missing_count

    17    end if18    print '(A, 1X, I0)', trim(status), warning_count + missing_count19end program quality_flag_summary_demo
    outputaccept 3
    values this stepacceptstatus3total_flags
  1. warning_count ← 2

    9warning_count = 210missing_count = 1
    values this step2warning_count
  2. missing_count ← 1

    9warning_count = 210missing_count = 111tolerance = 1
    values this step1missing_count
  3. tolerance ← 1

    10missing_count = 111tolerance = 112report_ok = warning_count + missing_count <= tolerance
    values this step1tolerance
  4. report_ok ← .false.

    11tolerance = 112report_ok = warning_count + missing_count <= tolerance13if (report_ok) then
    values this step.false.report_ok2warning_count1missing_count1tolerance
  5. status ← review

    15else16    status = 'review'17end if
    values this stepreviewstatus
  6. print '(A, 1X, I0)', trim(status), warning_count + missing_count

    17    end if18    print '(A, 1X, I0)', trim(status), warning_count + missing_count19end program quality_flag_summary_demo
    outputreview 3
    values this stepreviewstatus3total_flags
  1. warning_count ← 2

    9warning_count = 210missing_count = 1
    values this step2warning_count
  2. missing_count ← 1

    9warning_count = 210missing_count = 111tolerance = 4
    values this step1missing_count
  3. tolerance ← 4

    10missing_count = 111tolerance = 412report_ok = warning_count + missing_count <= tolerance
    values this step4tolerance
  4. report_ok ← .true.

    11tolerance = 412report_ok = warning_count + missing_count <= tolerance13if (report_ok) then
    values this step.true.report_ok2warning_count1missing_count4tolerance
  5. status ← accept

    13if (report_ok) then14    status = 'accept'15else
    values this stepacceptstatus
  6. print '(A, 1X, I0)', trim(status), warning_count + missing_count

    17    end if18    print '(A, 1X, I0)', trim(status), warning_count + missing_count19end program quality_flag_summary_demo
    outputaccept 3
    values this stepacceptstatus3total_flags
flag total Multiple validation counts can be combined into one total.
gate `report_ok` records whether the report should continue.
status A short label makes the validation decision visible in the trace.