Thank, Barry. After turning off "check array bound" option, it can work without any problem.

Danyang
On 03/05/2014 4:48 PM, Barry Smith wrote:
On May 3, 2014, at 2:33 PM, Danyang Su <[email protected]> wrote:

Hi All,

The codes can run successfully in release mode, but in debug mode, it causes 
the following error.
forrtl: severe (408): fort: (11): Subscript #1 of the array XX has value 
-665625807 which is less than the lower bound of 1

I can get rid of this error by replacing VecGetArray to VecGetArrayF90 and do 
not use idx in XX. The same problem exists in ltog from DMDAGetGlobalIndices().

Is there any other way to avoid this kind of error in fortran since the release 
mode can run without error?
Is this caused by the configuration in Fortran?
     Certain Fortran compilers add extra code which check for out of array 
bounds access. Found out how to turn it off your your compiler. For example 
https://software.intel.com/en-us/forums/topic/271337  and do some googling.

    Barry

Thanks and regards,

Danyang

Reply via email to