Type-bound procedure and procedure pointer component calls
Dominique Dhumieres
dominiq@lps.ens.fr
Wed Aug 27 18:26:00 GMT 2008
Daniel,
Do you understand why I get an error for the following code:
[ibook-dhum] f90/bug% cat pointer_subs_red.f90
module myMod
CONTAINS
real function proc3( arg1 )
integer :: arg1
proc3 = arg1+7
end function proc3
subroutine proc4( arg1 )
real, external :: arg1
print*, 'the func: ', arg1(0)
end subroutine proc4
end module myMod
program myProg
use myMod
PROCEDURE (), POINTER :: p => NULL()
p => proc3
call proc4( p )
end program myProg
[ibook-dhum] f90/bug% gfc pointer_subs_red.f90
pointer_subs_red.f90:17.16:
call proc4( p )
1
Error: Type/rank mismatch in argument 'arg1' at (1)
TIA
Dominique
More information about the Fortran
mailing list