Skip to content

Commit

Permalink
need to set n_parcels
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-frey committed Apr 20, 2024
1 parent 6596c31 commit faa89ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/3d/parcels/parcel_netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ subroutine read_netcdf_parcels(fname)
!
call mpi_print("WARNING: MPI ranks disagree. Reading parcels with optimised rejection method!")

n_parcels = 0
pfirst = 1

do n = 1, num_indices
Expand Down Expand Up @@ -469,14 +470,16 @@ subroutine rejection_method(start_index, end_index, pfirst)
integer, intent(in) :: start_index
integer, intent(in) :: end_index
integer, intent(in) :: pfirst
integer :: m, k
integer :: m, k, n_read
integer, allocatable :: invalid(:)

call read_chunk(start_index, end_index, pfirst)
n_read = end_index - start_index + 1
n_parcels = n_parcels + n_read

! if all MPI ranks read all parcels, each MPI rank must delete the parcels
! not belonging to its domain
allocate(invalid(0:end_index-start_index+1))
allocate(invalid(0:n_read))

m = 1
do k = pfirst, n_parcels
Expand Down

0 comments on commit faa89ff

Please # to comment.