When using the DllFunction class, it is necessary to specify the type and value of each function parameter. When calling a Fortran function from an IMLPlus program, it is necessary to map the Fortran data type expected by the function into an equivalent Java data type. ("Equivalent" in this context usually means "same bit width".) There are several issues to be aware of:
By default, Fortran passes scalar parameters by reference. When interfacing a Fortran function with IMLPlus, it is usually best to configure the Fortran function to accept scalar parameters passed by value.
This is really not a hardship because IML doesn't support a data type for complex numbers either. You can pass the real and imaginary components of a complex number to a Fortran function as a pair of parameters of type REAL(8) and then compose a COMPLEX variable within the Fortran function.
IMLPlus cannot directly call a Fortran function that requires a derived-type parameter. You can, however, write an intermediate Fortran function that IMLPlus can call that in turn calls the Fortran function requiring the derived-type parameter.
In many cases, IMLPlus is able to convert from one data type to another automatically. This is often very useful when calling a Fortran function. For example, if a Fortran function expects a particular parameter to be of type INTEGER(4) but your IMLPlus program has the value in a scalar numeric matrix, you can call the method NextArgIsInt32 and pass it the matrix variable. IMLPlus will automatically convert from the matrix data type to the Java type int, which corresponds to the Fortran type INTEGER(4). For details on type conversion in IMLPlus, see Type Conversion and Casting.
Please refer to the following topics:
Passing a Numeric Matrix to a Fortran Function
Passing a Character Matrix to a Fortran Function
When interfacing Fortran with IMLPlus, keep in mind that the DllFunction class is really designed for interfacing C with IMLPlus. Thus, the easiest way to interface a Fortran function with IMLPlus is to make the Fortran function look like a C function. You should review the information on passing parameters to C functions.
If you are using Compaq Visual Fortran, there is extensive documentation on the subject of interfacing Fortran with other programming languages in the Programmer's Guide in the chapter Programming with Mixed Languages.