I try to run the following code on (a 64-bit) gfortran 14.2
program test1
real, allocatable :: a(:), b(:,:)
! allocate( a(3870457856_8) )
allocate( b(8000, 2000000) )
end program test1
and get the error:
In file 'test4.f90', around line 5: Error allocating 3870457856 bytes: Not enough space.
At the same time, if I uncomment the first allocate and comment the second one, the program runs with no errors. Using compiler option -mcmodel=large does not help.
I get the same issue with gcc 12.
The problem seems somehow to deal with transition of addressing from integer(4) to integer(8), since allocate( b(6000, 2000000) ) causes no errors.
What can I do to allocate the 2-dimensional array?
Update: Everything is Ok with this code. It seems that 3870457856 is just a chunk size or something like that. 8000*2000000 real array needs 64Gb of RAM, which is not available at this moment.