Merge pull request #979 from paulromano/extra-material-fix

Avoid segfault from unused nuclides in extra materials
This commit is contained in:
Sterling Harper 2018-03-05 22:42:05 -05:00 committed by GitHub
commit 0496237fe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4265,12 +4265,16 @@ contains
! Show which nuclide results in lowest energy for neutron transport
do i = 1, size(nuclides)
if (nuclides(i) % grid(1) % energy(size(nuclides(i) % grid(1) % energy)) &
== energy_max_neutron) then
call write_message("Maximum neutron transport energy: " // &
trim(to_str(energy_max_neutron)) // " eV for " // &
trim(adjustl(nuclides(i) % name)), 7)
exit
! If a nuclide is present in a material that's not used in the model, its
! grid has not been allocated
if (size(nuclides(i) % grid) > 0) then
if (nuclides(i) % grid(1) % energy(size(nuclides(i) % grid(1) % energy)) &
== energy_max_neutron) then
call write_message("Maximum neutron transport energy: " // &
trim(to_str(energy_max_neutron)) // " eV for " // &
trim(adjustl(nuclides(i) % name)), 7)
exit
end if
end if
end do