diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index efcccf0535..d602414bd9 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -445,6 +445,7 @@ contains OUT_BACK, IN_BACK, IN_FRONT, OUT_FRONT, & OUT_BOTTOM, IN_BOTTOM, IN_TOP, OUT_TOP /) end if + filt % current = .true. ! Add filter to dictionary call filter_dict % add_key(filt % id, i_filt) end select diff --git a/src/initialize.F90 b/src/initialize.F90 index 2ca40cf6f4..566b5aad7d 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -432,7 +432,6 @@ contains integer :: id ! user-specified id type(Cell), pointer :: c => null() class(Lattice), pointer :: lat => null() - type(TallyObject), pointer :: t => null() do i = 1, n_cells ! ======================================================================= @@ -567,26 +566,20 @@ contains end do - TALLY_LOOP: do i = 1, n_tallies - t => tallies(i) + ! ======================================================================= + ! ADJUST INDICES FOR EACH TALLY FILTER - ! ======================================================================= - ! ADJUST INDICES FOR EACH TALLY FILTER + FILTER_LOOP: do i = 1, n_filters - FILTER_LOOP: do j = 1, size(t % filter) + select type(filt => filters(i) % obj) + type is (SurfaceFilter) + ! Check if this is a surface filter only for surface currents + if (.not. filt % current) call filt % initialize() + class default + call filt % initialize() + end select - select type(filt => filters(t % filter(j)) % obj) - type is (SurfaceFilter) - ! Check if this is a surface filter only for surface currents - if (.not. any(t % score_bins == SCORE_CURRENT)) & - call filt % initialize() - class default - call filt % initialize() - end select - - end do FILTER_LOOP - - end do TALLY_LOOP + end do FILTER_LOOP end subroutine adjust_indices diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 436d9a0091..db06814cc5 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -3842,6 +3842,7 @@ contains OUT_BOTTOM, OUT_TOP, IN_LEFT, IN_RIGHT, IN_BACK, & IN_FRONT, IN_BOTTOM, IN_TOP /) end if + filt % current = .true. end select t % find_filter(FILTER_SURFACE) = n_filter diff --git a/src/tally_filter.F90 b/src/tally_filter.F90 index d417593092..0c316f73b8 100644 --- a/src/tally_filter.F90 +++ b/src/tally_filter.F90 @@ -103,6 +103,9 @@ module tally_filter !=============================================================================== type, extends(TallyFilter) :: SurfaceFilter integer, allocatable :: surfaces(:) + + ! True if this filter is used for surface currents + logical :: current = .false. contains procedure :: get_next_bin => get_next_bin_surface procedure :: to_statepoint => to_statepoint_surface