Zoltan User's Guide  |  Next  |  Previous

FORTRAN 77

There is no FORTRAN 77 interface for Zoltan; however, an existing FORTRAN 77 application can be compiled by a Fortran 90 compiler provided it does not use vendor specific extensions (unless the same extensions are supported by the Fortran 90 compiler), and the application can use Zoltan's Fortran 90 interface with a minimal amount of Fortran 90 additions. This section provides details of the Fortran 90 code that must be added.

When building the Zoltan library, use the file fort/zoltan_user_data.f90 for zoltan_user_data.f90. This assumes that DATA in a call to ZOLTAN_SET_FN is either omitted (you can omit arguments that are labeled OPTIONAL in the Fortran API) or an array of type INTEGER, REAL or DOUBLE PRECISION (REAL*4 and REAL*8 might be acceptable). If a more complicated set of data is required (for example, two arrays), then it should be made available to the query functions through COMMON blocks.

To get access to the interface, each program unit (main program, subroutine or function) that calls a Zoltan routine must begin with the statement

and this should be the first statement after the program, subroutine or function statement (before the declarations).

The pointer to the Zoltan structure returned by ZOLTAN_CREATE should be declared as

(you can use a name other than ZZ if you wish).

To create the structure, use a pointer assignment statement with the call to ZOLTAN_CREATE:

Note that the assignment operator is "=>". If ZZ is used in more than one procedure, then put it in a COMMON block. It cannot be passed as an argument unless the procedure interfaces are made "explicit." (Let's not go there.)

The eight import and export arrays passed to ZOLTAN_LB_PARTITION (and other procedures) must be pointers. They should be declared as, for example,

Note that the double colon after POINTER is required, and the dimension must be declared as "(:)" with a colon. Like ZZ, if they are used in more than one procedure, pass them through a COMMON block, not as an argument.

Except in the unlikely event that the default kinds of intrinsic types do not match the C intrinsic types, you do not have to use the kind type parameters Zoltan_INT, etc. It is also not necessary to include the INTENT attribute in the declarations of the query functions, so they can be simplified to, for example,

to be more consistent with a FORTRAN 77 style.


[Table of Contents  |  Next:  FORTRAN--System-Specific Remarks  |  Previous:  FORTRAN API