Skip to content

Commit 18fe6ff

Browse files
Addressed AI review comments
1 parent aa34f6b commit 18fe6ff

3 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/post_process/m_data_output.fpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,28 +1364,28 @@ contains
13641364
real(wp), dimension(:), allocatable :: angle_x, angle_y, angle_z
13651365
real(wp), dimension(:), allocatable :: ib_diameter
13661366
1367-
! Build path to per-timestep IB state file
1368-
write (file_loc, '(A,I0,A)') '/restart_data/ib_state_', t_step, '.dat'
1369-
file_loc = trim(case_dir) // trim(file_loc)
1367+
if (proc_rank == 0) then
1368+
! Build path to per-timestep IB state file
1369+
write (file_loc, '(A,I0,A)') '/restart_data/ib_state_', t_step, '.dat'
1370+
file_loc = trim(case_dir) // trim(file_loc)
13701371
1371-
inquire (FILE=trim(file_loc), EXIST=file_exist)
1372-
if (.not. file_exist) then
1373-
call s_mpi_abort('Restart file ' // trim(file_loc) // ' does not exist!')
1374-
end if
1372+
inquire (FILE=trim(file_loc), EXIST=file_exist)
1373+
if (.not. file_exist) then
1374+
call s_mpi_abort('Restart file ' // trim(file_loc) // ' does not exist!')
1375+
end if
13751376
1376-
nBodies = num_ibs
1377+
nBodies = num_ibs
13771378
1378-
if (nBodies > 0) then
1379-
allocate (ib_data(nBodies, NFIELDS_PER_IB))
1380-
allocate (px(nBodies), py(nBodies), pz(nBodies))
1381-
allocate (force_x(nBodies), force_y(nBodies), force_z(nBodies))
1382-
allocate (torque_x(nBodies), torque_y(nBodies), torque_z(nBodies))
1383-
allocate (vel_x(nBodies), vel_y(nBodies), vel_z(nBodies))
1384-
allocate (omega_x(nBodies), omega_y(nBodies), omega_z(nBodies))
1385-
allocate (angle_x(nBodies), angle_y(nBodies), angle_z(nBodies))
1386-
allocate (ib_diameter(nBodies))
1379+
if (nBodies > 0) then
1380+
allocate (ib_data(nBodies, NFIELDS_PER_IB))
1381+
allocate (px(nBodies), py(nBodies), pz(nBodies))
1382+
allocate (force_x(nBodies), force_y(nBodies), force_z(nBodies))
1383+
allocate (torque_x(nBodies), torque_y(nBodies), torque_z(nBodies))
1384+
allocate (vel_x(nBodies), vel_y(nBodies), vel_z(nBodies))
1385+
allocate (omega_x(nBodies), omega_y(nBodies), omega_z(nBodies))
1386+
allocate (angle_x(nBodies), angle_y(nBodies), angle_z(nBodies))
1387+
allocate (ib_diameter(nBodies))
13871388
1388-
if (proc_rank == 0) then
13891389
open (newunit=file_unit, file=trim(file_loc), form='unformatted', access='stream', status='old', iostat=ios)
13901390
if (ios /= 0) call s_mpi_abort('Cannot open IB state file: ' // trim(file_loc))
13911391
@@ -1430,12 +1430,12 @@ contains
14301430
call s_write_ib_variable('ib_angle_y', t_step, angle_y, nBodies)
14311431
call s_write_ib_variable('ib_angle_z', t_step, angle_z, nBodies)
14321432
call s_write_ib_variable('ib_diameter', t_step, ib_diameter, nBodies)
1433-
end if
14341433
1435-
deallocate (ib_data, px, py, pz, force_x, force_y, force_z)
1436-
deallocate (torque_x, torque_y, torque_z, vel_x, vel_y, vel_z)
1437-
deallocate (omega_x, omega_y, omega_z, angle_x, angle_y, angle_z)
1438-
deallocate (ib_diameter)
1434+
deallocate (ib_data, px, py, pz, force_x, force_y, force_z)
1435+
deallocate (torque_x, torque_y, torque_z, vel_x, vel_y, vel_z)
1436+
deallocate (omega_x, omega_y, omega_z, angle_x, angle_y, angle_z)
1437+
deallocate (ib_diameter)
1438+
end if
14391439
end if
14401440
#endif
14411441

src/simulation/m_collisions.fpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ contains
440440
!> @brief function checks if this local MPI processor owns this specific collision
441441
function f_neighborhood_ranks_own_location(location) result(owns_collision)
442442

443-
$:GPU_ROUTINE(parallelism='[seq]')
444-
445443
real(wp), dimension(3), intent(in) :: location
446444
logical :: owns_collision, periodic_owner
447445
real(wp) :: temp_neighbor_domain

src/simulation/m_start_up.fpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,8 @@ contains
12271227

12281228
num_gbl_ibs = num_ibs
12291229
num_local_ibs = num_ibs
1230+
@:PROHIBIT(num_local_ibs > num_local_ibs_max, &
1231+
& "Too many IBs on a single processor rank. Modify case file or increase limit of num_local_ibs_max to resolve.")
12301232
do i = 1, num_local_ibs_max
12311233
local_ib_patch_ids(i) = i
12321234
end do

0 commit comments

Comments
 (0)