33 integer(kind=kint ),
intent(inout):: ITER, error
34 real (kind=
kreal),
intent(inout):: resid, tset, tsol, tcomm
36 integer(kind=kint ) :: N, NP, NDOF, NNDOF
37 integer(kind=kint ) :: my_rank
38 integer(kind=kint ) :: ITERlog, TIMElog
39 real(kind=
kreal),
pointer :: b(:), x(:)
41 real(kind=
kreal),
dimension(:,:),
allocatable :: ww
42 real(kind=
kreal),
dimension(2) :: cg
44 integer(kind=kint ) :: MAXIT
47 real (kind=
kreal):: tol
48 integer(kind=kint )::i
49 real (kind=
kreal)::s_time,s1_time,e_time,e1_time, start_time, end_time
50 real (kind=
kreal)::bnrm2,c2
51 real (kind=
kreal)::rho,rho1,beta,alpha,dnrm2
52 real (kind=
kreal)::omega
53 real (kind=
kreal)::t_max,t_min,t_avg,t_sd
55 integer(kind=kint),
parameter :: R = 1
56 integer(kind=kint),
parameter :: RT= 2
57 integer(kind=kint),
parameter :: P = 3
58 integer(kind=kint),
parameter :: PT= 4
59 integer(kind=kint),
parameter :: S = 5
60 integer(kind=kint),
parameter :: ST= 1
61 integer(kind=kint),
parameter :: T = 6
62 integer(kind=kint),
parameter :: V = 7
63 integer(kind=kint),
parameter :: WK= 8
65 integer(kind=kint) :: N_ITER_RECOMPUTE_R
66 integer(kind=kint),
parameter :: N_ITER_RECOMPUTE_R_DEFAULT= 100
80 my_rank = hecmesh%my_rank
90 if (n_iter_recompute_r == 0) n_iter_recompute_r = n_iter_recompute_r_default
92 if (n_iter_recompute_r < 0) n_iter_recompute_r = maxit + 1
100 allocate (ww(ndof*np, 8))
139 if (bnrm2.eq.0.d0)
then
147 if (timelog.eq.2)
then
149 t_max, t_min, t_avg, t_sd)
150 if (hecmesh%my_rank.eq.0)
then
151 write(*,*)
'Time solver setup'
152 write(*,*)
' Max :',t_max
153 write(*,*)
' Min :',t_min
154 write(*,*)
' Avg :',t_avg
155 write(*,*)
' Std Dev :',t_sd
159 tset = e_time - s_time
183 if ( iter.gt.1 )
then
184 beta = (rho/rho1) * (alpha/omega)
203 call hecmw_matvec(hecmesh, hecmat, ww(:,pt), ww(:,v), tcomm)
227 call hecmw_matvec(hecmesh, hecmat, ww(:,st), ww(:,t), tcomm)
239 tcomm = tcomm + e_time - s_time
241 omega = cg(1) / cg(2)
252 if ( mod(iter,n_iter_recompute_r)==0 )
then
260 resid= dsqrt(dnrm2/bnrm2)
263 if (my_rank.eq.0.and.iterlog.eq.1)
write (*,
'(i7, 1pe16.6)') iter, resid
266 if ( resid.le.tol )
then
267 if ( mod(iter,n_iter_recompute_r)==0 )
exit
271 resid= dsqrt(dnrm2/bnrm2)
272 if ( resid.le.tol )
exit
290 tcomm = tcomm + end_time - start_time
301 if (timelog.eq.2)
then
303 t_max, t_min, t_avg, t_sd)
304 if (hecmesh%my_rank.eq.0)
then
305 write(*,*)
'Time solver iterations'
306 write(*,*)
' Max :',t_max
307 write(*,*)
' Min :',t_min
308 write(*,*)
' Avg :',t_avg
309 write(*,*)
' Std Dev :',t_sd
313 tsol = e1_time - s1_time
Jagged Diagonal Matrix storage for vector processors. Original code was provided by JAMSTEC.
subroutine, public hecmw_jad_init(hecMAT)
subroutine, public hecmw_jad_finalize(hecMAT)
subroutine, public hecmw_mat_integrate(hecMAT)
Integrate matrix components into a single array for efficient access.
real(kind=kreal) function, public hecmw_mat_get_resid(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_iterlog(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_timelog(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_recompute_residual(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_usejad(hecMAT)
integer(kind=kint) function, public hecmw_mat_get_iter(hecMAT)
subroutine, public hecmw_precond_setup(hecMAT, hecMESH, sym)
subroutine, public hecmw_precond_apply(hecMESH, hecMAT, R, Z, ZP, COMMtime)
subroutine hecmw_solve_bicgstab(hecMESH, hecMAT, ITER, RESID, error, Tset, Tsol, Tcomm)
subroutine, public hecmw_matvec_teardown(hecMAT)
subroutine, public hecmw_matvec_setup(hecMESH, hecMAT)
subroutine, public hecmw_matresid(hecMESH, hecMAT, X, B, R, COMMtime)
subroutine, public hecmw_matvec(hecMESH, hecMAT, X, Y, COMMtime)
subroutine hecmw_xpay_r(n, alpha, X, Y)
subroutine hecmw_axpyz_r(n, alpha, X, Y, Z)
subroutine hecmw_innerproduct_r_nocomm(hecMESH, ndof, X, Y, sum)
subroutine hecmw_innerproduct_r(hecMESH, ndof, X, Y, sum, COMMtime)
subroutine hecmw_axpy_r(n, alpha, X, Y)
subroutine hecmw_copy_r(n, X, Y)
subroutine hecmw_time_statistics(hecMESH, time, t_max, t_min, t_avg, t_sd)
subroutine, public hecmw_solver_scaling_fw(hecMESH, hecMAT, COMMtime)
subroutine, public hecmw_solver_scaling_bk(hecMAT)
integer(kind=kint), parameter hecmw_sum
integer(kind=4), parameter kreal
real(kind=kreal) function hecmw_wtime()
subroutine hecmw_update_r(hecMESH, val, n, m)
subroutine hecmw_allreduce_r(hecMESH, val, n, ntag)
subroutine hecmw_barrier(hecMESH)
integer(kind=kint), parameter hecmw_solver_error_noconv_maxit