Good day,
In the main subroutine is declared a matrix size of 500 times 500. This matrix is transferred to the subroutine Set_null. In the subroutine Set_null I want another matrix (matrix_work) of the same size (a_matrix), but the program crashes. I have simplified the example to a minimum so that the problem still existed (see figures).
If you make the same thing, but for matrix 300 by 300 everything is OK (MAX_SIZE = 300).
If you use matrix_work allocatable everything is OK.
Intel Fortran Compiler 11.1.067.
Best regards
Lukas Weis
!******************************************************************************* ! Experiment6 - Padani. !******************************************************************************* subroutine Experiment6 implicit none integer(4), parameter :: MAX_SIZE = 500 real(8), dimension(MAX_SIZE, MAX_SIZE):: a_matrix call Set_null(a_matrix(1:MAX_SIZE, 1:MAX_SIZE)) return contains !******************************************************************************* ! Nulovani matice. !******************************************************************************* pure subroutine Set_null(matrix) implicit none real(8), intent(inout), dimension(:,:) :: matrix real(8), dimension(size(matrix, dim=1), size(matrix, dim=2)) :: matrix_work matrix = 0.d0 matrix_work = 0.d0 return end subroutine end subroutine Experiment6