I am trying to allocate an real array finn_var(459,299,27,24,nspec) in Fortran. nspec = 24 works ok, while nspec = 25 not. No error message for allocation process, but print
It doesn't have to be insufficient memory. The size of the array is 2 223 304 200
. That is suspiciously close to the maximum 32bit integer 2 147 483 648
.
It looks like that the element count that the compiler uses internally overflows. The internal call to malloc
requests not enough memory and then any attempt to read some of the elements at the end fails.
It is a limitation of the compiler in its default settings. It can be set-up to use 64bit addressing by using the option ‑Mlarge_arrays
.
See http://www.pgroup.com/products/freepgi/freepgi_ref/ch05.html#ArryIndex