2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
5 subroutine exchange_4(g,h,ibeg,ifin1,jbeg,jfin1)
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
10 c---------------------------------------------------------------------
11 c compute the right hand side based on exact solution
12 c---------------------------------------------------------------------
19 c---------------------------------------------------------------------
21 c---------------------------------------------------------------------
22 double precision g(0:isiz2+1,0:isiz3+1),
23 > h(0:isiz2+1,0:isiz3+1)
27 c---------------------------------------------------------------------
29 c---------------------------------------------------------------------
32 double precision dum(1024)
34 integer msgid1, msgid3
35 integer STATUS(MPI_STATUS_SIZE)
42 c---------------------------------------------------------------------
43 c communicate in the east and west directions
44 c---------------------------------------------------------------------
46 c---------------------------------------------------------------------
48 c---------------------------------------------------------------------
59 call MPI_WAIT( msgid3, STATUS, IERROR )
68 c---------------------------------------------------------------------
70 c---------------------------------------------------------------------
87 c---------------------------------------------------------------------
88 c communicate in the south and north directions
89 c---------------------------------------------------------------------
91 c---------------------------------------------------------------------
93 c---------------------------------------------------------------------
104 call MPI_WAIT( msgid1, STATUS, IERROR )
108 h(nx+1,j) = dum(j+ny2+1)
113 c---------------------------------------------------------------------
115 c---------------------------------------------------------------------
119 dum(j+ny2+1) = h(1,j)