this loop not OMP'd because the deferred procs are OMP'd
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pf_magpicard_t), | intent(inout) | :: | this | |||
type(pf_pfasst_t), | intent(inout), | target | :: | pf | ||
integer, | intent(in) | :: | level_index | |||
real(kind=pfdp), | intent(in) | :: | t0 | |||
real(kind=pfdp), | intent(in) | :: | dt | |||
integer, | intent(in) | :: | nsweeps | |||
integer, | intent(in), | optional | :: | flags |
subroutine magpicard_sweep(this, pf, level_index, t0, dt, nsweeps, flags)
use pf_mod_timer
use pf_mod_hooks
class(pf_magpicard_t), intent(inout) :: this
type(pf_pfasst_t), intent(inout),target :: pf
real(pfdp), intent(in) :: dt, t0
integer, intent(in) :: level_index
integer, intent(in) :: nsweeps
integer, optional, intent(in ) :: flags
class(pf_level_t), pointer :: lev
integer :: m, nnodes, k
real(pfdp) :: t
lev => pf%levels(level_index)
nnodes = lev%nnodes
call call_hooks(pf, level_index, PF_PRE_SWEEP)
call lev%Q(1)%copy(lev%q0)
call start_timer(pf, TLEVEL+lev%index-1)
do k = 1, nsweeps
! Copy values into residual
do m = 1, nnodes-1
call lev%R(m)%copy(lev%Q(m+1))
end do
t = t0
!$omp parallel do private(m, t)
do m = 1, nnodes
! t = t + dt*this%dtsdc(m)
t=t0+dt*lev%nodes(m)
call this%f_eval(lev%Q(m), t, lev%index, lev%F(m,1))
end do
!$omp end parallel do
!$omp barrier
call magpicard_integrate(this, lev, lev%Q, lev%F, dt, lev%I)
if (this%magnus_order > 1 .and. nnodes > 2) then
call start_timer(pf, TAUX)
call this%compute_single_commutators(lev%F)
call end_timer(pf, TAUX)
endif
!! this loop not OMP'd because the deferred procs are OMP'd
do m = 1, nnodes-1
call start_timer(pf, TAUX+1)
call this%compute_omega(this%omega(m), lev%I, lev%F, &
lev%nodes, lev%sdcmats%qmat, dt, m, this%commutator_coefs(:,:,m))
call end_timer(pf, TAUX+1)
end do
!$omp parallel do private(m)
do m = 1, nnodes-1
call this%propagate_solution(lev%Q(1), lev%Q(m+1), this%omega(m), lev%index)
end do
!$omp end parallel do
call pf_residual(pf, lev, dt)
call call_hooks(pf, level_index, PF_POST_SWEEP)
end do ! Loop over sweeps
call lev%qend%copy(lev%Q(nnodes))
call end_timer(pf, TLEVEL+lev%index-1)
end subroutine magpicard_sweep