True if an end of kind closing ends the open construct open.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | closing |
construct named by the |
||
| integer, | intent(in) | :: | open |
construct that is open |
pure logical function closes(closing, open) !! True if an `end` of kind `closing` ends the open construct `open`. integer, intent(in) :: closing !! construct named by the `end` (`C_ANY` for a bare `end`) integer, intent(in) :: open !! construct that is open closes = closing == open .or. closing == C_ANY ! `end function` / `end subroutine` may close a separate module procedure, and vice versa if (closing == C_PROCEDURE) closes = closes .or. open == C_FUNCTION .or. open == C_SUBROUTINE if (open == C_PROCEDURE) closes = closes .or. closing == C_FUNCTION .or. closing == C_SUBROUTINE end function closes