LoadCoeff_spec.F
c**********************************************************************
#include "author.inc"
c* $Id: LoadCoeff_spec.F,v 1.2 1996/07/08 00:51:22 turner Exp $
c*
c* Subroutine to load the nonzero elements of a coefficient matrix
c* in full storage format.
c*
c* <PARAMETER LIST>
c*
c* Input:
c* lu - logical unit from which to read
c* idim - leading dimension of a
c* nrows - number of rows in a
c* ncols - number of columns in a
c*
c* Output:
c* a - coefficient matrix
c* status - return status
c*
#include "copyright.inc"
c**********************************************************************
subroutine JT_LoadCoeff_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, ij
real element
c
c ... Read non-zero elements.
do ij=1,nrows*ncols
read(lu,*,end=9999,err=9999) i, j, element
if (i .eq. 0) goto 9999
a(i,j) = element
enddo
c
9999 continue
status = 0
return
end
c**********************************************************************
#include "author.inc"
c* $Id: LoadCoeff_spec.F,v 1.2 1996/07/08 00:51:22 turner Exp $
c*
c* Subroutine to load the nonzero elements of a coefficient matrix
c* in ELL storage format.
c*
c* <PARAMETER LIST>
c*
c* Input:
c* lu - logical unit from which to read
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*
c* Output:
c* a - coefficient matrix
c* ja - index matrix
c* status - return status
c*
#include "copyright.inc"
c**********************************************************************
subroutine JT_LoadCoeff_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, ij, j, jj
real element
c
c ... Read non-zero elements.
do ij=1,nrows*maxnz
read(lu,*,end=9999,err=9999) i, j, element, jj
if (i .eq. 0) goto 9999
a(i,jj) = element
ja(i,jj) = j
enddo
c
9999 continue
status = 0
return
end
c**********************************************************************
#include "author.inc"
c* $Id: LoadCoeff_spec.F,v 1.2 1996/07/08 00:51:22 turner Exp $
c*
c* Subroutine to load the nonzero elements of a coefficient matrix
c* in COO storage format.
c*
c* <PARAMETER LIST>
c*
c* Input:
c* lu - logical unit from which to read
c* nelem - number of active elements in a
c* nrows - number of rows in a
c*
c* Output:
c* a - coefficient matrix
c* ja - index array
c* status - return status
c*
#include "copyright.inc"
c**********************************************************************
subroutine JT_LoadCoeff_COO (lu, nelem, a, ja, status)
implicit none
c
c ... Input:
integer lu, nelem
integer ja(2*nelem)
real a(nelem)
c
c ... Output:
integer status
c
c ... Local:
integer i, j, ij, iijj
real element
c
c ... Read non-zero elements.
do iijj=1,nelem
read(lu,*,end=9999,err=9999) i, j, element, ij
if (i .eq. 0) goto 9999
a(ij) = element
ja(ij) = i
ja(ij+nelem) = j
enddo
c
9999 continue
status = 0
return
end
c**********************************************************************
#include "author.inc"
c* $Id: LoadCoeff_spec.F,v 1.2 1996/07/08 00:51:22 turner Exp $
c*
c* Subroutine to load the nonzero elements of a coefficient matrix
c* in RSS storage format.
c*
c* <PARAMETER LIST>
c*
c* Input:
c* lu - logical unit from which to read
c* nelem - number of active elements in a
c* nrows - number of rows in a
c*
c* Output:
c* a - coefficient matrix
c* ja - index array
c* status - return status
c*
#include "copyright.inc"
c**********************************************************************
subroutine JT_LoadCoeff_RSS (lu, nelem, a, ja, status)
implicit none
c
c ... Input:
integer lu, nelem
integer ja(nelem)
real a(nelem)
c
c ... Output:
integer status
c
c ... Local:
integer i, j, ij, iijj, map
real element
c
c ... Read non-zero elements.
do iijj=1,nelem
read(lu,*,end=9999,err=9999) i, j, element, map, ij
if (i .eq. 0) goto 9999
a(ij) = element
ja(ij) = map
enddo
c
9999 continue
status = 0
return
end
c**********************************************************************
#include "author.inc"
c* $Id: LoadCoeff_spec.F,v 1.2 1996/07/08 00:51:22 turner Exp $
c*
c* Subroutine to load the nonzero elements of a coefficient matrix
c* in CSS storage format.
c*
c* <PARAMETER LIST>
c*
c* Input:
c* lu - logical unit from which to read
c* nelem - number of active elements in a
c* nrows - number of rows in a
c*
c* Output:
c* a - coefficient matrix
c* ja - index array
c* status - return status
c*
#include "copyright.inc"
c**********************************************************************
subroutine JT_LoadCoeff_CSS (lu, nelem, a, ja, status)
implicit none
c
c ... Input:
integer lu, nelem
integer ja(nelem)
real a(nelem)
c
c ... Output:
integer status
c
c ... Local:
integer i, j, ij, iijj, map
real element
c
c ... Read non-zero elements.
do iijj=1,nelem
read(lu,*,end=9999,err=9999) i, j, element, map, ij
if (i .eq. 0) goto 9999
a(ij) = element
ja(ij) = map
enddo
c
9999 continue
status = 0
return
end