Compile error: array argument said to have procedure attribute
Arjen Markus
arjen.markus895@gmail.com
Wed Aug 31 09:50:00 GMT 2011
Hello,
when I try to compile the program below I get the following messages:
sort_mystery.f90:15.22:
subroutine sort( array )
1
Error: PROCEDURE attribute conflicts with INTENT attribute in 'array' at (1)
sort_mystery.f90:26.20:
write(*,*) size(array)
1
Error: 'array' argument of 'size' intrinsic at (1) must be an array
Somehow the argument "array" is not seen to be a one-dimensional array.
As far as I can tell, there is nothing wrong with the code.
Regards,
Arjen
--------
! abstract_sort.f90 --
! Show how to define a generic sortable type
!
! Module for sortable objects
!
module sortable_types
type, abstract :: sortable
! No particular data
contains
end type sortable
contains
subroutine sort( array )
class(sortable), dimension(:), intent(inout), target :: array
class(sortable), allocatable :: tmp
class(sortable), pointer :: first_element
integer :: i
integer :: j
allocate( tmp, source = array(1) )
write(*,*) size(array)
end subroutine sort
end module sortable_types
More information about the Fortran
mailing list