diff --git a/src/cross_section.F90 b/src/cross_section.F90 index 86d15ef1d1..1ab4e41d51 100644 --- a/src/cross_section.F90 +++ b/src/cross_section.F90 @@ -12,7 +12,7 @@ module cross_section use fission, only: nu_total use global use material_header, only: Material - use output, only: write_message + use output, only: write_message, print_nuclide, header use string, only: split_string, str_to_int, str_to_real, & lower_case, int_to_str @@ -137,6 +137,9 @@ contains ! ========================================================================== ! READ ALL ACE CROSS SECTION TABLES + ! display header in summary.out + if (master) call header("CROSS SECTION TABLES", unit=UNIT_SUMMARY) + call dict_create(already_read) ! Loop over all files @@ -154,6 +157,10 @@ contains call read_ace_table(index_nuclides, index_list) + ! Print out information on table to summary.out file + nuc => nuclides(index_nuclides) + if (master) call print_nuclide(nuc, unit=UNIT_SUMMARY) + call dict_add_key(already_read, name, 0) call dict_add_key(already_read, alias, 0) end if @@ -634,6 +641,8 @@ contains rxn % Q_value = ZERO rxn % TY = 1 rxn % IE = 1 + rxn % has_angle_dist = .false. + rxn % has_energy_dist = .false. allocate(rxn % sigma(nuc % n_grid)) rxn % sigma = nuc % elastic @@ -650,6 +659,10 @@ contains do i = 1, NMT rxn => nuc % reactions(i+1) + ! set defaults + rxn % has_angle_dist = .false. + rxn % has_energy_dist = .false. + ! read MT number, Q-value, and neutrons produced rxn % MT = int(XSS(LMT + i - 1)) rxn % Q_value = XSS(JXS4 + i - 1) @@ -701,10 +714,6 @@ contains nuc % index_fission(i_fission) = i + 1 nuc % n_fission = nuc % n_fission + 1 end if - - ! set defaults - rxn % has_angle_dist = .false. - rxn % has_energy_dist = .false. end do end subroutine read_reactions diff --git a/src/output.F90 b/src/output.F90 index 68ddee6bc5..e5e0c5facb 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -3,7 +3,7 @@ module output use ISO_FORTRAN_ENV use constants - use cross_section_header, only: Reaction + use cross_section_header, only: Nuclide, Reaction use datatypes, only: dict_get_key use endf, only: reaction_name use geometry_header, only: Cell, Universe, Surface @@ -711,6 +711,83 @@ contains end subroutine print_geometry +!=============================================================================== +! PRINT_NUCLIDE displays information about a continuous-energy neutron +! cross_section table and its reactions and secondary angle/energy distributions +!=============================================================================== + + subroutine print_nuclide(nuc, unit) + + type(Nuclide), pointer :: nuc + integer, optional :: unit + + integer :: i + integer :: unit_ + integer :: size_total + integer :: size_xs + integer :: size_angle + integer :: size_energy + type(Reaction), pointer :: rxn => null() + + ! set default unit for writing information + if (present(unit)) then + unit_ = unit + else + unit_ = OUTPUT_UNIT + end if + + ! Determine size of cross-sections + size_xs = (5 + nuc % n_reaction) * nuc % n_grid * 8 + size_total = size_xs + + ! Basic nuclide information + write(unit_,*) 'Nuclide ' // trim(nuc % name) + write(unit_,*) ' zaid = ' // trim(int_to_str(nuc % zaid)) + write(unit_,*) ' awr = ' // trim(real_to_str(nuc % awr)) + write(unit_,*) ' kT = ' // trim(real_to_str(nuc % kT)) + write(unit_,*) ' # of grid points = ' // trim(int_to_str(nuc % n_grid)) + write(unit_,*) ' Fissionable = ', nuc % fissionable + write(unit_,*) ' # of fission reactions = ' // trim(int_to_str(nuc % n_fission)) + write(unit_,*) ' # of reactions = ' // trim(int_to_str(nuc % n_reaction)) + write(unit_,*) ' Size of cross sections = ' // trim(int_to_str(& + size_xs)) // ' bytes' + + write(unit_,*) ' Reaction Q-value Mult IE size(angle) size(energy)' + do i = 1, nuc % n_reaction + ! Information on each reaction + rxn => nuc % reactions(i) + + ! Determine size of angle distribution + if (rxn % has_angle_dist) then + size_angle = rxn % adist % n_energy * 16 + size(rxn % adist % data) * 8 + else + size_angle = 0 + end if + + ! Determine size of energy distribution + if (rxn % has_energy_dist) then + size_energy = size(rxn % edist % data) * 8 + else + size_energy = 0 + end if + + write(unit_,'(3X,A11,1X,F8.3,2X,I3,3X,I6,1X,I11,1X,I11)') & + reaction_name(rxn % MT), rxn % Q_value, rxn % TY, rxn % IE, & + size_angle, size_energy + + ! Accumulate data size + size_total = size_total + size_angle + size_energy + end do + + ! Write total memory used + write(unit_,*) ' Total memory used = ' // trim(int_to_str(size_total)) & + // ' bytes' + + ! Blank line at end of nuclide + write(unit_,*) + + end subroutine print_nuclide + !=============================================================================== ! PRINT_SUMMARY displays summary information about the problem about to be run ! after reading all input files