compdyn / partmc

Particle-resolved stochastic atmospheric aerosol model
http://lagrange.mechse.illinois.edu/partmc/
GNU General Public License v2.0
28 stars 16 forks source link

particle ID problem with restart runs #67

Closed jcurtis2 closed 3 years ago

jcurtis2 commented 6 years ago

When doing a restart run, particle IDs are read in from the NetCDF file but the next_id in the model is set to 1. So when new particles are created, it will start at 1 and increase. As a result, eventually different particles will share the same IDs and if these particles attempt to coagulate, the code will cause it to exit (as we test particle IDs in coagulation).

To fix this, we should set the next_id variable to the maximum value of the aero_id array +1 when inputing the aero_state for a restart.

This occurs in the fractal tests on relatively rare occasions as those tests use restart files.