44 include
'dmumps_struc.h' 60 logical :: created = .false.
63 type(dmumps_struc) :: dmumps
100 if (
choral_verb>1)
write(*,*)
"mumps_mod : mumps_init" 103 &
"mumps_mod: mumps_init: double precision only")
118 if (
associated(lu%dmumps%irn))
deallocate(lu%dmumps%irn)
119 lu%dmumps%irn => null()
120 if (
associated(lu%dmumps%jcn))
deallocate(lu%dmumps%jcn)
121 lu%dmumps%jcn => null()
122 if (
associated(lu%dmumps%rhs))
deallocate(lu%dmumps%rhs)
123 lu%dmumps%rhs => null()
124 if (
associated(lu%dmumps%a ))
deallocate(lu%dmumps%a)
125 lu%dmumps%a => null()
129 call dmumps(lu%dmumps)
154 type(
csr),
intent(in) :: g
155 integer ,
intent(in) :: type
156 integer ,
intent(in),
optional :: verb
158 integer :: ii, jj, cpt
165 &
"mumps_mod: mumps_create: CSR matrix 'g' not valid" )
173 if (
choral_verb>1)
write(*,*)
" mumps structure initialisation" 174 lu%dmumps%comm = mpi_comm_world
189 if (
choral_verb>1)
write(*,*)
" Symmetric positive definite CSR" 192 call quit(
"mumps_mod: mumps_create: & 193 & unknown parameter 'type' " )
198 call dmumps(lu%dmumps)
201 if (lu%dmumps%infog(1)<0)
then 203 write(*,*)
" dmumps error, code =", &
204 & lu%dmumps%infog(1), lu%dmumps%infog(2)
207 call quit(
"mumps_mod: mumps_create: init. error")
212 if (lu%dmumps%myid==0)
then 218 if (lu%dmumps%sym > 0)
then 221 do jj=g%row(ii), g%row(ii+1) - 1
222 if (g%col(jj) <= ii ) cpt = cpt + 1
228 lu%dmumps%nnz = g%nnz
231 allocate(lu%dmumps%rhs(g%nl ))
232 allocate(lu%dmumps%irn(g%nnz))
233 allocate(lu%dmumps%jcn(g%nnz))
234 allocate(lu%dmumps%a( g%nnz))
238 if (lu%dmumps%sym > 0)
then 242 do jj=g%row(ii), g%row(ii+1) - 1
244 if (g%col(jj) <= ii )
then 247 lu%dmumps%irn(cpt) = ii
248 lu%dmumps%jcn(cpt) = g%col(jj)
249 lu%dmumps%a(cpt) = g%a(jj)
260 do jj=g%row(ii), g%row(ii+1) - 1
263 lu%dmumps%irn(cpt) = ii
264 lu%dmumps%jcn(cpt) = g%col(jj)
265 lu%dmumps%a(cpt) = g%a(jj)
276 lu%dmumps%icntl(4) = -1
278 if (
present(verb))
then 279 lu%dmumps%icntl(4) = verb
285 if (
choral_verb>1)
write(*,*)
" mumps analysis phase" 287 call dmumps(lu%dmumps)
290 if (lu%dmumps%infog(1)<0)
then 292 write(*,*)
" dmumps error, code =", &
293 & lu%dmumps%infog(1), lu%dmumps%infog(2)
296 call quit(
"mumps_mod: mumps_create: analysis phase error")
302 if (
choral_verb>1)
write(*,*)
" mumps factorisation phase" 304 call dmumps(lu%dmumps)
307 if (lu%dmumps%infog(1)<0)
then 309 write(*,*)
" dmumps error, code =", &
310 & lu%dmumps%infog(1), lu%dmumps%infog(2)
313 call quit(
"mumps_mod: mumps_create: factorisation phase error")
317 call quit(
"mumps_mod: mumps_create: MUMPS not available")
323 &
" CPU =",
real(cpu,
sp)
331 real(RP),
dimension(:),
intent(inout) :: x
332 type(
mumps) ,
intent(inout) :: LU
333 real(RP),
dimension(:),
intent(in) :: b
339 call dmumps(lu%dmumps)
342 if (lu%dmumps%infog(1)<0)
then 344 write(*,*)
"mumps_mod : mumps_solve = error ", &
345 & lu%dmumps%infog(1), lu%dmumps%infog(2)
346 call quit(
"mumps_mod: mumps_solve; error detected")
353 call quit(
"mumps_mod: mumps_solve: MUMPS not available")
is the csr matrix well defined ?
integer, parameter mumps_ldlt
MUMPS LDLT , symm mat.
subroutine mumps_solve(x, LU, b)
SOLVE LU x = b.
integer, parameter, public rp
real(kind=RP) = real precision in the code REAL_TOL = epsilon to test real equality ...
type(mumps) function mumps_create(g, type, verb)
Constructor for the type mumps
integer, parameter, public sp
simple precision for real numbers
REAL NUMBERS PRECISION IN CHORAL: selects simple/double/quad
Derived type for sparse matrices in CSR format.
subroutine, public mumps_init()
Initialisation.
integer, parameter mumps_ldlt_sdp
MUMPS LDLT-SDP, sym def pos mat.
integer choral_verb
Verbosity level.
integer, parameter, public dp
double precision for real numbers
subroutine mumps_clear(lu)
Destructor.
DERIVED TYPE mumps: to use the library MUMPS
DEFINITION OF GLOBAL VARIABLES FOR THE LIBRARY CHORAL
Factorisation of csr matrices with MUMPS.
DERIVED TYPE csr for sparse matrices
integer, parameter mumps_lu
MUMPS LU.