From b57a128a88fdb245aad08f4f8125468be955afe2 Mon Sep 17 00:00:00 2001 From: Christoph Kords Date: Fri, 3 Apr 2009 07:04:31 +0000 Subject: [PATCH] added subroutine 'IO_skipChunks' that is needed by mesh.f90 --- trunk/IO.f90 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/trunk/IO.f90 b/trunk/IO.f90 index c6dde2955..a1860b849 100644 --- a/trunk/IO.f90 +++ b/trunk/IO.f90 @@ -596,6 +596,30 @@ END FUNCTION END SUBROUTINE +!******************************************************************** +! read on in file to skip (at least) N chunks (may be over multiple lines) +!******************************************************************** + SUBROUTINE IO_skipChunks (unit,N) + + use prec, only: pReal,pInt + implicit none + + integer(pInt) remainingChunks,unit,N + integer(pInt), parameter :: maxNchunks = 64 + integer(pInt), dimension(1+2*maxNchunks) :: pos + character(len=300) line + + remainingChunks = N + do while (remainingChunks > 0) + read(unit,'(A300)',end=100) line + pos = IO_stringPos(line,maxNchunks) + remainingChunks = remainingChunks - pos(1) + end do +100 return + + END SUBROUTINE + + !******************************************************************** ! count items in consecutive lines of ints concatenated by "c" ! as last char or range of values a "to" b