In the code below an automatic array freq is declared since the extents of each dimension are defined variables in the module.
This code is ANSI/ISO compliant.
When run with /CHECKMATE enabled the following error message is provided. The error happens when trying to make the call to scale_vector.
*** Error 14, Attempt to alter an actual argument that is a constant, an expression, an INTENT(IN) argument, or a DO variable
This error occurs with 32 bit (whether debugging or not).
Using the 64 bit compiler and /CHECKMATE the code works but the debugger doesn't work (it doesn't open).
This code works in version 7.2 and 8.05.
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, k1
! Automatic array
integer, dimension(bins,num) :: freq
freq = 0
do k=1, num
call scale_vector(freq(:,k), 100, k1)
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'
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