WriteMatrix_spec.F


c**********************************************************************
#include "author.inc"
c*    $Id: WriteMatrix_spec.F,v 1.1 1995/11/14 02:20:08 turner Exp $
c*
c*    Writes out matrix in coordinate format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit to which to write
c*      nelem - number of active elements in a
c*      a - matrix
c*      ja - index array
c*      title - character description
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_WriteMatrix_COO (lu, nelem, a, ja, title, status)
      implicit none
c
c ... Input:
      integer lu, nelem
      integer ja(2*nelem)
      real a(nelem)
      character*(*) title
c
c ... Output:
      integer status
c
c ... Local:
      integer i
c
      write(lu,*)
      write(lu,*) title
      write(lu,*)
      do i=1,nelem
       write(lu,500) ja(i), ja(i+nelem), a(i)
      enddo
c
      status = 0
      return
c
  500 format (t2, 2(2x,i7), 2x, 1pe13.6)
      end
c**********************************************************************
#include "author.inc"
c*    $Id: WriteMatrix_spec.F,v 1.1 1995/11/14 02:20:08 turner Exp $
c*
c*    Writes out matrix in RSS format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit to which to write
c*      n - rank of a
c*      nelem - number of active elements in a
c*      a - matrix
c*      ja - index array
c*      title - character description
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_WriteMatrix_RSS (lu, nelem, n, a, ja, title,
     &           status)
      implicit none
c
c ... Input:
      integer lu, n, nelem
      integer ja(nelem)
      real a(nelem)
      character*(*) title
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j, ij
c
      write(lu,*)
      write(lu,*) title
      write(lu,*)
      do ij=1,nelem
       i = (ja(ij) - 1)/n + 1
       j = ja(ij) - (i-1)*n
       write(lu,500) i, j, a(ij)
      enddo
c
      status = 0
      return
c
  500 format (t2, 2(2x,i7), 2x, 1pe13.6)
      end
c**********************************************************************
#include "author.inc"
c*    $Id: WriteMatrix_spec.F,v 1.1 1995/11/14 02:20:08 turner Exp $
c*
c*    Writes out matrix in CSS format.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      lu - logical unit to which to write
c*      n - rank of a
c*      nelem - number of active elements in a
c*      a - matrix
c*      ja - index array
c*      title - character description
c*
c*     Output:
c*      status - return status
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_WriteMatrix_CSS (lu, nelem, n, a, ja, title,
     &           status)
      implicit none
c
c ... Input:
      integer lu, n, nelem
      integer ja(nelem)
      real a(nelem)
      character*(*) title
c
c ... Output:
      integer status
c
c ... Local:
      integer i, j, ij
c
      write(lu,*)
      write(lu,*) title
      write(lu,*)
      do ij=1,nelem
       j = (ja(ij) - 1)/n + 1
       i = ja(ij) - (j-1)*n
       write(lu,500) i, j, a(ij)
      enddo
c
      status = 0
      return
c
  500 format (t2, 2(2x,i7), 2x, 1pe13.6)
      end