fdoc

subroutineunique_tag

subroutine unique_tag(tag)

A number, as text, that another run at the same time is very unlikely to get, for temporary names.

Arguments

NameTypeIntentAttributesDescription
tagcharacter(len=*)out

the number

Source

Show the code
subroutine unique_tag(tag)
    character(len=*), intent(out) :: tag    !! the number
    integer(int64) :: clock
    real :: random

    call random_init(repeatable=.false., image_distinct=.true.)
    call random_number(random)
    call system_clock(clock)
    write (tag, '(i0,a,i0)') mod(clock, 1000000000_int64), '-', int(random*1.0e9)
end subroutine unique_tag

Graphs

Called by