[comp.lang.fortran] External Subprograms in Interface B

hirchert@uxe.cso.uiuc.edu (09/18/89)

peb@cs.purdue.EDU asks:
>How does one declare the arguments to an external subprogram
>in a Fortran 8x interface block?  My only reference to the 
>standard is the first edition of Metcalf and Reid.
...
>Has the standard been patched up since Metcalf and Reid's first edition
>to cover this sort of thing?

I don't have my copy of Metcalf and Reid handy to check what they had to say
about this, but the standard covered it from the beginning.  In your example,
function f had an implicit interface inside function eval, and the interface
block you supplied for eval correctly reflected that fact.  If you modify
eval to have an explicit interface for f,

      function eval(f, x)
      real x
      interface 
        function f(a)
        real f,a
        end function f
      end interface
      eval = f(x)
      return
      end function eval

you would need to modify your interface block accordingly

      interface
        function eval(f, x)
        real x
        interface 
          function f(a)
          real f,a
          end function f
        end interface
        end function eval
      end interface

Kurt W. Hirchert     hirchert@ncsa.uiuc.edu
National Center for Supercomputing Applications