mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Merge pull request #278 from nelsonag/lc_fix
Fixes to support reading of older cross-section data sets
This commit is contained in:
commit
7f84d89b5a
3 changed files with 52 additions and 63 deletions
|
|
@ -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
|
||||
******************
|
||||
|
||||
|
|
|
|||
105
src/ace.F90
105
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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue