INTERFACE problem

Paul Thomas paulthomas2@wanadoo.fr
Thu Mar 9 17:16:00 GMT 2006


Michael,

This list is associated with gfortran, which is the gcc fortran 
compiler.  g95 is the other GNU fortran95 compiler.  See our wiki for an 
explanation.

That said, we can help you out:

>
>Module IntTest2
>
>IMPLICIT NONE
>
>CONTAINS
>
>     SUBROUTINE mytest(myfunc,x,s)
>         INTERFACE
>           FUNCTION myfunc(x,a,b)
>              REAL(8)  x,a,b
>           END FUNCTION myfunc
>         END INTERFACE
>
You have not declared the type of the function itself.  Both g95 (last 
week's Linux binary) and gfortran give the identical message here:

           FUNCTION myfunc(x,a,b)
                          1
Error: Symbol 'myfunc' at (1) has no IMPLICIT type
Add myfunc to the list of real(8)'s (or declare whatever it is) and you 
will find that both compilers will now produce an object file.

View the interface as being like a C prototype;

double *
myfunc (double *, double *, double*);

is equivalent to

INTERFACE
  FUNCTION myfunc (x, a, b)
    REAL(8)  x, a, b, myfunc
  END FUNCTION myfunc
END INTERFACE

You will find gfortran binaries at our wiki, as well.

Best regards

Paul Thomas









More information about the Fortran mailing list