- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working on a large program that has a lot of arrays, so I have always got the link error that says that the image may not run. However, it has always run perfectly well in the past.
In the last modification I added some more arrays, and a rather unexpected problem has arisen in part of the program that was not modified. The first thing the program does when run is to read in a large number of values from an input file. Inserting debug code shows that a line that should read a value into variable X is actually reading it into Y, overwriting the value that was already read in for Y.
Now this code worked perfectly before. Furthermore, a friend ported the code onto a Unix system and compiled it there (don't know which compiler) and it ran perfectly. So there is nothing wrong with the Fortran code itself; this problem only manifests itself in Visual Fortran and only after the overall number/size of arrays has been increased.
Is there some link option that will prevent this problem from occurring? Any advice would be very welcome.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no link option that wll help. It would seem that you have an error in the program that you did not detect before. If these large arrays are in common, make absolutely sure that you use the same declarations in every program unit that uses this common.
The link warning about size can be ignored - it is not relevant to this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your advice.
What happened next is strange. I carefully checked all the common blocks and they seemed fine. So I hit on the idea of making a copy of the program, removing most of the subroutines from the copy, putting in a stop statement after the overwrite manifested itself, and before any of the missing subroutines were called, and seeing if that would run OK.
It did, so I started putting back the subroutines one by one. It was still working. After adding a couple back in, I thought I'd better check the original for the effect of putting in the stop statement (illogical, but it seemed worth checking).
The error didn't show!
So I took out the stop statement, and the program now runs perfectly, even though earlier this afternoon it was failing repeatedly and I changed nothing. I can no longer produce the error.
Weird!
Well, it works now, and that's the main thing.

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