Prism 6.0 User's Guide

Generic Functions

Prism fully supports generic functions in Fortran 90. For example, given the generic function fadd, declared as follows:

interface fadd
  integer function intadd(i, j)
  integer*4, intent(in) :: i, j
  end function intadd
  real function realadd(x, y) 
  real, intent(in) :: x, y
  end function realadd
end interface

you can use Prism commands with these Fortran 90 generic functions:

(prism) p fadd(1,2)
(prism) whatis fadd
(prism) stop in fadd

In each case, Prism asks you which instance of fadd your command refers to: For example:

(prism) whatis fadd
More than one identifier `fadd'.
Select one of the following names:
0) Cancel
1) `f90_user_op_generic.exe`f90_user_op_generic.f90`fadd
! real*4 realadd
2) `f90_user_op_generic.exe`f90_user_op_generic.f90`fadd
! integer*4 intadd
> 1
real*4 function fadd (x, y)
(dummy argument) real*4 x
(dummy argument) real*4 y