Seem to have fixed the L(I) issue, testing now

This commit is contained in:
Adam Nelson 2014-05-19 09:36:39 -04:00
parent 74fb90a923
commit 070e282486

View file

@ -967,24 +967,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 (L(i) == L(i + 1)) 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 +992,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 +1025,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 (L(i) == L(i + 1)) 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 +1049,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 (L(i) == L(i + 1)) 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 +1094,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 +1108,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))