Skip to content

Commit ee9b269

Browse files
Fix an issue with setting num_gps too large for later use
1 parent 23a4993 commit ee9b269

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/simulation/m_ibm.fpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,14 @@ contains
119119
call s_find_num_ghost_points(num_gps)
120120
if (moving_immersed_boundary_flag) then
121121
call s_mpi_allreduce_integer_sum(num_gps, max_num_gps)
122-
num_gps = min(max_num_gps*2, (m + 1)*(n + 1)*(p + 1))
122+
max_num_gps = min(max_num_gps*2, (m + 1)*(n + 1)*(p + 1))
123+
else
124+
max_num_gps = num_gps
123125
end if
124126

125127
! set the size of the ghost point arrays to be the amount of points total, plus a factor of 2 buffer
126128
$:GPU_UPDATE(device='[num_gps]')
127-
@:ALLOCATE(ghost_points(1:num_gps))
129+
@:ALLOCATE(ghost_points(1:max_num_gps))
128130

129131
$:GPU_ENTER_DATA(copyin='[ghost_points]')
130132
call s_find_ghost_points(ghost_points)

0 commit comments

Comments
 (0)