This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Compile error: array argument said to have procedure attribute
- From: Arjen Markus <arjen dot markus895 at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Date: Wed, 31 Aug 2011 11:50:02 +0200
- Subject: Compile error: array argument said to have procedure attribute
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