Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximum array size in Fortran 90

Status
Not open for further replies.

clergy1122

Technical User
Jul 2, 2008
3
CA
Hi Guys,

I wrote a code that part of it looks like:

integer: imax
parameter(imax=4000)
double precision,dimension(imax,imax): clst,Nver.

When I used imax=500, it worked so well, but with imax=4000, it gives error like this:

libc detected *** malloc(): memory corruption: 0x1c109cb8 ***
forrtl: error (76): IOT trap signal
/var/spool/pbs/mom_priv/jobs/72248.totor.SC: line 6: 31794 Aborted .

I am using Intel fortran compiler. My friends say it could be due to the array size, but I want to seek your advice as me and my friends are all learners.
Does Fortran has a maximum array size?

Thanks in anticipation.
 
Your friend is right. Check your compiler documentation.

A way of looking at it is

4000*4000*8
=128000000
= appx 128Mb

That is how much space you're using.

a) Could you make it a real array instead of double precision? That would reduce it to 64Mb

b) Do you really need an array that size? For data input, that would mean you have to input 16 million numbers. Is that practical?

c) Is it a sparse array (i.e. most of it is zero). If so, there are other techniques for handling sparse arrays.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top