functionfind_namepureprivate
pure integer function find_name(c, name) result(id)
The number of name name, or 0.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | in | the state | |
| name | character(len=*) | in | the name |
Result
| Name | Type | Attributes | Description |
|---|---|---|---|
| id | integer |
Source
Show the code
pure integer function find_name(c, name) result(id)
type(fypp_t), intent(in) :: c !! the state
character(len=*), intent(in) :: name !! the name
integer :: k
id = 0
do k = 1, c%num_names
if (len(c%names(k)%s) /= len(name)) cycle
if (c%names(k)%s == name) then
id = k
return
end if
end do
end function find_name