2 c---------------------------------------------------------------------
3 c---------------------------------------------------------------------
5 subroutine compute_buffer_size(dim)
7 c---------------------------------------------------------------------
8 c---------------------------------------------------------------------
12 integer c, dim, face_size
14 if (ncells .eq. 1) return
16 c---------------------------------------------------------------------
17 c compute the actual sizes of the buffers; note that there is
18 c always one cell face that doesn't need buffer space, because it
19 c is at the boundary of the grid
20 c---------------------------------------------------------------------
26 face_size = cell_size(2,c) * cell_size(3,c) * dim * 2
27 if (cell_coord(1,c).ne.1) west_size = west_size + face_size
28 if (cell_coord(1,c).ne.ncells) east_size = east_size +
35 face_size = cell_size(1,c)*cell_size(3,c) * dim * 2
36 if (cell_coord(2,c).ne.1) south_size = south_size + face_size
37 if (cell_coord(2,c).ne.ncells) north_size = north_size +
44 face_size = cell_size(1,c) * cell_size(2,c) * dim * 2
45 if (cell_coord(3,c).ne.1) bottom_size = bottom_size +
47 if (cell_coord(3,c).ne.ncells) top_size = top_size +
52 start_send_east = start_send_west + west_size
53 start_send_south = start_send_east + east_size
54 start_send_north = start_send_south + south_size
55 start_send_bottom = start_send_north + north_size
56 start_send_top = start_send_bottom + bottom_size
58 start_recv_east = start_recv_west + west_size
59 start_recv_south = start_recv_east + east_size
60 start_recv_north = start_recv_south + south_size
61 start_recv_bottom = start_recv_north + north_size
62 start_recv_top = start_recv_bottom + bottom_size