[FLASH-BUGS] Bug in serial hdf5 particle reader

Nathan Goldbaum goldbaum at ucolick.org
Fri Mar 9 16:32:13 CST 2012


Hello,

I think I've found a bug in the serial hdf5 particle reader: 

$FLASH4DIR/source/IO/IOParticles/hdf5/serial/io_ptReadParticleData.F90

If one tries to restart a simulation with no particles BUT with the useParticles flag set to .true., the simulation will crash in Particles_advance.F90 because the particles array has not yet been initialized.  This is a problem for simulations that spawn particles during the simulation and do not have particles in the initial conditions.  The bug can be fixed with the following diff:

diff io_ptReadParticleData.F90 io_ptReadParticleData_orig.F90 
93a94,102
>   !get the global number of particles in the simulation
>   call IO_getScalar("globalNumParticles", globalNumParticles)
> 
>   if(globalNumParticles <= 0 ) then
>      return
>   else
>      pt_posInitialized = .true.
>   end if
> 
107,115d115
< 
<   !get the global number of particles in the simulation
<   call IO_getScalar("globalNumParticles", globalNumParticles)
< 
<   if(globalNumParticles <= 0 ) then
<      return
<   else
<      pt_posInitialized = .true.
<   end if

Best,

Nathan Goldbaum
Graduate Student
Astronomy & Astrophysics, UCSC
goldbaum at ucolick.org
http://www.ucolick.org/~goldbaum



More information about the flash-bugs mailing list