-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathexchangeable_interface.f90
111 lines (88 loc) · 2.91 KB
/
exchangeable_interface.f90
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
module exchangeable_interface
use grid_interface, only : grid_t
implicit none
private
public :: exchangeable_t
type exchangeable_t
private
real, allocatable, public :: local(:,:,:)
real, allocatable :: halo_south_in(:,:,:)[:]
real, allocatable :: halo_north_in(:,:,:)[:]
real, allocatable :: halo_west_in(:,:,:)[:]
real, allocatable :: halo_east_in(:,:,:)[:]
logical :: north_boundary=.false.
logical :: south_boundary=.false.
logical :: east_boundary=.false.
logical :: west_boundary=.false.
contains
private
procedure, public :: const
procedure, public :: send
procedure, public :: retrieve
procedure, public :: exchange
generic, public :: initialize=>const
procedure :: put_north
procedure :: put_south
procedure :: put_west
procedure :: put_east
procedure :: retrieve_north_halo
procedure :: retrieve_south_halo
procedure :: retrieve_west_halo
procedure :: retrieve_east_halo
end type
integer, parameter :: space_dim=3
interface
module subroutine const(this, grid, initial_value, halo_width)
implicit none
class(exchangeable_t), intent(inout) :: this
type(grid_t), intent(in) :: grid
real, intent(in) :: initial_value
integer, intent(in), optional :: halo_width
end subroutine
module subroutine send(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine retrieve(this, no_sync)
implicit none
class(exchangeable_t), intent(inout) :: this
logical, intent(in), optional :: no_sync
end subroutine
module subroutine exchange(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine put_north(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine put_south(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine retrieve_north_halo(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine retrieve_south_halo(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine put_east(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine put_west(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine retrieve_east_halo(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
module subroutine retrieve_west_halo(this)
implicit none
class(exchangeable_t), intent(inout) :: this
end subroutine
end interface
end module