From 334b10077ee5df6820aed99ed2e6a0cec8c5d185 Mon Sep 17 00:00:00 2001 From: nhorelik Date: Mon, 6 May 2013 19:11:23 -0400 Subject: [PATCH] Changed plot to strickly serpent-style plots, and added mpi reduce --- src/DEPENDENCIES | 2 ++ src/initialize.F90 | 20 ++++++++++++++++---- src/input_xml.F90 | 5 ----- src/plot.F90 | 12 +++++++++++- src/plot_header.F90 | 2 -- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index c42098a76..448e82001 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -187,6 +187,7 @@ hdf5_interface.o: string.o hdf5_interface.o: tally_header.o initialize.o: ace.o +initialize.o: ace_header.o initialize.o: bank_header.o initialize.o: constants.o initialize.o: dict_header.o @@ -197,6 +198,7 @@ initialize.o: geometry_header.o initialize.o: global.o initialize.o: hdf5_interface.o initialize.o: input_xml.o +initialize.o: material_header.o initialize.o: output.o initialize.o: random_lcg.o initialize.o: source.o diff --git a/src/initialize.F90 b/src/initialize.F90 index fc7569baf..cccfb3120 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -1,6 +1,7 @@ module initialize use ace, only: read_xs + use ace_header, only: Nuclide use bank_header, only: Bank use constants use dict_header, only: DictIntInt, ElemKeyValueII @@ -11,6 +12,7 @@ module initialize use global use input_xml, only: read_input_xml, read_cross_sections_xml, & cells_in_univ_dict, read_plots_xml + use material_header, only: Material use output, only: title, header, write_summary, print_version, & print_usage, write_xs_summary, print_plot use random_lcg, only: initialize_prng @@ -42,6 +44,10 @@ contains subroutine initialize_run() + integer :: i, j + type(Material), pointer :: mat => null() + type(Nuclide), pointer :: nuc => null() + ! Start total and initialization timer call time_total % start() call time_initialize % start() @@ -98,10 +104,16 @@ contains call read_xs() call time_read_xs % stop() - TODO - ! Set material fissionable flag - matnuc => nuclides(mat % nuclide(j)) - if (matnuc % fissionable) mat % fissionable = .true. + do i = 1, n_materials + mat => materials(i) + do j = 1, mat % n_nuclides + + ! Set material fissionable flag + nuc => nuclides(mat % nuclide(j)) + if (nuc % fissionable) mat % fissionable = .true. + + end do + end do ! Construct unionized energy grid from cross-sections if (grid_method == GRID_UNION) then diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 8eb5e29fc..6bbf408da 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -1018,7 +1018,6 @@ contains type(ListChar) :: list_names ! temporary list of nuclide names type(ListReal) :: list_density ! temporary list of nuclide densities type(Material), pointer :: mat => null() - type(Nuclide), pointer :: matnuc => null() type(nuclide_xml), pointer :: nuc => null() type(sab_xml), pointer :: sab => null() @@ -2431,10 +2430,6 @@ contains ! Copy rxn rate type select case (plot_(i) % rrtype) - case ("fission") - pl % rrtype = PLOT_RXN_FISSION - case ("absorption") - pl % rrtype = PLOT_RXN_ABSORPTION case ("fluxthermal") pl % rrtype = PLOT_RXN_FLUX_THERMAL case ("fluxfast") diff --git a/src/plot.F90 b/src/plot.F90 index f5b20c851..46d7f55b7 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -14,6 +14,10 @@ module plot use progress_header use string, only: to_str +#ifdef MPI + use mpi +#endif + implicit none contains @@ -77,7 +81,6 @@ contains if (bin == NO_BIN_FOUND) cycle if (nuclides(p % event_nuclide) % fissionable) then -! pl % fisswgt(bin) = pl % fisswgt(bin) + keff * p % wgt_bank n = nuclides(p % event_nuclide) % index_fission(1) pl % fisswgt(bin) = pl% fisswgt(bin) + p % last_wgt * & nuclides(p % event_nuclide) % reactions(n) % Q_value @@ -103,6 +106,13 @@ contains if (.not. pl % type == PLOT_TYPE_RXNRATE) cycle +#ifdef MPI + call MPI_REDUCE(MPI_IN_PLACE, pl % fisswgt, size(pl % fisswgt), & + MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) + call MPI_REDUCE(MPI_IN_PLACE, pl % fluxwgt, size(pl % fluxwgt), & + MPI_REAL8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) +#endif + pl % fisswgt = pl % fisswgt / maxval(pl % fisswgt) pl % fluxwgt = pl % fluxwgt / maxval(pl % fluxwgt) diff --git a/src/plot_header.F90 b/src/plot_header.F90 index 8030f61d6..cc20edc12 100644 --- a/src/plot_header.F90 +++ b/src/plot_header.F90 @@ -51,8 +51,6 @@ module plot_header ! Reaction rate plot types integer, parameter :: PLOT_RXN_FLUX_THERMAL = 1 integer, parameter :: PLOT_RXN_FLUX_FAST = 2 - integer, parameter :: PLOT_RXN_FISSION = 3 - integer, parameter :: PLOT_RXN_ABSORPTION = 4 contains