|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Tue Apr 24, 2018 8:02 am Post subject: Can't assign to intent(out) automatic array element. |
|
|
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.
Code: |
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
|
_________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Tue Apr 24, 2018 8:34 am Post subject: |
|
|
Thanks. The same fix as before also applies to this code.
In v7.2, runtime checking was not applied when passing array sections as arguments. Runtime checking of array sections was added and worked OK in our initial tests, but in the light of your experience it has proved necessary to backtrack until we have more time to work on this. |
|
Back to top |
|
|
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Tue Apr 24, 2018 8:39 am Post subject: Re: |
|
|
PaulLaidler wrote: | Thanks. The same fix as before also applies to this code.
In v7.2, runtime checking was not applied when passing array sections as arguments. Runtime checking of array sections was added and worked OK in our initial tests, but in the light of your experience it has proved necessary to backtrack until we have more time to work on this. |
Thanks Paul. I understand the need to backtrack. For this one I have enabled /SUPPRESS_ARG_CHECK as a workaround. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|