10 #ifdef HECMW_WITH_MUMPS
12 include
'dmumps_struc.h'
18 #ifdef HECMW_WITH_MUMPS
19 type (dmumps_struc),
save :: mumps_par
26 type (sparse_matrix),
intent(inout) :: spmat
27 integer(kind=kint),
intent(in) :: job
28 integer(kind=kint),
intent(out) :: istat
30 #ifdef HECMW_WITH_MUMPS
31 integer(kind=kint) :: ierr,
myrank
36 write(*,*)
'ERROR: MUMPS require COO type sparse matrix'
46 mumps_par%CNTL(1) = 0.0d0
54 call set_mumps_pointers(mumps_par, spmat)
55 if (job==3 .or. job==5 .or. job==6)
then
57 allocate(mumps_par%RHS(mumps_par%N), stat=ierr)
59 allocate(mumps_par%RHS(1), stat=ierr)
62 write(*,*)
" Allocation error, mumps_par%RHS"
69 if (spmat%timelog == 2)
then
74 elseif (spmat%timelog == 1)
then
88 call dmumps(mumps_par)
89 istat = mumps_par%INFOG(1)
91 if (istat == -9 .and. mumps_par%ICNTL(14) < 200)
then
92 mumps_par%ICNTL(14) = mumps_par%ICNTL(14) + 20
94 write(*,*)
'INFO: MUMPS increasing relaxation parameter to', &
96 elseif (istat < 0)
then
98 write(*,*)
'ERROR: MUMPS job=',job,&
99 ', INFOG(1)=',istat,
', INFOG(2)=',mumps_par%INFOG(2)
107 mumps_par%ICNTL(28)=0
111 mumps_par%ICNTL(29)=0
113 mumps_par%ICNTL(14)=20
115 mumps_par%ICNTL(10)=3
116 mumps_par%CNTL(2)=1.0e-8
118 mumps_par%ICNTL(22)=0
120 if (job==3 .or. job==5 .or. job==6)
then
122 deallocate(mumps_par%RHS)
126 stop
"MUMPS not available"
130 #ifdef HECMW_WITH_MUMPS
131 subroutine set_mumps_pointers(mumps_par, spMAT)
133 type (dmumps_struc),
intent(inout) :: mumps_par
134 type (sparse_matrix),
intent(in) :: spmat
135 mumps_par%N = spmat%N
137 mumps_par%ICNTL(18) = 3
138 mumps_par%NZ_loc = spmat%NZ
139 mumps_par%IRN_loc => spmat%IRN
140 mumps_par%JCN_loc => spmat%JCN
141 mumps_par%A_loc => spmat%A
142 end subroutine set_mumps_pointers