Where it, jt and kt are given as a subroutine's argument.
I can compile to program, but it crashed when the subroutine that uses automatic array is called. My question: how to make intel compiler recognizes this is an Fortran77 but with automatic array allocation ? SUN compiler can do this very well.
I had the exactly the same problem. For large array sizes, the automatic declaration produced a "signal 11" seg fault crash. The above solution works. However, in the above declaration of the arraysone has to include the "allocatable" keyword to make it work, e.g.
accompanied by an
statement works, while a simple
real(kind=8) :: a(N)
at the beginning of a subroutine crashed for me for large array sizes. The crash happensdirectly after calling the subroutine.While it looks like a stack overflow, an increase of stack size to unlimited or compilation with the -save optiondoes not help!
Again, your a(N) in the declaration creates an automatic array which is always allocated on the stack when the routine is called. (This assumes that a is not an argument to the routine.) If N is large, you'll use a lot of stack. Whether or not you can get this to work by increasing the stack limit depends on your system configuration. There also tends to be a hard upper limit of 1GB for the stack.
I recommend using ALLOCATABLE local arrays rather than automatic arrays when the array is likely to be large.
Why do you recommend to use an allocatable array instead of an automatic array for large arrays? Conceptually it seems to be the same inside a subroutine. Has the former any performance advantages or something else?
If you're talking an automatic array, it's not a dummy argument.
Yes, my thought was that a large array would have many operations that would be more significant than the fixed allocate/deallocate time. I would not expect any noticeable impact of the actual array references.