Static Analysis Problem Type Reference
The type of an actual argument does not match the corresponding formal parameter at a subroutine call.
Specifically, this error occurs when both the actual and formal parameter types are arrays, but the element sizes do not match.
This same kind of error can also happen when a FORTRAN dummy argument of type subroutine is invoked. That is, the subroutine that is invoked through a dummy argument might exhibit the same problem as can occur in a direct call. In this case, the problem may or may not happen, depending on what subroutine was passed to the dummy argument of subroutine type. There will be an additional code location in such cases that identifies the call site where the subroutine argument was passed in.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Call site |
The actual argument that was passed |
|
2 |
Definition |
The definition of the called procedure and shows the declaration of the formal parameter |
subroutine mysub(m)
type mytype1
integer f1
real f2
end type mytype1
type (mytype1), dimension(3) :: m
print *, m
end
type mytype2
integer g1
real g2
integer g3
end type mytype2
type (mytype2), dimension(2) :: n
n%g1 = 1
call mysub(n)
! sizes of element of argument #1 and element of dummy argument are different.
print *,n%g1
end