subroutinemark_common_membersprivate
subroutine mark_common_members(list, id)
Mark the variables of unit id named in its common blocks.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(entity_list_t) | inout | the entities | |
| id | integer | in | the unit |
Calls
Source
Show the code
subroutine mark_common_members(list, id)
type(entity_list_t), intent(inout) :: list !! the entities
integer, intent(in) :: id !! the unit
character(len=:), allocatable :: member
integer :: c, m, v, block, child, at
do c = 1, size(list%box(id)%e%children)
block = list%box(id)%e%children(c)
if (list%box(block)%e%kind /= E_COMMON) cycle
do m = 1, size(list%box(block)%e%more%args)
member = lowercase(list%box(block)%e%more%args(m)%s)
at = index(member, '(')
if (at > 0) member = strip(member(:at - 1))
do v = 1, size(list%box(id)%e%children)
child = list%box(id)%e%children(v)
if (list%box(child)%e%kind /= E_VARIABLE) cycle
if (list%box(child)%e%var_role /= VAR_PLAIN) cycle
if (lowercase(list%box(child)%e%name) == member) list%box(child)%e%var_role = VAR_COMMON
end do
end do
end do
end subroutine mark_common_members