Operational Diagnostics Reports
Resource Drift Report
Label Change
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.
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
baseline ← 100
8baseline = 1009current = 112values this step100baselinecurrent ← 112
8baseline = 1009current = 11210drift = current - baselinevalues this step112currentdrift ← 12
9current = 11210drift = current - baseline11if (drift >= 25) thenvalues this step12drift112current100baselineif (drift >= 25) then
10drift = current - baseline11if (drift >= 25) then12 status = 'high'values this step12driftelse if (drift >= 8) then
12 status = 'high'13else if (drift >= 8) then14 status = 'elevated'values this step12driftstatus ← elevated
13else if (drift >= 8) then14 status = 'elevated'15elsevalues this stepelevatedstatusprint '(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_demooutputcurrent=112 drift=12 elevatedvalues this step112current12driftelevatedstatus
baseline ← 100
8baseline = 1009current = 103values this step100baselinecurrent ← 103
8baseline = 1009current = 10310drift = current - baselinevalues this step103currentdrift ← 3
9current = 10310drift = current - baseline11if (drift >= 25) thenvalues this step3drift103current100baselineif (drift >= 25) then
10drift = current - baseline11if (drift >= 25) then12 status = 'high'values this step3driftelse if (drift >= 8) then
12 status = 'high'13else if (drift >= 8) then14 status = 'elevated'values this step3driftstatus ← normal
15else16 status = 'normal'17end ifvalues this stepnormalstatusprint '(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_demooutputcurrent=103 drift=3 normalvalues this step103current3driftnormalstatus
baseline ← 100
8baseline = 1009current = 130values this step100baselinecurrent ← 130
8baseline = 1009current = 13010drift = current - baselinevalues this step130currentdrift ← 30
9current = 13010drift = current - baseline11if (drift >= 25) thenvalues this step30drift130current100baselineif (drift >= 25) then
10drift = current - baseline11if (drift >= 25) then12 status = 'high'values this step30driftstatus ← high
11if (drift >= 25) then12 status = 'high'13else if (drift >= 8) thenvalues this stephighstatusprint '(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_demooutputcurrent=130 drift=30 highvalues 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.