subroutinepush_intpure
pure subroutine push_int(list, value)
Append value to list, allocating it if needed.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| list | integer | inout | allocatabledimension(:) | the list |
| value | integer | in | the value to append |
Called by
- add_external_modules
- add_use
- build_graphs
- children_of
- close_interface
- collect_lists
- connect
- file_body
- implemented_here
- inherit
- interface_body
- link_calls
- link_submodule
- list_add
- load_external_project
- merge_list
- merge_separate_procedures
- neighbours_of
- new_node
- type_tree
- write_form
- write_site
Source
Show the code
pure subroutine push_int(list, value)
integer, allocatable, intent(inout) :: list(:) !! the list
integer, intent(in) :: value !! the value to append
integer, allocatable :: grown(:)
integer :: n
n = 0
if (allocated(list)) n = size(list)
allocate (grown(n + 1))
if (n > 0) grown(1:n) = list
grown(n + 1) = value
call move_alloc(grown, list)
end subroutine push_int