1 c---------------------------------------------------------------------
2 c---------------------------------------------------------------------
4 subroutine compute_buffer_size(dim)
6 c---------------------------------------------------------------------
7 c---------------------------------------------------------------------
11 integer c, dim, face_size
13 if (ncells .eq. 1) return
15 c---------------------------------------------------------------------
16 c compute the actual sizes of the buffers; note that there is
17 c always one cell face that doesn't need buffer space, because it
18 c is at the boundary of the grid
19 c---------------------------------------------------------------------
24 face_size = cell_size(2,c) * cell_size(3,c) * dim * 2
25 if (cell_coord(1,c).ne.1) west_size = west_size + face_size
26 if (cell_coord(1,c).ne.ncells) east_size = east_size +
33 face_size = cell_size(1,c)*cell_size(3,c) * dim * 2
34 if (cell_coord(2,c).ne.1) south_size = south_size + face_size
35 if (cell_coord(2,c).ne.ncells) north_size = north_size +
42 face_size = cell_size(1,c) * cell_size(2,c) * dim * 2
43 if (cell_coord(3,c).ne.1) bottom_size = bottom_size +
45 if (cell_coord(3,c).ne.ncells) top_size = top_size +
50 start_send_east = start_send_west + west_size
51 start_send_south = start_send_east + east_size
52 start_send_north = start_send_south + south_size
53 start_send_bottom = start_send_north + north_size
54 start_send_top = start_send_bottom + bottom_size
56 start_recv_east = start_recv_west + west_size
57 start_recv_south = start_recv_east + east_size
58 start_recv_north = start_recv_south + south_size
59 start_recv_bottom = start_recv_north + north_size
60 start_recv_top = start_recv_bottom + bottom_size