What I meant was you can work around the static data size restriction by changing the type
of your arrays. Here is an example program that declares a pair of three gigabyte static arrays:
PROGRAM MAIN
IMPLICIT NONE
REAL(KIND=8) :: first(50331648,8)
REAL(KIND=8) :: second(50331648,8)
SAVE first,second
first(1,8) = 1.0D0
second(8,1) = 2.0D0
END
Compiling this code in 64 bit project produces the expected linker error:
LINK : fatal error LNK1248: image size (8002E000) exceeds maximum allowable size (80000000)
Modifying the code to use allocatable arrays allows the code to link successfully:
PROGRAM MAIN
IMPLICIT NONE
REAL(KIND=8),ALLOCATABLE :: first(:,:)
REAL(KIND=8),ALLOCATABLE :: second(:,:)
INTEGER alloc_err
ALLOCATE(first(50331648,8),STAT=alloc_err)
ALLOCATE(second(50331648,8),STAT=alloc_err)
IF (alloc_err .NE. 0) THEN
WRITE(*,*) "Array allocation failed, error ",alloc_err
ELSE
first(1,8) = 1.0D0
second(8,1) = 2.0D0
END IF
END
The maximum size of allocatable data is 8 terabytes but in reality, it is limited to the
amount of virtual memory configured for a particular system. Exceeding the amount
of installed physical memory by a large amount will a have a very noticeable
impact on performance.