|
|
@ -34,11 +34,11 @@
|
|
|
|
!!$ POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
!!$ POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
!!$
|
|
|
|
!!$
|
|
|
|
!!$
|
|
|
|
!!$
|
|
|
|
! File: mld_dilut_fct.f90
|
|
|
|
! File: mld_dilut_fact.f90
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: mld_dilut_fct
|
|
|
|
! Subroutine: mld_dilut_fact
|
|
|
|
! Version: real
|
|
|
|
! Version: real
|
|
|
|
! Contains: mld_dilut_fctint, ilut_copyin, ilut_fact, ilut_copyout
|
|
|
|
! Contains: mld_dilut_factint, ilut_copyin, ilut_fact, ilut_copyout
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine computes the ILU(k,t) factorization of the local part of the
|
|
|
|
! This routine computes the ILU(k,t) factorization of the local part of the
|
|
|
|
! matrix stored into a. This factorization is used to build the 'base
|
|
|
|
! matrix stored into a. This factorization is used to build the 'base
|
|
|
@ -90,10 +90,10 @@
|
|
|
|
! greater than 0. If the overlap is 0 or the matrix has been reordered
|
|
|
|
! greater than 0. If the overlap is 0 or the matrix has been reordered
|
|
|
|
! (see mld_bjac_bld), then blck does not contain any row.
|
|
|
|
! (see mld_bjac_bld), then blck does not contain any row.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine mld_dilut_fct(fill_in,thres,a,l,u,d,info,blck)
|
|
|
|
subroutine mld_dilut_fact(fill_in,thres,a,l,u,d,info,blck)
|
|
|
|
|
|
|
|
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
use mld_prec_mod, mld_protect_name => mld_dilut_fct
|
|
|
|
use mld_prec_mod, mld_protect_name => mld_dilut_fact
|
|
|
|
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
|
|
|
@ -112,7 +112,7 @@ subroutine mld_dilut_fct(fill_in,thres,a,l,u,d,info,blck)
|
|
|
|
type(psb_dspmat_type), pointer :: blck_
|
|
|
|
type(psb_dspmat_type), pointer :: blck_
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
name='mld_dilut_fct'
|
|
|
|
name='mld_dilut_fact'
|
|
|
|
info = 0
|
|
|
|
info = 0
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
@ -146,11 +146,11 @@ subroutine mld_dilut_fct(fill_in,thres,a,l,u,d,info,blck)
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Compute the ILU(k,t) factorization
|
|
|
|
! Compute the ILU(k,t) factorization
|
|
|
|
!
|
|
|
|
!
|
|
|
|
call mld_dilut_fctint(fill_in,thres,m,a,blck_,&
|
|
|
|
call mld_dilut_factint(fill_in,thres,m,a,blck_,&
|
|
|
|
& d,l%aspk,l%ia1,l%ia2,u%aspk,u%ia1,u%ia2,l1,l2,info)
|
|
|
|
& d,l%aspk,l%ia1,l%ia2,u%aspk,u%ia1,u%ia2,l1,l2,info)
|
|
|
|
if (info /= 0) then
|
|
|
|
if (info /= 0) then
|
|
|
|
info=4010
|
|
|
|
info=4010
|
|
|
|
ch_err='mld_dilut_fctint'
|
|
|
|
ch_err='mld_dilut_factint'
|
|
|
|
call psb_errpush(info,name,a_err=ch_err)
|
|
|
|
call psb_errpush(info,name,a_err=ch_err)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
@ -199,9 +199,9 @@ subroutine mld_dilut_fct(fill_in,thres,a,l,u,d,info,blck)
|
|
|
|
contains
|
|
|
|
contains
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: mld_dilut_fctint
|
|
|
|
! Subroutine: mld_dilut_factint
|
|
|
|
! Version: real
|
|
|
|
! Version: real
|
|
|
|
! Note: internal subroutine of mld_dilut_fct
|
|
|
|
! Note: internal subroutine of mld_dilut_fact
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine computes the ILU(k,t) factorization of the local part of the
|
|
|
|
! This routine computes the ILU(k,t) factorization of the local part of the
|
|
|
|
! matrix stored into a. These factorization is used to build the 'base
|
|
|
|
! matrix stored into a. These factorization is used to build the 'base
|
|
|
@ -263,7 +263,7 @@ contains
|
|
|
|
! info - integer, output.
|
|
|
|
! info - integer, output.
|
|
|
|
! Error code.
|
|
|
|
! Error code.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
subroutine mld_dilut_fctint(fill_in,thres,m,a,b,&
|
|
|
|
subroutine mld_dilut_factint(fill_in,thres,m,a,b,&
|
|
|
|
& d,laspk,lia1,lia2,uaspk,uia1,uia2,l1,l2,info)
|
|
|
|
& d,laspk,lia1,lia2,uaspk,uia1,uia2,l1,l2,info)
|
|
|
|
|
|
|
|
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
@ -286,7 +286,7 @@ contains
|
|
|
|
real(kind(1.d0)), allocatable :: row(:)
|
|
|
|
real(kind(1.d0)), allocatable :: row(:)
|
|
|
|
type(psb_int_heap) :: heap
|
|
|
|
type(psb_int_heap) :: heap
|
|
|
|
type(psb_dspmat_type) :: trw
|
|
|
|
type(psb_dspmat_type) :: trw
|
|
|
|
character(len=20), parameter :: name='mld_dilut_fctint'
|
|
|
|
character(len=20), parameter :: name='mld_dilut_factint'
|
|
|
|
character(len=20) :: ch_err
|
|
|
|
character(len=20) :: ch_err
|
|
|
|
|
|
|
|
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
@ -394,12 +394,12 @@ contains
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end subroutine mld_dilut_fctint
|
|
|
|
end subroutine mld_dilut_factint
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: ilut_copyin
|
|
|
|
! Subroutine: ilut_copyin
|
|
|
|
! Version: real
|
|
|
|
! Version: real
|
|
|
|
! Note: internal subroutine of mld_dilut_fct
|
|
|
|
! Note: internal subroutine of mld_dilut_fact
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine performs the following tasks:
|
|
|
|
! This routine performs the following tasks:
|
|
|
|
! - copying a row of a sparse matrix A, stored in the sparse matrix structure a,
|
|
|
|
! - copying a row of a sparse matrix A, stored in the sparse matrix structure a,
|
|
|
@ -411,14 +411,14 @@ contains
|
|
|
|
! - computing the 2-norm of the row.
|
|
|
|
! - computing the 2-norm of the row.
|
|
|
|
! The output array row is such that it contains a full row of A, i.e. it contains
|
|
|
|
! The output array row is such that it contains a full row of A, i.e. it contains
|
|
|
|
! also the zero entries of the row. This is useful for the elimination step
|
|
|
|
! also the zero entries of the row. This is useful for the elimination step
|
|
|
|
! performed by ilut_fact after the call to ilut_copyin (see mld_ilut_fctint).
|
|
|
|
! performed by ilut_fact after the call to ilut_copyin (see mld_ilut_factint).
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! If the sparse matrix is in CSR format, a 'straight' copy is performed;
|
|
|
|
! If the sparse matrix is in CSR format, a 'straight' copy is performed;
|
|
|
|
! otherwise psb_sp_getblk is used to extract a block of rows, which is then
|
|
|
|
! otherwise psb_sp_getblk is used to extract a block of rows, which is then
|
|
|
|
! copied, row by row, into the array row, through successive calls to
|
|
|
|
! copied, row by row, into the array row, through successive calls to
|
|
|
|
! ilut_copyin.
|
|
|
|
! ilut_copyin.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine is used by mld_dilut_fctint in the computation of the ILU(k,t)
|
|
|
|
! This routine is used by mld_dilut_factint in the computation of the ILU(k,t)
|
|
|
|
! factorization of a local sparse matrix.
|
|
|
|
! factorization of a local sparse matrix.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -452,7 +452,7 @@ contains
|
|
|
|
! nrmi - real(kind(1.d0)), output.
|
|
|
|
! nrmi - real(kind(1.d0)), output.
|
|
|
|
! The 2-norm of the current row.
|
|
|
|
! The 2-norm of the current row.
|
|
|
|
! row - real(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! row - real(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! In input it is the null vector (see mld_ilut_fctint and
|
|
|
|
! In input it is the null vector (see mld_ilut_factint and
|
|
|
|
! ilut_copyout). In output it contains the row extracted
|
|
|
|
! ilut_copyout). In output it contains the row extracted
|
|
|
|
! from the matrix A. It actually contains a full row, i.e.
|
|
|
|
! from the matrix A. It actually contains a full row, i.e.
|
|
|
|
! it contains also the zero entries of the row.
|
|
|
|
! it contains also the zero entries of the row.
|
|
|
@ -491,7 +491,7 @@ contains
|
|
|
|
integer, parameter :: nrb=16
|
|
|
|
integer, parameter :: nrb=16
|
|
|
|
real(kind(1.d0)) :: dmaxup
|
|
|
|
real(kind(1.d0)) :: dmaxup
|
|
|
|
real(kind(1.d0)), external :: dnrm2
|
|
|
|
real(kind(1.d0)), external :: dnrm2
|
|
|
|
character(len=20), parameter :: name='mld_dilut_fctint'
|
|
|
|
character(len=20), parameter :: name='mld_dilut_factint'
|
|
|
|
|
|
|
|
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
info = 0
|
|
|
|
info = 0
|
|
|
@ -609,14 +609,14 @@ contains
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: ilut_fact
|
|
|
|
! Subroutine: ilut_fact
|
|
|
|
! Version: real
|
|
|
|
! Version: real
|
|
|
|
! Note: internal subroutine of mld_dilut_fct
|
|
|
|
! Note: internal subroutine of mld_dilut_fact
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine does an elimination step of the ILU(k,t) factorization on a single
|
|
|
|
! This routine does an elimination step of the ILU(k,t) factorization on a single
|
|
|
|
! matrix row (see the calling routine mld_ilut_fctint). Actually, only the dropping
|
|
|
|
! matrix row (see the calling routine mld_ilut_factint). Actually, only the dropping
|
|
|
|
! rule based on the threshold is applied here. The dropping rule based on the
|
|
|
|
! rule based on the threshold is applied here. The dropping rule based on the
|
|
|
|
! fill-in is applied by ilut_copyout.
|
|
|
|
! fill-in is applied by ilut_copyout.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! The routine is used by mld_dilut_fctint in the computation of the ILU(k,t)
|
|
|
|
! The routine is used by mld_dilut_factint in the computation of the ILU(k,t)
|
|
|
|
! factorization of a local sparse matrix.
|
|
|
|
! factorization of a local sparse matrix.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -645,12 +645,12 @@ contains
|
|
|
|
! uia1 - integer, dimension(:), input.
|
|
|
|
! uia1 - integer, dimension(:), input.
|
|
|
|
! The column indices of the nonzero entries of the part of the U
|
|
|
|
! The column indices of the nonzero entries of the part of the U
|
|
|
|
! factor above the current row, stored in uaspk row by row (see
|
|
|
|
! factor above the current row, stored in uaspk row by row (see
|
|
|
|
! ilut_copyout, called by mld_dilut_fctint), according to the CSR
|
|
|
|
! ilut_copyout, called by mld_dilut_factint), according to the CSR
|
|
|
|
! storage format.
|
|
|
|
! storage format.
|
|
|
|
! uia2 - integer, dimension(:), input.
|
|
|
|
! uia2 - integer, dimension(:), input.
|
|
|
|
! The indices identifying the first nonzero entry of each row of
|
|
|
|
! The indices identifying the first nonzero entry of each row of
|
|
|
|
! the U factor above the current row, stored in uaspk row by row
|
|
|
|
! the U factor above the current row, stored in uaspk row by row
|
|
|
|
! (see ilut_copyout, called by mld_dilut_fctint), according to
|
|
|
|
! (see ilut_copyout, called by mld_dilut_factint), according to
|
|
|
|
! the CSR storage format.
|
|
|
|
! the CSR storage format.
|
|
|
|
! uaspk - real(kind(1.d0)), dimension(:), input.
|
|
|
|
! uaspk - real(kind(1.d0)), dimension(:), input.
|
|
|
|
! The entries of the U factor above the current row (except the
|
|
|
|
! The entries of the U factor above the current row (except the
|
|
|
@ -766,7 +766,7 @@ contains
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Subroutine: ilut_copyout
|
|
|
|
! Subroutine: ilut_copyout
|
|
|
|
! Version: real
|
|
|
|
! Version: real
|
|
|
|
! Note: internal subroutine of mld_dilut_fct
|
|
|
|
! Note: internal subroutine of mld_dilut_fact
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine copies a matrix row, computed by ilut_fact by applying an
|
|
|
|
! This routine copies a matrix row, computed by ilut_fact by applying an
|
|
|
|
! elimination step of the ILU(k,t) factorization, into the arrays laspk,
|
|
|
|
! elimination step of the ILU(k,t) factorization, into the arrays laspk,
|
|
|
@ -784,10 +784,10 @@ contains
|
|
|
|
! - the inverse of the diagonal entries of U is actually stored into d; this
|
|
|
|
! - the inverse of the diagonal entries of U is actually stored into d; this
|
|
|
|
! is then managed in the solve stage associated to the ILU(k,t) factorization;
|
|
|
|
! is then managed in the solve stage associated to the ILU(k,t) factorization;
|
|
|
|
! - the row entries are stored in laspk and uaspk according to the CSR format;
|
|
|
|
! - the row entries are stored in laspk and uaspk according to the CSR format;
|
|
|
|
! - the array row is re-initialized for future use in mld_ilut_fct(see also
|
|
|
|
! - the array row is re-initialized for future use in mld_ilut_fact(see also
|
|
|
|
! ilut_copyin and ilut_fact).
|
|
|
|
! ilut_copyin and ilut_fact).
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine is used by mld_dilut_fctint in the computation of the ILU(k,t)
|
|
|
|
! This routine is used by mld_dilut_factint in the computation of the ILU(k,t)
|
|
|
|
! factorization of a local sparse matrix.
|
|
|
|
! factorization of a local sparse matrix.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -828,12 +828,12 @@ contains
|
|
|
|
! Pointer to the last occupied entry of uaspk.
|
|
|
|
! Pointer to the last occupied entry of uaspk.
|
|
|
|
! lia1 - integer, dimension(:), input/output.
|
|
|
|
! lia1 - integer, dimension(:), input/output.
|
|
|
|
! The column indices of the nonzero entries of the L factor,
|
|
|
|
! The column indices of the nonzero entries of the L factor,
|
|
|
|
! copied in laspk row by row (see mld_dilut_fctint), according
|
|
|
|
! copied in laspk row by row (see mld_dilut_factint), according
|
|
|
|
! to the CSR storage format.
|
|
|
|
! to the CSR storage format.
|
|
|
|
! lia2 - integer, dimension(:), input/output.
|
|
|
|
! lia2 - integer, dimension(:), input/output.
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! of the L factor, copied in laspk row by row (see
|
|
|
|
! of the L factor, copied in laspk row by row (see
|
|
|
|
! mld_dilut_fctint), according to the CSR storage format.
|
|
|
|
! mld_dilut_factint), according to the CSR storage format.
|
|
|
|
! laspk - real(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! laspk - real(kind(1.d0)), dimension(:), input/output.
|
|
|
|
! The array where the entries of the row corresponding to the
|
|
|
|
! The array where the entries of the row corresponding to the
|
|
|
|
! L factor are copied.
|
|
|
|
! L factor are copied.
|
|
|
@ -842,7 +842,7 @@ contains
|
|
|
|
! row is copied (only d(i) is used by the routine).
|
|
|
|
! row is copied (only d(i) is used by the routine).
|
|
|
|
! uia1 - integer, dimension(:), input/output.
|
|
|
|
! uia1 - integer, dimension(:), input/output.
|
|
|
|
! The column indices of the nonzero entries of the U factor
|
|
|
|
! The column indices of the nonzero entries of the U factor
|
|
|
|
! copied in uaspk row by row (see mld_dilut_fctint), according
|
|
|
|
! copied in uaspk row by row (see mld_dilut_factint), according
|
|
|
|
! to the CSR storage format.
|
|
|
|
! to the CSR storage format.
|
|
|
|
! uia2 - integer, dimension(:), input/output.
|
|
|
|
! uia2 - integer, dimension(:), input/output.
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
|
! The indices identifying the first nonzero entry of each row
|
|
|
@ -1154,4 +1154,4 @@ contains
|
|
|
|
end subroutine ilut_copyout
|
|
|
|
end subroutine ilut_copyout
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end subroutine mld_dilut_fct
|
|
|
|
end subroutine mld_dilut_fact
|