| View previous topic :: View next topic |
| Author |
Message |
ionutg
Joined: 25 Jul 2009 Posts: 1
|
Posted: Thu Mar 08, 2012 5:56 pm Post subject: Passing a procedure(*) argument to another subroutine |
|
|
Hi everyone
I am tryingto pass a subroutine f() as an argument to subroutine a() and then to b()
| Code: |
call a(f)
subroutine a(f)
procedure(sub) :: f
call b(f)
end subroutine
subroutine b(f)
procedure(sub) :: f
call f()
end subroutine |
but if fails with
| Quote: | | PGF90-S-0448-Argument number 1 to b must be a subroutine name (r.f90: 24) |
ifort and gfortran compile and run just fine.
Am I missing anything?
Thanks a lot,
Ionut
Here is a full code to play with:
| Code: |
module m
abstract interface
subroutine sub(i)
integer :: i
end subroutine
end interface
contains
subroutine c(i)
integer :: i
print *, 'F was called with i=', i
end subroutine
end module
program r
use m
call a(c)
contains
subroutine a(f)
procedure(sub) :: f
print *, 'A calling B'
call b(f)
end subroutine
subroutine b(f)
procedure(sub) :: f
print *, 'B calling F'
call f(5)
end subroutine
end program
|
|
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4995 Location: The Portland Group Inc.
|
Posted: Tue Mar 13, 2012 10:06 am Post subject: |
|
|
Hi ionutg,
I passed this on to our compiler engineers and they determined that it is a compiler error. We have create TPR#18543 to track this issue.
Thanks for the report!
Mat |
|
| Back to top |
|
 |
jtull
Joined: 30 Jun 2004 Posts: 233
|
Posted: Tue May 28, 2013 6:56 pm Post subject: TPR 18543 was fixed in 12.10 |
|
|
TPR 18543 - Error should not be detected for passing a procedure dummy argument
was corrected in our 12.10 release. A late update for you.
dave |
|
| Back to top |
|
 |
|