prep_superlu Subroutine

public subroutine prep_superlu(sulu)

Arguments

Type IntentOptional AttributesName
type(SULU_ENV), intent(inout) :: sulu

Calls

proc~~prep_superlu~~CallsGraph proc~prep_superlu prep_superlu interface~dcreate_compcol_matrix dCreate_CompCol_Matrix proc~prep_superlu->interface~dcreate_compcol_matrix interface~dcreate_dense_matrix dCreate_Dense_Matrix proc~prep_superlu->interface~dcreate_dense_matrix

Called by

proc~~prep_superlu~~CalledByGraph proc~prep_superlu prep_superlu proc~analyse_solver analyse_solver proc~analyse_solver->proc~prep_superlu proc~solv_superlu solv_superlu proc~solv_superlu->proc~prep_superlu proc~solve_syst solve_syst proc~solve_syst->proc~analyse_solver proc~solution_solver solution_solver proc~solve_syst->proc~solution_solver proc~solution_solver->proc~solv_superlu program~test_solvers test_solvers program~test_solvers->proc~solve_syst

Contents

Source Code


Source Code

   subroutine prep_superlu(sulu)
   implicit none
   type(sulu_env), intent(inout) :: sulu
      integer(kind=I4) :: nn, nz, nb

      nn = sulu%n
      nz = sulu%nz
      nb = sulu%nrhs

      if (.not.allocated( sulu%perm_c )) then
         allocate( sulu%perm_c(1:nn) )
         allocate( sulu%perm_r(1:nn) )
         allocate( sulu%etree( 1:nn) )

         allocate( sulu%RR(1:nn) )
         allocate( sulu%CC(1:nn) )

         allocate( sulu%ferr(1:nb) )
         allocate( sulu%berr(1:nb) )

         allocate(   sulu%rpg(1:nb) )
         allocate( sulu%rcond(1:nb) )

         allocate( sulu%x(1:nn) )
      endif

      sulu%x(1:nn) = 0

      call dCreate_CompCol_Matrix(  A      = sulu%SMA,     & ! out SuperMatrix
                                    m      = sulu%n,       & ! in int
                                    n      = sulu%n,       & ! in int
                                    nnz    = sulu%nz,      & ! in int
                                    nzval  = sulu%a_elt,   & ! in double dimension()
                                    rowind = sulu%irow,    & ! in int dimension()
                                    colptr = sulu%jptr,    & ! in int dimension()
                                    stype  = SLU_NC,       & ! in int
                                    dtype  = SLU_D,        & ! in int
                                    mtype  = SLU_GE        & ! in int
                                 )

      call dCreate_Dense_Matrix( BX    = sulu%smb,  & ! out SuperMatrix
                                 m     = sulu%n,    & ! in int
                                 n     = sulu%nrhs, & ! in int
                                 x     = sulu%b,    & ! in double dimension()
                                 ldx   = sulu%n,    & ! in int
                                 stype = SLU_DN,    & ! in int
                                 dtype = SLU_D,     & ! in int
                                 mtype = SLU_GE     & ! in int
                               )

      call dCreate_Dense_Matrix( BX    = sulu%smx,  & ! out SuperMatrix
                                 m     = sulu%n,    & ! in int
                                 n     = sulu%nrhs, & ! in int
                                 x     = sulu%x,    & ! in double dimension()
                                 ldx   = sulu%n,    & ! in int
                                 stype = SLU_DN,    & ! in int
                                 dtype = SLU_D,     & ! in int
                                 mtype = SLU_GE     & ! in int
                               )

   return
   endsubroutine prep_superlu