Iterator that computes the max of contents.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(in) | :: | key | The node key. |
||
class(*), | intent(in), | pointer | :: | content | The generic content. |
|
logical, | intent(out) | :: | done | Flag to set to true to stop traversing. |
subroutine iterator_max(key, content, done)
!---------------------------------------------------------------------------------------------------------------------------------
!< Iterator that computes the max of contents.
!---------------------------------------------------------------------------------------------------------------------------------
class(*), intent(in) :: key !< The node key.
class(*), pointer, intent(in) :: content !< The generic content.
logical, intent(out) :: done !< Flag to set to true to stop traversing.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (associated(content)) then
select type(content)
type is(integer(int32))
max_content = max(max_content, content)
endselect
endif
done = .false.
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine iterator_max