mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #422 from cjosey/fix-logind
Bugfix for out-of-bounds issues with logarithm grid
This commit is contained in:
commit
0d53bb46ad
1 changed files with 6 additions and 4 deletions
|
|
@ -92,15 +92,17 @@ contains
|
|||
! Determine corresponding indices in nuclide grid to energies on
|
||||
! equal-logarithmic grid
|
||||
j = 1
|
||||
do k = 0, M - 1
|
||||
do k = 0, M
|
||||
do while (log(nuc%energy(j + 1)/E_min) <= umesh(k))
|
||||
! Ensure that for isotopes where maxval(nuc % energy) << E_max
|
||||
! that there are no out-of-bounds issues.
|
||||
if (j + 1 == nuc % n_grid) then
|
||||
exit
|
||||
end if
|
||||
j = j + 1
|
||||
end do
|
||||
nuc % grid_index(k) = j
|
||||
end do
|
||||
|
||||
! Set the last point explicitly so that we don't have out-of-bounds issues
|
||||
nuc % grid_index(M) = size(nuc % energy) - 1
|
||||
end do
|
||||
|
||||
deallocate(umesh)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue