Is there a function to identify the type of dummy arguments?

Is there a function to identify the type of dummy arguments?

Post by li.simul » Tue, 11 Sep 2007 11:05:20


Seems that I'm a little crazy! hehe
 
 
 

Is there a function to identify the type of dummy arguments?

Post by Arjen Mark » Tue, 11 Sep 2007 16:32:25


You better let the compiler do that for you. It is far better
equipped to check the types than us mere mortals:

module mymodule
interface mysub
module procedure a, b
end interface
contains

subroutine a(x)
integer :: x
end subroutine


subroutine a(x)
real :: x
end subroutine
end module

program myprogram
use mymodule

real :: x
integer :: y

call mysub(x) ! The compiler will call b()
call mysub(y) ! The compiler will call a()

end program myprogram

Or perhaps you should explain a bit why you need such
a function?

Regards,

Arjen

 
 
 

Is there a function to identify the type of dummy arguments?

Post by James Turs » Tue, 11 Sep 2007 17:46:46

I think you meant "b" for the real subroutine, e.g.

subroutine b(x)
real :: x
end subroutine


On Mon, 10 Sep 2007 00:32:25 -0700, Arjen Markus
 
 
 

Is there a function to identify the type of dummy arguments?

Post by Arjen Mark » Tue, 11 Sep 2007 19:04:12


Oops, yes, you are right :)