From abb9f3e31b7ae5a224230481614fdca942cf895d Mon Sep 17 00:00:00 2001 From: Colin Josey Date: Tue, 21 Jul 2015 13:11:48 -0400 Subject: [PATCH 1/2] Modified logarithm grid so that it does not fail when an isotope has a maximum energy below 20 MeV --- src/energy_grid.F90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/energy_grid.F90 b/src/energy_grid.F90 index 9bde48a5ec..f8becff545 100644 --- a/src/energy_grid.F90 +++ b/src/energy_grid.F90 @@ -94,6 +94,11 @@ contains j = 1 do k = 0, M - 1 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 From c6dc1778fdb24197f19a6a2a234934f9b31637c1 Mon Sep 17 00:00:00 2001 From: Colin Josey Date: Wed, 22 Jul 2015 16:29:57 -0400 Subject: [PATCH 2/2] Cleaned up logarithm energy grid setup --- src/energy_grid.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/energy_grid.F90 b/src/energy_grid.F90 index f8becff545..1473e52105 100644 --- a/src/energy_grid.F90 +++ b/src/energy_grid.F90 @@ -92,20 +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 + 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)