Set label to the value of text, unless that is not a statement label. This is not an internal
read, because it runs in parallel, where those take a lock in the runtime library.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
the label |
||
| integer, | intent(inout) | :: | label |
its value, or as it was |
pure subroutine read_label(text, label) !! Set `label` to the value of `text`, unless that is not a statement label. This is not an internal !! `read`, because it runs in parallel, where those take a lock in the runtime library. character(len=*), intent(in) :: text !! the label integer, intent(inout) :: label !! its value, or as it was integer :: k, n, value n = len_trim(text) if (n == 0 .or. n > 9) return value = 0 do k = 1, n if (text(k:k) < '0' .or. text(k:k) > '9') return value = 10*value + iachar(text(k:k)) - iachar('0') end do label = value end subroutine read_label