Convert.F


#include "iadefines.h"
c**********************************************************************
#include "author.inc"
c*    $Id: Convert.F,v 1.2 1996/04/24 19:14:02 turner Exp $
c*
c*    Convert between coefficient storage formats.
c*
c*    On input a,ia,ja should be completely defined, and ib(_JT_storage_)
c*    should contain the desired format for b,ib,jb.
c*
c*    <PARAMETER LIST>
c*
c*     Input:
c*      a - matrix
c*      ia - integer vector containing info about how "a" is stored
c*        NOTE: see description of ia below
c*      ja - index array
c*
c*     In/Out:
c*      ib - integer vector containing info about how "a" is stored
c*        NOTE: see description of ia below
c*
c*     Output:
c*      b - matrix
c*      jb - index array
c*      status - return status
c*        -1  ==>  invalid argument(s)
c*         0  ==>  success
c*
#include "iadesc.inc"
c*
c*    <SUBROUTINES REQUIRED>
c*
c*     JT_ELL2COO - converts from ELL to COO format
c*     JT_ELL2RSS - converts from ELL to RSS format
c*     JT_ELL2CSS - converts from ELL to CSS format
c*
#include "copyright.inc"
c**********************************************************************
      subroutine JT_Convert (a, ia, ja, b, ib, jb, status)
      implicit none
c
c ... Input:
      real a(*)
      integer ia(_JT_no_of_storage_parameters_)
      integer ja(*)
c
c ... In/Out:
      integer ib(_JT_no_of_storage_parameters_)
c
c ... Output:
      real b(*)
      integer jb(*)
      integer status
c
      if (ia(_JT_storage_) .eq. _JT_storage_ELL_) then
       if (ib(_JT_storage_) .eq. _JT_storage_COO_) then
        call JT_ELL2COO (ia(_JT_idim_), ia(_JT_nrows_), ia(_JT_maxnz_), a, ja,
     &                   ib(_JT_nelem_), ib(_JT_nrows_), b, jb, status)
       elseif (ib(_JT_storage_) .eq. _JT_storage_RSS_) then
        call JT_ELL2RSS (ia(_JT_idim_), ia(_JT_nrows_), ia(_JT_maxnz_), a, ja,
     &                   ib(_JT_nelem_), ib(_JT_nrows_), b, jb, status)
       elseif (ib(_JT_storage_) .eq. _JT_storage_CSS_) then
        call JT_ELL2CSS (ia(_JT_idim_), ia(_JT_nrows_), ia(_JT_maxnz_), a, ja,
     &                   ib(_JT_nelem_), ib(_JT_nrows_), b, jb, status)
       else
        status = -1
       endif
      else
       status = -1
      endif
c
      return
      end