33 logical(LGP) :: has_converged
35 real(dp) :: global_max_dvc
36 real(dp) :: abs_max_dvc
42 has_converged = .false.
43 abs_max_dvc = abs(max_dvc)
44 call mpi_allreduce(abs_max_dvc, global_max_dvc, 1, mpi_double_precision, &
45 mpi_max, mpi_world%comm, ierr)
47 if (global_max_dvc <= this%dvclose)
then
48 has_converged = .true.
56 real(dp),
intent(in) :: dpak
57 character(len=LENPAKLOC),
intent(in) :: cpakout
58 integer(I4B),
intent(in) :: iend
60 integer(I4B) :: icnvg_global
61 integer(I4B) :: icnvg_local
68 this%NumericalSolutionType%sln_package_convergence(dpak, cpakout, iend)
70 call mpi_allreduce(icnvg_local, icnvg_global, 1, mpi_integer, &
71 mpi_min, mpi_world%comm, ierr)
78 integer(I4B),
intent(in) :: inewtonur
80 integer(I4B) :: ivalue
85 call mpi_allreduce(inewtonur, ivalue, 1, mpi_integer, &
86 mpi_max, mpi_world%comm, ierr)
94 real(dp),
intent(in) :: dxold_max
95 real(dp),
intent(in) :: hncg
96 logical(LGP) :: has_converged
98 integer(I4B) :: icnvg_local
99 integer(I4B) :: icnvg_global
105 has_converged = .false.
107 if (this%NumericalSolutionType%sln_nur_has_converged( &
108 dxold_max, hncg))
then
112 call mpi_allreduce(icnvg_local, icnvg_global, 1, mpi_integer, &
113 mpi_min, mpi_world%comm, ierr)
115 if (icnvg_global == 1) has_converged = .true.
126 integer(I4B) :: iptc_loc
127 real(DP) :: ptcf_loc, ptcf_glo_max
132 call this%NumericalSolutionType%sln_calc_ptc(iptc_loc, ptcf_loc)
133 if (iptc_loc == 0) ptcf_loc =
dzero
136 call mpi_allreduce(ptcf_loc, ptcf_glo_max, 1, mpi_double_precision, &
137 mpi_max, mpi_world%comm, ierr)
142 if (ptcf_glo_max >
dzero)
then
153 integer(I4B),
intent(in) :: kiter
154 real(DP),
intent(in) :: bigch
155 integer(I4B),
intent(in) :: neq
156 integer(I4B),
dimension(neq),
intent(in) :: active
157 real(DP),
dimension(neq),
intent(inout) :: x
158 real(DP),
dimension(neq),
intent(in) :: xtemp
160 real(DP) :: dvc_global_max, dvc_global_min
167 call mpi_allreduce(bigch, dvc_global_max, 1, mpi_double_precision, &
168 mpi_max, mpi_world%comm, ierr)
170 call mpi_allreduce(bigch, dvc_global_min, 1, mpi_double_precision, &
171 mpi_min, mpi_world%comm, ierr)
174 if (abs(dvc_global_min) > abs(dvc_global_max))
then
175 dvc_global_max = dvc_global_min
179 call this%NumericalSolutionType%sln_underrelax(kiter, dvc_global_max, &
180 neq, active, x, xtemp)
189 integer(I4B),
intent(inout) :: bt_flag
191 integer(I4B) :: btflag_local
198 btflag_local = this%NumericalSolutionType%get_backtracking_flag()
201 call mpi_allreduce(btflag_local, bt_flag, 1, mpi_integer, &
202 mpi_max, mpi_world%comm, ierr)
206 if (bt_flag > 0)
then
207 call this%NumericalSolutionType%apply_backtracking()
This module contains simulation constants.
integer(i4b), parameter lenpakloc
maximum length of a package location
real(dp), parameter dzero
real constant zero
real(dp), parameter done
real constant 1
This module defines variable data types.
type(mpiworldtype) function, pointer, public get_mpi_world()
subroutine, public check_mpi(mpi_error_code)
Check the MPI error code, report, and.
logical(lgp) function par_has_converged(this, max_dvc)
Check global convergence. The local maximum dependent variable change is reduced over MPI with all ot...
integer(i4b) function par_package_convergence(this, dpak, cpakout, iend)
logical(lgp) function par_nur_has_converged(this, dxold_max, hncg)
integer(i4b) function par_sync_newtonur_flag(this, inewtonur)
subroutine par_underrelax(this, kiter, bigch, neq, active, x, xtemp)
apply under-relaxation in sync over all processes
subroutine par_backtracking_xupdate(this, bt_flag)
synchronize backtracking flag over processes
subroutine par_calc_ptc(this, iptc, ptcf)
Calculate pseudo-transient continuation factor.