subroutineread_namelistprivate
subroutine read_namelist(list, unit, line, doc, s)
Read a namelist statement.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | type(entity_list_t) | inout | the entities | |
| unit | integer | in | the entity it is in | |
| line | character(len=*) | in | the statement | |
| doc | type(doc_lines_t) | in | the statement's documentation | |
| s | type(settings_t) | in | the settings |
Calls
Source
Show the code
subroutine read_namelist(list, unit, line, doc, s)
type(entity_list_t), intent(inout) :: list !! the entities
integer, intent(in) :: unit !! the entity it is in
character(len=*), intent(in) :: line !! the statement
type(doc_lines_t), intent(in) :: doc !! the statement's documentation
type(settings_t), intent(in) :: s !! the settings
integer :: a, b, id
a = index(line, '/')
b = index(line, '/', back=.true.)
if (a == 0 .or. b <= a) return
id = list%add(E_NAMELIST, unit)
associate (n => list%box(id)%e)
n%name = strip(line(a + 1:b - 1))
n%permission = inherited_permission(list, unit)
n%more%args = top_split(line(b + 1:), ',')
allocate (n%attribs(0))
if (allocated(doc%lines)) then
call set_doc(n, s, doc%lines)
else
call set_doc(n, s, [string_t ::])
end if
end associate
end subroutine read_namelist