I think /clr invokes .net which is probably not what you want.
You have two main options.
- Change the program to remove local big ARRAYS from the stack, puting them in common/modules.
For large global arrays, this can be done by moving large arrays to a COMMON or MODULE
( this is easy as you just list the large arrays in a named common as
COMMON /BIG_STACK/ array_1, array_2
or if they are temporary arrays in a subroutine, allocating them with ALLOCATE, rather than being just local arrays.
Example
! declare with
real*8, allocatable, dimension( :,: ) :: big_array ! if this is identified as a large local array
!
! early in the executable code : the dimensions can be variables
ALLOCATE (BIG_ARRAY(4000,5000))
!
! to be neat, at the ned
DEALLOCATE (BIG_ARRAY)
Typically you should have few arrays to implement this change.
The memory limit for FTN95 is about 1.6gb. If the program is old chances are it is nowhere near this. However if you are changing the size in anticipation of 64bit, that may explain the problem
- change the way you compile and link
compile with >ftn95 myprog.for
link with >slink myprog.obj -stack:9999999
I have never had any success with /stack or -stack and would recommend analysing your program to remove large local arrays from the stack.
Also, avoid /ZERO or /SAVE if you can, as this increases the stack use.
You may be reluctant to change your F77 code, but the changes should not be significant, as you are only telling the compiler where to use memory.
John
Ps. I omitted ',allocatable' from the declaration.