-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboundary_exchange.f95
More file actions
96 lines (71 loc) · 1.79 KB
/
boundary_exchange.f95
File metadata and controls
96 lines (71 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
subroutine get_neighbors(numneighbors,neighbors,g)
use global_data
implicit none
type (global_type), pointer :: g
integer :: numneighbors
integer :: neighbors(MAX_DOMAIN_NEIGHBORS)
integer :: i
numneighbors = g%NEIGHPROC
do i=1,numneighbors
neighbors(i) = g%IPROC(i)
end do
end subroutine get_neighbors
subroutine get_outgoing_nodes(g, neighbor, num_nodes, alives)
use global_data
implicit none
type (global_type), pointer :: g
integer :: neighbor
integer,intent(out) :: num_nodes
integer :: alives(MAX_BOUNDARY_SIZE)
integer :: i,j,index
logical :: neighbor_found
neighbor_found = .false.
do I=1,g%NEIGHPROC
if (g%IPROC(I).eq.neighbor) then
index = i
neighbor_found = .true.
exit
end if
end do
if (neighbor_found) then
num_nodes = g%NNODSEND(INDEX)
do J=1,g%NNODSEND(INDEX)
alives(J)=g%ALIVE(g%ISENDLOC(J,INDEX))
end do
else
print*, "FORTRAN ERROR: neighbor not found"
stop
end if
end subroutine get_outgoing_nodes
subroutine put_incoming_nodes(g, neighbor, num_nodes, alives)
use global_data
implicit none
type (global_type), pointer :: g
integer :: neighbor
integer :: num_nodes
integer :: alives(MAX_BOUNDARY_SIZE)
integer :: i,j,index
logical :: neighbor_found
neighbor_found = .false.
do I=1,g%NEIGHPROC
if (g%IPROC(i).eq.neighbor) then
index = i
neighbor_found = .true.
exit
end if
end do
if (neighbor_found) then
if (num_nodes.ne.g%NNODRECV(index)) then
print*, "Error, numn_nodes .ne. g%NNODRECV(index)"
print*, "num_nodes = ", num_nodes
print*, "g%NNODRECV(index) = ", g%NNODRECV(index)
stop
end if
do J=1,g%NNODRECV(index)
g%new_alive(g%IRECVLOC(J,I))=alives(J)
end do
else
print*, "FORTRAN ERROR: neighbor not found"
stop
end if
end subroutine put_incoming_nodes