Synchronize CAF images.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(euler_1D_caf), | intent(in) | :: | self | Euler field. |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine synchronize(self)
!---------------------------------------------------------------------------------------------------------------------------------
!< Synchronize CAF images.
!---------------------------------------------------------------------------------------------------------------------------------
class(euler_1D_caf), intent(IN) :: self !< Euler field.
integer(I_P) :: i !< Images counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
#ifdef CAF
if (self%we>1) then
remote_U = self%U
if (self%me==1) then
sync images(self%me+1)
U_R(:,:) = remote_U(:,:)[self%me+1]
else if (self%me==self%we) then
sync images(self%me-1)
U_L(:,:) = remote_U(:,:)[self%me-1]
else
sync images([self%me-1, self%me+1])
U_L(:,:) = remote_U(:,:)[self%me-1]
U_R(:,:) = remote_U(:,:)[self%me+1]
endif
endif
#endif
return
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine synchronize