- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to read long chains from file using
read(1,*iostat=io)my_chain
but I got iostat error 59 for long chains.
I don't know if this is a compiler bug or there is something concerning free format (or open(recl=)) that would not allow me to do that. I cannnot find anything on the docs or my Fortran95/2003 explained. Any help is most welcome.
The following example program starts showing reading errors from n >= about 2500.
Thanks
Andres
I am trying to read long chains from file using
read(1,*iostat=io)my_chain
but I got iostat error 59 for long chains.
I don't know if this is a compiler bug or there is something concerning free format (or open(recl=)) that would not allow me to do that. I cannnot find anything on the docs or my Fortran95/2003 explained. Any help is most welcome.
The following example program starts showing reading errors from n >= about 2500.
Thanks
Andres
[plain]program test ! features of free-format reading for data100.txt implicit none integer,parameter:: n=2500 character(len=n):: genome integer:: io,i integer:: snp(n) snp=1 open(unit=1,file='kk.txt',status='replace',recl=12000) do i=1,100 write(1,'(12000i1)')snp enddo close(1) do i =1,n genome(i:i)='A' enddo print *,genome(1:20) open(unit=1,file='kk.txt',status='old',recl=12000) i=0 do i=i+1 read(1,*,iostat=io)genome print *, genome(1:20),io,i read(*,*) enddo end [/plain]
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The documented limit (Building Applications > Reference Information > Compiler Limits) is 2048 characters for list-directed input.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In past compilers, the limit on length of a character string has been as low as 254, so this is clearly implementation dependent. I don't know whether the information in the ifort docs under BUFFERCOUNT may be relevant, or whether you should consider access='stream'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The documented limit (Building Applications > Reference Information > Compiler Limits) is 2048 characters for list-directed input.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page