Workflow Composition
Accepted Delay Workflow
Loop and Accumulate
A workflow can scan repeated inputs, accept the values within a limit, and accumulate a summary.
Program
Play the program to choose a delay limit and watch the loop update the accepted count and total.
accepted_delay_workflow.f90
program accepted_delay_workflow_demo
implicit none
integer :: delays(3)
integer :: delay_limit
integer :: accepted_count
integer :: total_delay
integer :: i
delays = [3, 7, 5]
delay_limit =
accepted_count = 0
total_delay = 0
do i = 1, 3
if (delays(i) <= delay_limit) then
accepted_count = accepted_count + 1
total_delay = total_delay + delays(i)
end if
end do
print '(I0, 1X, I0)', accepted_count, total_delay
end program accepted_delay_workflow_demo
program accepted_delay_workflow_demo
implicit none
integer :: delays(3)
integer :: delay_limit
integer :: accepted_count
integer :: total_delay
integer :: i
delays = [3, 7, 5]
delay_limit =
accepted_count = 0
total_delay = 0
do i = 1, 3
if (delays(i) <= delay_limit) then
accepted_count = accepted_count + 1
total_delay = total_delay + delays(i)
end if
end do
print '(I0, 1X, I0)', accepted_count, total_delay
end program accepted_delay_workflow_demo
program accepted_delay_workflow_demo
implicit none
integer :: delays(3)
integer :: delay_limit
integer :: accepted_count
integer :: total_delay
integer :: i
delays = [3, 7, 5]
delay_limit =
accepted_count = 0
total_delay = 0
do i = 1, 3
if (delays(i) <= delay_limit) then
accepted_count = accepted_count + 1
total_delay = total_delay + delays(i)
end if
end do
print '(I0, 1X, I0)', accepted_count, total_delay
end program accepted_delay_workflow_demo
loop replay
Each `do` iteration revisits the same source lines with new index state.
guarded update
The `if` body runs only for delays within the selected limit.
summary
The final line reports the count and accumulated total.