From cfc1dc2ab33f28c54013847373bd0eb4c17350f1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 22 Mar 2012 18:20:12 -0400 Subject: [PATCH] Added check for source file size different from n_particles. --- src/source.F90 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/source.F90 b/src/source.F90 index fb35728f7e..45e9d76996 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -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)