From 771670f87303cb392b6f40fdced2e866005ede09 Mon Sep 17 00:00:00 2001 From: walshjon Date: Mon, 23 Dec 2013 17:01:24 -0800 Subject: [PATCH] handle negative 0K elastic xs values by setting to ZERO --- src/ace.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ace.F90 b/src/ace.F90 index e902b516db..6aec1702dc 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -398,6 +398,7 @@ contains type(Nuclide), pointer :: nuc integer :: NE ! number of energy points for total and elastic cross sections + integer :: i ! index in 0K elastic xs array for this nuclide ! determine number of energy points NE = NXS(3) @@ -419,6 +420,12 @@ contains ! Continue reading elastic scattering and heating nuc % elastic_0K = get_real(NE) + ! Negative cross sections result in a CDF that is not monotonically + ! increasing. Set all negative xs values to ZERO. + do i = 1, nuc % n_grid_0K + if (nuc % elastic_0K(i) < ZERO) nuc % elastic_0K(i) = ZERO + end do + else ! read in non-0K data nuc % n_grid = NE allocate(nuc % energy(NE))