magpicard_sweep Subroutine

public subroutine magpicard_sweep(this, pf, level_index, t0, dt, nsweeps, flags)

Uses

  • proc~~magpicard_sweep~~UsesGraph proc~magpicard_sweep magpicard_sweep module~pf_mod_hooks pf_mod_hooks proc~magpicard_sweep->module~pf_mod_hooks module~pf_mod_timer pf_mod_timer proc~magpicard_sweep->module~pf_mod_timer module~pf_mod_dtype pf_mod_dtype module~pf_mod_hooks->module~pf_mod_dtype module~pf_mod_timer->module~pf_mod_dtype iso_c_binding iso_c_binding module~pf_mod_dtype->iso_c_binding

this loop not OMP'd because the deferred procs are OMP'd

Arguments

Type IntentOptional AttributesName
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

Calls

proc~~magpicard_sweep~~CallsGraph proc~magpicard_sweep magpicard_sweep proc~call_hooks call_hooks proc~magpicard_sweep->proc~call_hooks proc~start_timer start_timer proc~magpicard_sweep->proc~start_timer proc~pf_residual pf_residual proc~magpicard_sweep->proc~pf_residual proc~magpicard_integrate magpicard_integrate proc~magpicard_sweep->proc~magpicard_integrate proc~end_timer end_timer proc~magpicard_sweep->proc~end_timer proc~call_hooks->proc~start_timer proc~call_hooks->proc~end_timer proc~pf_residual->proc~start_timer proc~pf_residual->proc~end_timer

Contents

Source Code


Source Code

  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