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))