108 integer,
parameter :: IDX_I_ITER = 1
109 integer,
parameter :: IDX_I_METHOD = 2
110 integer,
parameter :: IDX_I_PRECOND = 3
111 integer,
parameter :: IDX_I_NSET = 4
112 integer,
parameter :: IDX_I_ITERPREMAX = 5
113 integer,
parameter :: IDX_I_NREST = 6
114 integer,
parameter :: IDX_I_SCALING = 7
115 integer,
parameter :: IDX_I_PENALIZED = 11
116 integer,
parameter :: IDX_I_PENALIZED_B = 12
117 integer,
parameter :: IDX_I_MPC_METHOD = 13
118 integer,
parameter :: IDX_I_ESTCOND = 14
119 integer,
parameter :: IDX_I_ITERLOG = 21
120 integer,
parameter :: IDX_I_TIMELOG = 22
121 integer,
parameter :: IDX_I_DUMP = 31
122 integer,
parameter :: IDX_I_DUMP_EXIT = 32
123 integer,
parameter :: IDX_I_USEJAD = 33
124 integer,
parameter :: IDX_I_NCOLOR_IN = 34
125 integer,
parameter :: IDX_I_MAXRECYCLE_PRECOND = 35
126 integer,
parameter :: IDX_I_NRECYCLE_PRECOND = 96
127 integer,
parameter :: IDX_I_FLAG_NUMFACT = 97
128 integer,
parameter :: IDX_I_FLAG_SYMBFACT = 98
129 integer,
parameter :: IDX_I_SOLVER_TYPE = 99
131 integer,
parameter :: IDX_I_METHOD2 = 8
132 integer,
parameter :: IDX_I_FLAG_CONVERGED = 81
133 integer,
parameter :: IDX_I_FLAG_DIVERGED = 82
134 integer,
parameter :: IDX_I_FLAG_MPCMATVEC = 83
136 integer,
parameter :: IDX_I_SOLVER_OPT1 = 41
137 integer,
parameter :: IDX_I_SOLVER_OPT2 = 42
138 integer,
parameter :: IDX_I_SOLVER_OPT3 = 43
139 integer,
parameter :: IDX_I_SOLVER_OPT4 = 44
140 integer,
parameter :: IDX_I_SOLVER_OPT5 = 45
141 integer,
parameter :: IDX_I_SOLVER_OPT6 = 46
143 integer,
parameter :: IDX_R_RESID = 1
144 integer,
parameter :: IDX_R_SIGMA_DIAG = 2
145 integer,
parameter :: IDX_R_SIGMA = 3
146 integer,
parameter :: IDX_R_THRESH = 4
147 integer,
parameter :: IDX_R_FILTER = 5
148 integer,
parameter :: IDX_R_PENALTY = 11
149 integer,
parameter :: IDX_R_PENALTY_ALPHA = 12
223 if (
associated(hecmat%D))
deallocate(hecmat%D)
224 if (
associated(hecmat%B))
deallocate(hecmat%B)
225 if (
associated(hecmat%X))
deallocate(hecmat%X)
226 if (
associated(hecmat%AL))
deallocate(hecmat%AL)
227 if (
associated(hecmat%AU))
deallocate(hecmat%AU)
228 if (
associated(hecmat%indexL))
deallocate(hecmat%indexL)
229 if (
associated(hecmat%indexU))
deallocate(hecmat%indexU)
230 if (
associated(hecmat%itemL))
deallocate(hecmat%itemL)
231 if (
associated(hecmat%itemU))
deallocate(hecmat%itemU)
232 if (
associated(hecmat%ALU))
deallocate(hecmat%ALU)
239 hecmat%N = hecmatorg%N
240 hecmat%NP = hecmatorg%NP
241 hecmat%NDOF = hecmatorg%NDOF
242 hecmat%NPL = hecmatorg%NPL
243 hecmat%NPU = hecmatorg%NPU
244 allocate(hecmat%indexL(
size(hecmatorg%indexL)))
245 allocate(hecmat%indexU(
size(hecmatorg%indexU)))
246 allocate(hecmat%itemL (
size(hecmatorg%itemL )))
247 allocate(hecmat%itemU (
size(hecmatorg%itemU )))
248 allocate(hecmat%D (
size(hecmatorg%D )))
249 allocate(hecmat%AL(
size(hecmatorg%AL)))
250 allocate(hecmat%AU(
size(hecmatorg%AU)))
251 allocate(hecmat%B (
size(hecmatorg%B )))
252 allocate(hecmat%X (
size(hecmatorg%X )))
253 hecmat%indexL = hecmatorg%indexL
254 hecmat%indexU = hecmatorg%indexU
255 hecmat%itemL = hecmatorg%itemL
256 hecmat%itemU = hecmatorg%itemU
267 integer(kind=kint) :: ierr
268 integer(kind=kint) :: i
270 if (hecmat%N /= hecmatorg%N) ierr = 1
271 if (hecmat%NP /= hecmatorg%NP) ierr = 1
272 if (hecmat%NDOF /= hecmatorg%NDOF) ierr = 1
273 if (hecmat%NPL /= hecmatorg%NPL) ierr = 1
274 if (hecmat%NPU /= hecmatorg%NPU) ierr = 1
276 write(0,*)
'ERROR: hecmw_mat_copy_val: different profile'
279 do i = 1,
size(hecmat%D)
280 hecmat%D(i) = hecmatorg%D(i)
282 do i = 1,
size(hecmat%AL)
283 hecmat%AL(i) = hecmatorg%AL(i)
285 do i = 1,
size(hecmat%AU)
286 hecmat%AU(i) = hecmatorg%AU(i)
292 integer(kind=kint) :: iter
294 hecmat%Iarray(idx_i_iter) = iter
306 integer(kind=kint) :: method
308 hecmat%Iarray(idx_i_method) = method
320 integer(kind=kint) :: method2
322 hecmat%Iarray(idx_i_method2) = method2
334 integer(kind=kint) :: precond
336 hecmat%Iarray(idx_i_precond) = precond
348 integer(kind=kint) :: nset
350 hecmat%Iarray(idx_i_nset) = nset
362 integer(kind=kint) :: iterpremax
364 if (iterpremax.lt.0) iterpremax= 0
365 if (iterpremax.gt.4) iterpremax= 4
367 hecmat%Iarray(idx_i_iterpremax) = iterpremax
379 integer(kind=kint) :: nrest
381 hecmat%Iarray(idx_i_nrest) = nrest
393 integer(kind=kint) :: scaling
395 hecmat%Iarray(idx_i_scaling) = scaling
407 integer(kind=kint) :: penalized
409 hecmat%Iarray(idx_i_penalized) = penalized
421 integer(kind=kint) :: penalized_b
423 hecmat%Iarray(idx_i_penalized_b) = penalized_b
435 integer(kind=kint) :: mpc_method
437 hecmat%Iarray(idx_i_mpc_method) = mpc_method
455 integer(kind=kint) :: estcond
456 hecmat%Iarray(idx_i_estcond) = estcond
461 integer(kind=kint) :: iterlog
463 hecmat%Iarray(idx_i_iterlog) = iterlog
475 integer(kind=kint) :: timelog
477 hecmat%Iarray(idx_i_timelog) = timelog
495 integer(kind=kint) :: dump_type
496 hecmat%Iarray(idx_i_dump) = dump_type
507 integer(kind=kint) :: dump_exit
508 hecmat%Iarray(idx_i_dump_exit) = dump_exit
519 integer(kind=kint) :: usejad
520 hecmat%Iarray(idx_i_usejad) = usejad
531 integer(kind=kint) :: ncolor_in
532 hecmat%Iarray(idx_i_ncolor_in) = ncolor_in
543 integer(kind=kint) :: maxrecycle_precond
544 if (maxrecycle_precond > 100) maxrecycle_precond = 100
545 hecmat%Iarray(idx_i_maxrecycle_precond) = maxrecycle_precond
556 hecmat%Iarray(idx_i_nrecycle_precond) = 0
561 hecmat%Iarray(idx_i_nrecycle_precond) = hecmat%Iarray(idx_i_nrecycle_precond) + 1
572 integer(kind=kint) :: flag_numfact
573 hecmat%Iarray(idx_i_flag_numfact) = flag_numfact
584 integer(kind=kint) :: flag_symbfact
585 hecmat%Iarray(idx_i_flag_symbfact) = flag_symbfact
590 hecmat%Iarray(idx_i_flag_symbfact) = 0
601 integer(kind=kint) :: solver_type
602 hecmat%Iarray(idx_i_solver_type) = solver_type
607 integer(kind=kint) :: flag_converged
608 hecmat%Iarray(idx_i_flag_converged) = flag_converged
619 integer(kind=kint) :: flag_diverged
620 hecmat%Iarray(idx_i_flag_diverged) = flag_diverged
631 integer(kind=kint) :: flag_mpcmatvec
632 hecmat%Iarray(idx_i_flag_mpcmatvec) = flag_mpcmatvec
643 integer(kind=kint) :: solver_opt1
644 hecmat%Iarray(idx_i_solver_opt1) = solver_opt1
655 integer(kind=kint) :: solver_opt2
656 hecmat%Iarray(idx_i_solver_opt2) = solver_opt2
667 integer(kind=kint) :: solver_opt3
668 hecmat%Iarray(idx_i_solver_opt3) = solver_opt3
679 integer(kind=kint) :: solver_opt4
680 hecmat%Iarray(idx_i_solver_opt4) = solver_opt4
691 integer(kind=kint) :: solver_opt5
692 hecmat%Iarray(idx_i_solver_opt5) = solver_opt5
703 integer(kind=kint) :: solver_opt6
704 hecmat%Iarray(idx_i_solver_opt6) = solver_opt6
715 real(kind=
kreal) :: resid
717 hecmat%Rarray(idx_r_resid) = resid
729 real(kind=
kreal) :: sigma_diag
731 if( sigma_diag < 0.d0 )
then
732 hecmat%Rarray(idx_r_sigma_diag) = -1.d0
733 elseif( sigma_diag < 1.d0 )
then
734 hecmat%Rarray(idx_r_sigma_diag) = 1.d0
735 elseif( sigma_diag > 2.d0 )
then
736 hecmat%Rarray(idx_r_sigma_diag) = 2.d0
738 hecmat%Rarray(idx_r_sigma_diag) = sigma_diag
751 real(kind=
kreal) :: sigma
753 if (sigma < 0.d0)
then
754 hecmat%Rarray(idx_r_sigma) = 0.d0
755 elseif (sigma > 1.d0)
then
756 hecmat%Rarray(idx_r_sigma) = 1.d0
758 hecmat%Rarray(idx_r_sigma) = sigma
771 real(kind=
kreal) :: thresh
773 hecmat%Rarray(idx_r_thresh) = thresh
785 real(kind=
kreal) :: filter
787 hecmat%Rarray(idx_r_filter) = filter
799 real(kind=
kreal) :: penalty
801 hecmat%Rarray(idx_r_penalty) = penalty
813 real(kind=
kreal) :: alpha
815 hecmat%Rarray(idx_r_penalty_alpha) = alpha
829 integer(kind=kint) :: ndiag, i
832 ndiag = hecmat%NDOF**2 * hecmat%NP
841 integer(kind=kint) :: nrecycle, maxrecycle
842 if (hecmat%Iarray(idx_i_flag_symbfact) >= 1)
then
843 hecmat%Iarray(idx_i_flag_numfact)=1
845 elseif (hecmat%Iarray(idx_i_flag_numfact) > 1)
then
847 hecmat%Iarray(idx_i_flag_numfact) = 1
848 elseif (hecmat%Iarray(idx_i_flag_numfact) == 1)
then
851 if ( nrecycle < maxrecycle )
then
852 hecmat%Iarray(idx_i_flag_numfact) = 0
869 if (
associated(src%D)) dest%D => src%D
870 if (
associated(src%B)) dest%B => src%B
871 if (
associated(src%X)) dest%X => src%X
872 if (
associated(src%ALU)) dest%ALU => src%ALU
873 if (
associated(src%AL)) dest%AL => src%AL
874 if (
associated(src%AU)) dest%AU => src%AU
875 if (
associated(src%CAL)) dest%CAL => src%CAL
876 if (
associated(src%indexL)) dest%indexL => src%indexL
877 if (
associated(src%indexU)) dest%indexU => src%indexU
878 if (
associated(src%indexCL)) dest%indexCL => src%indexCL
879 if (
associated(src%indexCU)) dest%indexCU => src%indexCU
880 if (
associated(src%itemL)) dest%itemL => src%itemL
881 if (
associated(src%itemU)) dest%itemU => src%itemU
882 if (
associated(src%itemCL)) dest%itemCL => src%itemCL
883 if (
associated(src%itemCU)) dest%itemCU => src%itemCU
884 dest%Iarray(:) = src%Iarray(:)
885 dest%Rarray(:) = src%Rarray(:)
integer(kind=kint) function, public hecmw_mat_get_iterpremax(hecmat)
integer(kind=kint) function, public hecmw_mat_get_usejad(hecmat)
integer(kind=kint) function, public hecmw_mat_get_nrest(hecmat)
subroutine, public hecmw_mat_incr_nrecycle_precond(hecmat)
subroutine, public hecmw_mat_set_resid(hecmat, resid)
integer(kind=kint) function, public hecmw_mat_get_maxrecycle_precond(hecmat)
subroutine, public hecmw_mat_set_usejad(hecmat, usejad)
integer(kind=kint) function, public hecmw_mat_get_method2(hecmat)
integer(kind=kint) function, public hecmw_mat_get_solver_opt6(hecmat)
integer(kind=kint) function, public hecmw_mat_get_solver_opt4(hecmat)
subroutine, public hecmw_mat_clear_flag_symbfact(hecmat)
integer(kind=kint) function, public hecmw_mat_get_method(hecmat)
subroutine, public hecmw_mat_set_sigma_diag(hecmat, sigma_diag)
integer(kind=kint) function, public hecmw_mat_get_solver_opt2(hecmat)
integer(kind=kint) function, public hecmw_mat_get_flag_symbfact(hecmat)
subroutine, public hecmw_mat_recycle_precond_setting(hecmat)
integer(kind=kint) function, public hecmw_mat_get_flag_mpcmatvec(hecmat)
subroutine, public hecmw_mat_set_scaling(hecmat, scaling)
subroutine, public hecmw_mat_set_flag_numfact(hecmat, flag_numfact)
integer(kind=kint) function, public hecmw_mat_get_solver_type(hecmat)
real(kind=kreal) function, public hecmw_mat_get_penalty(hecmat)
subroutine, public hecmw_mat_set_solver_opt6(hecmat, solver_opt6)
subroutine, public hecmw_mat_set_filter(hecmat, filter)
integer(kind=kint) function, public hecmw_mat_get_flag_diverged(hecmat)
subroutine, public hecmw_mat_set_penalized(hecmat, penalized)
subroutine, public hecmw_mat_set_penalized_b(hecmat, penalized_b)
integer(kind=kint) function, public hecmw_mat_get_nrecycle_precond(hecmat)
subroutine, public hecmw_mat_set_dump(hecmat, dump_type)
subroutine, public hecmw_mat_set_solver_opt1(hecmat, solver_opt1)
subroutine, public hecmw_mat_set_solver_type(hecmat, solver_type)
subroutine, public hecmw_mat_set_solver_opt2(hecmat, solver_opt2)
integer(kind=kint) function, public hecmw_mat_get_ncolor_in(hecmat)
subroutine, public hecmw_mat_set_penalty(hecmat, penalty)
subroutine, public hecmw_mat_reset_nrecycle_precond(hecmat)
integer(kind=kint) function, public hecmw_mat_get_timelog(hecmat)
subroutine, public hecmw_mat_clear(hecmat)
subroutine, public hecmw_mat_set_estcond(hecmat, estcond)
integer(kind=kint) function, public hecmw_mat_get_estcond(hecmat)
subroutine, public hecmw_mat_set_ncolor_in(hecmat, ncolor_in)
subroutine, public hecmw_mat_set_iterlog(hecmat, iterlog)
real(kind=kreal) function, public hecmw_mat_get_resid(hecmat)
integer(kind=kint) function, public hecmw_mat_get_dump(hecmat)
integer(kind=kint) function, public hecmw_mat_get_penalized_b(hecmat)
subroutine, public hecmw_mat_set_sigma(hecmat, sigma)
subroutine, public hecmw_mat_set_mpc_method(hecmat, mpc_method)
subroutine, public hecmw_mat_set_method2(hecmat, method2)
subroutine, public hecmw_mat_set_solver_opt3(hecmat, solver_opt3)
integer(kind=kint) function, public hecmw_mat_get_scaling(hecmat)
subroutine, public hecmw_mat_set_flag_symbfact(hecmat, flag_symbfact)
subroutine, public hecmw_mat_substitute(dest, src)
subroutine, public hecmw_mat_copy_profile(hecmatorg, hecmat)
real(kind=kreal) function, public hecmw_mat_diag_max(hecmat, hecmesh)
subroutine, public hecmw_mat_set_flag_converged(hecmat, flag_converged)
subroutine, public hecmw_mat_set_iter(hecmat, iter)
subroutine, public hecmw_mat_set_dump_exit(hecmat, dump_exit)
subroutine, public hecmw_mat_set_solver_opt5(hecmat, solver_opt5)
subroutine, public hecmw_mat_set_nrest(hecmat, nrest)
subroutine, public hecmw_mat_set_nset(hecmat, nset)
subroutine, public hecmw_mat_set_method(hecmat, method)
integer(kind=kint) function, public hecmw_mat_get_iter(hecmat)
subroutine, public hecmw_mat_copy_val(hecmatorg, hecmat)
subroutine, public hecmw_mat_set_maxrecycle_precond(hecmat, maxrecycle_precond)
subroutine, public hecmw_mat_set_flag_mpcmatvec(hecmat, flag_mpcmatvec)
real(kind=kreal) function, public hecmw_mat_get_sigma(hecmat)
integer(kind=kint) function, public hecmw_mat_get_mpc_method(hecmat)
real(kind=kreal) function, public hecmw_mat_get_penalty_alpha(hecmat)
real(kind=kreal) function, public hecmw_mat_get_thresh(hecmat)
subroutine, public hecmw_mat_set_flag_diverged(hecmat, flag_diverged)
subroutine, public hecmw_mat_init(hecmat)
integer(kind=kint) function, public hecmw_mat_get_solver_opt3(hecmat)
subroutine, public hecmw_mat_finalize(hecmat)
integer(kind=kint) function, public hecmw_mat_get_penalized(hecmat)
integer(kind=kint) function, public hecmw_mat_get_solver_opt1(hecmat)
subroutine, public hecmw_mat_set_iterpremax(hecmat, iterpremax)
integer(kind=kint) function, public hecmw_mat_get_precond(hecmat)
subroutine, public hecmw_mat_clear_b(hecmat)
integer(kind=kint) function, public hecmw_mat_get_flag_numfact(hecmat)
integer(kind=kint) function, public hecmw_mat_get_flag_converged(hecmat)
subroutine, public hecmw_mat_set_penalty_alpha(hecmat, alpha)
integer(kind=kint) function, public hecmw_mat_get_nset(hecmat)
subroutine, public hecmw_mat_set_solver_opt4(hecmat, solver_opt4)
subroutine, public hecmw_mat_set_timelog(hecmat, timelog)
subroutine, public hecmw_mat_set_thresh(hecmat, thresh)
real(kind=kreal) function, public hecmw_mat_get_filter(hecmat)
integer(kind=kint) function, public hecmw_mat_get_dump_exit(hecmat)
integer(kind=kint) function, public hecmw_mat_get_iterlog(hecmat)
integer(kind=kint) function, public hecmw_mat_get_solver_opt5(hecmat)
real(kind=kreal) function, public hecmw_mat_get_sigma_diag(hecmat)
subroutine, public hecmw_mat_set_precond(hecmat, precond)
integer(kind=kint), parameter hecmw_max
integer(kind=4), parameter kreal
subroutine hecmw_nullify_matrix(p)
subroutine hecmw_allreduce_r1(hecmesh, s, ntag)