Skip to content

Commit

Permalink
fix for sirocco-rt#498, don't overwrite macro_pops values
Browse files Browse the repository at this point in the history
  • Loading branch information
jhmatthews committed Jul 5, 2019
1 parent d344f83 commit 022ff20
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/matrix_ion.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,20 @@ matrix_ion_populations (xplasma, mode)
{
newden[nn] = xplasma->density[nn] / elem_dens[ion[nn].z];
}

for (mm = 0; mm < nrows; mm++) // inner loop over the elements of the population array

/* if the ion is "simple" then find it's calculated ionization state in populations array */
else
{
if (xion[mm] == nn) // if this element contains the population of the ion is question

for (mm = 0; mm < nrows; mm++) // inner loop over the elements of the population array
{
newden[nn] = populations[mm]; // get the population
if (xion[mm] == nn) // if this element contains the population of the ion is question
{
newden[nn] = populations[mm]; // get the population
}
}
}


if (newden[nn] < DENSITY_MIN) // this wil also capture the case where population doesnt have a value for this ion
newden[nn] = DENSITY_MIN;
}
Expand Down

0 comments on commit 022ff20

Please sign in to comment.