Stack overflow problem but increasing stack size does not solve theproblem : Fortran
This is a discussion on Stack overflow problem but increasing stack size does not solve theproblem within the Fortran forums in Programming Languages category; Richard Maine wrote: > Louis Krupp <lkrupp @ pssw.nospam.com.invalid> wrote: > >> 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. > > Two things. > > 1. SAVE in a main program has no effect according to the standard. Of > course, the matter of stack versus other storage implementation is > outside of the scope of the standard and it is possible that a compiler > might change ...
![]() |
| | LinkBack | Thread Tools |
|
#11
| |||
| |||
| > Louis Krupp <lkrupp@pssw.nospam.com.invalid> wrote: > >> 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. > > Two things. > > 1. SAVE in a main program has no effect according to the standard. Of > course, the matter of stack versus other storage implementation is > outside of the scope of the standard and it is possible that a compiler > might change that depending on SAVE. > > 2. This syntax won't work in any case. > > Quite right, of course. In the unlikely event that the OP is still interested, this *might* work: DOUBLE PRECISION a(65,2001) SAVE a Louis |
|
#12
| |||
| |||
| Hi, I am facing a similar problem. The fortran code i wrote has a two dimensional array: Y(400000)(200). And the executable obj and exe files are around 300MB each. It compiles properly, but when i try to run it, an error message with : stack overflow is displayed. Can anybody help me with this? PS: I use FTN95 compiler... |


