[Pw_forum] array bound check

Paolo Giannozzi giannozz at democritos.it
Thu Sep 25 11:26:08 CEST 2008


On Sep 25, 2008, at 6:41 , Manoj Srivastava wrote:

> I guess I will try the CVS version and see what i get.

I guess you should rather see what happens at the line of the
code where the error happens. If you did things properly (likely),
and if the compiler work properly (less likely), you should have
gotten a message saying something very self-explanatory like

Subscript #1 of the array R has value 172 which is greater than the  
upper bound of 171

in addition to a traceback with the line number where the offending
command is called.

Sometimes such messages are bogus, i.e. they do not signal a true
out of bound array but usage of obsolete syntax that prevents the
compiler to know about the true size of arrays

> By the way, is there a way to do array bound check in a particular
> subroutine I am interested rather than doing the whole code?

there is the safe and slow way: compile normally the entire code,
change the flags in make.sys to switch bound check on, remove
the object (*.o) corresponding to the routine you want to check,
"make" again

Paolo
---
Paolo Giannozzi, Dept of Physics, University of Udine
via delle Scienze 208, 33100 Udine, Italy
Phone +39-0432-558216, fax +39-0432-558222





More information about the Pw_forum mailing list