- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding formatted I/O, I don't get the same behavior from these two source code examples:
write(1,* ) (a(ira,kk),kk=1,nca)
write(1,*) a(ira,1:nca)
The first one does it right, but the second one gives different results.
A is a 2-dimensional array, could be REAL, D.P. or integer.
The row number IRA is specified ahead of time.
Is there any reason why the compiler would give different behaviors ?
I can generate a simple test program if needed.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A simple test program as well as a description or example of the "different behaviors" would be useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recall there was(is) a different thread on the Windows or Linux forum that discusses the same issue. It may have a tracking number.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't remember an issue like this. Could it be that you are thinking of one related to use of a zero width in an explicit format causing a side-effect of a later WRITE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I remember, the thread related to a statement like:
some2Darray = other2DarrayFirstDimGT1(idx, 1:N)
Where the compiler produced/interpreted the shape of the rhs as being a 1D array
This problem may potentially suffer part of this confusion.
A simple test to confirm this would be to try encapsulating the array slice in ()'s
write(1,*) (a(ira,1:nca))
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For list-directed output, the shape of the array would not have any effect. It's just a sequence of elements.
Bill hasn't told us what the different results are. At this point I suggest we wait for a test case and sample output, along with the exact compiler version being used, before speculating further.
![](/skins/images/7B0AB6865064EAE32B30EC9A4E94B48A/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page