DumpCoeff.F


#include "iadefines.h"
c**********************************************************************
#include "author.inc"
c*    $Id: DumpCoeff.F,v 1.5 1996/07/08 00:50:17 turner Exp $
c*
c*    Subroutine to dump the nonzero elements of a coefficient matrix
c*    in a variety of storage formats.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit to which to write
c*      a - coefficient matrix
c*      ia - integer vector containing info about how "a" is stored
c*        NOTE: see description of ia below
c*      ja - map array
c*
c*     Output:
c*      status - return status
c*        -1  ==>  invalid argument(s)
c*         0  ==>  success
c*
#include "iadesc.inc"
c*
c*    <SUBROUTINES REQUIRED>
c*
c*     JT_DumpCoeff_Full - for full-storage format
c*     JT_DumpCoeff_ELL - for ELL storage format
c*     JT_DumpCoeff_COO - for coordinate format
c*     JT_DumpCoeff_RSS - for RSS format
c*     JT_DumpCoeff_CSS - for CSS format
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_DumpCoeff (lu, a, ia, ja, status)
      implicit none
c
c ... Input:
      integer lu
      integer ia(_JT_no_of_storage_parameters_)
      integer ja(*)
      real a(*)
c
c ... Output:
      integer status
c
c ... Local:
      integer i
      real zero
      parameter (zero=0.0d0)
c
c ... Write out array storage info.
      write(lu,100) '#', (ia(i), i=1,_JT_no_of_storage_parameters_)
c
c ... Write out coefficient in appropriate format.
      if (ia(_JT_storage_) .eq. _JT_storage_full_) then
       call JT_DumpCoeff_Full (lu, ia(_JT_idim_), ia(_JT_nrows_), ia(_JT_nrows_), a, status)
      else if (ia(_JT_storage_) .eq. _JT_storage_ELL_) then
       call JT_DumpCoeff_ELL (lu, ia(_JT_idim_), ia(_JT_nrows_), ia(_JT_maxnz_), a, ja, status)
      else if (ia(_JT_storage_) .eq. _JT_storage_COO_) then
       call JT_DumpCoeff_COO (lu, ia(_JT_nelem_), ia(_JT_nrows_), a, ja, status)
      else if (ia(_JT_storage_) .eq. _JT_storage_RSS_) then
       call JT_DumpCoeff_RSS (lu, ia(_JT_nelem_), ia(_JT_nrows_), a, ja, status)
      else if (ia(_JT_storage_) .eq. _JT_storage_CSS_) then
       call JT_DumpCoeff_CSS (lu, ia(_JT_nelem_), ia(_JT_nrows_), a, ja, status)
      else
       status = -1
      endif
c
c ... Write divider.
      write(lu,101) 0, 0, zero, 0, 0
c
      return
  100 format (a1, _JT_no_of_storage_parameters_(1x, i8))
  101 format (2(i8, 1x), 1pg15.8, 2(1x, i8))
      end