Skip to content

Commit 64d9677

Browse files
authored
-1.2k LOC in s_mpi_sendrecv_variables_buffers (#409)
1 parent 9c60ebf commit 64d9677

File tree

3 files changed

+256
-1464
lines changed

3 files changed

+256
-1464
lines changed

src/common/m_helper.fpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ module m_helper
3333
f_cross, &
3434
f_create_transform_matrix, &
3535
f_create_bbox, &
36-
s_print_2D_array
36+
s_print_2D_array, &
37+
f_xor, &
38+
f_logical_to_int
3739

3840
contains
3941

@@ -516,4 +518,22 @@ contains
516518

517519
end function f_create_bbox
518520

521+
function f_xor(lhs, rhs) result(res)
522+
logical, intent(in) :: lhs, rhs
523+
logical :: res
524+
525+
res = (lhs .and. .not. rhs) .or. (.not. lhs .and. rhs)
526+
end function f_xor
527+
528+
function f_logical_to_int(predicate) result(int)
529+
logical, intent(in) :: predicate
530+
integer :: int
531+
532+
if (predicate) then
533+
int = 1
534+
else
535+
int = 0
536+
end if
537+
end function f_logical_to_int
538+
519539
end module m_helper

src/simulation/m_boundary_conditions.fpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ contains
4545
case (-16) ! No-slip wall BC at beginning
4646
call s_no_slip_wall(q_prim_vf, pb, mv, 1, -1)
4747
case default ! Processor BC at beginning
48-
call s_mpi_sendrecv_conservative_variables_buffers( &
48+
call s_mpi_sendrecv_variables_buffers( &
4949
q_prim_vf, pb, mv, 1, -1)
5050
end select
5151

@@ -61,7 +61,7 @@ contains
6161
case (-16) ! No-slip wall bc at end
6262
call s_no_slip_wall(q_prim_vf, pb, mv, 1, 1)
6363
case default ! Processor BC at end
64-
call s_mpi_sendrecv_conservative_variables_buffers( &
64+
call s_mpi_sendrecv_variables_buffers( &
6565
q_prim_vf, pb, mv, 1, 1)
6666
end select
6767

@@ -105,7 +105,7 @@ contains
105105
case (-16) ! No-slip wall BC at beginning
106106
call s_no_slip_wall(q_prim_vf, pb, mv, 2, -1)
107107
case default ! Processor BC at beginning
108-
call s_mpi_sendrecv_conservative_variables_buffers( &
108+
call s_mpi_sendrecv_variables_buffers( &
109109
q_prim_vf, pb, mv, 2, -1)
110110
end select
111111

@@ -121,7 +121,7 @@ contains
121121
case (-16) ! No-slip wall BC at end
122122
call s_no_slip_wall(q_prim_vf, pb, mv, 2, 1)
123123
case default ! Processor BC at end
124-
call s_mpi_sendrecv_conservative_variables_buffers( &
124+
call s_mpi_sendrecv_variables_buffers( &
125125
q_prim_vf, pb, mv, 2, 1)
126126
end select
127127

@@ -165,7 +165,7 @@ contains
165165
case (-16) ! No-slip wall BC at beginning
166166
call s_no_slip_wall(q_prim_vf, pb, mv, 3, -1)
167167
case default ! Processor BC at beginning
168-
call s_mpi_sendrecv_conservative_variables_buffers( &
168+
call s_mpi_sendrecv_variables_buffers( &
169169
q_prim_vf, pb, mv, 3, -1)
170170
end select
171171

@@ -181,7 +181,7 @@ contains
181181
case (-16) ! No-slip wall BC at end
182182
call s_no_slip_wall(q_prim_vf, pb, mv, 3, 1)
183183
case default ! Processor BC at end
184-
call s_mpi_sendrecv_conservative_variables_buffers( &
184+
call s_mpi_sendrecv_variables_buffers( &
185185
q_prim_vf, pb, mv, 3, 1)
186186
end select
187187

0 commit comments

Comments
 (0)