A resource diagnostic report can compare a current reading with a baseline and label the drift for review.

Program

Play the program to choose a current reading and inspect the drift label.

current
resource_drift_report.f90
Replay: real traced execution (multi-file project)
program resource_drift_report_demo
    implicit none
    integer :: baseline
    integer :: current
    integer :: drift
    character(len=8) :: status

    baseline = 100
    current = 112
    drift = current - baseline
    if (drift >= 25) then
        status = 'high'
    else if (drift >= 8) then
        status = 'elevated'
    else
        status = 'normal'
    end if
    print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drift, trim(status)
end program resource_drift_report_demo
program resource_drift_report_demo
    implicit none
    integer :: baseline
    integer :: current
    integer :: drift
    character(len=8) :: status

    baseline = 100
    current = 103
    drift = current - baseline
    if (drift >= 25) then
        status = 'high'
    else if (drift >= 8) then
        status = 'elevated'
    else
        status = 'normal'
    end if
    print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drift, trim(status)
end program resource_drift_report_demo
program resource_drift_report_demo
    implicit none
    integer :: baseline
    integer :: current
    integer :: drift
    character(len=8) :: status

    baseline = 100
    current = 130
    drift = current - baseline
    if (drift >= 25) then
        status = 'high'
    else if (drift >= 8) then
        status = 'elevated'
    else
        status = 'normal'
    end if
    print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drift, trim(status)
end program resource_drift_report_demo
  1. baseline ← 100

    8baseline = 1009current = 112
    values this step100baseline
  2. current ← 112

    8baseline = 1009current = 11210drift = current - baseline
    values this step112current
  3. drift ← 12

    9current = 11210drift = current - baseline11if (drift >= 25) then
    values this step12drift112current100baseline
  4. if (drift >= 25) then

    10drift = current - baseline11if (drift >= 25) then12    status = 'high'
    values this step12drift
  5. else if (drift >= 8) then

    12    status = 'high'13else if (drift >= 8) then14    status = 'elevated'
    values this step12drift
  6. status ← elevated

    13else if (drift >= 8) then14    status = 'elevated'15else
    values this stepelevatedstatus
  7. print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drif…

    17    end if18    print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drift, trim(status)19end program resource_drift_report_demo
    outputcurrent=112 drift=12 elevated
    values this step112current12driftelevatedstatus
  1. baseline ← 100

    8baseline = 1009current = 103
    values this step100baseline
  2. current ← 103

    8baseline = 1009current = 10310drift = current - baseline
    values this step103current
  3. drift ← 3

    9current = 10310drift = current - baseline11if (drift >= 25) then
    values this step3drift103current100baseline
  4. if (drift >= 25) then

    10drift = current - baseline11if (drift >= 25) then12    status = 'high'
    values this step3drift
  5. else if (drift >= 8) then

    12    status = 'high'13else if (drift >= 8) then14    status = 'elevated'
    values this step3drift
  6. status ← normal

    15else16    status = 'normal'17end if
    values this stepnormalstatus
  7. print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drif…

    17    end if18    print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drift, trim(status)19end program resource_drift_report_demo
    outputcurrent=103 drift=3 normal
    values this step103current3driftnormalstatus
  1. baseline ← 100

    8baseline = 1009current = 130
    values this step100baseline
  2. current ← 130

    8baseline = 1009current = 13010drift = current - baseline
    values this step130current
  3. drift ← 30

    9current = 13010drift = current - baseline11if (drift >= 25) then
    values this step30drift130current100baseline
  4. if (drift >= 25) then

    10drift = current - baseline11if (drift >= 25) then12    status = 'high'
    values this step30drift
  5. status ← high

    11if (drift >= 25) then12    status = 'high'13else if (drift >= 8) then
    values this stephighstatus
  6. print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drif…

    17    end if18    print '(A, I0, 1X, A, I0, 1X, A)', 'current=', current, 'drift=', drift, trim(status)19end program resource_drift_report_demo
    outputcurrent=130 drift=30 high
    values this step130current30drifthighstatus
baseline The baseline is fixed so the diagnostic is deterministic and replay-friendly.
drift `current - baseline` produces the scalar signal that drives the label.
diagnostic row The print line exposes the reading, derived drift, and status.