I'm trying to pass an allocatable array, which is already allocated, to a subroutine. something like this:
real(8), dimension(:,:), allocatable :: A allocate (A (6,6)) call subroutine mysub(A) subroutine mysub(B) real (8), dimension (:,:) :: B write (*,*) B(1,1)
This causes segmentation fault when mysub is accessing B. I have had the same approach to pass the array to a function and it worked fine. I wonder what's going wrong here.
Thanks,
Alireza