DumpCoeff_spec.F


c**********************************************************************
#include "author.inc"
c*    $Id: DumpCoeff_spec.F,v 1.1 1996/03/17 23:24:01 turner Exp $
c*
c*    Subroutine to dump the nonzero elements of a coefficient matrix
c*    in full storage format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit
c*      idim - leading dimension of a
c*      nrows - number of rows in a
c*      ncols - number of columns in a
c*      a - coefficient matrix
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_DumpCoeff_Full (lu, idim, nrows, ncols, a, status)
      implicit none
c
c ... Input:
      integer idim, lu, nrows, ncols
      real a(idim,ncols)
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j
      real zero
      parameter (zero=0.0d0)
c
c ... Write out non-zero elements.
      do i=1,nrows
       do j=1,ncols
        if (a(i,j) .ne. zero) write(lu,100) i, j, a(i,j)
       enddo
      enddo
c
      status = 0
      return
  100 format (2(i8, 1x), 1pg15.8)
      end
c**********************************************************************
#include "author.inc"
c*    $Id: DumpCoeff_spec.F,v 1.1 1996/03/17 23:24:01 turner Exp $
c*
c*    Subroutine to dump the nonzero elements of a coefficient matrix
c*    in ELL storage format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit
c*      idim - leading dimension of a
c*      nrows - number of rows in a
c*      maxnz - max number of non-zero elements in any row of a
c*      a - coefficient matrix
c*      ja - index matrix
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_DumpCoeff_ELL (lu, idim, nrows, maxnz, a, ja,
     &           status)
      implicit none
c
c ... Input:
      integer idim, lu, nrows, maxnz
      integer ja(idim,maxnz)
      real a(idim,maxnz)
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j
      real zero
      parameter (zero=0.0d0)
c
c ... Write out non-zero elements.
      do i=1,nrows
       do j=1,maxnz
        if (a(i,j) .ne. zero) write(lu,100) i, ja(i,j), a(i,j), j
       enddo
      enddo
c
      status = 0
      return
  100 format (2(i8, 1x), 1pg15.8, 1x, i8)
      end
c**********************************************************************
#include "author.inc"
c*    $Id: DumpCoeff_spec.F,v 1.1 1996/03/17 23:24:01 turner Exp $
c*
c*    Subroutine to dump the nonzero elements of a coefficient matrix
c*    in COO storage format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit
c*      nelem - number of active elements in a
c*      nrows - number of rows in a
c*      a - coefficient matrix
c*      ja - index array
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_DumpCoeff_COO (lu, nelem, nrows, a, ja, status)
      implicit none
c
c ... Input:
      integer lu, nelem, nrows
      integer ja(2*nelem)
      real a(nelem)
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j, ij
      real zero
c
      parameter (zero=0.0d0)
c
c ... Write out non-zero elements.
      do ij=1,nelem
       if (a(ij) .ne. zero) then
        i = ja(ij)
        j = ja(ij+nelem)
        write(lu,100) i, j, a(ij), ij
       endif
      enddo
c
      status = 0
      return
  100 format (2(i8, 1x), 1pg15.8, 1x, i8)
      end
c**********************************************************************
#include "author.inc"
c*    $Id: DumpCoeff_spec.F,v 1.1 1996/03/17 23:24:01 turner Exp $
c*
c*    Subroutine to dump the nonzero elements of a coefficient matrix
c*    in RSS storage format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit
c*      nelem - number of active elements in a
c*      nrows - number of rows in a
c*      a - coefficient matrix
c*      ja - index array
c*
c*     In/Out:
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_DumpCoeff_RSS (lu, nelem, nrows, a, ja, status)
      implicit none
c
c ... Input:
      integer lu, nelem, nrows
      integer ja(nelem)
      real a(nelem)
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j, ij
      real zero
      parameter (zero=0.0d0)
c
c ... Write out non-zero elements.
      do ij=1,nelem
       if (a(ij) .ne. zero) then
        i = (ja(ij) - 1)/nrows + 1
        j = ja(ij) - (i-1)*nrows
        write(lu,100) i, j, a(ij), ja(ij), ij
       endif
      enddo
c
      status = 0
      return
  100 format (2(i8, 1x), 1pg15.8, 2(1x, i8))
      end
c**********************************************************************
#include "author.inc"
c*    $Id: DumpCoeff_spec.F,v 1.1 1996/03/17 23:24:01 turner Exp $
c*
c*    Subroutine to dump the nonzero elements of a coefficient matrix
c*    in CSS storage format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit
c*      nelem - number of active elements in a
c*      nrows - number of rows in a
c*      a - coefficient matrix
c*      ja - index array
c*
c*     In/Out:
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_DumpCoeff_CSS (lu, nelem, nrows, a, ja, status)
      implicit none
c
c ... Input:
      integer lu, nelem, nrows
      integer ja(nelem)
      real a(nelem)
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j, ij
      real zero
      parameter (zero=0.0d0)
c
c ... Write out non-zero elements.
      do ij=1,nelem
       if (a(i) .ne. zero) then
        j = (ja(ij) - 1)/nrows + 1
        i = ja(ij) - (j-1)*nrows
        write(lu,100) i, j, a(ij), ja(ij), ij
       endif
       enddo
c
      status = 0
      return
  100 format (2(i8, 1x), 1pg15.8, 2(1x, i8))
      end