pf_post Subroutine

public subroutine pf_post(pf, level, tag, direction)

Subroutine to post a receive request for a new initial condition to be received after doing some work

Arguments

Type IntentOptional AttributesName
type(pf_pfasst_t), intent(in) :: pf
class(pf_level_t), intent(inout) :: level
integer, intent(in) :: tag
integer, intent(in), optional :: direction

Called by

proc~~pf_post~~CalledByGraph proc~pf_post pf_post proc~pf_v_cycle pf_v_cycle proc~pf_v_cycle->proc~pf_post proc~pf_v_cycle_oc pf_v_cycle_oc proc~pf_v_cycle_oc->proc~pf_post proc~pf_block_run pf_block_run proc~pf_block_run->proc~pf_v_cycle proc~pf_pfasst_block_oc pf_pfasst_block_oc proc~pf_pfasst_block_oc->proc~pf_v_cycle_oc proc~pf_pfasst_run pf_pfasst_run proc~pf_pfasst_run->proc~pf_block_run

Contents

Source Code


Source Code

  subroutine pf_post(pf, level, tag, direction)
    type(pf_pfasst_t), intent(in)    :: pf
    class(pf_level_t),  intent(inout) :: level
    integer,           intent(in)    :: tag
    integer, optional, intent(in)    :: direction
    integer                          :: dir
    integer ::  ierror 
    
    dir = 1 ! default 1: send forward; set to 2 for send backwards
    if(present(direction)) dir = direction
    if (pf%debug) print*,'DEBUG --', pf%rank, 'is beginning pf_post, state%pstatus=', pf%state%pstatus, 'with tag =', tag
    ierror = 0
    if (pf%rank /= 0 .and. pf%state%pstatus == PF_STATUS_ITERATING &
                                  .and. dir == 1) then
       call pf%comm%post(pf, level, tag, ierror, dir)
    elseif (pf%rank /= pf%comm%nproc-1 .and. pf%state%pstatus == PF_STATUS_ITERATING &
                                  .and. dir == 2) then
       call pf%comm%post(pf, level, tag, ierror, dir)
    end if
    
    if (ierror /= 0) then
      print *, pf%rank, 'warning: error during post', ierror
      stop "pf_parallel:pf_post"
   endif
   if (pf%debug) print*,'DEBUG --', pf%rank, 'is leaving pf_post, state%pstatus=', pf%state%pstatus, 'with tag =', tag     
  end subroutine pf_post