We now discuss the implementation of the Fortran wrappers.
The main task is to convert between arguments specified
by the Fortran interfaces and arguments specified by
the C interfaces. If their types happen to be the same, there
is no need to convert. Otherwise, we need to declare temporaries
to accommodate the conversion. Depending on the
intent value, we may need to convert Fortran to C (for in
arguments), or convert C to Fortran (for out arguments),
or do both (for inout arguments). When an argument is an
array, if a temporary array is needed, we need to allocate it
efficiently. We now discuss argument conversion for various
Fortran types.