Could I allocate a 2D array like that? array(1,:) only have 5 elements and array(2,:) only have 3 elements? What I can do is only like allocate( array(2,5) ) but it allocates a 2*5 = 10 elements. Could I allocate 8 elements?
Asked
Active
Viewed 42 times
0
-
I just want to save spaces and avoid errors. But it seems like it does not work. – shixx597_Min Aug 13 '16 at 21:43
-
you cannot. FORTRAN is not a dynamic kind of language. To do that you would have to work with 1D array and a code of your own (ex: sparse matrix). Good luck! – Jean-François Fabre Aug 13 '16 at 21:46