Kenneth_Smith
Joined: 18 May 2012 Posts: 801 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Sun Jan 12, 2025 6:20 pm Post subject: Error 967 |
|
|
Paul,
I think you need to look at this one.
Code: | !
! With either the 32 bit or 64 bit complier, with /checkmate the following
! error stops compilation at the line indicated:
!
! error 967 - In the INTERFACE to F1, the first argument (A) is rank 1,
! but it is a scalar in this call
!
! F2 does not generate this error.
!
! If a is not allocatable, and simply real*8 :: a(10) /checkmate does not
! report error 967.
!
! If the contains section of program P1 is commented out and instead uses
! pmod the program compiles and runs without error with /checkmate.
!
module pmod
implicit none
contains
logical function f1( a )
real*8, intent(in) :: a(:)
f1 = .false.
if (size(a) .gt. 1) f1 = .true.
end function f1
function f2( a ) result ( returnvalue )
real*8, intent(in) :: a(:)
logical :: returnvalue
returnvalue = .false.
if (size(a) .gt. 1) returnvalue = .true.
end function f2
end module pmod
program p1
!use pmod
implicit none
real*8, allocatable :: a(:)
!real*8 :: a(10)
integer :: i
allocate(a(10))
do i = 1, 10
a(i) = i
end do
print*, f1(a) ! #####
print*, f2(a)
contains
logical function f1( a )
real*8, intent(in) :: a(:)
f1 = .false.
if (size(a) .gt. 1) f1 = .true.
end function f1
function f2( a ) result ( returnvalue )
real*8, intent(in) :: a(:)
logical :: returnvalue
returnvalue = .false.
if (size(a) .gt. 1) returnvalue = .true.
end function f2
end program p1 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8182 Location: Salford, UK
|
Posted: Mon Jan 13, 2025 8:15 am Post subject: |
|
|
Ken
Thank you for the valued feedback.
This false error report has now be fixed for the next release of FTN95.
In the mean time, a work-around is to use /ignore 967 when using /undef in this context. |
|