From 0eed581c4d4c8150caf9fab20a7387ec7ed34ef2 Mon Sep 17 00:00:00 2001 From: Bryan Herman Date: Thu, 22 Aug 2013 16:58:23 -0400 Subject: [PATCH] warnings can now be printed from any processor if force logical is true --- src/error.F90 | 6 ++++-- src/geometry.F90 | 2 +- src/particle_restart_write.F90 | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/error.F90 b/src/error.F90 index ab033f1691..78fd64c25e 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -17,7 +17,9 @@ contains ! stream. !=============================================================================== - subroutine warning() + subroutine warning(force) + + logical, optional :: force ! force write from proc other than master integer :: i_start ! starting position integer :: i_end ! ending position @@ -26,7 +28,7 @@ contains integer :: indent ! length of indentation ! Only allow master to print to screen - if (.not. master) return + if (.not. master .and. .not. present(force)) return ! Write warning at beginning write(ERROR_UNIT, fmt='(1X,A)', advance='no') 'WARNING: ' diff --git a/src/geometry.F90 b/src/geometry.F90 index a50e55252a..f2b9fed8d7 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -1557,7 +1557,7 @@ contains type(Particle), intent(inout) :: p ! Print warning and write lost particle file - call warning() + call warning(force = .true.) call write_particle_restart(p) ! Increment number of lost particles diff --git a/src/particle_restart_write.F90 b/src/particle_restart_write.F90 index 0820224e11..5625871fdb 100644 --- a/src/particle_restart_write.F90 +++ b/src/particle_restart_write.F90 @@ -56,7 +56,7 @@ contains ! set up file name filename = trim(path_output) // 'particle_' // trim(to_str(current_batch)) & - // '_' // trim(to_str(current_work)) // '.h5' + // '_' // trim(to_str(p % id)) // '.h5' ! create hdf5 file call h5fcreate_f(filename, H5F_ACC_TRUNC_F, hdf5_particle_file, hdf5_err) @@ -102,7 +102,7 @@ contains ! set up file name filename = trim(path_output) // 'particle_' // trim(to_str(current_batch)) & - // '_' // trim(to_str(current_work)) // '.binary' + // '_' // trim(to_str(p % id)) // '.binary' ! create hdf5 file open(UNIT=UNIT_PARTICLE, FILE=filename, STATUS='replace', &