- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There's nothing specific for array constructors. See the documentation index under "Stack, linker option setting size of".
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Once the freq_all array is allocated, can't it be initialized with freq_all=0.d0?
Mike
Mike

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page