Author: deadpickledeadpickle Date: Sep 15, 2008 13:31
I have been trying to pass an allocatable array around to a few
subroutines. I am getting a bounds error which means that the array is
not allocated. It might be better to create a little program:
!The main program
Program main
Implicit none
real, dimension(:,:), allocatable :: array
call sub1 (array)
call sub2 (array)
end program main
subroutine sub1 (array)
real, allocatable, dimension(:,:), intent(out) :: array
integer :: j
j = 1
allocate(array(j,3)
array(1,3) = 1.1
end subroutine sub1
subroutine sub2 (array)
real, allocatable, dimension(:,:), intent(inout) :: array
|