Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29298 Discussions

handling big size of 3 dimension data

hyenchun
Beginner
656 Views

Hello,

I am working on a program dealing with 3d data files.

My input filesareseries of 1000*1000 binary ascii files. I want to read 1000 files at once so I can treat as 1000*1000*1000 3d data. But the Fortran gives me an error...all these data are read as z(1000,1000,1000) and this parameter is too big for Fortran (Error: A common block or variable may not exceed 2147483647 bytes)..

I tried to seperate data into 5 parameters, but it gave me also an error (program exception...).

How can I solve this problem?

Here is a part of my code;

dimension z1(1000,1000,1000)
integer z1

character p,pp,pp2
character*80 inpfil(5000),outfil1(5000), outfil2(5000),outfil3(5000)


OPEN(4,FILE='prbinary2.i')
!First, read number of sample image and read output names!
read(4,*)nfile3
do 1 nf3=1,nfile3


READ(4,'(A)') outfil1(nf3)
READ(4,'(A)') outfil2(nf3)

READ(4,'(A)') outfil3(nf3)

1 continue
do 10 nff=1,nfile3
READ(4,*) nfile

DO 2 nf=1,nfile

READ(4,'(A)') inpfil(nf)

2 CONTINUE

CLOSE(4)

do 6 nf=1,nfile
OPEN(5, FILE=inpfil(nf))

zz1=zz1+1

read(5,11)p
11 format(a2)

read(5,12)pp
12 format(a45)

read(5,13)pp2
13 format(a20)
read(5,14)ww,qq
14 format(t1,i4,i10)
read(5,15)((z1(ii,jj,zz1),ii=1,ww),jj=1,qq)
15 format(35i2,1x)

6 continue

Hyen Chung

0 Kudos
1 Reply
Steven_L_Intel1
Employee
656 Views
You are trying to declare a variable of size 4,000,000,000 which is larger than the 2GB address space on 32-but Windows. You will need to either rewrite your program so that you don't have all the data in variables at once (so that the variables can be smaller) or move to a 64-bit system (with adequate RAM and the Intel compiler for EM64T) so that you have a larger address space. Even on a 64-bit system, though, you cannot declare the array as a local variable the way you have done it here, as there is still a 2GB limit on static code and data. Instead, you'll have to make the array ALLOCATABLE and allocate it to the correct size.
0 Kudos
Reply