- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
I'm wrote a program, half a year ago. It worked perfectly. Now a collegue tried to run it, but she got some really bogus results ... so I started debugging.
The problem is like this:
I have an integer and a float array. When I write the integer before and after, my nested do-loops for filling my float array, ... I get different results
It seems that the address of my integer is the same as the address of 1 element of my array. So ... with the filling of my array, my integer gets overwritten and ....
Nowhere in the program is there any usage of pointers, so I couldn't accidently change addresses ...
Now for the weirdest thing ...
when I add an extra write(*,*) of one completly different variable, between the write of the int AND the filling of the array ...
magic happens, and everything works as was intended.
Anyone can help me with this ? This type of problem( getting bogus data, which can be solved by adding some nonsense write(*,*) 's, ), I have encountered now, for the third time ... Do I miss something important/obvious ?
Thanks in advance
Jo
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Turn on bounds checking (-CB) and verify that when you pass arguments the types match. Try compiling with "-gen_interfaces -warn interfaces" and see if it tells you anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thank you for yourquick reply.
The -CB optionindeed pointed out where we went out of bounds. We corrected our bug accordingly.
Thank you very much !!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page