mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Sat Feb 10, 2018 10:24 pm Post subject: FTN95 8.10 false error report of undefined variable |
|
|
The following program is a shortened version of a larger program (Hompack90) in which the same mysterious runtime error was generated when I compiled and ran it with FTN95 8.10 32- or 64-bit), with /check /debug.
Code: | program salbugx
implicit none
integer :: y(6) = (/ 1, 2, 3, 4, 5, 6 /)
integer :: n = 5
integer :: q(6)
!
call tang(y,q,n)
print *,q(:n)
contains
subroutine tang(y, q, n)
implicit none
integer n,np1
integer :: q(n+1),y(:)
!
np1 = n+1
call f(y(2:np1), q(1:n))
return
end subroutine tang
subroutine f(x, v)
implicit none
integer, intent(in) :: x(:)
integer, intent(out) :: v(:)
integer :: n
!
n = size(x)
v(1) = product(x) - 1
v(2:n) = sum(x) - (n+1) + x(2:n)
return
end subroutine f
end program |
The output from the program with the /check /debug options:
Code: | Runtime error from program:s:\homp\tbed\buga1.exe
Run-time Error
*** Error 15, Attempt to access undefined argument to routine
SALBUGX~F - in file buga1.f90 at line 28 [+00d9]
SALBUGX~TANG - in file buga1.f90 at line 17 [+00e0]
SALBUGX - in file buga1.f90 at line 7 [+0075] |
In reality, the variables used are all defined, and the expected output from the program is:
|
|