PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Passing a procedure(*) argument to another subroutine

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
ionutg



Joined: 25 Jul 2009
Posts: 1

PostPosted: Thu Mar 08, 2012 5:56 pm    Post subject: Passing a procedure(*) argument to another subroutine Reply with quote

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
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6146
Location: The Portland Group Inc.

PostPosted: Tue Mar 13, 2012 10:06 am    Post subject: Reply with quote

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
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 441

PostPosted: Tue May 28, 2013 6:56 pm    Post subject: TPR 18543 was fixed in 12.10 Reply with quote

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
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group