Allocate large array in PGI Fortran

前端 未结 2 903
北荒
北荒 2021-01-15 03:17

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

2条回答
  •  甜味超标
    2021-01-15 03:42

    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

提交回复
热议问题