- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I have a compiler loop and I do not why. In the oroginal code there is a do--end do. the program works.
If I insert a "definitions" at the end of the do-enddo the progran runs but does not stop.
Do you know why? I made some error?
the do end do is:
DO IP=1,NPT
....
....
ENDDO
RHO(IP)=1000.D0
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You showed too little a part of the code to answer, but here is one point for you to consider. After the DO loop ends, the value of IP is NPT+1. If the array RHO is dimensioned 1:NPT, the assignment statement following the ENDDO causes an array overrun, and other unpredictable side effects may follow, including failure to complete execution in a nice way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
thank for the answer. Is there any option in the compilation to find this error?
I have just posted a question in the forum about that.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can add the runtime check for array index out of bounds in your debug build. This should catch most of the errors.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
sorry, but how can I do it?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-CB or -check bounds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
thanks a lot it really helps me.
so again thanks, I have saved a lot of time.
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