Help: IFC stack overflow



Hi,

I have a module with many global arrays,

!------------------------------------------------------
module Global
integer, save :: dims(4)=(/0,0,0,0/)
real (kind = 8), save, allocatable :: A(:,:,:,:)
! save data read from a file
real (kind = 8), save, allocatable :: B(:,:,:,:) ! B to E
have the same size
real (kind = 8), save, allocatable :: C(:,:,:,:) ! as A
real (kind = 8), save, allocatable :: D(:,:,:,:)
real (kind = 8), save, allocatable :: E(:,:,:,:)
. . .
. . .
. . .
logical, save, allocatable :: L(:,:,:,:)

contains
!
! subroutines here
!
end module Global
!--------------------------------------------------------

When I read in the dimensional information to dims, these arrays can
be allocated.

The process is
* read in dimensions
* allocate A, populate A using file stream I/O
* allocate B, save intermediate results in B (e.g. sub1(B,A))
* allocate C, do something like sub2(C,B)
etc

Everything works fine when I compile the codes with g95.

However, when I tried to use Intel Fortran compiler 9, it only works
when the data size is relatively small, say dims= (/30,30,8,30/). For
large dimensions like dims=(/256,256,25,30/), it crashes when I call
sub3 to allocate D array. The error report is stack overflow:

forrtl: severe (170): Program Exception - stack overflow
( I have not found the error code 'severe (170)' in Intel docs)

The computer has plenty of memory (4GB). I also check the status
after each allocate statement.

I am wondering why the data size matters.
Is it related to the 'save' attribute?
Will it be helpful if I reduce the number of those global arrays?

Any suggestions and comments are welcome.

Thanks.

Ben

.



Relevant Pages

  • Re: Fortran pointers
    ... The data field is actually allocated in a third variable, ... when I change the dimension for "plotdata" in Mike's example ... Now if I allocate memory for plotdata 0, 2 and 3 to the same dimensions ...
    (comp.lang.fortran)
  • Re: structures of CONTROLLED variables.
    ... DECLARE YCOUNT FIXED BINARY; ... YCOUNT = 5; ALLOCATE SY SET.PSY); ... Minor structures and structure elements inherit the dimensions of the upper level structures in which they are contained. ...
    (comp.lang.pl1)
  • Re: N-dimensional mathematical functions
    ... Then you will probably have to write a parser. ... have memory to allocate bookkeeping data for) and use the same code to ... allows a carefully written evaluator to handle arbitrary dimensions, ... The key that is a pointer to the real key is not itself the real key ...
    (comp.lang.c)