Subroutine to prepare the SULU_ENV components
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(SULU_ENV), | intent(inout) | :: | sulu |
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