|
[Sponsors] |
June 7, 2005, 08:02 |
F-90::Regarding Chk bounds
|
#1 |
Guest
Posts: n/a
|
hi
i am having some problem regardng compiling my f-90 program in Compaq Visual FORTRAN 6.5. The problem is as follows:: when i compile the program with check bounds option i get some results and when i do it without check bounds option, i get different results. Can anybody help me out with this? I also want to know that what actually "check bounds" means?? and what are the differences in compiling with n without it? Thanks n waiting 4 positive response Arnie |
|
June 7, 2005, 12:21 |
Re: F-90::Regarding Chk bounds
|
#2 |
Guest
Posts: n/a
|
When you use "check bounds" option, the compiler checks your program to see if the code is accessing memory locations outside of those assigned. For example, if you have declared an array A of size 10 and your program tries to access A(11) then the compiler will catch this with check bounds option.
Now when you compile with check bounds option, from my experience, the code stops when an outside memory is accessed. But in your case you say that the program runs, but gives a different answer. Do you know which of the two answers are correct? My guess is that your solution without check bounds might be incorrect, but further debugging might be needed. Good luck. |
|
June 7, 2005, 18:43 |
Re: F-90::Regarding Chk bounds
|
#3 |
Guest
Posts: n/a
|
I am not sure if this is compiler dependend, but the "check bounds" option with my compilers (absoft, portland group, intel) does not mean that the compiler will check for out-of-bounds indices. In fact, the compiler may not even able to do so, because some array indices may not be evaluated at compile time. More precisely (and maybe this is what you meant, agg), the compiler will produce machine code which checks at runtime for out-of-bound indices. So you really only know if you're out of bounds when you execute your program, not when you compile it. Typically, the program will be interrupted and will print out some statement telling you in which subroutine, which line you went out of bounds on which array.
If your program produces different results depending on compiler options, you might indeed have a segmentation problem. However, it's not necessarily an array "out of bounds". It could be something else, like a pointer to unallocated memory, or some inconsistency in subroutine arguments. |
|
June 10, 2005, 06:07 |
Re: F-90::Regarding Chk bounds
|
#4 |
Guest
Posts: n/a
|
Hi agg,
I am sorry to have mistakenly told you that my prog was running with check bounds option. Its running only without chk. bounds. And its giving wrong answers. I got wheres the snag in the program, actually some value calculated, which is used in a subroutine, is causing problems. I dont know why he value is getiing incorrectly calculated. I guess its some modelling error. Thanks for your support Arnie |
|
June 10, 2005, 11:40 |
Re: F-90::Regarding Chk bounds
|
#5 |
Guest
Posts: n/a
|
Try using -g option or any debugger your program comes with to track errors.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
bounds error | jai | CFX | 3 | July 3, 2014 07:03 |
fatal bounds error detected | s_baghalian | CFX | 0 | April 28, 2011 12:51 |
Bounds error detected | Felix | CFX | 2 | July 30, 2007 14:35 |
Solver: Fatal Bounds error detected | hagupta | CFX | 5 | March 24, 2006 11:17 |
*** WARNING #065 *** OUT OF BOUNDS VALUE??? | Ted Crilly | Siemens | 4 | March 14, 2005 13:28 |