- #1
ZackVM
- 3
- 0
I'm having trouble allocating memory for a dynamic two dimensional array in FORTRAN 90; the odd thing is that when I did the same thing using three on dimensional arrays instead of an array with the dimensions 3*x, I didn't have a problem.
read (1,*) ndat1 !The first line of every file is the number of
read (2,*) ndat2 !rows of data.
allocate (input1(3,ndat1), STAT=AllocateStatus) !Allocating memory for input arrays.
if (AllocateStatus /= 0) STOP "first ***Not enough memory"
allocate (input1(3,ndat2), STAT=AllocateStatus)
if (AllocateStatus /= 0) STOP "***second Not enough memory"
When I run it, I get to 'second Non enough memory', and when I print out an error statement, I get 5014. Does anyone know what is going on? Thanks.
read (1,*) ndat1 !The first line of every file is the number of
read (2,*) ndat2 !rows of data.
allocate (input1(3,ndat1), STAT=AllocateStatus) !Allocating memory for input arrays.
if (AllocateStatus /= 0) STOP "first ***Not enough memory"
allocate (input1(3,ndat2), STAT=AllocateStatus)
if (AllocateStatus /= 0) STOP "***second Not enough memory"
When I run it, I get to 'second Non enough memory', and when I print out an error statement, I get 5014. Does anyone know what is going on? Thanks.