- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Maybe the following should compile:
[fortran]program test integer, dimension(1) :: x, y x = 1 y(1) = x end program test [/fortran] Instead, I get (OSX):
[plain][octopus] misc > ifort --version ifort (IFORT) 12.1.3 20120130 Copyright (C) 1985-2012 Intel Corporation. All rights reserved. [octopus] misc > ifort -free test.f test.f(6): error #6366: The shapes of the array expressions do not conform.
y(1) = x
--^
compilation aborted for test.f (code 1)
[/plain]
Teemu Laakso
Maybe the following should compile:
[fortran]program test integer, dimension(1) :: x, y x = 1 y(1) = x end program test [/fortran] Instead, I get (OSX):
[plain][octopus] misc > ifort --version ifort (IFORT) 12.1.3 20120130 Copyright (C) 1985-2012 Intel Corporation. All rights reserved. [octopus] misc > ifort -free test.f test.f(6): error #6366: The shapes of the array expressions do not conform.
Teemu Laakso
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, my mistake. y(1)=x should be written y(1:1)=x, of course. No problem here, whatsoever.
Teemu
Teemu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or better:
y=x
y=x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
True. For me, this silly example reminded that the correct way to extrapolate to smaller subarray size is x(1:3), x(1:2), and x(1:1) - NOT x(1).
x(1:1) is rank 1 and x(1) is rank 0.
Teemu
x(1:1) is rank 1 and x(1) is rank 0.
Teemu

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