- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to write a rather large CHARACTER buffer:
CHARACTER(LEN=MAXLINE) :: buff
INTEGER :: buff_length
[...]
WRITE(*,'(A)') buff(1:buff_length)
and get the following error
Input/Output Error 154: Wrong length record
In Procedure: main program
At Line: 356
Statement: Formatted WRITE
Unit: 6
Connected To: Stdout
Form: Formatted (contains List-Directed records)
Access: Sequential
Records Read : 0
Records Written: 27
End of diagnostics
when buff_length is greater than 1024. The following
CHARACTER(LEN=MAXLINE) :: buff, buff_format
INTEGER :: buff_length
[...]
WRITE(buff_format,'(A,I0,A)') '(A', buff_length, ')'
WRITE(*,buff_fromat) buff(1:buff_length)
doesn't fix the problem, i.e. I get the same error.
I've checked the Programmer's Reference found no mention of a maximum string or output size and hence no way of getting around this problem. Wrapping the WRITE-statement in a loop and writing buff piecewise works, but it is not elegant.
Did I miss something in the Programmer's Reference or is this a bug in the I/O routines?
Cheers and many thanks in advance
Pedro
CHARACTER(LEN=MAXLINE) :: buff
INTEGER :: buff_length
[...]
WRITE(*,'(A)') buff(1:buff_length)
and get the following error
Input/Output Error 154: Wrong length record
In Procedure: main program
At Line: 356
Statement: Formatted WRITE
Unit: 6
Connected To: Stdout
Form: Formatted (contains List-Directed records)
Access: Sequential
Records Read : 0
Records Written: 27
End of diagnostics
when buff_length is greater than 1024. The following
CHARACTER(LEN=MAXLINE) :: buff, buff_format
INTEGER :: buff_length
[...]
WRITE(buff_format,'(A,I0,A)') '(A', buff_length, ')'
WRITE(*,buff_fromat) buff(1:buff_length)
doesn't fix the problem, i.e. I get the same error.
I've checked the Programmer's Reference found no mention of a maximum string or output size and hence no way of getting around this problem. Wrapping the WRITE-statement in a loop and writing buff piecewise works, but it is not elegant.
Did I miss something in the Programmer's Reference or is this a bug in the I/O routines?
Cheers and many thanks in advance
Pedro
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What version are you using? Please spell out the full package ID (l_fc_????)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifc -V says
Intel Fortran Compiler for 32-bit applications, Version 7.1 Build 20030307Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
GNU ld version 2.14 20030612
Supported emulations:
elf_i386
i386linux
Cheers and thanks
Pedro
Intel Fortran Compiler for 32-bit applications, Version 7.1 Build 20030307Z
Copyright (C) 1985-2003 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
GNU ld version 2.14 20030612
Supported emulations:
elf_i386
i386linux
Cheers and thanks
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An old 7.1, hmm. I am not familiar with the I/O implementation of 7.1. I know it is very different in 8.0 and you should not have this problem there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem with version 8.0 is that it woun't compile the program in which this happens, so this won't fix the problem :(
Also, after having read the thread on SSE optimizations in the latest 7.1, I don't really feel like upgrading since I also work on AMD machines.
Has this problem ever been documented before or is there a way of getting around it that does not imply making the code ifc-specific?
Cheers and thanks
Pedro
Also, after having read the thread on SSE optimizations in the latest 7.1, I don't really feel like upgrading since I also work on AMD machines.
Has this problem ever been documented before or is there a way of getting around it that does not imply making the code ifc-specific?
Cheers and thanks
Pedro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The SSE issue is fixed in the current 8.0 package.
Did you submit a report on the compile failure? What's the report number?
Seems to me you already have a solution for 7.1.

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