Basic string to integer(ip) routine. Hacky hack just so we can overload as int()
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | str | |||
| integer, | intent(in) | :: | kind |
pure function char_to_int64(str, kind) result(i) character(len=*),intent(in) :: str integer,intent(in) :: kind integer(ip) :: i integer :: istat if (kind/=ip) error stop 'error' read(str,*, iostat=istat) i if (istat/=0) then error stop str end if end function char_to_int64