- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DO iB=1,tNT%nBoards
WRITE(11) tBrd(iB)%tEn
END DO
READ(11, IOSTAT=iErr) Sec
READ(11, IOSTAT=iErr) tBrd
DO i=1,NT%nBoards
DEALLOCATE(tBrd(i)%tEn, STAT=iSt)
ALLOCATE(tBrd(i)%tEn( tBrd(i)%nEntries))
READ(11) tBrd(i)%tEn
END DO
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting from the TR: "As with ultimate pointer components, variables containing ultimate allocatable array components are forbidden from appearing directly in input/output lists - the user shall list any allocatable array or pointer component for i/o"
It's a bit garbled to me too... but I parse it as if I do violate the standard, as I store tBrd array -- which is a variable containing ultimate allocatable array components-- prior to the values of its tEn components. If I parse it well, then there's no way to save/retrieve tBrd at all (which is really painful, as it contains lots of other non-allocatable stuff).
I'll pass this on to comp.lang.fortran to see if language gurus have to say something about it.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
| On Wed, 03 Mar 2004 20:42:57 -0800, Richard Maine
| wrote:
|
|| I'm somewhat surprised that the compiler didn't gripe about the
|| ilegality of these I/O lists? That's not something it is required
|| to disgnose, but I'd biatch anyway...that is assuming you have full
|| diagnostic options turned on.
||
||| It would not astonish me if the compiler did not detect this as a standards
||| violation.
||
|| Yep. That's what I thought also. Same reasoning.
|
| Jugoslav hadn't included his declarations when he posted on the user forum, so
| I wasn't entirely sure what he was doing. I wrote my own example and the
| Intel 8.0.042 compiler properly complained (as a regular error, not just a
| standards warning) when a derived type with an ultimate pointer or allocatable
| component was in an I/O list. For example:
|
| t.f90(29) : Error: Variables containing ultimate allocatable array components
| are forbidden from appearing directly in input/output lists. [R1]
| write (1) r1
| ----------^
|
| (CVF 6.6C gives the same error.)
I wrote an array of such. However, 6.6C didn't complain. When I tried
a scalar, it didn't complain either. Here's the complete relevant code:
MODULE NSBKMOD
TYPE T_CONTRACT
INTEGER(1):: iSuit = 0
INTEGER(1):: iLevel = 0
INTEGER(1):: iTricks = 0
INTEGER(1):: iFlags = 0
END TYPE T_CONTRACT
TYPE T_ENTRY
INTEGER(1):: iPair(2) = (/0, 0/)
INTEGER(1):: iFlags = 0
INTEGER(1):: iReserved = 0
REAL:: fResult = 0.
REAL:: fImp(2) = (/0., 0./)
REAL:: fProc(2) = (/0., 0./)
TYPE(T_CONTRACT):: tCo
INTEGER:: iReserved2
END TYPE T_ENTRY
TYPE T_BOARD
INTEGER:: nEntries = 0
INTEGER:: iFlags = 0
TYPE(T_ENTRY), ALLOCATABLE:: tEn(: )
END TYPE T_BOARD
TYPE(T_BOARD), ALLOCATABLE:: tBrd(: )
END MODULE
!===============================
USE NSBKMOD
USE GLOBALS
IMPLICIT NONE
CHARACTER(*):: szNtrFile
INTEGER:: iB
OPEN (11, FILE=szNtrFile, FORM='BINARY')
WRITE(11) CURR_VERSION, tNT, tSec, tBrd
DO iB=1,tNT%nBoards
WRITE(11) tBrd(iB)%tEn
END DO
...
CLOSE(11)
CVF 6.6C doesn't complain about trying to WRITE tBrd (neither if
I replace tBrd with a dummy scalar T_BOARD). I didn't manage to
find time to try IVF 8.
| Without seeing a complete example, I have to assume that Jugoslav's code that
| compiled had the array itself and not a derived type with an array component
| in the I/O list. If there's an example that shows otherwise, I'd like to see
| it.
I wanted to, but the user forum has been giving me "Access denied" for en tire
day yesterday.
| Interesting. I wonder what the compiler sees different in this case? We'll
| investigate - thanks.
If a sample workspace would help, I don't mind sharing it. Premier,
direct e-mail or...?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve.
I redesigned the code so that it now stores/retrieves only nEntries and iFlags components of tBrd.

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