fdoc

subroutinerank_labelprivate

subroutine rank_label(text, rank, in_columns, tied, relative, offset, label)

The text of type text with its rank. A rank in columns is left out, and a tied one is relative.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the type

rankintegerin

the rank

in_columnslogicalin

true if the columns of the table show the rank

tiedlogicalin

true if it is a fixed distance from the columns

relativecharacter(len=*)in

the rank of the columns, as text

offsetintegerin

that distance

labelcharacter(len=:)outallocatable

the result

Calls

Source

Show the code
subroutine rank_label(text, rank, in_columns, tied, relative, offset, label)
    character(len=*), intent(in) :: text                !! the type
    integer, intent(in) :: rank                         !! the rank
    logical, intent(in) :: in_columns                   !! true if the columns of the table show the rank
    logical, intent(in) :: tied                         !! true if it is a fixed distance from the columns
    character(len=*), intent(in) :: relative            !! the rank of the columns, as text
    integer, intent(in) :: offset                       !! that distance
    character(len=:), allocatable, intent(out) :: label !! the result
    type(buffer_t) :: b

    call add(b, text)
    if (rank == ANY_RANK) then
        call add(b, ', any rank')
    else if (in_columns) then
        continue
    else if (tied) then
        call add(b, ', '//relative)
        if (offset > 0) call add(b, ' + '//trim(int_text(offset)))
        if (offset < 0) call add(b, ' - '//trim(int_text(-offset)))
    else if (rank > 0) then
        call add(b, ', rank '//trim(int_text(rank)))
    end if
    call take(b, label)
end subroutine rank_label

Graphs

Calls

Called by