ILU.F


#include "iadefines.h"
c**********************************************************************
#include "author.inc"
c*    $Id: ILU.F,v 1.4 1996/04/24 19:34:36 turner Exp $
c*
c*    Compute the incomplete LU factorization of a matrix.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      omega - relaxation parameter
c*
c*     In/Out:
c*      a - matrix to be factored
c*      ia - integer vector containing info about how "a" is stored
c*        NOTE: see description of ia below
c*      ja - column index array for a
c*
c*     Output:
c*      status - return status
c*        -1  ==>  invalid argument(s)
c*         0  ==>  success
c*
c*    <SUBROUTINES REQUIRED>
c*
c*     JT_ILU_ELL
c*     JT_ILU_Full
c*     JT_MILU
c*     JT_RILU
c*
#include "iadesc.inc"
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_ILU (omega, a, ia, ja, status)
      implicit none
c
c ... Input:
      real omega
c
c ... In/Out:
      integer ia(_JT_no_of_storage_parameters_), ja(*)
      real a(*)
c
c ... Output:
      integer status
c
c ... Local:
      real zero, one
c
      parameter (zero=0.0d0, one=1.0d0)
c
      if (omega .eq. zero) then
       if (ia(_JT_storage_) .eq. _JT_storage_full_) then
        call JT_ILU_Full (ia(_JT_idim_), ia(_JT_nrows_), a, status)
       elseif (ia(_JT_storage_) .eq. _JT_storage_ELL_) then
        call JT_ILU_ELL (ia(_JT_idim_), ia(_JT_nrows_), ia(_JT_maxnz_), ja, a, status)
       else
        status = -1
       endif
      elseif (omega .eq. one) then
       call JT_MILU (a, ia, ja, status)
      else
       call JT_RILU (omega, a, ia, ja, status)
      endif
c
      return
      end