I'm an absolute beginner to Fortran95 so I apologise for the simplicity of this question. I want to be able define the dimensions of an array in terms of integers but I get the error
'The module or main program array 'arrayx' at (1) must have constant shape'
and 'Variable 'y' cannot appear in the expression at (1)' (same error for x). Is it simply not possible to define the dimensions in terms of variables or am I just missing something obvious.
program arrayForm
implicit none
integer, save :: x=40, y=2
real, dimension(x,y) :: arrayX
end program arrayForm