Subroutine to post a receive request for a new initial condition to be received after doing some work
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pf_pfasst_t), | intent(in) | :: | pf | |||
class(pf_level_t), | intent(inout) | :: | level | |||
integer, | intent(in) | :: | tag | |||
integer, | intent(in), | optional | :: | direction |
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