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
program capacity_margin_report_demo
    implicit none
    integer :: demand
    integer :: capacity
    integer :: reserve
    character(len=8) :: status

    demand = 
    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 = 
    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 = 
    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
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.