From ffdcead9e4be5dfcfee52ffe0cdb67b8cf23b813 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 18 Dec 2011 17:59:29 -0500 Subject: [PATCH] Check for neighboring energy points that are the same on nuclide energy grid. --- src/physics.F90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/physics.F90 b/src/physics.F90 index 7f1487ddb6..f4dcbd28dd 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -235,8 +235,13 @@ contains ! TODO: If not using unionized energy grid, we need to find the index on the ! nuclide energy grid using lethargy mapping or whatever other technique - ! search nuclide energy grid + ! get index on nuclide energy grid IE = nuc % grid_index(p % IE) + + ! check for rare case where two energy points are the same + if (nuc % energy(IE) == nuc % energy(IE+1)) IE = IE + 1 + + ! calculate interpolation factor f = (p%E - nuc%energy(IE))/(nuc%energy(IE+1) - nuc%energy(IE)) micro_xs(index_nuclide) % index_grid = IE