I have been investigating the use of /xref and I am finding a few problems. When I review the results, I am getting a lot of incorrect reports. For example; the routine daxpy is at the end of a file from lines 520:532 and consists of:
subroutine daxpy ( n, a, x, y )
! [y] = [y] + a * [x]
integer*4, INTENT (IN) :: n
real*8, INTENT (IN) :: x(n), a
real*8, INTENT (INOUT) :: y(n)
if ( n==1 ) then
y(1) = y(1) + a * x(1)
else
y = y + a * x
end if
end subroutine daxpy
The xref produced includes Generating information for SUBROUTINE DAXPY
DOUBLE PRECISION, INTENT(IN), ARGUMENT :: A
317, 333, 347, 348, 349*, 351*, 359,
363, 364, 385, 405, 425, 427, 429,
457, 494, 515, 543, 558, 566, 599,
606, 614, 631, 641*, 646*, 681, 691,
693, 736, 740, 742
SUBROUTINE DAXPY
INTEGER, INTENT(IN), ARGUMENT :: N
314, 315, 317, 327, 333, 385, 405*,
421, 425, 427, 429, 453, 454, 457,
466, 467, 468, 494, 515, 538, 539,
543, 549, 550, 558, 566, 595, 596,
599, 606, 614, 626, 627, 631, 636,
645, 677, 678, 681, 686, 730*, 735,
736, 738, 739
DOUBLE PRECISION, INTENT(IN), ARGUMENT, DIMENSION(1:) :: X
317, 345, 347, 363*, 365, 390, 404,
425, 427, 429, 457, 494, 543, 558,
599, 606, 631, 641, 681, 693, 736,
740, 742
DOUBLE PRECISION, INTENT(INOUT), ARGUMENT, DIMENSION(1:) :: Y
315, 332, 333, 389, 400, 425, 427,
429, 454, 468, 494, 515, 539, 558,
566, 596, 606, 614, 631, 646, 678,
690, 738, 740*, 742*
My understanding is that the numbers refer to line numbers, which should be in the range 520:532 ? In general the line number references are not correct. There are 13 routines in the file, which has USE, INCLUDE and CONTAINS being used. I am using: Silverfrost FTN95/.NET Copyright (C) 1993-2018 Silverfrost Ltd Version: 8.40.0 Built: Mon Nov 12 12:24:36 2018
Actually I am also investigating a reverse xref, where I can list all places where a routine is being referenced. I was intending to generate .xrf files and then try to interpret them and so produce the reverse reference.
I thought there was once a /XREFS option (FTN77 ?) that listed only those variables that are defined AND used, which excludes listing variables in INCLUDE and USE that are not used in the routine.
I would be happy to explain further or email an example.
John