subroutinebind_oneprivate
subroutine bind_one(c, id, v)
Bind one name in a comprehension.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| id | integer | in | the name | |
| v | type(value_t) | in | the value |
Calls
Source
Show the code
subroutine bind_one(c, id, v)
type(fypp_t), intent(inout) :: c !! the state
integer, intent(in) :: id !! the name
type(value_t), intent(in) :: v !! the value
integer, allocatable :: ids(:)
type(value_t), allocatable :: values(:)
integer :: k
if (c%num_bound == size(c%bound)) then
allocate (ids(2*c%num_bound), values(2*c%num_bound))
ids(1:c%num_bound) = c%bound(1:c%num_bound)
do k = 1, c%num_bound
call move_value(c%bound_values(k), values(k))
end do
call move_alloc(ids, c%bound)
call move_alloc(values, c%bound_values)
end if
c%num_bound = c%num_bound + 1
c%bound(c%num_bound) = id
c%bound_values(c%num_bound) = v
end subroutine bind_one