diff --git a/docs/source/usersguide/troubleshoot.rst b/docs/source/usersguide/troubleshoot.rst index ba7e4405cc..10ac12184f 100644 --- a/docs/source/usersguide/troubleshoot.rst +++ b/docs/source/usersguide/troubleshoot.rst @@ -79,14 +79,6 @@ with the :envvar:`CROSS_SECTIONS` environment variable. It is recommended to add a line in your ``.profile`` or ``.bash_profile`` setting the :envvar:`CROSS_SECTIONS` environment variable. -ERROR: Invalid usage of L(I) in ACE data; Consider using more recent data set. -****************************************************************************** - -The cross-sections requested in ``materials.xml`` do not conform to the current -standard format. This typically happens with fissionable nuclides in a ``.6*c`` -library as distributed with MCNP. Please try a newer library such as any from -the ``.7*c`` set. - Geometry Debugging ****************** diff --git a/src/ace.F90 b/src/ace.F90 index e3327b2da5..d414e21f89 100644 --- a/src/ace.F90 +++ b/src/ace.F90 @@ -789,14 +789,19 @@ contains ! read angular distribution -- currently this does not actually parse the ! angular distribution tables for each incoming energy, that must be done ! on-the-fly - LC = rxn % adist % location(1) - XSS_index = JXS9 + abs(LC) - 1 + XSS_index = JXS9 + LOCB + 2 * NE rxn % adist % data = get_real(length) ! change location pointers since they are currently relative to JXS(9) - LC = abs(rxn % adist % location(1)) - rxn % adist % location = abs(rxn % adist % location) - LC - + LC = LOCB + 2 * NE + 1 + do j = 1, NE + ! For consistency, leave location as 0 if type is isotropic. + ! This is not necessary for current correctness, but can avoid + ! future issues + if (rxn % adist % location(j) /= 0) then + rxn % adist % location(j) = abs(rxn % adist % location(j)) - LC + end if + end do end do end subroutine read_angular_dist @@ -967,24 +972,23 @@ contains ! Continuous tabular distribution NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) - ! Before progressing, check to see if data set uses L(I) values - ! in a way inconsistent with the current form of the ACE Format Guide - ! (MCNP5 Manual, Vol 3) allocate(L(NE)) L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) - do i = 1,NE - ! Now check to see if L(i) is equal to any other entries - ! If so, then we must exit - if (count(L == L(i)) > 1) then - message = "Invalid usage of L(I) in ACE data; & - &Consider using more recent data set." - call fatal_error() - end if - end do - deallocate(L) + ! Continue with finding data length length = length + 2 + 2*NR + 2*NE do i = 1,NE + ! Some older data sets use the same LDAT for multiple Ein tables. + ! If this is the case, we should skip incrementing length when it is + ! not needed. + if (i < NE) then + if (any(L(i) == L(i + 1: NE))) then + ! adjust location for this block + j = lc + 2 + 2*NR + NE + i + XSS(j) = XSS(j) - LOCC - lid + cycle + end if + end if ! determine length NP = int(XSS(lc + length + 2)) length = length + 2 + 3*NP @@ -993,6 +997,7 @@ contains j = lc + 2 + 2*NR + NE + i XSS(j) = XSS(j) - LOCC - lid end do + deallocate(L) case (5) ! General evaporation spectrum @@ -1025,24 +1030,23 @@ contains ! Kalbach-Mann correlated scattering NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) - ! Before progressing, check to see if data set uses L(I) values - ! in a way inconsistent with the current form of the ACE Format Guide - ! (MCNP5 Manual, Vol 3) allocate(L(NE)) L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) - do i = 1,NE - ! Now check to see if L(i) is equal to any other entries - ! If so, then we must exit - if (count(L == L(i)) > 1) then - message = "Invalid usage of L(I) in ACE data; & - &Consider using more recent data set." - call fatal_error() - end if - end do - deallocate(L) + ! Continue with finding data length length = length + 2 + 2*NR + 2*NE do i = 1,NE + ! Some older data sets use the same LDAT for multiple Ein tables. + ! If this is the case, we should skip incrementing length when it is + ! not needed. + if (i < NE) then + if (any(L(i) == L(i + 1: NE))) then + ! adjust location for this block + j = lc + 2 + 2*NR + NE + i + XSS(j) = XSS(j) - LOCC - lid + cycle + end if + end if NP = int(XSS(lc + length + 2)) length = length + 2 + 5*NP @@ -1050,29 +1054,30 @@ contains j = lc + 2 + 2*NR + NE + i XSS(j) = XSS(j) - LOCC - lid end do + deallocate(L) case (61) ! Correlated energy and angle distribution NR = int(XSS(lc + 1)) NE = int(XSS(lc + 2 + 2*NR)) - ! Before progressing, check to see if data set uses L(I) values - ! in a way inconsistent with the current form of the ACE Format Guide - ! (MCNP5 Manual, Vol 3) allocate(L(NE)) L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) - do i = 1,NE - ! Now check to see if L(i) is equal to any other entries - ! If so, then we must exit - if (count(L == L(i)) > 1) then - message = "Invalid usage of L(I) in ACE data; & - &Consider using more recent data set." - call fatal_error() - end if - end do - deallocate(L) + ! Continue with finding data length length = length + 2 + 2*NR + 2*NE do i = 1,NE + ! Some older data sets use the same LDAT for multiple Ein tables. + ! If this is the case, we should skip incrementing length when it is + ! not needed. + if (i < NE) then + if (any(L(i) == L(i + 1: NE))) then + ! adjust locators for energy distribution + j = lc + 2 + 2*NR + NE + i + XSS(j) = XSS(j) - LOCC - lid + cycle + end if + end if + ! outgoing energy distribution NP = int(XSS(lc + length + 2)) @@ -1094,7 +1099,7 @@ contains j = lc + 2 + 2*NR + NE + i XSS(j) = XSS(j) - LOCC - lid end do - + deallocate(L) case (66) ! N-body phase space distribution length = 2 @@ -1108,15 +1113,7 @@ contains ! (MCNP5 Manual, Vol 3) allocate(L(NE)) L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1)) - do i = 1,NE - ! Now check to see if L(i) is equal to any other entries - ! If so, then we must exit - if (count(L == L(i)) > 1) then - message = "Invalid usage of L(I) in ACE data; & - &Consider using more recent data set." - call fatal_error() - end if - end do + ! Don't currently do anything with L deallocate(L) ! Continue with finding data length NMU = int(XSS(lc + 4 + 2*NR + 2*NE)) diff --git a/src/physics.F90 b/src/physics.F90 index 5d3433f3be..3460873e55 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -1164,7 +1164,7 @@ contains ! calculate cosine mu0 = rxn % adist % data(lc + k) mu1 = rxn % adist % data(lc + k+1) - mu = mu0 + (32.0_8 * xi - k) * (mu1 - mu0) + mu = mu0 + (32.0_8 * xi - k + ONE) * (mu1 - mu0) elseif (type == ANGLE_TABULAR) then interp = int(rxn % adist % data(lc + 1))