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.

delay_limit
accepted_delay_workflow.f90
Replay: real traced execution (multi-file project)
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 = 6
    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 = 4
    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 = 10
    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
  1. delays ← [3, 7, 5]

    9delays = [3, 7, 5]10delay_limit = 6
    values this step[3, 7, 5]delays
  2. delay_limit ← 6

    9delays = [3, 7, 5]10delay_limit = 611accepted_count = 0
    values this step6delay_limit
  3. accepted_count ← 0

    10delay_limit = 611accepted_count = 012total_delay = 0
    values this step0accepted_count
  4. total_delay ← 0

    11accepted_count = 012total_delay = 013do i = 1, 3
    values this step0total_delay
  5. i ← 1

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step1i
  6. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.true.delays(1) <= delay_limit
  7. accepted_count ← 1

    14if (delays(i) <= delay_limit) then15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)
    values this step1accepted_count
  8. total_delay ← 3

    15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)17end if
    values this step0 3total_delay3delays(1)
  9. i ← 2

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step2i
  10. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.false.delays(2) <= delay_limit
  11. i ← 3

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step3i
  12. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.true.delays(3) <= delay_limit
  13. accepted_count ← 2

    14if (delays(i) <= delay_limit) then15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)
    values this step2accepted_count
  14. total_delay ← 8

    15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)17end if
    values this step3 8total_delay5delays(3)
  15. print '(I0, 1X, I0)', accepted_count, total_delay

    18    end do19    print '(I0, 1X, I0)', accepted_count, total_delay20end program accepted_delay_workflow_demo
    output2 8
    values this step2accepted_count8total_delay
  1. delays ← [3, 7, 5]

    9delays = [3, 7, 5]10delay_limit = 4
    values this step[3, 7, 5]delays
  2. delay_limit ← 4

    9delays = [3, 7, 5]10delay_limit = 411accepted_count = 0
    values this step4delay_limit
  3. accepted_count ← 0

    10delay_limit = 411accepted_count = 012total_delay = 0
    values this step0accepted_count
  4. total_delay ← 0

    11accepted_count = 012total_delay = 013do i = 1, 3
    values this step0total_delay
  5. i ← 1

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step1i
  6. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.true.delays(1) <= delay_limit
  7. accepted_count ← 1

    14if (delays(i) <= delay_limit) then15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)
    values this step1accepted_count
  8. total_delay ← 3

    15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)17end if
    values this step0 3total_delay3delays(1)
  9. i ← 2

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step2i
  10. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.false.delays(2) <= delay_limit
  11. i ← 3

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step3i
  12. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.false.delays(3) <= delay_limit
  13. print '(I0, 1X, I0)', accepted_count, total_delay

    18    end do19    print '(I0, 1X, I0)', accepted_count, total_delay20end program accepted_delay_workflow_demo
    output1 3
    values this step1accepted_count3total_delay
  1. delays ← [3, 7, 5]

    9delays = [3, 7, 5]10delay_limit = 10
    values this step[3, 7, 5]delays
  2. delay_limit ← 10

    9delays = [3, 7, 5]10delay_limit = 1011accepted_count = 0
    values this step10delay_limit
  3. accepted_count ← 0

    10delay_limit = 1011accepted_count = 012total_delay = 0
    values this step0accepted_count
  4. total_delay ← 0

    11accepted_count = 012total_delay = 013do i = 1, 3
    values this step0total_delay
  5. i ← 1

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step1i
  6. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.true.delays(1) <= delay_limit
  7. accepted_count ← 1

    14if (delays(i) <= delay_limit) then15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)
    values this step1accepted_count
  8. total_delay ← 3

    15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)17end if
    values this step0 3total_delay3delays(1)
  9. i ← 2

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step2i
  10. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.true.delays(2) <= delay_limit
  11. accepted_count ← 2

    14if (delays(i) <= delay_limit) then15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)
    values this step2accepted_count
  12. total_delay ← 10

    15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)17end if
    values this step3 10total_delay7delays(2)
  13. i ← 3

    12total_delay = 013do i = 1, 314    if (delays(i) <= delay_limit) then
    values this step3i
  14. if (delays(i) <= delay_limit) then

    13do i = 1, 314    if (delays(i) <= delay_limit) then15        accepted_count = accepted_count + 1
    values this step.true.delays(3) <= delay_limit
  15. accepted_count ← 3

    14if (delays(i) <= delay_limit) then15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)
    values this step3accepted_count
  16. total_delay ← 15

    15    accepted_count = accepted_count + 116    total_delay = total_delay + delays(i)17end if
    values this step10 15total_delay5delays(3)
  17. print '(I0, 1X, I0)', accepted_count, total_delay

    18    end do19    print '(I0, 1X, I0)', accepted_count, total_delay20end program accepted_delay_workflow_demo
    output3 15
    values this step3accepted_count15total_delay
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.