mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Added check for source file size different from n_particles.
This commit is contained in:
parent
b940ec69f0
commit
cfc1dc2ab3
1 changed files with 15 additions and 0 deletions
|
|
@ -275,10 +275,18 @@ contains
|
|||
call MPI_FILE_OPEN(MPI_COMM_WORLD, 'source.binary', MPI_MODE_RDONLY, &
|
||||
MPI_INFO_NULL, fh, mpi_err)
|
||||
|
||||
! Read number of source sites in file
|
||||
offset = 0
|
||||
call MPI_FILE_READ_AT(fh, offset, n_sites, 1, MPI_INTEGER8, &
|
||||
MPI_STATUS_IGNORE, mpi_err)
|
||||
|
||||
! Check that number of source sites matches
|
||||
if (n_sites /= n_particles) then
|
||||
message = "No support yet for source files of different size than &
|
||||
&specified number of particles per generation."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Set proper offset for source data on this processor
|
||||
offset = 8*(1 + rank*maxwork*8)
|
||||
|
||||
|
|
@ -300,6 +308,13 @@ contains
|
|||
! Read number of source sites in file
|
||||
read(UNIT=UNIT_SOURCE) n_sites
|
||||
|
||||
! Check that number of source sites matches
|
||||
if (n_sites /= n_particles) then
|
||||
message = "No support yet for source files of different size than &
|
||||
&specified number of particles per generation."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Read position, angle, and energy
|
||||
read(UNIT=UNIT_SOURCE) source_bank(1:work)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue