XMDF  2.2
4.1. XMDF Functions/Subroutines

All function/subroutine names begin with the letters "xf" to avoid likely conflicts with other function names. The memory for all variables must be allocated outside of the library. This is done so users can reuse memory and users are more likely to deallocate memory if they have to allocate it.

C/C++ Interface

All functions return an integer status value. A zero or positive values indicates success and negative values indicate failure.

All arrays in the C library must be contiguous blocks of memory. This means that 2D and 3D arrays must be allocated with a single allocation with the size necessary to store all the information at one time.

FORTRAN Interface

The entire FORTRAN interface uses subroutines rather than functions. The final argument is always an integer which is set to a negative number if an error occurs. The FORTRAN interface is available as a module to other model codes. The FORTAN library is just a wrapper that calls the corresponding functions in the C library.

The function calls from FORTAN to C can be slightly deferent depending upon the compiler. Thus a set of #defines are used to change the C function names. The default is for the C wrapper functions to be all lower case with an underscore after the name. If the compiler does not add an underscore then the user needs to define FLOWER. If the compiler modifies the C wrapper functions to be uppercase then the user defines FUPPER.