Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

References to Non-Fortran Procedures

When a procedure is called, Fortran (by default) passes the address of the actual argument, and its length if it is of type character. To call non-Fortran procedures, you may need to pass the actual arguments in a form different from that used by Fortran.

The built-in functions %REF and %VAL let you change the form of an actual argument. You must specify these functions in the actual argument list of a CALL statement or function reference. You cannot use them in any other context.

%LOC computes the internal address of a storage item.

The intrinsic module ISO_C_BINDING provides a standard set of mechanisms for calling C functions from Fortran, and for writing Fortran procedures called from C.