PIM iterative method routines need parameters corresponding to external routines for the matrix-vector (possible matrix-transpose-vector) product, and the preconditioner application.
The calling interface for these external routines is fairly simple, e.g.,
subroutine matvec{u,v,ipar} double precision u(*),v(*) integer ipar(*)where the ipar array is the information array that is passed to the iterative method.
Unfortunately this puts a number of restriction on the user's choices. For instance, it implies that the matrix has to be in common blocks, and that the vectors need to be simple arrays; they can not be pointers to more elaborate structures.