Research Article

MPI to Coarray Fortran: Experiences with a CFD Solver for Unstructured Meshes

Listing 8

exhboundhigher subroutine from the Coarray Fortran version of the code. Note that only the code responsible for communication is shown.
subroutine exhboundhigher ( n, iexchanger, iexchanges,
  iexboundhir, iexboundhis, itestcase, numberofpoints2,
  isize )
if (itestcase  .eq. 4) then
  do i=1, tndl
   ! add +1 since coarray images are mpi ranks+1
   j = iexchanges(i)%procid + 1
   iexboundhir(CommArr1(j))[j]%facesol(:,:,:,:) =
    iexboundhis(i)%facesol(:,:,:,:)
  end do
  do i=1, tndl
   ! add +1 since coarray images are mpi ranks+1
   j = iexchanges(i)%procid + 1
   iexboundhir(CommArr1(j))[j]%facesolv(:,:,:,:) =
    iexboundhis(i)%facesolv(:,:,:,:)
  end do
end if
sync all
end subroutine exhboundhigher