fdoc

subroutinewrite_lineprivate

subroutine write_line(count)

Write the line of count steps done, if its percentage is new. This can be called from any thread.

Arguments

NameTypeIntentAttributesDescription
countintegerin

how many steps are done

Calls

Called by

Source

Show the code
subroutine write_line(count)
    integer, intent(in) :: count    !! how many steps are done
    character(len=128) :: line
    integer :: filled, unfilled, percent

    call bar_text(count, total, 1, filled, unfilled, percent)
    if (total == 0) percent = 0
    if (percent <= last_percent) return
    !$omp critical (file_io)
    if (percent > last_percent) then
        last_percent = percent
        call progress_line(percent, label, min(count, total), total, line)
        write (output_unit, '(a)') trim(line)
        flush (output_unit)
    end if
    !$omp end critical (file_io)
end subroutine write_line