Array Constructor Stack Overflow Problem

Array Constructor Stack Overflow Problem

The below (simplified version of a larger) code runs fine for npts_all=60000 (or less) on my NT machine but it gives a stack error for npts_all=70000 (or more).
This error occurs only for the array constructor part.
Is there some compiler option that needs to be set for
this? I am using Compaq Visual Fortran. I looked in
manual but could find nothing that needed to be set for
array constructors explicitly.

One solution to my problem would be to remove all array constructors from my code and replace them with Do loops. I would rather not do this of course.

Any help would be much appreciated.
Thanks!

-Roger Jones
-----------------------
rmj@slac.stanford.edu
-----------------------

double precision, allocatable:: freq_all(:)
integer npts_all
read *,npts_all
allocate(freq_all(npts_all))
do 2222 kk=1,npts_all
freq_all(kk)=0.d0
2222 continue
pause
c
C Array Constructor below does not work for npts larger than
c approx 65,000 (70,000 does not work)
C But the DO loop above always works!
C
freq_all=(/(0.d0,kk=1,npts_all)/)
pause
stop
end

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

There's nothing specific for array constructors. See the documentation index under "Stack, linker option setting size of".

Steve

Steve

Once the freq_all array is allocated, can't it be initialized with freq_all=0.d0?

Mike

Melden Sie sich an, um einen Kommentar zu hinterlassen.