This bug is similar to the issue with passing automatic arrays on the other thread. A run-time error occurs on the line nn = n when /CHECKMATE or /CHECK is used with the 32 bit compiler. (v 8.3).
I have enabled /inhibit_check 14 to get around the other bug. However, it doesn't prevent the run-time error this time. Also this error also occurs when /CHECK is used. I think its a different bug so I have created a new thread.
It works fine in version 7.2.
module proc_mod
integer :: num
integer :: bins
contains
subroutine run_analysis
bins = 40
num = 1
call process
end subroutine run_analysis
subroutine process
integer :: k
! Automatic array
integer, dimension(bins,num) :: freq
integer, dimension(num) :: k1
freq = 0
do k=1, num
call scale_vector(freq(:,k), 100, k1(k))
end do
contains
subroutine scale_vector(c, n, nn)
integer, intent(in) :: n
integer, intent(out) :: nn
integer, intent(inout) :: c(:)
print *,'subroutine was called'
nn = n
print *,'nn was defined'
end subroutine scale_vector
end subroutine process
end module proc_mod
program main
use proc_mod, only: run_analysis
call run_analysis
end program main