Re: Stack overflow problem but increasing stack size does not solve the problem



nure123@xxxxxxxxx wrote:
On Jan 26, 1:43 am, Ravindra Vidhate <ravividh...@xxxxxxxxx> wrote:
As the your code shows that it is a recursive function so there must
exists a condition to break this recursiveness.

Ravindra

Sorry, I pasted the wrong version. Problem exists with the following
code too.

file1:
PROGRAM MAIN
DOUBLE PRECISION a(65,2001)
CALL ROUTINE1(a)
END PROGRAM

file2:
SUBROUTINE ROUTINE1(a)
DOUBLE PRECISION a(65,2001)
RETURN
END SUBROUTINE

You might try adding "SAVE" to the array declaration in your main program:

SAVE DOUBLE PRECISION a(65,2001)

This might get the array off the stack at the expense of making your code file bigger.

Dynamically allocating the array might be even better; see your Fortran manual for details.

(Others here will know more about these options, but depending on what time zone you're in, this might be useful for now.)

Louis
.