- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had an old fortran 90 code with the following command:
data1(1:100) = data_all(:)
where "data_all" is a bigger array then "data1".
Since I know that this is not a robust syntax, it worked good when using Visual Studio 2008.
I recently switched to Visual Studio 2013, and I am not able to use this code anymore, since it tries to fill the 101th position of "data1".
How can I correctly change Compiler options to accept that?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fix your code. The shapes of the left and right side must match unless the left side is the name of an allocatable array. (Adding the (1:100) disqualifies it.) You can write instead:
data1(1:100) = data_all(1:100)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fix your code. The shapes of the left and right side must match unless the left side is the name of an allocatable array. (Adding the (1:100) disqualifies it.) You can write instead:
data1(1:100) = data_all(1:100)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Steve,
thanks for your kind reply.
I think you're right: maybe a compilator option previously allowed me to compile, but I agree with you that this code is bad written.
I Will fix it soon.
Thank you!
Lorenzo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not an option, just an accident of the choice made by the code generator, which can change. Unfortunately, Intel Fortran doesn't yet do "shape checking", and it is unpredictable which size it will use on such erroneous assignments.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page