mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #909 from SlaybaughLab/correct-mat-index
Corrected material index in `openmc_cell_set_temperature` routine
This commit is contained in:
commit
a69c0d02fb
1 changed files with 4 additions and 7 deletions
11
src/api.F90
11
src/api.F90
|
|
@ -100,7 +100,6 @@ contains
|
|||
integer(C_INT) :: err ! error code
|
||||
integer :: j ! looping variable
|
||||
integer :: n ! number of cell instances
|
||||
integer :: material_ID ! material associated with cell
|
||||
integer :: material_index ! material index in materials array
|
||||
integer :: num_nuclides ! num nuclides in material
|
||||
integer :: nuclide_index ! index of nuclide in nuclides array
|
||||
|
|
@ -121,16 +120,14 @@ contains
|
|||
if (cells(index) % fill /= NONE) then
|
||||
err = E_CELL_NO_MATERIAL
|
||||
else
|
||||
! find which material is associated with this cell
|
||||
! find which material is associated with this cell (material_index
|
||||
! is the index into the materials array)
|
||||
if (present(instance)) then
|
||||
material_ID = cells(index) % material(instance)
|
||||
material_index = cells(index) % material(instance)
|
||||
else
|
||||
material_ID = cells(index) % material(1)
|
||||
material_index = cells(index) % material(1)
|
||||
end if
|
||||
|
||||
! index of that material into the materials array
|
||||
material_index = material_dict % get_key(material_ID)
|
||||
|
||||
! number of nuclides associated with this material
|
||||
num_nuclides = size(materials(material_index) % nuclide)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue