Operational Reliability Reports
Capacity Margin Report
Label Reserve
Capacity reports often turn demand and capacity into a small reserve label that operators can scan quickly.
Program
Play the program to choose demand and inspect the reserve label.
capacity_margin_report.f90
Replay: real traced execution (multi-file project)
program capacity_margin_report_demo
implicit none
integer :: demand
integer :: capacity
integer :: reserve
character(len=8) :: status
demand = 72
capacity = 100
reserve = capacity - demand
if (reserve >= 25) then
status = 'stable'
else if (reserve >= 10) then
status = 'watch'
else
status = 'tight'
end if
print '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)
end program capacity_margin_report_demo
program capacity_margin_report_demo
implicit none
integer :: demand
integer :: capacity
integer :: reserve
character(len=8) :: status
demand = 88
capacity = 100
reserve = capacity - demand
if (reserve >= 25) then
status = 'stable'
else if (reserve >= 10) then
status = 'watch'
else
status = 'tight'
end if
print '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)
end program capacity_margin_report_demo
program capacity_margin_report_demo
implicit none
integer :: demand
integer :: capacity
integer :: reserve
character(len=8) :: status
demand = 95
capacity = 100
reserve = capacity - demand
if (reserve >= 25) then
status = 'stable'
else if (reserve >= 10) then
status = 'watch'
else
status = 'tight'
end if
print '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)
end program capacity_margin_report_demo
demand ← 72
8demand = 729capacity = 100values this step72demandcapacity ← 100
8demand = 729capacity = 10010reserve = capacity - demandvalues this step100capacityreserve ← 28
9capacity = 10010reserve = capacity - demand11if (reserve >= 25) thenvalues this step28reserve100capacity72demandif (reserve >= 25) then
10reserve = capacity - demand11if (reserve >= 25) then12 status = 'stable'values this step28reservestatus ← stable
11if (reserve >= 25) then12 status = 'stable'13else if (reserve >= 10) thenvalues this stepstablestatusprint '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)
17 end if18 print '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)19end program capacity_margin_report_demooutput72 28 stablevalues this step72demand28reservestablestatus
demand ← 88
8demand = 889capacity = 100values this step88demandcapacity ← 100
8demand = 889capacity = 10010reserve = capacity - demandvalues this step100capacityreserve ← 12
9capacity = 10010reserve = capacity - demand11if (reserve >= 25) thenvalues this step12reserve100capacity88demandif (reserve >= 25) then
10reserve = capacity - demand11if (reserve >= 25) then12 status = 'stable'values this step12reserveelse if (reserve >= 10) then
12 status = 'stable'13else if (reserve >= 10) then14 status = 'watch'values this step12reservestatus ← watch
13else if (reserve >= 10) then14 status = 'watch'15elsevalues this stepwatchstatusprint '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)
17 end if18 print '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)19end program capacity_margin_report_demooutput88 12 watchvalues this step88demand12reservewatchstatus
demand ← 95
8demand = 959capacity = 100values this step95demandcapacity ← 100
8demand = 959capacity = 10010reserve = capacity - demandvalues this step100capacityreserve ← 5
9capacity = 10010reserve = capacity - demand11if (reserve >= 25) thenvalues this step5reserve100capacity95demandif (reserve >= 25) then
10reserve = capacity - demand11if (reserve >= 25) then12 status = 'stable'values this step5reserveelse if (reserve >= 10) then
12 status = 'stable'13else if (reserve >= 10) then14 status = 'watch'values this step5reservestatus ← tight
15else16 status = 'tight'17end ifvalues this steptightstatusprint '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)
17 end if18 print '(I0, 1X, I0, 1X, A)', demand, reserve, trim(status)19end program capacity_margin_report_demooutput95 5 tightvalues this step95demand5reservetightstatus
reserve
`capacity - demand` creates the margin used by the rest of the report.
tiered labels
The `if`/`else if` chain maps reserve ranges to stable, watch, or tight.
operator output
The printed line keeps the raw demand and derived reserve visible.