> read (*,*) N
> Dimension AA(N)
Either make it allocatable:
real, dimension(:), allocatable :: aa
...
read (5,*) n
allocate (aa(n), stat=ierror)
or, if it's only used in one branch of the call tree, you can also make
it an automatic array:
read (5,*) n
call sub (n)
..
subroutine sub (n)
integer, intent(in) :: n
real, dimension(n) :: aa
But this gives you no error control, and most compilers will place aa on
the stack, which, on some machines, is not very large by default.
HTH,
Herbert
|