The subroutine prepares for reading the next uncommented line of data from file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout) | :: | un | |||
logical, | intent(out) | :: | leof |
subroutine nxtdat(un, leof) !! The subroutine prepares for reading the next uncommented line of data from file integer, intent(inout) :: un logical, intent(out) :: leof ! Local variables character(len=256) :: txtstr integer :: io ! If file unit is non-positive then just return if (un .le. 0) return leof = .false. ! Read lines from file do read(un,"(a)", iostat=io) txtstr if (io /= 0) then leof = .true. exit else if (txtstr(1:1) == "*" .or. txtstr(1:1) == "{" .or. txtstr(1:1) == "#") then cycle else backspace(un) exit end if end if end do end subroutine nxtdat