warnings can now be printed from any processor if force logical is true

This commit is contained in:
Bryan Herman 2013-08-22 16:58:23 -04:00
parent d07594b831
commit 0eed581c4d
3 changed files with 7 additions and 5 deletions

View file

@ -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: '

View file

@ -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

View file

@ -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', &