Objectmix
Tags Register Mark Forums Read

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 ...


Object Mix > Programming Languages > Fortran > Stack overflow problem but increasing stack size does not solve theproblem

Reply

 

LinkBack Thread Tools
  #11  
Old 01-26-2008, 09:18 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Stack overflow problem but increasing stack size does not solvethe problem

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 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  
Old 06-22-2009, 02:27 AM
Junior Member
 
Join Date: Jun 2009
Posts: 1
jyotiswaroopr123321 is on a distinguished road
Default Re: Stack overflow problem but increasing stack size does not solve theproblem

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...
Reply

Thread Tools



All times are GMT -5. The time now is 12:49 AM.

Managed by Infnx Pvt Ltd.