## Create 250^4 or 250^5 elements-arrays

## Create 250^4 or 250^5 elements-arrays

(OP)

Hi,

How can I declare the arrays of such size

REAL, DIMENSION(250,250,250,250) :: A ??

I use intel visual Fortran and it generates the error message: The size of the array dimension is too large, and overflow occurred when computing the array size.

I cannot get away with sparse matrix as well.

Please give some suggestion.

Thanks.

How can I declare the arrays of such size

REAL, DIMENSION(250,250,250,250) :: A ??

I use intel visual Fortran and it generates the error message: The size of the array dimension is too large, and overflow occurred when computing the array size.

I cannot get away with sparse matrix as well.

Please give some suggestion.

Thanks.

## RE: Create 250^4 or 250^5 elements-arrays

Well, let's think for a moment...you are requesting an array that will have 250*250*250*250 = 3906250000 items in it; if each item was 1 byte long, you would need 3.9 GB of memory...but you want this array to be REAL. If the length of the default REAL is 8 bytes, you are requesting 31.25 GB of RAM...does your computer have this kind of memory?

You really need to figure out what the problem at hand is and how else you can solve it.

If sparse techniques cannot be used, maybe you need to stage your handling by working only on a portion of your matrix at a time and keep the rest on disk....read part of it, process, write it down, load another portion, process, write it down and so on.

## RE: Create 250^4 or 250^5 elements-arrays

## RE: Create 250^4 or 250^5 elements-arrays

For

, the values are calculated from some other part of the code and need to be stored in this huge arrays. Then, I need to pick the largest element from these 250^4 values simultaneously. Do you think I can reduce the dimension, find the MAXLOC from each dimension, and then MAXLOC again from the 1st MAXLOC ?xwbThanks.

## RE: Create 250^4 or 250^5 elements-arrays

## RE: Create 250^4 or 250^5 elements-arrays

,salgermanNope. It is the algorithm that must be done. It works for 2*(250^3) and I tried to extend that to 250^4.

Thanks for your answer.

## RE: Create 250^4 or 250^5 elements-arrays

## RE: Create 250^4 or 250^5 elements-arrays

I have no idea on how to work only a portion. It seems that I cannot avoid declaring things like

REAL, DIMENSION(250,250,250,30) :: A1

REAL, DIMENSION(250,250,250,30) :: A2

...

REAL, DIMENSION(250,250,250,30) :: A8

REAL, DIMENSION(250,250,250,10) :: A9

What is worse is that the arrays I really need to work on is of dimension (260,260,2,260,260,260), which can be declared for (260,260,2,260,3,3) (3 is the highest number allowed)

## RE: Create 250^4 or 250^5 elements-arrays

## CODE

## RE: Create 250^4 or 250^5 elements-arrays

,xwbSuppose the working code look like this.

## CODE --> FORTRAN

How can I do as you suggested ?

Thank you very much.

## RE: Create 250^4 or 250^5 elements-arrays

My previous comment about not needing a huge matrix and simply needing a single variable is this:

## CODE

## RE: Create 250^4 or 250^5 elements-arrays

,salgermanxwbActually, the actual code is not this simple just to choose the largest element from A.

I need part of the A matrix to do some matrix operation, i.e.## CODE --> fortran

(Sorry I did not show you my actual code since it would be too long here.)

So far I still don't have any idea other than declare thing bit by bit.

Someone is telling me that I need to access a super computer in order to do this.

## RE: Create 250^4 or 250^5 elements-arrays

If you do matrix operation you are only using 2 indices.

So IMO you really need only 2D-portion of matrix A and therefore should be able to reduce your 4D-task to smaller 2D tasks.

Then you can compute the result X of every 2D-tier in dependence of the previous tier for example something like this:

## CODE

The result from one 2D-tier to the next tier will be transfered using the matrix X, but maybe you only need a vector or a skalar - it depends of your problem.

## RE: Create 250^4 or 250^5 elements-arrays

This seems to be a good way to try. I will try to do this. Thank you very much.

## RE: Create 250^4 or 250^5 elements-arrays

Maybe, even if you initialize the matrix on the current tier, it would be good to know the matrix of the previous tier.

So then the code simplify to:

## CODE

## RE: Create 250^4 or 250^5 elements-arrays

, I really appreciate your help. All I need to do is just to fix the indices.mikrom