- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I compiled und linked a old fortran 77 program with intel Fortran Compiler, some COMMON BLOCK variables got changed (reset to 0) after calling some unrelevant subrutines. I have also tried with CVF6.5, but there is no such problem. Does anyone here also meet this problem?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - temgy1986
When I compiled und linked a old fortran 77 program with intel Fortran Compiler, some COMMON BLOCK variables got changed (reset to 0) after calling some unrelevant subrutines. I have also tried with CVF6.5, but there is no such problem. Does anyone here also meet this problem?
When variables change unexpectedly, something is happening that causes the memory to be overwritten.
Some that come to mind are mismatched arguments ( either number or kind) in subroutine calls, and
out of bound array references. Uninitialzed variables can also bite you.
The compiler can catch some of these errors if you have the right debugging options turned on.
Different behavior between compilers is certainly possible for this type of error, since they will vary in
how they locate variables within the programs memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To catch the problem, get the hex address of the variable being changed (position the memory dump window on the variable), using the hex address (you can select and copy), open Debug | Windows | Breakpoints select data break as C++ (no Fortran selection) and paste in the hex address. Use 4 bytes to watch as I think 8 bytes have a problem.
add the break each time you make a test run and do so prior to the corruption.
You may have a missing or moved common block and/or equivilence.
OR
This may be a very old bug that was not uncovered until now.
Jim Dempsey

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