# Fortran 95 Interface Conventions

Fortran 95 interface to BLAS and Sparse BLAS Level 1 routines is implemented through wrappers that call respective FORTRAN 77 routines. This interface uses such features of Fortran 95 as assumed-shape arrays and optional arguments to provide simplified calls to BLAS and Sparse BLAS Level 1 routines with fewer parameters.

### Note

For BLAS, Intel MKL offers two types of Fortran 95 interfaces:

- using mkl_blas.fi only through `include ‘mkl_blas_subroutine.fi’` statement. Such interfaces allow you to make use of the original LAPACK routines with all their arguments
- using mkl_blas.f90 that includes improved interfaces described below. This file is used to generate the module files mkl95_blas.mod and mkl95_precision.mod. See also section “Fortran 95 interfaces and wrappers to LAPACK and BLAS” of Intel® MKL User's Guide for details. The module files are used to process the FORTRAN use clauses referencing the LAPACK interface: `use mkl95_blas` and `use mkl95_precision`.

The main conventions used in Fortran 95 interface are as follows:

- The names of parameters used in Fortran 95 interface are typically the same as those used for the respective generic (FORTRAN 77) interface. However, certain changes of some parameter names are made to reduce their number in the whole library. For BLAS and Sparse BLAS Level 1 routines only one generic parameter name ap is changed to a in the Fortran 95 interface.

  Note that these changes of the formal parameter names have no impact on program semantics and follow the conventions of names unification.

- Some input parameters such as array dimensions are not required in Fortran 95 and are skipped from the calling sequence. Array dimensions are reconstructed from the user data that must exactly follow the required array shape.

- A parameter can be skipped if its value is completely defined by the presence or absence of another parameter in the calling sequence, and the restored value is the only meaningful value for the skipped parameter.

- Parameters specifying the increment values incx and incy are skipped. In most cases their values are equal to 1. In Fortran 95 an increment with different value can be directly established in the corresponding parameter.

- Some generic parameters are declared as optional in Fortran 95 interface and may or may not be present in the calling sequence. A parameter can be declared optional if it satisfies one of the following conditions:

  1. It can take only a few possible values. The default value of such parameter typically is the first value in the list; all exceptions to this rule are explicitly stated in the routine description.

  2. It has a natural default value.

  Optional parameters are given in square brackets in Fortran 95 call syntax.

The particular rules used for reconstructing the values of omitted optional parameters are specific for each routine and are detailed in the respective “Fortran 95 Notes” subsection at the end of routine specification section. If this subsection is omitted, the Fortran 95 interface for the given routine does not differ from the corresponding FORTRAN 77 interface.

Note that this interface is not implemented in the current version of Sparse BLAS Level 2 and Level 3 routines. Fortran 95 interface for each of these routines is given in the “Interfaces - Fortran 95” subsection at the end of the respective routine specification section.

Parent topic: BLAS and Sparse BLAS Routines