Skip to content

Commit

Permalink
fixed bug for atom composition in result
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholaswogan committed Oct 2, 2024
1 parent b2a9d99 commit f4293d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/equilibrate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ function create_ChemEquiAnalysis(thermopath, atoms, species, err) result(cea)
! Get composition of each species
cea%species_composition = 0.0_dp
do j = 1,size(cea%species_names)
jj = cea%dat%id_reactants(j,1)
do k = 1,size(cea%dat%reac_atoms_id,1)
if (cea%dat%reac_atoms_id(k,j) > 0) then
i = findloc(cea%dat%id_atoms, cea%dat%reac_atoms_id(k, j), 1)
if (cea%dat%reac_atoms_id(k,jj) > 0) then
i = findloc(cea%dat%id_atoms, cea%dat%reac_atoms_id(k,jj), 1)
if (i == 0 .or. i > size(cea%atoms_names) + 1) then
err = 'Indexing error during initialization.'
return
Expand All @@ -164,7 +165,7 @@ function create_ChemEquiAnalysis(thermopath, atoms, species, err) result(cea)
! Electron so we skip
cycle
endif
cea%species_composition(i,j) = cea%dat%reac_stoich(k,j)
cea%species_composition(i,j) = cea%dat%reac_stoich(k,jj)
endif
enddo
enddo
Expand Down

0 comments on commit f4293d5

Please sign in to comment.